/* Diving school page extras: video hero, swimming sea life, seabed footer.
   Loaded only by diving-school.html (05-case-study.css is shared with other case studies). */

/* ---------- Hero video ---------- */
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.hero-bg.has-video .hero-video { opacity: .7; }
.hero-bg.has-video img { opacity: 0; transition: opacity 1.2s ease; }
.hero-bg img { object-position: center 40%; }

/* ---------- Gallery: masonry (true aspect ratios, no cropping) ---------- */
.gallery { display: block; columns: 3; column-gap: clamp(14px, 1.4vw, 28px); }
.gallery .shot, .gallery .shot.tall, .gallery .shot.sq, .gallery .shot.wide { grid-column: auto; grid-row: auto; break-inside: avoid; margin: 0 0 clamp(14px, 1.4vw, 28px); }
.gallery .shot-in { height: auto; will-change: auto; }
.gallery .shot-btn { height: auto; }
.gallery .shot img { width: 100%; height: auto; object-fit: contain; }
@media (max-width: 899.98px) { .gallery { columns: 2; } }
@media (max-width: 519.98px) { .gallery { columns: 1; } }

/* ---------- Swimmers that glide while you scroll (they pass behind the content, so text stays readable) ---------- */
main, .page { position: relative; z-index: 1; }
.swim { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sw { position: absolute; left: 0; top: 0; height: auto; opacity: 0; will-change: transform; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); animation: sw-bob 5s ease-in-out infinite alternate; }
.sw.on { opacity: .85; transition: opacity .6s ease; }
.sw-diver { opacity: 0; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); animation-duration: 8s; }
.sw-diver.on { opacity: .8; }
.sw:nth-child(2n) { animation-duration: 6.5s; animation-delay: -2s; }
.sw:nth-child(3n) { animation-duration: 4.2s; animation-delay: -1s; }
@keyframes sw-bob { from { translate: 0 -2px; } to { translate: 0 2px; } }
[data-theme="light"] .sw.on { opacity: .75; }

/* ---------- Seabed (bottom of page) ---------- */
.seabed { position: relative; z-index: 1; isolation: isolate; overflow-x: clip; overflow-y: visible; margin-top: 56px; min-height: clamp(320px, 44vw, 680px); background: #06233a; }
.seabed-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; z-index: -3; }
.seabed-fade { position: absolute; inset: 0 0 auto 0; height: 42%; z-index: -2; background: linear-gradient(180deg, var(--page-bg) 0%, color-mix(in srgb, var(--page-bg) 55%, transparent) 40%, transparent 100%); pointer-events: none; }
.seabed::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 45%, rgba(2,10,18,.45) 100%); pointer-events: none; }

