@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --bg: #0b131d; --bg2: #102033; --panel: #14212f; --panel2: #1a2b3d; --line: #29405a;
  --ink: #eaf1f8; --muted: #8ea4ba; --blue: #1b8fe6; --teal: #22bfac; --amber: #f3b544;
  --red: #ef5d5d; --green: #3fd08f; --water: #2b8fe0; --mono: "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; }
body { font-family: Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); }
body.started { cursor: none; }

/* ---- stage: 1920x1080, or 1080x1920 for reels ---- */
#stage {
  position: absolute; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(1400px 900px at 78% 18%, #15324f 0%, var(--bg) 60%), var(--bg);
  display: grid; grid-template-columns: 1080px 1fr; column-gap: 56px;
  grid-template-rows: 84px 112px 1fr 150px;
  grid-template-areas: "brand brand" "title title" "visual side" "cap cap";
  padding: 44px 72px 0;
}
body.vertical #stage {
  width: 1080px; height: 1920px; grid-template-columns: 1fr; row-gap: 0;
  grid-template-rows: 96px auto 860px 1fr 380px;
  grid-template-areas: "brand" "title" "visual" "side" "cap";
  padding: 84px 56px 0;
}

.brand { grid-area: brand; display: flex; align-items: center; gap: 18px; font-size: 34px; font-weight: 800; }
.brand img { width: 60px; height: 60px; }
.brand .word b { color: var(--blue); }
.brand .kicker { margin-left: 14px; padding: 6px 18px; border: 2px solid var(--teal); color: var(--teal);
  border-radius: 999px; font-size: 24px; font-weight: 600; letter-spacing: .04em; }
h1 { grid-area: title; font-size: 76px; font-weight: 800; letter-spacing: -.01em; line-height: 1.05; align-self: center; }
body.vertical h1 { font-size: 88px; padding: 20px 0 30px; }

/* ---- visual: a stack of scenes, one at a time ---- */
.visual { grid-area: visual; position: relative; min-height: 0; }
.scene { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scene svg { width: 100%; height: 100%; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 22px; justify-content: center; min-height: 0; }
body.vertical .side { justify-content: flex-start; padding-top: 24px; gap: 18px; }
body.vertical .side > .older, .side > .gone, .side > .ahead { display: none; }

[data-at] { opacity: 0; transition: opacity .6s ease, transform .6s ease; }
.side [data-at], .pop[data-at] { transform: translateY(22px); }
.on { opacity: 1 !important; transform: none !important; }
body.still [data-at] { transition: none !important; }

.point { background: var(--panel); border-left: 8px solid var(--teal); border-radius: 14px; padding: 22px 28px;
  font-size: 34px; line-height: 1.25; font-weight: 600; }
.point small { display: block; color: var(--muted); font-size: 26px; font-weight: 400; margin-top: 6px; }
body.vertical .point { font-size: 38px; padding: 20px 28px; }
body.vertical .point small { font-size: 28px; }
.point.amber { border-color: var(--amber); }
.point.blue { border-color: var(--blue); }
.mono { font-family: var(--mono); }
.hl { color: var(--teal); }
.warn { color: var(--amber); }

/* ---- panels used inside scenes ---- */
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 22px; padding: 34px 40px; }
.card h3 { font-size: 30px; color: var(--muted); font-weight: 600; margin-bottom: 18px; letter-spacing: .03em; text-transform: uppercase; }
table.sheet { border-collapse: collapse; font-family: var(--mono); font-size: 26px; }
table.sheet th { background: #1f4e79; color: #fff; padding: 12px 16px; text-align: left; font-weight: 700; }
table.sheet td { padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.sheet tr.new td { background: rgba(34, 191, 172, .16); color: var(--ink); }
body.vertical table.sheet { font-size: 23px; }
body.vertical table.sheet th, body.vertical table.sheet td { padding: 10px 11px; }
.code { background: #0a0f16; border: 2px solid var(--line); border-radius: 18px; padding: 30px 36px; font-family: var(--mono);
  font-size: 29px; line-height: 1.55; white-space: pre; width: 100%; }
body.vertical .code { font-size: 27px; padding: 26px 26px; }
.code .k { color: #c792ea; } .code .s { color: #c3e88d; } .code .c { color: #6f859b; } .code .n { color: #f78c6c; }
.code .ln { display: block; }
.code .ln[data-at] { transform: translateX(-14px); }
.out { color: var(--green); }

/* captions (reels) */
.cap { grid-area: cap; display: flex; align-items: center; justify-content: center; text-align: center; visibility: hidden; }
body.cc .cap.show { visibility: visible; }
.cap { font-size: 50px; font-weight: 800; line-height: 1.15; padding: 0 40px; text-shadow: 0 3px 12px #000; }
body.vertical .cap { font-size: 62px; align-items: flex-start; padding: 30px 30px 0; }

/* end card */
.endcard { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; background: radial-gradient(1200px 800px at 50% 40%, #15324f 0%, var(--bg) 70%); text-align: center; }
.endcard img { width: 210px; height: 210px; }
.endcard .name { font-size: 130px; font-weight: 800; letter-spacing: -.02em; }
.endcard .tag { font-size: 44px; color: var(--muted); }
.endcard .url { font-size: 76px; font-weight: 800; color: var(--teal); }
.endcard .word { font-size: 40px; font-weight: 800; margin-top: 30px; }
.endcard .word b { color: var(--blue); }
body.vertical .endcard .name { font-size: 140px; }

/* SVG theme */
svg text { font-family: Inter, "Segoe UI", sans-serif; fill: var(--ink); }
.s-box { fill: var(--panel); stroke: var(--line); stroke-width: 3; }
.s-strong { fill: var(--panel2); stroke: var(--blue); stroke-width: 4; }
.s-pipe { fill: none; stroke: #5b7088; stroke-width: 16; stroke-linecap: round; }
.s-flow { fill: none; stroke: var(--water); stroke-width: 6; stroke-dasharray: 14 18; animation: flow 1s linear infinite; }
.s-wire { fill: none; stroke: var(--line); stroke-width: 5; }
.s-water { fill: var(--water); transform-box: fill-box; transform-origin: bottom; }
.s-muted { fill: var(--muted); }
.s-teal { fill: var(--teal); }
@keyframes flow { to { stroke-dashoffset: -32; } }
@keyframes tide { 0%, 100% { transform: scaleY(.48); } 50% { transform: scaleY(.78); } }
@keyframes drain { from { transform: scaleY(.72); } to { transform: scaleY(.3); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .25; } }
@keyframes scanrow { 0% { transform: translateY(0); } 100% { transform: translateY(var(--scan-h)); } }
.tide { animation: tide 18s ease-in-out infinite; }
.on .draining { animation: drain 14s linear forwards; }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 2.4s linear infinite; }
.blink { animation: blink 1s steps(1) infinite; }

/* packets travelling along a path: <circle class="pkt"><animateMotion .../></circle> */
.pkt { fill: var(--teal); }
.pkt.back { fill: var(--amber); }

#hint { position: fixed; left: 16px; bottom: 12px; color: #9ab; font: 14px Inter, sans-serif; opacity: .8; z-index: 10; }
body.started #hint { display: none; }
