:root {
  /* Typography tokens mirrored from DESIGN.md: Roboto Slab** display, Inter** readable interface text. */
  --aqua-glass: #6FE8FF;
  --aero-blue: #1E8CFF;
  --lagoon-cyan: #20D7B5;
  --citrus: #B8FF3D;
  --pearl: #F4FFFB;
  --navy: #06345E;
  --silver: #B9D7E8;
  --coral: #FF6B9A;
  --progress: 0;
  --amp: 1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 255, 61, 0.48) 0 8rem, transparent 18rem),
    radial-gradient(circle at 84% 12%, rgba(255, 107, 154, 0.24) 0 5rem, transparent 16rem),
    linear-gradient(135deg, #F4FFFB 0%, #6FE8FF 32%, #1E8CFF 68%, #20D7B5 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(244, 255, 251, 0.72) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(185, 215, 232, 0.55) 0 1px, transparent 4px);
  background-size: 86px 86px, 137px 137px;
  transform: translateY(calc(var(--progress) * -90px));
  opacity: 0.56;
  z-index: 0;
}

.aero-shell { position: relative; isolation: isolate; }

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

.orb {
  position: absolute;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #F4FFFB 0 8%, rgba(111, 232, 255, 0.68) 9% 42%, rgba(30, 140, 255, 0.08) 70%);
  box-shadow: inset -28px -38px 72px rgba(6, 52, 94, 0.2), inset 24px 20px 38px rgba(244, 255, 251, 0.78), 0 24px 70px rgba(6, 52, 94, 0.16);
  animation: bubbleDrift 14s ease-in-out infinite alternate;
}

.orb-a { left: -4rem; top: 10rem; }
.orb-b { right: 5vw; top: 48vh; width: 14rem; height: 14rem; animation-duration: 18s; }
.orb-c { left: 50vw; bottom: -5rem; width: 24rem; height: 24rem; animation-duration: 22s; }

.grid-reflect {
  position: absolute;
  width: 24rem;
  height: 14rem;
  border-radius: 38px;
  background-image: linear-gradient(rgba(244,255,251,.26) 1px, transparent 1px), linear-gradient(90deg, rgba(244,255,251,.28) 1px, transparent 1px);
  background-size: 32px 32px;
  border: 1px solid rgba(244, 255, 251, 0.24);
  transform: rotate(-12deg);
  filter: blur(.2px);
}
.grid-one { right: 8vw; top: 13vh; }
.grid-two { left: 5vw; bottom: 8vh; transform: rotate(15deg); }

.glass-tabs {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(244, 255, 251, 0.36);
  border: 1px solid rgba(244, 255, 251, 0.72);
  box-shadow: inset 0 1px 1px rgba(244, 255, 251, 0.95), 0 18px 50px rgba(6, 52, 94, 0.16);
  backdrop-filter: blur(18px) saturate(150%);
  z-index: 20;
}

.glass-tabs a {
  color: var(--navy);
  text-decoration: none;
  font-family: "Zilla Slab", Georgia, serif;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background .28s ease, box-shadow .28s ease, transform .28s ease;
}
.glass-tabs a:hover { background: rgba(111, 232, 255, 0.45); box-shadow: inset 0 0 14px rgba(244, 255, 251, 0.9); transform: translateY(-1px); }

.scene {
  min-height: 100vh;
  padding: 96px clamp(18px, 4vw, 64px) 56px;
  position: relative;
  display: grid;
  align-items: center;
}

.bento { display: grid; gap: clamp(14px, 1.8vw, 24px); width: min(1180px, 100%); margin: 0 auto; }
.boot-grid { grid-template-columns: 1.2fr .72fr .72fr; grid-template-rows: minmax(170px, auto) minmax(180px, auto) minmax(200px, auto); }

.tile, .mini-tile, .horizon {
  position: relative;
  overflow: hidden;
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(244, 255, 251, 0.58), rgba(111, 232, 255, 0.22));
  border: 1px solid rgba(244, 255, 251, 0.76);
  box-shadow: inset 1px 1px 1px rgba(244, 255, 251, 0.96), inset -22px -22px 42px rgba(30, 140, 255, 0.13), 0 24px 68px rgba(6, 52, 94, 0.18);
  backdrop-filter: blur(18px) saturate(160%);
}

.tile { padding: clamp(20px, 2.5vw, 34px); min-height: 170px; }
.title-tank { grid-column: span 2; min-height: 330px; display: flex; flex-direction: column; justify-content: flex-end; }
.meter-tile { min-height: 150px; }
.code-cell { grid-column: 1 / 2; }
.scanner-tile { display: grid; place-items: center; text-align: center; }
.narrative-tile { grid-column: span 2; }