.sb-fish, .sb-school { position: absolute; height: auto; pointer-events: none; }
.sb-diverwrap { position: absolute; left: 10%; bottom: 3%; width: clamp(160px, 22vw, 340px); animation: sb-hover 9s ease-in-out infinite alternate; pointer-events: none; }
.sb-diver { display: block; width: 100%; height: auto; opacity: .95; filter: drop-shadow(0 12px 22px rgba(0,0,0,.45)); }
@keyframes sb-hover { from { transform: translate(0, 6px); } to { transform: translate(30px, -10px); } }
/* anchor point at the regulator; the bubble column (below) is lined up with it by JS */
/* bubbles leave the regulator (about 86% across, 16% down the sprite) and rise out of the top of the scene */
.sb-mouth { position: absolute; left: 86%; top: 16%; width: 0; height: 0; }
.sb-fish { width: clamp(44px, 6vw, 90px); top: 40%; animation: sb-swim-r 26s linear infinite; }
.sf1 { top: 46%; animation-name: sb-swim-l; animation-duration: 30s; animation-delay: -9s; }
.sf2 { top: 62%; animation-duration: 22s; animation-delay: -14s; }
@keyframes sb-swim-r { from { transform: translateX(-20vw); } to { transform: translateX(120vw); } }
@keyframes sb-swim-l { from { transform: translateX(120vw); } to { transform: translateX(-20vw); } }
.sb-school { right: 6%; top: 34%; width: clamp(180px, 26vw, 420px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; }

@media (max-width: 767.98px) {
  .sw-diver { display: none; }
  .sw { width: 44px; }
  .sb-diverwrap { width: 150px; left: 2%; }
  .sb-school { opacity: .4; }
  .hero-video { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .swim, .hero-video { display: none; }
  .sb-fish, .sb-diverwrap, .sb-mouth i, .sb-school { animation: none; }
  .sb-mouth i { opacity: .6; }
  .sb-fish { left: 30%; } .sf2 { left: 60%; }
}

/* ---------- Pinned diver on the left, middle of the screen. He stays put while the page scrolls past;
   bubbles stream out of his regulator and rise to the top (bigger as they climb). Sits behind the page content. ---------- */
.fd, .fd-diver { --w: clamp(90px, calc((100vw - 1120px) / 2 - 8px), 230px); }
.fd { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fd-diver { position: fixed; left: 0; top: 50%; z-index: 2; width: var(--w); aspect-ratio: 700 / 960; translate: 0 -50%; pointer-events: none; }
.fdd { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 14px 24px rgba(0,0,0,.4)); animation: fd-bob 6s ease-in-out infinite alternate; }
.fdd img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* fin kick: both lower legs swing about the knees, out of step with each other */
.fdd-a { transform-origin: 37.4% 63.5%; animation: kick-a 1.3s ease-in-out infinite alternate; }
.fdd-b { transform-origin: 42.9% 72.4%; animation: kick-b 1.3s ease-in-out -.65s infinite alternate; }
@keyframes kick-a { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes kick-b { from { transform: rotate(8deg); } to { transform: rotate(-8deg); } }
@keyframes fd-bob { from { transform: translateY(-5px) rotate(-1.2deg); } to { transform: translateY(6px) rotate(1.2deg); } }
.fd-mouth { position: absolute; left: calc(var(--w) * .87); top: calc(50% - var(--w) * .3566); --pw: clamp(56px, calc(var(--w) * .5), 120px); width: 300px; height: var(--rise, 500px); margin: calc(var(--rise, 500px) * -1) 0 0 -150px; z-index: 1;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 38%, rgba(0,0,0,.55) 68%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 38%, rgba(0,0,0,.55) 68%, transparent 100%); }
/* same bubbles4 stream as the footer diver: slow puffs that start small, grow as they rise and fade out toward the top of the screen */
.fd-mouth i { position: absolute; left: 50%; bottom: 0; width: var(--pw); height: calc(var(--pw) * 3.727); margin: 0 0 0 calc(var(--pw) / -2); background: url(../img/bubbles4.png) center bottom / 100% 100% no-repeat; opacity: 0; pointer-events: none; transform-origin: 50% 100%;
  filter: brightness(1.9) contrast(1.1) drop-shadow(0 0 5px rgba(190,235,255,.7)); animation: sb-breath 12s linear infinite; animation-delay: var(--d, 0s); animation-play-state: paused; will-change: transform, opacity; }
.fd.vis .fd-mouth i { animation-play-state: running; }
/* in front only where there is a free margin; on tablets and small laptops he swims behind the content; hidden on phones */
@media (max-width: 1099.98px) { .fd-diver { z-index: 0; } }
@media (max-width: 767.98px) { .fd, .fd-diver { display: none; } }
@media (prefers-reduced-motion: reduce) { .fdd, .fdd-leg, .fd-mouth i { animation: none; } .fd-mouth i { opacity: .6; transform: translateY(-30px); } }

/* ---------- Bottom of the page: "Like What You See?" sits on the seabed picture; legal line comes after it ---------- */
.seabed { min-height: clamp(520px, 58vw, 860px); margin-top: clamp(40px, 6vw, 90px); }
.seabed-cta { position: absolute; z-index: 2; left: 0; right: 0; top: clamp(70px, 11vw, 160px); margin-inline: auto; text-align: center; color: #fff; }
.seabed-cta::before { content: ""; position: absolute; inset: -40px -60px; z-index: -1; background: radial-gradient(closest-side, rgba(3,16,28,.62), rgba(3,16,28,.35) 60%, transparent); }
.seabed-cta h2 { color: #fff; text-shadow: 0 3px 22px rgba(0,0,0,.55); }
.seabed-cta p { max-width: 560px; margin: 16px auto 0; color: rgba(255,255,255,.92); text-shadow: 0 2px 14px rgba(0,0,0,.55); }
.seabed-cta .cta-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 24px; }
.seabed-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.12); }
.sf1 { top: 70%; } .sf2 { top: 80%; } .sb-school { top: 56%; }
.seabed + .page { padding-top: 24px; padding-bottom: 32px; }

/* ---------- The pinned diver appears from the 18 m banner down to the seabed ---------- */
.fd { opacity: 0; transition: opacity .6s ease; }
.fd.vis { opacity: var(--fade, 1); }
/* the diver is revealed from under the third banner (the 18 m picture) as it scrolls away; JS sets the clip */
.fd-diver { clip-path: inset(100% 0 0 0); opacity: var(--fade, 1); }

/* ---------- 05 Design process: a dive line. The diver follows your scroll down the guide line (up again when you scroll back),
   the line fills with water, each number lights up and bursts into bubbles as he reaches it. ---------- */
.steps .sl-fill { position: absolute; left: 21px; width: 2px; top: 0; height: 0; z-index: 0; border-radius: 2px; background: linear-gradient(#35c9dc, #8fe9ff); box-shadow: 0 0 12px rgba(53,201,220,.8); pointer-events: none; }
.steps .sl-diver { position: absolute; left: 22px; top: 0; width: 54px; z-index: 3; pointer-events: none; opacity: 0; translate: -50% -50%; transition: opacity .4s ease; }
.steps .sl-diver.on { opacity: 1; }
.steps .sl-diver img { display: block; width: 100%; height: auto; transition: transform .6s cubic-bezier(.3,1.3,.5,1); filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.steps .sl-diver.down img { transform: rotate(155deg); }
.steps .sl-diver.up img { transform: rotate(-12deg); }
.steps .sl-depth { position: absolute; left: 50%; top: 100%; translate: -50% 4px; margin-top: 2px; font: 700 10px/1 var(--font-body, inherit); letter-spacing: .06em; color: #04202c; background: #8fe9ff; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.step-n { transition: background .35s ease, color .35s ease, box-shadow .35s ease, border-color .35s ease; }
.step-n.on { background: #35c9dc; border-color: #8fe9ff; color: #04202c; box-shadow: 0 0 0 6px rgba(53,201,220,.22), 0 0 26px rgba(53,201,220,.55); animation: sl-pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes sl-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.sl-b { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); border-radius: 50%; pointer-events: none; z-index: 4;
  border: 1.5px solid rgba(190,235,255,.95); background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.95), rgba(160,220,255,.18) 55%, rgba(160,220,255,.06));
  box-shadow: 0 0 8px rgba(120,210,255,.5); animation: sl-burst var(--d) cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes sl-burst { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% - var(--dy))) scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .steps .sl-diver { display: none; } .step-n.on { animation: none; } .sl-b { display: none; } }

/* ---------- Cover image near the top ---------- */
.cover-sec { padding: clamp(28px, 4vw, 56px) 0 0; }
.cover-shot { margin: 0 auto; max-width: min(1100px, 100%); }
.cover-shot .shot-btn { height: auto; border-radius: calc(var(--radius) + 4px); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.cover-shot img { width: 100%; height: auto; object-fit: contain; }
.cover-shot figcaption { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-soft); }

/* ---------- Wireframes (desktop + mobile pairs, cropped previews, full page in the lightbox) ---------- */
.wf-set { margin-top: clamp(36px, 5vw, 64px); }
.wf-title { margin: 0 0 8px; font: 800 clamp(24px, 2.6vw, 32px)/1.15 var(--font-body); letter-spacing: -.01em; }
.wf-lead { max-width: 62ch; margin: 0 0 clamp(20px, 3vw, 32px); color: var(--text-soft); }
.wf-pair { margin-top: clamp(24px, 3vw, 40px); }
.wf-label { margin: 0 0 16px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.wf-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 28px); align-items: start; }
.wf-fig { position: relative; margin: 0; min-width: 0; }
.wf-fig .shot-btn { position: relative; height: clamp(300px, 40vw, 520px); background: #eef0f3; }
.wf-fig .shot-btn img { height: 100%; object-fit: cover; object-position: top center; }
.wf-fig .shot-btn::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(transparent, rgba(238,240,243,.95)); pointer-events: none; }
.wf-fig figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--text-soft); }
@media (max-width: 639.98px) { .wf-row { grid-template-columns: 1fr; } .wf-mobile .shot-btn { max-width: 300px; margin-inline: auto; } }

