:root {
  --bg: #050c0b;
  --bg-elevated: #08120f;
  --panel: #091512;
  --panel-2: #0b1a16;
  --border: #16302a;
  --border-soft: #1f4038;
  --text: #e8f3ef;
  --text-muted: #94b3aa;
  --text-dim: #64857c;
  --text-faint: #456a60;
  --accent: #5ee9c9;
  --accent-strong: #a6f7e4;
  --accent-dim: #2a8a74;
  --good: #c9f27a;
  --bad: #ff8f7a;
  --warm: #ffb36b;
  --radius: 18px;
  --max: 1320px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: rgba(94, 233, 201, .3); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hero .scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(130% 90% at 50% 10%, rgba(5,12,11,0) 30%, rgba(5,12,11,.4) 70%, rgba(5,12,11,.85) 100%),
    linear-gradient(180deg, rgba(5,12,11,.45) 0, rgba(5,12,11,.05) 26%, rgba(5,12,11,.55) 72%, var(--bg) 100%);
}
.grain {
  position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-3%) }
  60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) } 100% { transform: translate(0,0) }
}

.brand {
  position: fixed; z-index: 100; top: 16px; left: clamp(16px, 2.5vw, 40px);
  display: inline-flex; align-items: center; transition: transform .25s;
}
.brand svg { width: 52px; height: 52px; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); transition: filter .25s; }
.brand:hover { transform: translateY(-1px); }
.brand:hover svg { filter: drop-shadow(0 4px 14px rgba(94,233,201,.35)); }
.brand .ring-spin { transform-origin: 32px 32px; animation: logoTilt 8s ease-in-out infinite; }
@keyframes logoTilt { 0%,100% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) } }