.tile::before, .horizon::before {
  content: "";
  position: absolute;
  inset: 9px 12px auto;
  height: 42%;
  border-radius: 28px;
  background: linear-gradient(rgba(244, 255, 251, 0.58), rgba(244, 255, 251, 0.05));
  pointer-events: none;
}

.tile-shine {
  position: absolute;
  inset: -30% auto auto -20%;
  width: 58%;
  height: 88%;
  background: linear-gradient(100deg, transparent, rgba(244,255,251,.72), transparent);
  transform: rotate(18deg);
  animation: shimmer 7s ease-in-out infinite;
}

h1, h2, h3 { margin: 0; font-family: "Roboto Slab", Georgia, serif; line-height: .95; letter-spacing: -0.045em; }
h1 { font-size: clamp(4.5rem, 13vw, 11rem); color: var(--pearl); text-shadow: 0 4px 0 rgba(6, 52, 94, 0.18), 0 18px 50px rgba(6, 52, 94, 0.28); }
h2 { font-size: clamp(2.5rem, 6vw, 5.6rem); color: var(--navy); }
h3 { font-size: clamp(1.45rem, 2.4vw, 2.3rem); color: var(--navy); }
p { line-height: 1.55; font-size: 1rem; position: relative; }
.lead { width: min(680px, 100%); color: var(--pearl); font-size: clamp(1.06rem, 1.7vw, 1.35rem); text-shadow: 0 2px 16px rgba(6, 52, 94, .32); }
.caption, .module-label { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.caption { color: rgba(6, 52, 94, .78); }
.module-label { font-size: .86rem; display: inline-block; margin-bottom: 12px; }

.wave-back { position: absolute; inset: 0; width: 120%; height: 100%; opacity: .8; }
.wave-line { fill: none; stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 12px 16px rgba(6,52,94,.18)); animation: waveSlide 9s linear infinite; }
.wave-one { stroke: rgba(184, 255, 61, .75); }
.wave-two { stroke: rgba(244, 255, 251, .65); stroke-width: 8; animation-duration: 12s; animation-direction: reverse; }

