/* The descent: Nono-style paintings of the real cave route, travelled by scroll.
   Without JavaScript the scenes read as a plain gallery; dive.js turns them into a pinned, lit, moving stage. */

.dive { position: relative; background: #05090c; color: #F1F6F7; }
.dive-intro { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--pad) 2rem; }
.dive-intro h1 { margin: 0; font-size: var(--t-3xl); line-height: 1.02; letter-spacing: -0.045em; }
.dive-intro p { max-width: 34em; margin: 1rem 0 0; font-size: var(--t-l); line-height: 1.45; color: rgba(241, 246, 247, 0.82); }
.dive-intro .dive-note { font-size: var(--t-xs); line-height: 1.5; color: rgba(241, 246, 247, 0.62); }
.dive-go { display: none; }

/* static fallback: the scenes one under another */
.dive-scenes { list-style: none; margin: 0; padding: 0 var(--pad) 3rem; display: grid; gap: 2rem; max-width: var(--max); margin-inline: auto; }
.dive-scene img { display: block; width: 100%; height: auto; }
.dive-scene figcaption { margin-top: 0.6rem; font-size: var(--t-xs); color: rgba(241, 246, 247, 0.7); }
.dive-stage, .dive-hud, .dive-cap { display: none; }

/* live: a pinned stage, the page scroll drives the journey */
.dive.is-live { height: var(--dive-len, 1400svh); }
.dive.is-live .dive-scenes { display: none; }
.dive.is-live .dive-intro { position: absolute; top: 0; left: 0; right: 0; z-index: 4; pointer-events: none; padding-top: calc(var(--head-h) + clamp(1.5rem, 5vh, 4rem)); transition: opacity 0.6s ease; }
.dive.is-live .dive-intro a { pointer-events: auto; }
.dive.is-live .dive-intro h1, .dive.is-live .dive-intro p { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4); }
.dive.is-live .dive-go { display: inline-block; margin-top: 1.5rem; font-size: var(--t-s); color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.7); padding-bottom: 0.15rem; }
.dive.is-past-intro .dive-intro { opacity: 0; }
.dive.is-live .dive-stage { display: block; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.dive-gl, .dive-motes, .dive-still { position: absolute; inset: 0; width: 100%; height: 100%; }
.dive-still { object-fit: cover; opacity: 0; transition: opacity 0.4s linear; }
.dive-still.on { opacity: 1; }
.dive-motes { pointer-events: none; }
.dive-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 26%, transparent 62%, rgba(0, 0, 0, 0.55)); }

/* the gauge: depth, sea level, pressure, distance from the entrance */
.dive.is-live .dive-hud { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 3; transition: opacity 0.6s ease; }
.dive.is-live:not(.is-past-intro) .dive-hud, .dive.is-live:not(.is-past-intro) .dive-cap { opacity: 0; }
.dv-gauge { position: absolute; left: var(--pad); top: calc(var(--head-h) + 1rem); display: grid; gap: 0.15rem; font-variant-numeric: tabular-nums; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.dv-n { font-size: clamp(2.5rem, 1.3rem + 4.4vw, 5rem); font-weight: 300; line-height: 1; letter-spacing: -0.045em; }
.dv-n small { font-size: 0.45em; letter-spacing: 0; margin-left: 0.1em; }
.dv-l { font-size: var(--t-xs); line-height: 1.45; color: rgba(241, 246, 247, 0.84); }

/* a breath of air, squeezed by the water above it (Boyle's law) */
.dv-air { position: absolute; left: var(--pad); top: calc(var(--head-h) + 9.5rem); display: flex; align-items: center; gap: 0.75rem; }
.dv-bub-box { width: 3rem; height: 3rem; display: grid; place-items: center; }
.dv-bub { display: block; width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid rgba(241, 246, 247, 0.85); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.02) 70%); transform: scale(var(--b, 1)); transition: transform 0.15s linear; }