.nav {
  position: relative; z-index: 2; align-self: center; margin-top: 22px;
  display: flex; gap: 8px; padding: 8px; border-radius: 999px;
  background: rgba(6, 16, 14, .5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(94, 233, 201, .12);
  opacity: 0; transform: translateY(-12px); animation: dropIn .9s .2s cubic-bezier(.2,.7,.2,1) forwards;
}
.nav a { font-size: 13px; color: var(--text-muted); padding: 8px 16px; border-radius: 999px; transition: color .25s, background .25s; white-space: nowrap; }
.nav a:hover { color: var(--text); background: rgba(94, 233, 201, .1); }
.nav .social { display: inline-flex; align-items: center; padding: 8px 12px; }
@keyframes dropIn { to { opacity: 1; transform: none; } }

.hero-inner { position: relative; z-index: 2; margin-top: auto; width: 100%; padding: 0 24px 56px clamp(16px, 2.5vw, 40px); }
.hero-col { max-width: 620px; }
.wordmark {
  margin: 0; font-size: clamp(60px, 11vw, 168px); font-weight: 500; letter-spacing: -.06em; line-height: .9;
  color: rgba(232, 243, 239, .16); user-select: none;
  background: linear-gradient(100deg, rgba(232,243,239,.14) 0%, rgba(232,243,239,.14) 40%, rgba(166,247,228,.42) 50%, rgba(232,243,239,.14) 60%, rgba(232,243,239,.14) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sheen 7s 1.6s ease-in-out infinite, rise 1.2s .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes sheen { 0% { background-position: 100% 0 } 45%,100% { background-position: 0 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); filter: blur(8px) } to { opacity: 1; transform: none; filter: none } }
.lead { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; margin-top: 12px; }
.lead p { margin: 0; max-width: 26ch; font-size: 18px; line-height: 1.5; color: var(--text); animation: rise 1.1s .55s cubic-bezier(.2,.7,.2,1) both; }
.lead .cta { animation: rise 1.1s .75s cubic-bezier(.2,.7,.2,1) both; }

.cta {
  display: inline-flex; align-items: center; gap: 16px; padding: 14px 14px 14px 26px; border-radius: 999px;
  background: #eaf7f3; color: #06110e; font-size: 15px; font-weight: 500; border: 0; cursor: pointer;
  transition: transform .25s, background .25s, box-shadow .25s;
}
.cta:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 10px 40px -10px rgba(94,233,201,.45); }
.cta-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: #06110e; color: #eaf7f3; transition: transform .25s; }
.cta:hover .cta-icon { transform: translateX(3px); }

.scroll-hint {
  position: absolute; z-index: 2; right: clamp(16px, 2.5vw, 40px); bottom: 56px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--mono);
}
.scroll-hint i { width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ""; position: absolute; left: 0; top: -30%; width: 1px; height: 30%; background: #fff; animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { to { top: 110% } }

/* ---------- Sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: 120px 32px; position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 56px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(36px, 4.6vw, 64px); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; }
.section-head .aside { max-width: 300px; }
.section-head .aside p { margin: 0; font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.section-head .aside small { display: block; margin-top: 12px; font-size: 11px; color: var(--text-dim); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s } .reveal.d2 { transition-delay: .2s } .reveal.d3 { transition-delay: .3s }
.split .w { display: inline-block; opacity: 0; transform: translateY(.5em); transition: opacity .8s, transform .8s cubic-bezier(.2,.7,.2,1); }
.split.in .w { opacity: 1; transform: none; }

/* ---------- Flow ---------- */
.flow-grid { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.7fr); align-items: center; gap: 48px; }
.scenarios { display: flex; flex-direction: column; }
.scenarios > button {
  position: relative; text-align: left; cursor: pointer; color: var(--text-dim); background: none;
  border: 0; border-top: 1px solid var(--border); padding: 22px 0; transition: color .3s;
}
.scenarios > button:first-child { border-top: 0; }
.scenarios > button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); }
.scenarios > button[aria-pressed="true"]::after { width: 100%; transition: width var(--cycle, 5.5s) linear; }
.scenarios > button.held[aria-pressed="true"]::after { transition: width .5s; }
.sc-top { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.sc-top svg { opacity: .3; margin-left: auto; transition: opacity .3s, transform .3s; }
.sc-index { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 10px; }
.scenarios strong { display: block; margin: 12px 0 0 28px; letter-spacing: -.4px; color: var(--text-muted); font-size: 23px; font-weight: 400; transition: color .3s; }
.sc-copy { display: block; margin-left: 28px; opacity: 0; max-height: 0; overflow: hidden; font-size: 12px; line-height: 1.6; transition: opacity .3s, max-height .3s, margin .3s; }
.scenarios button[aria-pressed="true"] { color: var(--accent); }
.scenarios button[aria-pressed="true"] strong { color: var(--text); }
.scenarios button[aria-pressed="true"] .sc-top svg { opacity: 1; transform: translate(2px,-2px); }
.scenarios button[aria-pressed="true"] .sc-copy { opacity: 1; color: var(--text-muted); max-height: 90px; margin-top: 12px; }
.scenarios button:hover strong { color: var(--text); }
.note { display: flex; gap: 12px; margin-top: 28px; color: var(--text-dim); font-size: 11px; line-height: 1.6; }
.note .dot { flex-shrink: 0; width: 5px; height: 5px; margin-top: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.stage {
  min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(rgba(30, 60, 52, .45), rgba(0,0,0,0) 70%), var(--panel);
  position: relative;
}
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(94,233,201,.07), transparent 60%);
}
.stage-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; color: var(--text-dim); font-size: 11px; }
.badge { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); transition: color .3s, border-color .3s; }
.diagram { padding: 8px 12px 20px; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }

.mesh line { stroke: rgba(94, 233, 201, .06); stroke-width: 1; }
.route { fill: none; stroke: var(--border-soft); stroke-width: 1.4; transition: stroke .4s, opacity .4s; }
.route.inbound { stroke: rgba(94,233,201,.45); }
.flow { stroke-dasharray: 5 11; animation: flow 1.1s linear infinite; stroke: var(--good); opacity: .8; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.over .outbound { stroke: var(--bad); stroke-dasharray: 3 7; opacity: .35; animation: none; }
.paused .outbound { stroke: #5f7a71; stroke-dasharray: 3 7; opacity: .3; animation: none; }
.packet { fill: var(--accent-strong); filter: drop-shadow(0 0 6px var(--accent)); }
.packet-in { offset-path: path("M 150 150 H 380"); animation: absorbIn 3.2s ease-in infinite; }
.packet-out { offset-path: path("M 380 150 H 620"); animation: emitOut 3.2s ease-out infinite; fill: var(--good); filter: drop-shadow(0 0 6px var(--good)); }
@keyframes absorbIn {
  0% { offset-distance: 0; opacity: 0 } 14% { opacity: 1 } 47% { offset-distance: 100%; opacity: 1 }
  47.6% { offset-distance: 100%; opacity: 0 } 100% { offset-distance: 100%; opacity: 0 }
}
@keyframes emitOut { 0%, 66% { offset-distance: 0; opacity: 0 } 72% { opacity: 1 } 99% { opacity: 1 } 100% { offset-distance: 100%; opacity: 0 } }
.over .packet-out, .paused .packet-out { display: none; }
.paused .packet-in { display: none; }
.over .packet-in { fill: var(--bad); filter: drop-shadow(0 0 6px var(--bad)); }

.node-ring { fill: rgba(201, 242, 122, .03); stroke: rgba(201, 242, 122, .38); stroke-width: 1.2; }
.node-dot { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); animation: pulse 2.4s ease-in-out infinite; transform-origin: 110px 150px; }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.25) } }
.node-halo { fill: none; stroke: var(--accent); opacity: 0; transform-origin: 110px 150px; animation: halo 3.2s ease-out infinite; }
@keyframes halo { 0% { opacity: .5; transform: scale(.25) } 60%,100% { opacity: 0; transform: scale(1.15) } }
.paused .node-dot { fill: #5f7a71; animation: none; filter: none; }
.paused .node-halo { display: none; }
.node-label { fill: var(--text-dim); font-size: 11px; text-anchor: middle; font-family: "Geist", sans-serif; }
.limit-label { fill: var(--text-faint); font-size: 10px; text-anchor: middle; font-family: var(--mono); letter-spacing: .04em; }
.core { fill: rgba(94, 233, 201, .07); stroke: var(--accent); stroke-width: 1.6; filter: drop-shadow(0 0 9px rgba(94,233,201,.45)); transition: stroke .4s, fill .4s, filter .4s; }
.allowed .core { animation: coreCheck 3.2s ease-in-out infinite; }
@keyframes coreCheck {
  0%, 44% { filter: drop-shadow(0 0 9px rgba(94,233,201,.45)) }
  48%, 64% { filter: drop-shadow(0 0 18px rgba(94,233,201,.9)) }
  70%, 100% { filter: drop-shadow(0 0 9px rgba(94,233,201,.45)) }
}
.over .core { stroke: var(--bad); fill: rgba(255, 143, 122, .08); filter: drop-shadow(0 0 12px rgba(255,143,122,.45)); animation: shake 3.2s ease-in-out infinite; }
@keyframes shake { 0%,45%,60%,100% { transform: none } 48% { transform: translateX(-3px) } 51% { transform: translateX(3px) } 54% { transform: translateX(-2px) } 57% { transform: translateX(1px) } }
.paused .core { stroke: #5f7a71; fill: rgba(95,122,113,.06); filter: none; }
.mark { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: opacity .3s; opacity: 0; }
.mark-ok { stroke: var(--good); stroke-dasharray: 60; stroke-dashoffset: 60; }
.allowed .mark-ok { opacity: 1; animation: draw 3.2s ease-in-out infinite; }
@keyframes draw { 0%,44% { stroke-dashoffset: 60 } 54%,100% { stroke-dashoffset: 0 } }
.mark-x { stroke: var(--bad); }
.over .mark-x { opacity: 1; }
.mark-pause { stroke: #8aa39b; }
.paused .mark-pause { opacity: 1; }
.vendor { fill: rgba(201, 242, 122, .03); stroke: rgba(201, 242, 122, .38); stroke-width: 1.2; transition: stroke .4s, fill .4s; }
.allowed .vendor { animation: vendorHit 3.2s ease-out infinite; }
@keyframes vendorHit { 0%,96% { fill: rgba(201,242,122,.03) } 99% { fill: rgba(201,242,122,.2) } 100% { fill: rgba(201,242,122,.03) } }
.amount { fill: var(--text); font-size: 11px; text-anchor: middle; font-family: var(--mono); }
.verdict { fill: var(--good); font-weight: 600; }
.over .verdict { fill: var(--bad); }
.paused .verdict { fill: var(--text-dim); font-weight: 400; }

.allowed ~ .stage-top .badge, .stage[data-state="allowed"] .badge { color: var(--good); border-color: rgba(201,242,122,.25); }
.stage[data-state="over"] .badge { color: var(--bad); border-color: rgba(255,143,122,.3); }

/* ---------- Control ---------- */
.control-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 48px; align-items: center; }
.panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(120% 120% at 100% 0, rgba(30, 64, 54, .55), rgba(0,0,0,0) 60%), var(--panel);
  padding: 28px 32px 32px; position: relative; overflow: hidden;
  transition: border-color .4s, box-shadow .4s;
}
.panel.is-over { border-color: rgba(255,143,122,.25); box-shadow: 0 0 0 1px rgba(255,143,122,.06), 0 30px 80px -40px rgba(255,143,122,.35); }
.panel.is-ok { box-shadow: 0 30px 80px -50px rgba(94,233,201,.35); }
.panel-top { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 12px; }
.pause {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted);
  background: none; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 12px;
  transition: color .25s, border-color .25s, background .25s;
}
.pause:hover { color: var(--text); border-color: var(--border-soft); }
.pause[aria-pressed="true"] { color: var(--warm); border-color: rgba(255,179,107,.35); background: rgba(255,179,107,.06); }
.readout { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 30px; }
.readout .lbl { font-size: 11px; color: var(--text-dim); }
.big { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.big b { font-family: var(--mono); font-weight: 400; font-size: clamp(40px, 6vw, 56px); letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big span { color: var(--text-dim); font-size: 13px; }
.req { text-align: right; }
.req b { display: block; margin-top: 8px; font-family: var(--mono); font-weight: 400; font-size: 20px; color: var(--text-muted); }
.track { margin-top: 34px; position: relative; }
.track input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; outline: none; cursor: pointer; margin: 0;
  background: linear-gradient(to right, var(--accent) 0, var(--accent) var(--pct), var(--border) var(--pct), var(--border) 100%);
}
.track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #eaf7f3;
  border: 3px solid var(--accent); box-shadow: 0 0 0 6px rgba(94,233,201,.12), 0 0 18px rgba(94,233,201,.5); transition: transform .2s;
}
.track input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #eaf7f3; border: 3px solid var(--accent); box-shadow: 0 0 18px rgba(94,233,201,.5); }
.track input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.track input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(94,233,201,.35); }
.req-mark { position: absolute; top: -8px; width: 1px; height: 20px; background: var(--warm); left: 8%; pointer-events: none; }
.req-mark::after { content: "req"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font: 9px var(--mono); color: var(--warm); }
.ticks { display: flex; justify-content: space-between; margin-top: 14px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.verdict-row { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); gap: 12px; flex-wrap: wrap; }
.verdict-row strong { font-size: 14px; font-weight: 500; }
.v-left { display: flex; align-items: center; gap: 12px; }
.v-dot { width: 7px; height: 7px; border-radius: 50%; position: relative; }
.v-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: inherit; opacity: .35; animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .5 } to { transform: scale(2.2); opacity: 0 } }
.v-ok strong { color: var(--good); } .v-ok .v-dot { background: var(--good); }
.v-bad strong { color: var(--bad); } .v-bad .v-dot { background: var(--bad); }
.v-pause strong { color: var(--warm); } .v-pause .v-dot { background: var(--warm); }
.flip { display: inline-block; animation: flip .35s cubic-bezier(.2,.7,.2,1); }
@keyframes flip { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.rules li { display: grid; grid-template-columns: 28px 1fr; gap: 6px 14px; padding: 18px 0; border-top: 1px solid var(--border); }
.rules li:first-child { border-top: 0; }
.rules .k { font-family: var(--mono); font-size: 10px; color: var(--text-faint); padding-top: 3px; }
.rules b { font-weight: 500; font-size: 15px; }
.rules p { grid-column: 2; margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); }