.meter { height: 22px; border-radius: 999px; background: rgba(6, 52, 94, .13); padding: 4px; box-shadow: inset 0 2px 8px rgba(6,52,94,.16); }
.meter span { display: block; height: 100%; width: var(--level); border-radius: inherit; background: linear-gradient(90deg, #6FE8FF, #1E8CFF); box-shadow: 0 0 22px rgba(111, 232, 255, .84); animation: pulseMeter 2.8s ease-in-out infinite alternate; }
.meter.green span { background: linear-gradient(90deg, #B8FF3D, #20D7B5); }

pre { margin: 0; position: relative; font-family: "Zilla Slab", Georgia, serif; font-weight: 600; color: var(--navy); font-size: clamp(.92rem, 1.5vw, 1.12rem); white-space: pre-wrap; }

.scanner { width: 168px; height: 168px; border-radius: 50%; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #B8FF3D 0%, #6FE8FF 38%, #06345E 100%); box-shadow: inset 0 0 30px rgba(244,255,251,.72), 0 0 42px rgba(111,232,255,.8); }
.scanner-ring { position: absolute; inset: 18px; border: 3px solid rgba(244,255,251,.7); border-radius: 50%; animation: rotateRing 7s linear infinite; }
.scanner-ring::after { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); }
.scanner-ring.small { inset: 50px; animation-direction: reverse; animation-duration: 4.5s; }
.scanner-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--pearl); box-shadow: 0 0 22px var(--pearl); }

.seal { position: absolute; top: 22px; right: 24px; padding: 9px 14px; border-radius: 999px; font-family: "Roboto Slab", Georgia, serif; font-weight: 900; background: #B8FF3D; box-shadow: inset 0 2px 6px rgba(244,255,251,.8), 0 12px 24px rgba(6,52,94,.15); }
.aqua-button { border: 0; border-radius: 999px; padding: 13px 22px; font-family: "Zilla Slab", Georgia, serif; font-weight: 700; color: var(--navy); background: linear-gradient(135deg, #F4FFFB, #6FE8FF 52%, #B8FF3D); box-shadow: inset 0 2px 1px rgba(255,255,255,.9), 0 16px 36px rgba(6,52,94,.2); cursor: pointer; transition: transform .25s ease, filter .25s ease; }
.aqua-button:hover { transform: translateY(-3px) scale(1.02); filter: saturate(1.2); }
.aqua-button.ghost { background: rgba(244,255,251,.38); border: 1px solid rgba(244,255,251,.72); }

.section-header { width: min(860px, 100%); margin: 0 auto 28px; }
.section-header p:last-child { font-size: 1.1rem; width: min(650px, 100%); }
.compiler-grid { grid-template-columns: 1.35fr .75fr; }
.wide-flow { grid-row: span 2; min-height: 450px; display: flex; align-items: flex-end; }
.compiler-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.compiler-path { fill: none; stroke: url(#flowGrad); stroke-width: 16; stroke-linecap: round; opacity: .86; stroke-dasharray: 60 26; animation: flowDash 7s linear infinite; }
.path-b { stroke-width: 8; opacity: .62; animation-direction: reverse; }
.code-droplets rect { fill: rgba(244,255,251,.75); stroke: rgba(6,52,94,.16); filter: drop-shadow(0 14px 16px rgba(6,52,94,.16)); animation: dropletBob 5s ease-in-out infinite; }
.capsule { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px; border-radius: 999px; background: rgba(244,255,251,.42); font-family: "Zilla Slab", Georgia, serif; font-weight: 700; }
.capsule span { width: 36px; height: 22px; border-radius: 999px; background: var(--silver); box-shadow: inset 0 2px 7px rgba(6,52,94,.16); }
.capsule.on span { background: linear-gradient(90deg, #B8FF3D, #20D7B5); }
.fish { position: absolute; width: 54px; height: 25px; border-radius: 65% 40% 40% 65%; background: linear-gradient(135deg, #F4FFFB, #6FE8FF); box-shadow: 0 12px 24px rgba(6,52,94,.14); animation: swim 6s ease-in-out infinite; }
.fish::after { content: ""; position: absolute; right: -14px; top: 5px; border-left: 16px solid #6FE8FF; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.fish-one { top: 22px; left: 20px; }
.fish-two { top: 70px; right: 28px; animation-delay: -2s; }
.fish-three { bottom: 28px; left: 44%; animation-delay: -3.5s; }
.lens { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; margin: 10px auto 18px; font-family: "Roboto Slab", Georgia, serif; font-weight: 900; font-size: 2.1rem; color: var(--pearl); background: radial-gradient(circle at 32% 24%, #F4FFFB 0 7%, #6FE8FF 34%, #1E8CFF 64%, #06345E); box-shadow: inset 12px 18px 24px rgba(244,255,251,.48), inset -20px -25px 40px rgba(6,52,94,.35), 0 20px 55px rgba(6,52,94,.24); }

.scanner-stage { width: min(1120px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: center; }
.mega-scanner { min-height: min(70vh, 720px); border-radius: 60px; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #B8FF3D 0%, #6FE8FF 38%, #06345E 100%); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(244,255,251,.76), inset 0 0 70px rgba(244,255,251,.55), 0 34px 90px rgba(6,52,94,.25); }
.scan-beam { position: absolute; width: 50%; height: 140%; left: 50%; top: -20%; transform-origin: left center; background: linear-gradient(90deg, rgba(244,255,251,.56), transparent); clip-path: polygon(0 48%, 100% 0, 100% 100%, 0 52%); animation: sweep 5s linear infinite; }
.chrome-ring { position: absolute; border-radius: 50%; border: 3px solid rgba(244,255,251,.62); box-shadow: inset 0 0 22px rgba(244,255,251,.35), 0 0 26px rgba(111,232,255,.45); }
.ring-one { inset: 12%; animation: rotateRing 10s linear infinite; }
.ring-two { inset: 26%; animation: rotateRing 7s linear infinite reverse; }
.packet { position: absolute; padding: 10px 13px; border-radius: 18px; background: rgba(244,255,251,.68); font-family: "Zilla Slab", Georgia, serif; font-weight: 700; box-shadow: 0 14px 30px rgba(6,52,94,.18); animation: orbit 8s ease-in-out infinite; }
.packet-a { left: 19%; top: 28%; }
.packet-b { right: 20%; top: 34%; animation-delay: -2s; }
.packet-c { left: 30%; bottom: 22%; animation-delay: -4s; }
.packet-d { right: 28%; bottom: 26%; animation-delay: -6s; }
.scanner-core { width: min(300px, 52vw); height: min(300px, 52vw); border-radius: 50%; display: grid; place-content: center; text-align: center; padding: 28px; background: rgba(244,255,251,.34); backdrop-filter: blur(14px); border: 1px solid rgba(244,255,251,.72); box-shadow: inset 0 0 34px rgba(244,255,251,.76), 0 20px 50px rgba(6,52,94,.2); }
.scanner-core strong { font-family: "Roboto Slab", Georgia, serif; font-size: clamp(2rem, 4vw, 4rem); line-height: .9; }
.scanner-core small { margin-top: 12px; font-family: "Zilla Slab", Georgia, serif; font-weight: 600; }
.scanner-notes { display: grid; gap: 16px; }
.mini-tile { padding: 22px; min-height: 130px; }
.mini-tile b { display: block; font-family: "Roboto Slab", Georgia, serif; font-size: 1.35rem; margin-bottom: 8px; }
.mini-tile span { display: block; line-height: 1.45; }

.launch-current { overflow: hidden; background: linear-gradient(180deg, transparent 0%, rgba(244,255,251,.78) 70%, #F4FFFB 100%); }
.horizon { width: min(940px, 100%); margin: 0 auto; text-align: center; padding: clamp(34px, 7vw, 86px); border-radius: 54px; }
.horizon p { font-size: 1.14rem; width: min(680px, 100%); margin-left: auto; margin-right: auto; }
.launch-labels { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.drift-tiles { position: absolute; inset: 0; pointer-events: none; }
.drift-tile { position: absolute; border-radius: 30px; background: rgba(111,232,255,.24); border: 1px solid rgba(244,255,251,.68); box-shadow: inset 0 1px rgba(244,255,251,.8), 0 20px 54px rgba(6,52,94,.12); animation: driftApart 12s ease-in-out infinite alternate; }
.drift-tile.one { width: 180px; height: 120px; left: 8vw; top: 22vh; }
.drift-tile.two { width: 230px; height: 90px; right: 6vw; top: 24vh; animation-delay: -2s; }
.drift-tile.three { width: 140px; height: 180px; left: 18vw; bottom: 12vh; animation-delay: -4s; }
.drift-tile.four { width: 190px; height: 150px; right: 18vw; bottom: 8vh; animation-delay: -6s; }

.reveal { opacity: 0; filter: blur(18px); transform: translateY(34px) scale(.985); transition: opacity .9s ease, filter .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }
.delay-3 { transition-delay: .24s; }
.delay-4 { transition-delay: .32s; }
.shimmer-trace::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(110deg, transparent 40%, rgba(244,255,251,.62), transparent 60%); transform: translateX(-120%) rotate(8deg); animation: tracePass .72s ease-out; pointer-events: none; }
.ripple-target { --mx: 50%; --my: 50%; }
.ripple-target:hover { box-shadow: inset 1px 1px 1px rgba(244,255,251,.96), inset -22px -22px 42px rgba(30, 140, 255, 0.13), 0 28px 78px rgba(6, 52, 94, 0.22), 0 0 0 8px rgba(111,232,255,.08); }
.ripple-target:hover::after { content: ""; position: absolute; width: 180px; height: 180px; left: var(--mx); top: var(--my); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(244,255,251,.42), rgba(111,232,255,.18) 42%, transparent 68%); animation: rippleBloom .8s ease-out; pointer-events: none; }

@keyframes bubbleDrift { to { transform: translate3d(30px, calc(-36px * var(--amp)), 0) scale(1.05); } }
@keyframes shimmer { 0%, 44% { transform: translateX(-10%) rotate(18deg); opacity: 0; } 55% { opacity: 1; } 78%, 100% { transform: translateX(240%) rotate(18deg); opacity: 0; } }
@keyframes waveSlide { to { transform: translateX(-180px); } }
@keyframes pulseMeter { to { filter: brightness(1.18); transform: scaleX(.94); transform-origin: left; } }
@keyframes rotateRing { to { transform: rotate(360deg); } }
@keyframes flowDash { to { stroke-dashoffset: -172; } }
@keyframes dropletBob { 50% { transform: translateY(calc(-18px * var(--amp))); } }
@keyframes swim { 50% { transform: translate(22px, -12px) rotate(-4deg); } }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes orbit { 50% { transform: translate(calc(22px * var(--amp)), calc(-18px * var(--amp))) scale(1.06); } }
@keyframes driftApart { to { transform: translate(calc(24px * var(--amp)), calc(-32px * var(--amp))) rotate(6deg); } }
@keyframes tracePass { to { transform: translateX(120%) rotate(8deg); } }
@keyframes rippleBloom { from { opacity: .95; transform: translate(-50%, -50%) scale(.2); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } }

@media (max-width: 900px) {
  .glass-tabs { width: calc(100% - 20px); overflow-x: auto; justify-content: flex-start; }
  .boot-grid, .compiler-grid, .scanner-stage { grid-template-columns: 1fr; }
  .title-tank, .narrative-tile, .code-cell { grid-column: auto; }
  .wide-flow { min-height: 360px; }
  .scene { padding-top: 104px; }
  .scanner-stage { gap: 18px; }
}

@media (max-width: 560px) {
  .tile { border-radius: 28px; }
  .glass-tabs a { white-space: nowrap; }
  h1 { font-size: 4.3rem; }
  .mega-scanner { border-radius: 38px; }
  .launch-labels { flex-direction: column; }
}
