:root {
  /* Font implementation notes: IBM Plex Mono** Mon* pressure readings; Space Grotesk** Grotes* Regular and Medium instrument labels. */
  --navy: #071A2A;
  --deep: #0D3445;
  --teal: #2FB8B5;
  --aqua: #8EDDE0;
  --foam: #D8F3EA;
  --sand: #D7C79F;
  --coral: #FF6B5E;
  --display: "Poppins", "Century Gothic", "Avenir Next", sans-serif;
  --ui: "Space Grotesk", "Inter", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 74% 12%, rgba(47, 184, 181, 0.18), transparent 28rem),
    radial-gradient(circle at 12% 82%, rgba(142, 221, 224, 0.12), transparent 34rem),
    linear-gradient(180deg, #071A2A 0%, #0D3445 58%, #071A2A 100%);
  color: var(--foam);
  font-family: var(--ui);
  overflow-x: hidden;
}

.ambient-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(216, 243, 234, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 243, 234, 0.025) 1px, transparent 1px);
  background-size: 8.333vw 8.333vw;
  mask-image: linear-gradient(90deg, transparent, black 14%, black 82%, transparent);
}

.sonar {
  position: absolute;
  border: 1px solid rgba(215, 199, 159, 0.26);
  border-radius: 50%;
  opacity: 0.5;
}

.sonar::before,
.sonar::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(215, 199, 159, 0.16);
  border-radius: 50%;
}

.sonar::after { inset: 28%; }
.sonar-one { width: 34rem; height: 34rem; left: -12rem; top: 16vh; }
.sonar-two { width: 48rem; height: 48rem; right: -18rem; bottom: -14rem; }

.halftone-wave {
  position: absolute;
  left: 8vw;
  right: 8vw;
  top: 48vh;
  height: 12rem;
  background-image: radial-gradient(circle, rgba(142, 221, 224, 0.18) 1px, transparent 1.8px);
  background-size: 18px 18px;
  clip-path: polygon(0 42%, 9% 34%, 18% 45%, 27% 36%, 36% 47%, 45% 38%, 54% 49%, 63% 37%, 72% 48%, 81% 35%, 90% 44%, 100% 39%, 100% 72%, 0 72%);
  opacity: 0.55;
  animation: waveDrift 14s ease-in-out infinite alternate;
}

.coastal-haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36vh;
  background: linear-gradient(0deg, rgba(216, 243, 234, 0.11), transparent 70%);
}

.instrument-rail {
  position: fixed;
  z-index: 20;
  right: 2.2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.rail-marker {
  color: rgba(216, 243, 234, 0.62);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: color 300ms ease, transform 300ms ease;
}

.rail-marker span {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid rgba(142, 221, 224, 0.7);
  border-radius: 999px;
  background: rgba(7, 26, 42, 0.8);
  box-shadow: 0 0 0 0 rgba(47, 184, 181, 0.0);
  transition: all 300ms ease;
}

.rail-marker.active { color: var(--foam); transform: translateX(-0.35rem); }
.rail-marker.active span { background: var(--coral); border-color: var(--coral); box-shadow: 0 0 22px rgba(255, 107, 94, 0.55); }

.narrative { position: relative; z-index: 2; }

.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 7vw 9vw;
  overflow: hidden;
}

.coordinate-strip,
.chapter-label {
  position: absolute;
  left: 7vw;
  top: 6vh;
  color: rgba(215, 199, 159, 0.78);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.oval-bath {
  position: relative;
  width: min(78vw, 1050px);
  min-height: 56vh;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 243, 234, 0.22);
  border-radius: 50% / 34%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(216, 243, 234, 0.12), transparent 45%),
    linear-gradient(135deg, rgba(142, 221, 224, 0.12), rgba(47, 184, 181, 0.03));
  box-shadow: inset 0 0 80px rgba(142, 221, 224, 0.12), 0 32px 120px rgba(0, 0, 0, 0.28);
  clip-path: ellipse(50% 42% at 50% 50%);
}

.glass-sheen {
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 12%, rgba(216, 243, 234, 0.11) 27%, transparent 38%);
  transform: translateX(-4%);
}

.wordmark {
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 8.8rem);
  letter-spacing: -0.06em;
  color: var(--foam);
  text-shadow: 0 0 34px rgba(142, 221, 224, 0.24);
  animation: buoyantType 1900ms cubic-bezier(.19,1.32,.32,1) both;
}

.wordmark i { color: var(--teal); font-style: normal; margin: 0 0.04em; }