/* ---------- Access ---------- */
.access { padding-top: 40px; }
.access-glow { position: absolute; inset: auto 0 -40px 0; height: 340px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 70% at 20% 100%, rgba(94,233,201,.10), transparent 70%), radial-gradient(40% 60% at 80% 100%, rgba(255,179,107,.06), transparent 70%); }
.footer {
  max-width: var(--max); margin: auto; padding: 40px 32px 64px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px;
}
.footer .fbrand { color: var(--text); font-weight: 500; }
.legal { display: flex; gap: 20px; align-items: center; }
.legal a:hover { color: var(--text); }
.fsocial { display: inline-flex; align-items: center; color: var(--text-muted); }
.fsocial:hover { color: var(--text); }
.net { font-size: 11px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 8px; }
.net::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35 } }

/* ---------- Legal pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 120px 24px 80px; }
.doc .top { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; margin-bottom: 56px; }
.doc .top svg { width: 34px; height: 34px; }
.doc h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 500; letter-spacing: -.045em; margin: 0; line-height: 1; }
.doc .meta { margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.doc .intro { font-size: 18px; color: var(--text-muted); line-height: 1.55; margin: 28px 0 40px; }
.doc h2 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; margin: 44px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); }
.doc p, .doc li { color: var(--text-muted); line-height: 1.7; font-size: 15px; }
.doc ul { padding-left: 18px; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .flow-grid, .control-wrap { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 88px 16px; }
  .footer { padding: 32px 16px 48px; }
}
@media (max-width: 720px) {
  .hero-inner { padding: 0 16px 40px; }
  .lead p { font-size: 16px; }
  .brand { display: none; }
  .nav { gap: 0; padding: 6px; max-width: calc(100vw - 32px); }
  .nav a { padding: 8px 10px; font-size: 12px; }
  .scroll-hint { display: none; }
  .panel { padding: 22px 18px 24px; }
  .legal { flex-wrap: wrap; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal, .split .w { opacity: 1; transform: none; }
}

/* =========================================================
   Space motion inside the flow stage + budget panel
   ========================================================= */
.sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; border-radius: inherit; }
.stage > *:not(.sky), .panel > *:not(.sky) { position: relative; z-index: 1; }
.stage::after, .panel::after {
  content: ""; position: absolute; inset: -30%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(35% 30% at 20% 30%, rgba(94,233,201,.07), transparent 70%),
    radial-gradient(30% 28% at 80% 70%, rgba(255,179,107,.05), transparent 70%);
  animation: nebulaDrift 18s ease-in-out infinite alternate;
}
@keyframes nebulaDrift { from { transform: translate(-4%, -2%) rotate(0deg) } to { transform: translate(4%, 3%) rotate(6deg) } }
.panel.is-over::after { background: radial-gradient(40% 35% at 70% 30%, rgba(255,143,122,.10), transparent 70%), radial-gradient(30% 28% at 20% 80%, rgba(255,143,122,.05), transparent 70%); }
.panel.is-paused::after { animation-play-state: paused; opacity: .4; }

/* grid lines carry a faint travelling pulse */
.mesh line { stroke-dasharray: 2 6; animation: meshDrift 14s linear infinite; }
@keyframes meshDrift { to { stroke-dashoffset: -80; } }

/* orbits around the agent */
.orbit { transform-origin: 110px 150px; animation: spin 9s linear infinite; }
.orbit-agent2 { animation-duration: 15s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit-path { fill: none; stroke: rgba(94,233,201,.16); stroke-width: 1; stroke-dasharray: 1 5; }
.moon { fill: #ffd9a8; filter: drop-shadow(0 0 4px rgba(255,179,107,.8)); }
.moon-sm { fill: var(--accent-strong); filter: drop-shadow(0 0 4px var(--accent)); }
.paused .orbit, .paused .mesh line, .paused .ring-spark { animation-play-state: paused; }
.paused .moon { fill: #5f7a71; filter: none; }

/* saturn-style ring around the policy core */
.hex-ring { fill: none; stroke-width: 1.4; stroke: var(--warm); transition: stroke .4s, opacity .4s; }
.hex-ring.back { opacity: .28; }
.hex-ring.front { opacity: .75; stroke-dasharray: 3 3 40 3 1 3; animation: ringFlow 4s linear infinite; }
@keyframes ringFlow { to { stroke-dashoffset: -53; } }
.ring-spark { fill: #fff3e0; filter: drop-shadow(0 0 5px var(--warm)); }
.over .hex-ring { stroke: var(--bad); }
.over .ring-spark { fill: var(--bad); filter: drop-shadow(0 0 5px var(--bad)); }
.paused .hex-ring { stroke: #5f7a71; animation: none; }
.paused .ring-spark { opacity: .3; filter: none; }

/* comet trails behind packets */
.packet-in.t1, .packet-out.t1 { animation-delay: .05s; }
.packet-in.t2, .packet-out.t2 { animation-delay: .1s; }
.packet-in.t3, .packet-out.t3 { animation-delay: .15s; }
.trail { filter: none; }

/* over budget: shockwave from the policy core when the packet hits */
.shock { fill: none; stroke: var(--bad); stroke-width: 1.5; opacity: 0; transform-origin: 380px 150px; }
.over .shock { animation: shock 3.2s ease-out infinite; }
@keyframes shock { 0%, 46% { opacity: 0; transform: scale(.7) } 48% { opacity: .8; transform: scale(.75) } 75%, 100% { opacity: 0; transform: scale(1.9) } }

/* vendor scan beam while allowed */
.scan { fill: rgba(201,242,122,.18); opacity: 0; }
.allowed .scan { animation: scan 3.2s ease-in-out infinite; }
@keyframes scan { 0%, 92% { opacity: 0; transform: translateY(0) } 93% { opacity: 1 } 100% { opacity: 0; transform: translateY(46px) } }

/* ---------- budget panel ---------- */
.big b {
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 42%, var(--accent-strong) 50%, var(--text) 58%, var(--text) 100%);
  background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sheen 6s ease-in-out infinite;
}
.panel.is-over .big b { background-image: linear-gradient(100deg, #ffd2c9 0%, #ffd2c9 42%, #fff 50%, #ffd2c9 58%, #ffd2c9 100%); }
.panel.is-paused .big b { animation-play-state: paused; opacity: .55; }
.big b.bump { animation: sheen 6s ease-in-out infinite, bump .35s cubic-bezier(.2,.7,.2,1); }
@keyframes bump { 0% { transform: translateY(0) } 40% { transform: translateY(-3px) } 100% { transform: none } }
.big b { display: inline-block; }

.track input[type="range"] { position: relative; z-index: 2; display: block; }
.track input[type="range"]::-webkit-slider-thumb { opacity: 0; width: 26px; height: 26px; }
.track input[type="range"]::-moz-range-thumb { opacity: 0; width: 26px; height: 26px; }
.fill-shine {
  position: absolute; left: 0; top: 0; height: 4px; width: var(--p, 50%); border-radius: 999px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent 0, rgba(255,255,255,.75) 50%, transparent 100%) no-repeat;
  background-size: 60px 100%; animation: comet 2.6s linear infinite; mix-blend-mode: screen;
}
@keyframes comet { from { background-position: -60px 0 } to { background-position: calc(100% + 60px) 0 } }
.orb {
  position: absolute; top: 2px; left: calc(var(--p, 50%) + (13px - var(--pf, .5) * 26px)); z-index: 3; pointer-events: none;
  width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9fff4 0, #5ee9c9 38%, #1a6f5d 78%, #08241e 100%);
  box-shadow: 0 0 0 6px rgba(94,233,201,.1), 0 0 22px rgba(94,233,201,.6);
  transition: transform .2s, background .4s, box-shadow .4s;
}
.orb::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 38px; height: 11px; margin: -6.5px 0 0 -20px;
  border: 1.5px solid rgba(255,179,107,.85); border-radius: 50%; transform: rotate(-18deg);
  border-top-color: rgba(255,179,107,.2); animation: logoTilt 5s ease-in-out infinite;
}
.orb::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(94,233,201,.5);
  animation: ping 2.4s ease-out infinite;
}
.orb i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; animation: spin 4s linear infinite; }
.orb i::before { content: ""; position: absolute; left: 50%; top: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #ffd9a8; box-shadow: 0 0 6px var(--warm); }
.track:active .orb { transform: scale(1.15); }
.panel.is-over .orb { background: radial-gradient(circle at 35% 30%, #ffe3dc 0, #ff8f7a 40%, #7a2c20 80%, #200806 100%); box-shadow: 0 0 0 6px rgba(255,143,122,.12), 0 0 22px rgba(255,143,122,.6); }
.panel.is-over .orb::after { border-color: rgba(255,143,122,.6); }
.panel.is-paused .orb { background: radial-gradient(circle at 35% 30%, #cfd8d4 0, #6c847c 45%, #22302c 100%); box-shadow: none; }
.panel.is-paused .orb::before, .panel.is-paused .orb i, .panel.is-paused .fill-shine { animation-play-state: paused; }
.panel.is-paused .orb::after { animation: none; opacity: 0; }

.req-mark::before {
  content: ""; position: absolute; left: 50%; bottom: -3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--warm); box-shadow: 0 0 8px var(--warm); animation: blink 1.8s ease-in-out infinite;
}
.panel.is-over { animation: jolt .45s cubic-bezier(.3,.7,.3,1); }
@keyframes jolt { 20% { transform: translateX(-4px) } 45% { transform: translateX(3px) } 70% { transform: translateX(-1px) } }
@media (prefers-reduced-motion: reduce) { .sky { display: none; } }

/* readable diagram labels on phones (the SVG scales down ~0.45x) */
@media (max-width: 600px) {
  .diagram { padding: 4px 4px 14px; }
  .node-label { font-size: 21px; }
  .limit-label { font-size: 17px; }
  .amount { font-size: 19px; transform: translateY(-10px); }
  .stage-top { padding: 14px 16px; }
}

/* secondary call to action */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-soft); padding: 14px 26px; }
.cta.ghost:hover { background: rgba(94,233,201,.06); border-color: var(--accent-dim); box-shadow: none; }
