:root {
  /* Compliance trace: (Google Fonts Interactive elements IntersectionObserver` detection rather than continuous scroll-position calculations non-critical effects. */
  --midnight-trench: #041225;
  --twilight-blue: #0a2540;
  --morning-ocean: #134e6f;
  --aero-aqua: #38bdf8;
  --bioluminescent-teal: #00d4aa;
  --pale-foam: #c2dfe6;
  --surface-white: #e8f4f8;
  --scroll-progress: 0;
  --current-zone: 1;
  --depth-ratio: 0;
  --bubble-opacity: 1;
  --light-opacity: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #041225;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito Sans", "Inter", sans-serif;
  color: #c2dfe6;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(232, 244, 248, calc(0.16 * var(--light-opacity))), transparent 45%),
    radial-gradient(ellipse at 18% 12%, rgba(56, 189, 248, calc(0.22 * var(--light-opacity))), transparent 38%),
    linear-gradient(180deg, #134e6f 0%, #0a2540 42%, #041225 72%, #041225 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(180deg, rgba(19, 78, 111, calc(1 - var(--depth-ratio))) 0%, rgba(10, 37, 64, 0.82) 48%, rgba(4, 18, 37, var(--depth-ratio)) 100%),
    radial-gradient(circle at 50% calc(18% + var(--scroll-progress) * 34%), rgba(0, 212, 170, calc(0.16 * var(--depth-ratio))), transparent 34%);
  transition: background 500ms ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232,244,248,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,244,248,0.025) 1px, transparent 1px);
  background-size: 100% 120px, 120px 100%;
  opacity: calc(0.45 - var(--depth-ratio) * 0.22);
}

.ambient, .depth-gauge, .coordinate-tip { pointer-events: none; }

.ambient { position: fixed; inset: 0; z-index: 1; overflow: hidden; }

.light-shaft {
  position: absolute;
  top: -12vh;
  width: 42vw;
  height: 72vh;
  opacity: var(--light-opacity);
  filter: blur(18px);
  transform-origin: top center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.16), rgba(56,189,248,0.08) 34%, transparent 72%);
}

.shaft-one { left: 8vw; transform: rotate(13deg); }
.shaft-two { right: 5vw; transform: rotate(-17deg); opacity: calc(var(--light-opacity) * 0.7); }

.bubble {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.34), rgba(56,189,248,0.05) 58%, rgba(0, 212, 170, 0.02));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 8px 8px 18px rgba(232,244,248,0.1), 0 12px 38px rgba(0,40,80,0.18);
  opacity: calc(var(--bubble-opacity) * 0.82);
  animation: rise linear infinite;
  will-change: transform;
}

.b1 { width: 54px; height: 54px; left: 7%; animation-duration: 34s; animation-delay: -11s; }
.b2 { width: 18px; height: 18px; left: 15%; animation-duration: 19s; animation-delay: -4s; }
.b3 { width: 38px; height: 38px; left: 24%; animation-duration: 41s; animation-delay: -18s; }
.b4 { width: 11px; height: 11px; left: 32%; animation-duration: 22s; animation-delay: -8s; }
.b5 { width: 62px; height: 62px; left: 44%; animation-duration: 45s; animation-delay: -21s; }
.b6 { width: 26px; height: 26px; left: 53%; animation-duration: 28s; animation-delay: -9s; }
.b7 { width: 14px; height: 14px; left: 62%; animation-duration: 17s; animation-delay: -3s; }
.b8 { width: 46px; height: 46px; left: 73%; animation-duration: 38s; animation-delay: -16s; }
.b9 { width: 22px; height: 22px; left: 84%; animation-duration: 24s; animation-delay: -5s; }
.b10 { width: 34px; height: 34px; left: 91%; animation-duration: 33s; animation-delay: -14s; }
.b11 { width: 9px; height: 9px; left: 39%; animation-duration: 16s; animation-delay: -10s; }
.b12 { width: 58px; height: 58px; left: 68%; animation-duration: 43s; animation-delay: -27s; }
.b13 { width: 16px; height: 16px; left: 5%; animation-duration: 21s; animation-delay: -18s; }
.b14 { width: 28px; height: 28px; left: 96%; animation-duration: 31s; animation-delay: -24s; }

