:root {
  /* Interface sidebar labels: labels:** carry personality */
  --lagoon-cyan: #12F5E5;
  --bubble-aqua: #B8FFF7;
  --coral-pink: #FF4FB8;
  --electric-lime: #B9FF2E;
  --uv-lavender: #A575FF;
  --deep-reef: #06202A;
  --pearl-foam: #FFF7D6;
  --tangerine: #FF9B2F;
  --rail-width: 26vw;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--deep-reef);
  background: var(--pearl-foam);
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(18, 245, 229, .25), transparent 18rem),
    repeating-linear-gradient(112deg, rgba(6,32,42,.04) 0 1px, transparent 1px 34px);
  mix-blend-mode: multiply;
  z-index: 5;
}

.tide-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  min-width: 280px;
  max-width: 390px;
  z-index: 10;
  overflow: hidden;
  color: var(--pearl-foam);
  background:
    radial-gradient(circle at 46% 16%, rgba(18,245,229,.34), transparent 18%),
    radial-gradient(circle at 62% 83%, rgba(255,79,184,.24), transparent 22%),
    linear-gradient(180deg, #06202A 0%, #093847 52%, #06202A 100%);
  border-right: 2px solid rgba(184,255,247,.38);
  box-shadow: 0 0 55px rgba(18,245,229,.22), inset -22px 0 40px rgba(18,245,229,.08);
}

.rail-glow {
  position: absolute;
  inset: 6% 34% 6% 34%;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(18,245,229,.28), rgba(255,79,184,.2), transparent);
  filter: blur(18px);
  animation: strandPulse 5s ease-in-out infinite;
}

.rail-wordmark {
  position: absolute;
  top: 7vh;
  left: 1.25rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: .8;
  letter-spacing: -.08em;
  color: var(--lagoon-cyan);
  text-shadow: 0 0 22px rgba(18,245,229,.55);
}

.rail-wordmark b { color: var(--coral-pink); font-weight: 700; }

.chromosome-strand {
  position: absolute;
  top: 17vh;
  left: 50%;
  width: 5rem;
  height: 66vh;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(184,255,247,.34);
  background: linear-gradient(90deg, transparent 46%, rgba(184,255,247,.45) 48% 52%, transparent 54%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 1.2rem 0;
}

.bead {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--deep-reef);
  border: 2px solid rgba(184,255,247,.5);
  box-shadow: 0 0 0 rgba(18,245,229,0);
  animation: beadWake 4.5s ease-in-out infinite;
}

.bead::after {
  content: attr(data-base);
  color: var(--pearl-foam);
  font-family: "Geist Mono", monospace;
  font-size: .72rem;
}

.bead.active, .tide-rail.lit .bead {
  background: radial-gradient(circle, var(--bubble-aqua), var(--lagoon-cyan));
  border-color: var(--pearl-foam);
  box-shadow: 0 0 24px rgba(18,245,229,.85);
}

.tick {
  position: absolute;
  left: 50%;
  width: 6.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--electric-lime), transparent);
  animation: tickScan 2.8s linear infinite;
}
.tick-one { top: 18%; }
.tick-two { top: 50%; animation-delay: .8s; }
.tick-three { top: 77%; animation-delay: 1.5s; }

.cap-svg {
  position: absolute;
  left: 50%;
  width: 8rem;
  height: 6rem;
  transform: translateX(-50%);
  overflow: visible;
}
.top-cap { top: 6vh; }
.bottom-cap { bottom: 5vh; }
.cap-path {
  fill: none;
  stroke: var(--coral-pink);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  filter: drop-shadow(0 0 12px rgba(255,79,184,.8));
  animation: drawCap 3.2s ease-in-out forwards, capThrob 4s ease-in-out infinite 3.2s;
}

.rail-nav {
  position: absolute;
  right: 1rem;
  top: 22vh;
  display: grid;
  gap: .9rem;
  width: 42%;
}

.nav-dot {
  position: relative;
  padding: .7rem .6rem .7rem 1rem;
  border-radius: 1.2rem;
  color: rgba(255,247,214,.72);
  text-decoration: none;
  font-size: .72rem;
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(184,255,247,.08);
  border: 1px solid rgba(184,255,247,.2);
  backdrop-filter: blur(8px);
}
.nav-dot span { display: block; color: var(--lagoon-cyan); font-family: "Geist Mono", monospace; }
.nav-dot.current { color: var(--deep-reef); background: var(--bubble-aqua); box-shadow: 0 0 22px rgba(18,245,229,.42); }