.letter-bubble {
  position: absolute;
  width: 0.12em;
  height: 0.12em;
  border: 1px solid rgba(216, 243, 234, 0.86);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, white, rgba(142, 221, 224, 0.22) 34%, transparent 68%);
  box-shadow: 0 0 14px rgba(142, 221, 224, 0.5);
}
.bubble-a { left: 18%; top: 26%; animation: trappedPulse 3.6s ease-in-out infinite; }
.bubble-b { left: 43%; top: 58%; animation: trappedPulse 4.2s ease-in-out infinite 500ms; }
.bubble-c { right: 18%; top: 34%; animation: trappedPulse 3.9s ease-in-out infinite 900ms; }

.microcopy {
  position: absolute;
  bottom: 18%;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(215, 199, 159, 0.85);
}

.horizon-line,
.final-horizon {
  position: absolute;
  left: 12vw;
  right: 12vw;
  bottom: 15vh;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(142, 221, 224, 0.68), rgba(215, 199, 159, 0.42), transparent);
}
.horizon-line span {
  position: absolute;
  left: 58%;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.bubble {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  width: var(--s);
  height: var(--s);
  border: 1px solid rgba(216, 243, 234, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(216, 243, 234, 0.95), rgba(142, 221, 224, 0.24) 36%, rgba(47, 184, 181, 0.05) 70%);
  box-shadow: 0 0 16px rgba(47, 184, 181, 0.24);
  opacity: var(--o);
  animation: rise var(--d) linear infinite;
  animation-delay: var(--delay);
}

.trapped-bubbles, .channel-bubbles, .bubble-stream, .escape-constellation {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.capsule-panel {
  position: relative;
  width: min(620px, 72vw);
  min-height: 58vh;
  margin-right: 25vw;
  padding: clamp(2rem, 5vw, 4.6rem);
  border: 1px solid rgba(216, 243, 234, 0.2);
  border-radius: 42% 58% 46% 54% / 58% 40% 60% 42%;
  background: linear-gradient(135deg, rgba(216, 243, 234, 0.11), rgba(47, 184, 181, 0.05));
  box-shadow: inset 0 0 70px rgba(142, 221, 224, 0.09);
}

.capsule-grid {
  position: absolute;
  inset: 12%;
  opacity: 0.22;
  background-image: repeating-linear-gradient(90deg, transparent 0 30px, rgba(215, 199, 159, 0.45) 31px 32px), repeating-linear-gradient(0deg, transparent 0 30px, rgba(215, 199, 159, 0.26) 31px 32px);
  border-radius: inherit;
}

.capsule-panel h1,
.release-copy h2 {
  position: relative;
  margin: 0 0 1rem;
  max-width: 10ch;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3rem, 7.4vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.capsule-panel p,
.release-copy p {
  position: relative;
  max-width: 32rem;
  color: rgba(216, 243, 234, 0.72);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.7;
}

.valve-row { position: absolute; left: 15%; bottom: 13%; display: flex; gap: 0.7rem; }
.valve-row span { width: 2.4rem; height: 0.36rem; border-radius: 999px; background: rgba(215, 199, 159, 0.48); }

.narrow-channel {
  position: absolute;
  right: 13vw;
  top: 16vh;
  width: 15vw;
  min-width: 130px;
  height: 68vh;
  border: 1px solid rgba(142, 221, 224, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(142, 221, 224, 0.13), rgba(47, 184, 181, 0.03));
  overflow: hidden;
}
.ceiling { position: absolute; left: 12%; right: 12%; height: 1px; background: rgba(255, 107, 94, 0.5); }
.ceiling-one { top: 30%; }
.ceiling-two { top: 61%; }

.comparison-lab {
  width: min(1180px, 82vw);
  min-height: 66vh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 0.78fr) 1.3fr minmax(190px, 0.95fr);
  align-items: center;
  gap: clamp(1.3rem, 4vw, 3rem);
}

.water-column {
  position: relative;
  height: 63vh;
  min-height: 420px;
  padding: 2rem;
  border: 1px solid rgba(216, 243, 234, 0.22);
  border-radius: 999px 999px 42px 42px;
  background: linear-gradient(180deg, rgba(216, 243, 234, 0.13), rgba(47, 184, 181, 0.05) 52%, rgba(7, 26, 42, 0.28));
  overflow: hidden;
  box-shadow: inset 0 0 54px rgba(142, 221, 224, 0.13);
  transition: transform 900ms cubic-bezier(.2,1.4,.2,1), border-radius 900ms ease;
}
.column-left { transform: translateY(2.4rem) scaleX(0.86); }
.column-right { transform: translateY(-1.2rem) scaleX(1.05); }
.comparison-lab.shifted .column-left { transform: translateY(-0.8rem) scaleX(1.04); border-radius: 999px 999px 120px 60px; }
.comparison-lab.shifted .column-right { transform: translateY(2rem) scaleX(0.88); border-radius: 999px 999px 60px 120px; }

.column-glow { position: absolute; inset: 8%; border-radius: inherit; background: radial-gradient(ellipse at 50% 18%, rgba(142, 221, 224, 0.24), transparent 50%); }
.compare-index { font-family: var(--mono); color: var(--sand); letter-spacing: 0.2em; }
.water-column h2 { margin: 18vh 0 0.4rem; font-family: var(--display); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 500; letter-spacing: -0.05em; }
.water-column p { color: rgba(216, 243, 234, 0.62); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }

.elastic-lines { width: 100%; height: 58vh; overflow: visible; filter: drop-shadow(0 0 14px rgba(47, 184, 181, 0.45)); }
.line { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; opacity: 0.86; animation: elasticPath 6s ease-in-out infinite; }
.line-mid { stroke: var(--aqua); animation-delay: 650ms; }
.line-low { stroke: rgba(216, 243, 234, 0.68); animation-delay: 1200ms; }
.line-node { fill: var(--coral); opacity: 0.9; }

.pressure-toggle {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 107, 94, 0.65);
  border-radius: 999px;
  background: rgba(7, 26, 42, 0.46);
  color: var(--foam);
  padding: 0.9rem 1.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 107, 94, 0.18);
}