/* ---------- Lightbox zoom ---------- */
.lb-stage { touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; max-height: 88vh; max-height: 88dvh; overflow: auto; scrollbar-width: none; -ms-overflow-style: none; border-radius: var(--radius); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.lb-stage img { cursor: zoom-in; }
.lightbox.is-zoomed .lb-stage img { cursor: grab; border-radius: 0; }
.lb-stage.is-drag img { cursor: grabbing; }
.lb-zoom { position: absolute; left: 50%; bottom: 14px; z-index: 3; display: flex; gap: 4px; padding: 5px; transform: translateX(-50%); border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(3,16,26,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lb-zoom button { min-width: 44px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 800 18px/1 var(--font-body); cursor: pointer; }
.lb-zoom button:hover, .lb-zoom button:focus-visible { background: rgba(255,255,255,.16); outline: none; }
.lb-zoom .lb-zv { min-width: 64px; font-size: 14px; }

.lb-stage::-webkit-scrollbar { display: none; width: 0; height: 0; }

.lb-stage img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
@media (max-width: 767.98px) {
  .lightbox { width: 96vw; }
  .lb-close { top: -8px; right: -2px; }
  .lb-zoom { bottom: 10px; }
}

/* ---------- Footer diver breathes: a puff of bubbles from the regulator every few seconds, small at first, bigger as they rise past the top of the screen ---------- */
main > section.ds-sec { position: relative; z-index: 2; }
.seabed-cta { z-index: 3; }
.sb-mouth { --rise: 700px; --breath: 12s; --w: clamp(64px, 5.6vw, 180px); z-index: 4; width: 26vw; height: var(--rise); margin: calc(var(--rise) * -1) 0 0 -13vw;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 38%, rgba(0,0,0,.55) 68%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 38%, rgba(0,0,0,.55) 68%, transparent 100%); }
/* each puff is the bubbles4 picture: a column of bubbles that leaves the regulator small, then grows slowly while it floats up past the top of the screen */
.sb-mouth i { position: absolute; left: 50%; bottom: 0; width: var(--w); height: calc(var(--w) * 3.727); margin: 0 0 0 calc(var(--w) / -2);
  background: url(../img/bubbles4.png) center bottom / 100% 100% no-repeat; opacity: 0; pointer-events: none; transform-origin: 50% 100%;
  filter: brightness(1.9) contrast(1.1) drop-shadow(0 0 5px rgba(190,235,255,.7));
  animation: sb-breath var(--breath) linear infinite; animation-delay: var(--d, 0s); animation-play-state: paused; will-change: transform, opacity; }
.sb-mouth.on i { animation-play-state: running; }
@keyframes sb-breath {
  0%   { transform: translate(0, 0) scale(.8); opacity: 0; }
  5%   { opacity: .95; }
  30%  { transform: translate(var(--sx, .6vw), calc(var(--rise) * -.3)) scale(1.4); }
  60%  { transform: translate(calc(var(--sx, .6vw) * -1), calc(var(--rise) * -.62)) scale(2.2); opacity: .95; }
  90%  { transform: translate(0, calc(var(--rise) * -.98)) scale(3); opacity: .7; }
  100% { transform: translate(0, calc(var(--rise) * -1.05)) scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .sb-mouth i { animation: none; opacity: 0; } }

/* ---------- Banners (04, 05, 06 pictures): the picture stays put, the words slide up and over it as you scroll ---------- */
.band { clip-path: inset(0); overflow: hidden; min-height: clamp(520px, 105vh, 1000px); }
.band-img { position: fixed; inset: 0; height: 100lvh; transform: none !important; will-change: auto; }
.band-img img { width: 100%; height: 100%; object-fit: cover; }
.band-copy { will-change: transform; }
@media (prefers-reduced-motion: reduce) { .band-copy { transform: none !important; } }

/* bubbles exist only while their diver is on screen (a paused puff would otherwise hang in the page) */
.sb-mouth:not(.on) i, .fd:not(.vis) .fd-mouth i { visibility: hidden; }

/* ---------- Skill, technology and industry chips under the project facts ---------- */
.facts-tags { padding: clamp(18px, 2.4vw, 28px) 0 0; }
.facts-tags .wrap { display: grid; gap: 16px; }
.ft-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ft-label { flex: 0 0 136px; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); }
.ft-row .chips { margin: 0; flex: 1 1 320px; min-width: 0; }
@media (max-width: 639.98px) { .ft-label { flex-basis: 100%; } }

/* ---------- Quiet link to the rebuilt demo site (small, muted, end of the showcase) ---------- */
.demo-link { display: flex; justify-content: flex-end; margin: clamp(18px, 2.4vw, 28px) 0 0; }
.demo-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--chip-border); background: transparent; color: var(--text-soft); font-size: 13px; font-weight: 700; text-decoration: none; opacity: .75; transition: opacity .2s ease, color .2s ease, border-color .2s ease; }
.demo-btn:hover, .demo-btn:focus-visible { opacity: 1; color: var(--text); border-color: var(--accent); outline: none; }