.rail-sequence {
  position: absolute;
  left: 1.25rem;
  bottom: 2rem;
  font-family: "Geist Mono", monospace;
  color: var(--electric-lime);
  font-size: .75rem;
  letter-spacing: .16em;
}

.reef-story {
  position: relative;
  margin-left: var(--rail-width);
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 10%, rgba(255,155,47,.42), transparent 18rem),
    linear-gradient(180deg, #FFF7D6 0%, #B8FFF7 38%, #12F5E5 76%, #FFF7D6 100%);
}

.water-field {
  position: fixed;
  inset: 0 0 0 var(--rail-width);
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,247,214,.72) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(18,245,229,.36) 0 2px, transparent 3px);
  background-size: 130px 180px, 190px 230px;
  animation: bubbleRise 18s linear infinite;
  opacity: .7;
}

.chamber {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 7vw 7vw 7vw 6vw;
  isolation: isolate;
}

.chamber::before {
  content: "";
  position: absolute;
  inset: 4vw;
  border: 1px solid rgba(6,32,42,.15);
  border-radius: 46% 54% 49% 51% / 10% 14% 86% 90%;
  background: linear-gradient(120deg, rgba(255,255,255,.18), transparent 32%, rgba(18,245,229,.16));
  z-index: -1;
}

.glass-panel {
  position: relative;
  max-width: 780px;
  padding: clamp(1.6rem, 4vw, 4rem);
  border-radius: 3rem 4.8rem 2.2rem 5.2rem;
  border: 1px solid rgba(6,32,42,.18);
  background: rgba(255,247,214,.58);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(6,32,42,.18), inset 0 0 35px rgba(184,255,247,.4);
}

.foam-tag {
  display: inline-block;
  margin: 0 0 1.4rem;
  padding: .45rem .75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--coral-pink);
  background: rgba(255,255,255,.32);
  font-family: "Geist Mono", monospace;
  font-size: .78rem;
  letter-spacing: .08em;
}

h1, h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: .82;
}
h1 { font-size: clamp(5rem, 13vw, 12.5rem); color: var(--deep-reef); }
h1 span { display: block; color: var(--coral-pink); text-shadow: 0 0 26px rgba(255,79,184,.3); animation: titleRise 1.6s ease-out both; }
h1 strong { display: block; color: var(--lagoon-cyan); text-shadow: 0 0 22px rgba(18,245,229,.8); animation: titleRise 1.6s ease-out .25s both; }
h2 { font-size: clamp(4rem, 9vw, 9rem); color: var(--deep-reef); }

.lead, .glass-panel p:not(.foam-tag) {
  max-width: 42rem;
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.55;
}

.scene-lines, .coral-circuit, .renew-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.seaweed, .cap-orbit, .repair-path, .renew-loop path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawLine 7s ease-in-out infinite alternate;
}
.seaweed { stroke: var(--electric-lime); stroke-width: 5; filter: drop-shadow(0 0 8px rgba(185,255,46,.7)); }
.cap-orbit { stroke: var(--uv-lavender); stroke-width: 7; animation-duration: 5.8s; }
.hero-lines { transform: translate(calc((var(--mouse-x) - 50%) * .025), calc((var(--mouse-y) - 50%) * .02)); }

.sequence-cloud { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.sequence-cloud span, .nucleotide-pearl, .pearl-current i {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pearl-foam);
  border: 2px solid var(--deep-reef);
  color: var(--deep-reef);
  font-family: "Geist Mono", monospace;
  font-style: normal;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(255,247,214,.65);
}

.pearl-current {
  position: absolute;
  right: -8vw;
  bottom: 13vh;
  display: flex;
  gap: 1.3rem;
  animation: currentDrift 14s linear infinite;
}
.pearl-current i:nth-child(odd), .nucleotide-pearl:nth-child(odd) { background: var(--coral-pink); color: var(--pearl-foam); }
.pearl-current i:nth-child(even), .nucleotide-pearl:nth-child(even) { background: var(--lagoon-cyan); }

.drift-chamber { background: linear-gradient(90deg, rgba(18,245,229,.35), rgba(255,247,214,.65), rgba(165,117,255,.25)); }
.split-current {
  position: absolute;
  display: flex;
  gap: 1rem;
  white-space: nowrap;
  font-family: "Geist Mono", monospace;
}
.left-current { top: 22vh; left: -8vw; animation: codeDrift 18s linear infinite; }
.right-current { bottom: 18vh; right: -4vw; animation: reverseDrift 13s linear infinite; }
.split-current code {
  padding: .9rem 1.1rem;
  border-radius: 1.2rem;
  color: var(--bubble-aqua);
  background: rgba(6,32,42,.82);
  box-shadow: 0 0 18px rgba(18,245,229,.22);
}
.nucleotide-pearl.lime { background: var(--electric-lime); }
.drift-panel { margin-left: auto; }