.release-scene { place-items: end start; padding-bottom: 18vh; }
.release-glass {
  position: absolute;
  inset: 10vh 8vw 24vh;
  border: 1px solid rgba(216, 243, 234, 0.14);
  border-radius: 44% 56% 52% 48% / 45% 48% 52% 55%;
  background: linear-gradient(135deg, rgba(216, 243, 234, 0.075), transparent 60%);
  filter: blur(0.2px);
  opacity: 0.62;
}
.release-copy { max-width: 820px; position: relative; z-index: 2; }
.release-copy h2 { max-width: 12ch; color: var(--foam); }
.final-horizon { bottom: 18vh; left: 8vw; right: 8vw; }
.shore { position: absolute; left: 0; right: 0; top: -22px; height: 44px; background: linear-gradient(90deg, transparent, rgba(215, 199, 159, 0.18), transparent); clip-path: ellipse(50% 18% at 50% 50%); }
.signal-dot { position: absolute; right: 22%; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 28px rgba(255, 107, 94, 0.66); }

.scene.in-view .capsule-panel,
.scene.in-view .comparison-lab,
.scene.in-view .release-copy { animation: sceneFloat 1200ms cubic-bezier(.2,1,.25,1) both; }

@keyframes buoyantType {
  0% { transform: translateY(2rem) scale(0.98, 1.14); opacity: 0; filter: blur(9px); }
  58% { transform: translateY(-0.5rem) scale(1.025, 0.965); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
}

@keyframes trappedPulse { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-0.18em) scale(1.18, 0.92); } }
@keyframes rise { 0% { transform: translate3d(0, 0, 0) scale(0.86); } 45% { transform: translate3d(var(--drift), -42vh, 0) scale(1); } 100% { transform: translate3d(calc(var(--drift) * -0.5), -88vh, 0) scale(1.08); } }
@keyframes waveDrift { from { transform: translateX(-2vw) translateY(0); } to { transform: translateX(2vw) translateY(1.2rem); } }
@keyframes elasticPath { 0%,100% { stroke-dasharray: 1 0; transform: translateY(0) scaleY(1); } 45% { transform: translateY(-8px) scaleY(1.07); } 70% { transform: translateY(5px) scaleY(0.96); } }
@keyframes sceneFloat { from { transform: translateY(3rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 820px) {
  .instrument-rail { right: 1rem; }
  .scene { padding: 6rem 1.5rem; }
  .oval-bath { width: 94vw; min-height: 52vh; }
  .wordmark { font-size: clamp(2.2rem, 13vw, 4.8rem); }
  .capsule-panel { width: 86vw; margin-right: 0; }
  .narrow-channel { opacity: 0.35; right: 2vw; }
  .comparison-lab { grid-template-columns: 1fr; width: 78vw; gap: 1rem; }
  .elastic-lines { height: 26vh; order: 2; }
  .water-column { height: 34vh; min-height: 250px; border-radius: 120px; }
  .column-right { order: 3; }
}