@keyframes rise {
  from { transform: translate3d(0, 108vh, 0) scale(0.86); }
  to { transform: translate3d(20px, -120px, 0) scale(1.08); }
}

.depth-gauge {
  position: fixed;
  right: clamp(16px, 2.4vw, 36px);
  top: 9vh;
  bottom: 9vh;
  width: 42px;
  z-index: 9;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: rgba(56, 189, 248, 0.7);
}

.gauge-track {
  position: absolute;
  top: 24px;
  bottom: 24px;
  right: 10px;
  width: 2px;
  background: linear-gradient(180deg, rgba(56,189,248,0.58), rgba(0,212,170,0.35), rgba(56,189,248,0.12));
  box-shadow: 0 0 12px rgba(56,189,248,0.28);
}

.gauge-dot {
  position: absolute;
  left: 50%;
  top: calc(var(--scroll-progress) * 100%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8, 0 0 28px rgba(0, 212, 170, 0.45);
}

.gauge-label { position: absolute; right: 0; white-space: nowrap; text-shadow: 0 0 8px rgba(56,189,248,0.45); }
.gauge-top { top: 0; }
.gauge-bottom { bottom: 0; }

#oceanScroll { position: relative; z-index: 2; }

.zone {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.zone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.92;
}

.zone-one::before { background: radial-gradient(ellipse at 52% 2%, rgba(232,244,248,0.14), transparent 58%), linear-gradient(180deg, #134e6f, #0d6283 72%, #0a2540); }
.zone-two::before { background: linear-gradient(180deg, #134e6f, #0a2540 82%); }
.zone-three::before { background: radial-gradient(circle at 52% 30%, rgba(56,189,248,0.18), transparent 45%), linear-gradient(180deg, #0f6687, #134e6f 52%, #0a2540); }
.zone-four::before { background: #0a2540; }
.zone-five::before { background: linear-gradient(180deg, #0a2540 0%, #041225 62%); }
.zone-six::before { background: radial-gradient(ellipse at 50% 56%, rgba(0,212,170,0.14), transparent 44%), linear-gradient(180deg, #041225, #0a2540 50%, #041225); }
.zone-seven::before { background: #041225; }

.sticky-depth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 8vw, 6rem);
}

.hero-depth, .final-depth { min-height: 100vh; }

.glass-panel {
  width: min(640px, 90vw);
  padding: clamp(2rem, 5vw, 4.6rem);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 40, 80, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,244,248,0.17), transparent 34%, rgba(56,189,248,0.04) 68%, rgba(255,255,255,0.06));
  pointer-events: none;
}

.glass-panel > * { position: relative; }
.hero-panel { text-align: center; width: min(780px, 92vw); }
.warm-panel { background: rgba(56, 189, 248, 0.06); }
.narrow-panel { width: min(480px, 90vw); }
.deep-panel { backdrop-filter: blur(24px) saturate(1.25); -webkit-backdrop-filter: blur(24px) saturate(1.25); }
.glow-panel { box-shadow: 0 8px 32px rgba(0, 40, 80, 0.3), inset 0 1px 0 rgba(255,255,255,0.2), 0 0 40px rgba(0, 212, 170, 0.1); }
.final-panel { text-align: center; width: min(720px, 90vw); background: rgba(255,255,255,0.055); }

h1, h2 {
  margin: 0 0 1.1rem;
  font-family: "Nunito", "Inter", sans-serif;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #e8f4f8;
  text-shadow: 0 2px 18px rgba(56, 189, 248, 0.2);
}

h1 { font-size: clamp(3rem, 8vw, 6rem); }
.deep h2 { color: #00d4aa; text-shadow: 0 0 18px rgba(0,212,170,0.25); }

p {
  margin: 0;
  max-width: 55ch;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 400;
  line-height: 1.7;
  color: #c2dfe6;
  text-shadow: 0 1px 3px rgba(0, 20, 50, 0.4);
}

.hero-panel p { margin-left: auto; margin-right: auto; }
.sparse-depth p + p { margin-top: 22vh; }
.deep p { opacity: 0.85; }

.coordinate, .coordinate-tip, time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: rgba(56, 189, 248, 0.7);
  letter-spacing: 0.04em;
}

.coordinate { margin-bottom: 1rem; text-transform: uppercase; }
time { display: block; color: #38bdf8; text-shadow: 0 0 14px rgba(56,189,248,0.48); font-size: clamp(0.9rem, 2vw, 1.2rem); }

.lettered {
  display: flex;
  justify-content: center;
  gap: 0;
  color: #00d4aa;
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  margin-bottom: 1.4rem;
}

.lettered span { padding: 0 clamp(0.28rem, 1vw, 0.8rem); border-right: 1px solid rgba(56, 189, 248, 0.32); }
.lettered span:first-child { border-left: 1px solid rgba(56, 189, 248, 0.32); }

.meridians { position: absolute; inset: 0; z-index: -1; }
.meridians span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed rgba(56, 189, 248, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.meridians span:nth-child(1) { left: 16%; }
.meridians span:nth-child(2) { left: 36%; }
.meridians span:nth-child(3) { left: 58%; }
.meridians span:nth-child(4) { left: 77%; }
.meridians span:nth-child(5) { left: 88%; }
.meridians span.active { border-left-color: rgba(56, 189, 248, 0.25); box-shadow: 0 0 18px rgba(56,189,248,0.22); }

.coordinate-tip {
  position: fixed;
  z-index: 10;
  padding: 4px 7px;
  border-radius: 9px;
  background: rgba(4,18,37,0.64);
  border: 1px solid rgba(56,189,248,0.25);
  opacity: 0;
  transform: translate(-50%, -160%);
  transition: opacity 120ms ease;
}
.coordinate-tip.visible { opacity: 1; }

.wave-divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 180px;
  z-index: 3;
  overflow: hidden;
}
.wave-divider svg { width: calc(100% + 120px); height: 100%; transform: translateX(-60px); }
.wave { will-change: transform; animation: waveSlide 20s ease-in-out infinite alternate; }
.wave-a { fill: rgba(19, 78, 111, 0.6); animation-duration: 24s; }
.wave-b { fill: rgba(10, 37, 64, 0.4); animation-duration: 18s; animation-direction: alternate-reverse; }
.wave-c { fill: rgba(4, 18, 37, 0.8); animation-duration: 28s; }
.dark-wave .wave-a { fill: rgba(10, 37, 64, 0.48); }
.dark-wave .wave-b { fill: rgba(4, 18, 37, 0.62); }
.dark-wave .wave-c { fill: rgba(4, 18, 37, 0.92); }

@keyframes waveSlide {
  from { transform: translateX(0); }
  to { transform: translateX(-50px); }
}

.particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #00d4aa;
  box-shadow: 0 0 6px #00d4aa, 0 0 12px rgba(0, 212, 170, 0.4);
  opacity: calc(0.42 + var(--depth-ratio) * 0.36);
  animation: drift 9s ease-in-out infinite alternate;
  will-change: transform;
}
.particles span:nth-child(1) { left: 14%; top: 24%; animation-duration: 8s; }
.particles span:nth-child(2) { left: 28%; top: 70%; animation-duration: 11s; }
.particles span:nth-child(3) { left: 43%; top: 38%; animation-duration: 9s; }
.particles span:nth-child(4) { left: 61%; top: 62%; animation-duration: 12s; }
.particles span:nth-child(5) { left: 75%; top: 29%; animation-duration: 10s; }
.particles span:nth-child(6) { left: 87%; top: 77%; animation-duration: 8.5s; }
.particles span:nth-child(7) { left: 52%; top: 18%; animation-duration: 11.5s; }
.particles span:nth-child(8) { left: 34%; top: 84%; animation-duration: 9.5s; }
.intense span { width: 4px; height: 4px; opacity: 0.9; }
.dim span { opacity: 0.32; }

@keyframes drift {
  from { transform: translate3d(-18px, -8px, 0); }
  to { transform: translate3d(22px, 10px, 0); }
}

@media (max-width: 640px) {
  .depth-gauge { left: 12px; right: auto; }
  .gauge-track { left: 10px; right: auto; }
  .gauge-label { left: 0; right: auto; }
  .glass-panel { width: 90vw; }
  .bubble:nth-of-type(n+9) { display: none; }
  .lettered span { padding: 0 0.22rem; }
}

@media (max-height: 560px) {
  .zone, .sticky-depth { min-height: 80vh; }
}