.repair-chamber { background: radial-gradient(circle at 30% 35%, rgba(255,79,184,.3), transparent 20rem), linear-gradient(180deg, #B8FFF7, #FFF7D6); }
.coral-circuit { filter: drop-shadow(0 0 13px rgba(255,79,184,.55)); }
.repair-path { stroke: var(--coral-pink); stroke-width: 8; }
.repair-path.branch { stroke: var(--uv-lavender); stroke-width: 5; }
.repair-path.delay { animation-delay: .8s; stroke: var(--electric-lime); }
.repair-path.slow { animation-duration: 9s; }
.coral-circuit circle { fill: var(--electric-lime); stroke: var(--deep-reef); stroke-width: 3; animation: nodeBlink 2s ease-in-out infinite alternate; }
.break-gap { position: absolute; right: 13vw; top: 14vh; display: flex; gap: 1rem; transform: rotate(-12deg); }
.break-gap span { width: 5.5rem; height: .8rem; border-radius: 999px; background: var(--deep-reef); box-shadow: 0 0 18px rgba(6,32,42,.35); }
.repair-panel:hover ~ .coral-circuit .repair-path, .repair-chamber:hover .repair-path { stroke-width: 10; }

.renew-chamber { background: linear-gradient(180deg, #B8FFF7 0%, #FFF7D6 46%, #FF9B2F 170%); }
.sunrise-lagoon {
  position: absolute;
  right: 4vw;
  top: 9vh;
  width: 32vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF7D6 0 24%, #FF9B2F 25% 38%, #FF4FB8 39% 42%, transparent 43%);
  filter: drop-shadow(0 0 45px rgba(255,155,47,.7));
}
.renew-loop { inset: 14vh 8vw auto auto; width: 58vw; height: 58vh; }
.renew-loop path { stroke: var(--lagoon-cyan); stroke-width: 9; filter: drop-shadow(0 0 16px rgba(18,245,229,.85)); }
.renew-loop .inner { stroke: var(--uv-lavender); stroke-width: 5; animation-delay: .7s; }
.renew-panel { margin-top: 18vh; }

.tide-rail:hover .cap-path { stroke-width: 8; }
.tide-rail:hover .bead { transform: scale(1.08); }

@keyframes drawCap { to { stroke-dashoffset: 0; } }
@keyframes capThrob { 50% { stroke: var(--lagoon-cyan); filter: drop-shadow(0 0 18px rgba(18,245,229,.9)); } }
@keyframes drawLine { 0% { stroke-dashoffset: 1200; } 48%, 100% { stroke-dashoffset: 0; } }
@keyframes strandPulse { 50% { opacity: .35; transform: scaleX(1.25); } }
@keyframes beadWake { 50% { transform: translateY(-5px); } }
@keyframes tickScan { 0% { transform: translate(-50%, -28px); opacity: 0; } 45% { opacity: 1; } 100% { transform: translate(-50%, 28px); opacity: 0; } }
@keyframes bubbleRise { from { background-position: 0 0, 0 0; } to { background-position: 0 -720px, 0 -920px; } }
@keyframes titleRise { from { opacity: 0; transform: translateY(1em); } to { opacity: 1; transform: translateY(0); } }
@keyframes currentDrift { from { transform: translateX(0); } to { transform: translateX(-72vw); } }
@keyframes codeDrift { from { transform: translateX(-10%); opacity: .35; } 20%, 80% { opacity: 1; } to { transform: translateX(58vw); opacity: .35; } }
@keyframes reverseDrift { from { transform: translateX(0); } to { transform: translateX(-62vw); } }
@keyframes nodeBlink { to { fill: var(--pearl-foam); transform: scale(1.15); } }

@media (max-width: 920px) {
  :root { --rail-width: 108px; }
  .tide-rail { min-width: 108px; }
  .rail-wordmark { left: .55rem; font-size: 1.55rem; }
  .rail-nav, .rail-sequence { display: none; }
  .chromosome-strand { width: 3.8rem; }
  .chamber { padding: 8rem 1.2rem 4rem 2rem; }
  .glass-panel { border-radius: 2rem; }
  h1 { font-size: clamp(4rem, 18vw, 7rem); }
}