/* the survey map, with your place on the route */
.dv-map { position: absolute; right: var(--pad); bottom: 1.6rem; width: min(25rem, 32vw); height: auto; overflow: visible; }
.dv-map .lv { stroke: rgba(241, 246, 247, 0.18); stroke-width: 1; }
.dv-map .sea { stroke: rgba(241, 246, 247, 0.45); stroke-width: 1; stroke-dasharray: 4 4; }
.dv-map .route { fill: none; stroke: rgba(241, 246, 247, 0.38); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; }
.dv-map .done { fill: none; stroke: #7fe0e6; stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; }
.dv-map .tower { fill: none; stroke: rgba(241, 246, 247, 0.4); stroke-width: 1.4; }
.dv-map .dot { fill: #fff; }
.dv-map .halo { fill: rgba(127, 224, 230, 0.25); }
.dv-map text { fill: rgba(241, 246, 247, 0.7); font-family: var(--sans); font-size: 26px; }
.dv-map-l { position: absolute; right: var(--pad); bottom: 0.4rem; font-size: 0.6875rem; color: rgba(241, 246, 247, 0.55); }

/* the wall label for what is at this depth */
.dive.is-live .dive-cap { display: block; position: absolute; left: var(--pad); bottom: 1.5rem; z-index: 3; width: min(30rem, calc(100% - 2 * var(--pad) - min(25rem, 32vw) - 1.5rem)); pointer-events: none; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7); transition: opacity 0.35s ease, transform 0.35s ease; }
.dive-cap.swap { opacity: 0; transform: translateY(0.5rem); }
.dv-cap-d { display: block; font-size: var(--t-xs); color: rgba(241, 246, 247, 0.8); font-variant-numeric: tabular-nums; }
.dv-cap-t { display: block; margin: 0.15rem 0 0.35rem; font-size: var(--t-xl); line-height: 1.15; letter-spacing: -0.025em; }
.dv-cap-p { display: block; font-size: 0.9375rem; line-height: 1.5; color: rgba(241, 246, 247, 0.88); }

@media (max-width: 47.99rem) {
  .dv-air { top: calc(var(--head-h) + 7.6rem); }
  .dv-bub-box, .dv-bub { width: 2.25rem; height: 2.25rem; }
  .dv-map { width: 9.5rem; bottom: auto; top: calc(var(--head-h) + 1rem); }
  .dv-map-l { display: none; }
  .dive.is-live .dive-cap { width: auto; right: var(--pad); bottom: 1.25rem; }
  .dv-cap-t { font-size: var(--t-l); }
}

/* the log: everything on the way down, with sources (also the no-JS reading) */
.dive-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.dive-log li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 1.25rem; }
.dive-log .ld { font-size: var(--t-s); color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.dive-log .lt { display: block; font-weight: 500; }
.dive-log .lp { display: block; color: var(--ink); }
.dive-after .after { min-width: 0; }
.dive-after .after > section > * { max-width: var(--measure); }
.dive-after .after > section > .dive-log { max-width: 44rem; }
.dive-after h2 { margin: 0 0 1.1rem; font-size: var(--t-xl); line-height: 1.2; letter-spacing: -0.025em; }
.dive-after section + section { margin-top: clamp(4rem, 7vw, 6rem); }

@media (prefers-reduced-motion: reduce) { .dive-cap, .dive-still, .dv-bub { transition: none; } }

/* the header goes dark over the water */
.page-dive .site-head { background: rgba(5, 9, 12, 0.62); }
.page-dive .brand, .page-dive .nav-inline a, .page-dive .menu summary { color: #F1F6F7; }
.page-dive .nav-inline a:hover { color: rgba(241, 246, 247, 0.7); }
.page-dive .lang { color: rgba(241, 246, 247, 0.7); }
.page-dive .lang:hover { color: #fff; }
.page-dive .menu nav { background: #0b1114; }
.page-dive .menu nav a { color: #F1F6F7; }
.page-dive .menu nav a[aria-current] { color: rgba(241, 246, 247, 0.6); }

/* while the title is up, darken the top of the painting so it reads */
.dive-shade { transition: background 0.6s ease; }
.dive.is-live:not(.is-past-intro) .dive-shade { background: linear-gradient(to bottom, rgba(3, 8, 10, 0.78), rgba(3, 8, 10, 0.45) 52%, transparent 78%, rgba(0, 0, 0, 0.4)); }
