/* The beni homepage: the WebGL hero (src/logo.js draws into #stage), then one column of chapters
   strung on a glowing line that runs from violet into orange. Tokens and their roles: DESIGN.md. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../fonts/archivo.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist-mono.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #040205;              /* the hero scene's background (src/logo.js), so the canvas has no edge */
  --ink: #F1EDF7;             /* headings, lead paragraphs */
  --body: #B5ADC4;            /* body paragraphs */
  --muted: #8F87A1;           /* notes, captions */
  --faint: #5A5068;           /* separators */
  --orange: #FF9A3C;          /* the accent: what beni does, eyebrows, numbers, buttons, links, the node dots */
  --orange-soft: #FFC08A;     /* link and button hover */
  --orange-rgb: 255 154 60;   /* tints and glows of the accent, with an alpha */
  --on-orange: #1A0C02;       /* text on an orange button */
  --violet-rgb: 139 92 246;   /* the glows behind code and the top of the node line, with an alpha */
  --code: #E6E1EE;            /* code text */
  --keyword: #B79CFF;         /* code: keywords */
  --type: #FFB46B;            /* code: types and constructors */
  --string: #9EE0B0;          /* code: strings */
  --markup: #8EC8FF;          /* code: markup */

  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --gutter: clamp(20px, 4vw, 32px);
  --column: 700px;
  --chapter-gap: clamp(96px, 12vw, 150px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgb(var(--orange-rgb) / 0.35); }
a { color: var(--orange); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange-soft); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hot { font-style: normal; color: var(--orange); }

/* ---------- the hero ---------- */

.hero { position: relative; }
.stage {
  position: relative;
  height: 100svh;     /* the hero is the first screen, whatever its size; the page starts below it */
  min-height: 380px;
  overflow: hidden;
}
.stage canvas { position: absolute; inset: 0; display: block; }
/* the canvas ends in the page's own colour; this softens the haze into it */
.stage::after {
  content: ""; position: absolute; inset: auto 0 0; height: 18%;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.tagline {
  position: absolute; left: 0; right: 0; z-index: 1;
  top: calc(var(--word-bottom, 60%) + clamp(18px, 3vw, 44px));
  margin: 0; text-align: center;
  font-family: var(--mono); font-size: clamp(11px, 1.1vw, 16px); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--orange);
  pointer-events: none;
}

/* ---------- the column ---------- */

/* The column is 1100px, made of padding so that main itself spans the window: it clips at the window's
   edges only. The glows and the "?" note's label reach past the column on purpose; on a phone they
   must not widen the page. */
main { padding: 0 max(var(--gutter), (100% - 1100px) / 2); overflow-x: clip; }
section.intro, section.chapter {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 28px;
  padding-bottom: var(--chapter-gap);
}
section.intro { padding-top: clamp(24px, 4vw, 48px); }
:target { scroll-margin-top: 24px; }

/* each chapter hangs from the one above on a line that warms from violet to orange, ending in a dot */
.node { display: flex; flex-direction: column; align-items: center; }
.node::before {
  content: ""; width: 1px; height: clamp(72px, 9vw, 120px);
  background: linear-gradient(rgb(var(--violet-rgb) / 0), rgb(var(--violet-rgb) / 0.6) 60%, rgb(var(--orange-rgb) / 0.9));
}
.node::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 18px 4px rgb(var(--orange-rgb) / 0.45); }

/* a left-aligned reading column inside the centred chapter */
.col { width: 100%; max-width: var(--column); margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; text-align: left; }

h2 {
  margin: 0;
  font-weight: 600; font-stretch: 125%; font-size: clamp(2.3rem, 4.2vw, 3.6rem); line-height: 1.02; letter-spacing: -0.025em;
  text-wrap: balance;
}
h2.small { font-weight: 500; font-size: clamp(1.4rem, 2.2vw, 1.85rem); letter-spacing: -0.015em; line-height: 1.2; }
.lede {
  margin: 0; max-width: 860px;
  font-weight: 500; font-stretch: 112%; font-size: clamp(1.8rem, 3.2vw, 2.7rem); line-height: 1.15; letter-spacing: -0.025em;
  text-wrap: balance;
}
.lead { margin: 0; font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.lead.centred { max-width: 640px; text-wrap: balance; }
.body { margin: 0; font-size: clamp(1.1rem, 1.4vw, 1.25rem); line-height: 1.65; color: var(--body); text-wrap: pretty; }
.body.centred { max-width: 600px; text-wrap: balance; }
.note { margin: 0; font-size: 17px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
/* sits close above its heading (the chapter's gap is for the blocks between) */
.eyebrow {
  margin: 0 0 -12px;
  font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--orange);
}
.cap { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */

.button {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 26px; border-radius: 999px;
  background: var(--orange); color: var(--on-orange);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background 0.15s;
}
.button:hover { background: var(--orange-soft); color: var(--on-orange); }

/* ---------- code ---------- */

.glow { position: relative; isolation: isolate; }
.glow::before {
  content: ""; position: absolute; inset: -70px -110px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgb(var(--violet-rgb) / 0.15), rgb(var(--violet-rgb) / 0));
}
.code-figure { margin: 8px 0 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; text-align: left; }
.code {
  margin: 0; max-width: 100%; overflow-x: auto;
  font-family: var(--mono); font-size: clamp(12px, 3.3vw, 15px); line-height: 1.8; color: var(--code);
  white-space: pre;
}
.k { color: var(--keyword); } .t { color: var(--type); } .s { color: var(--string); } .g { color: var(--markup); } .m { color: #7D7590; }
.ic { font-family: var(--mono); font-size: 0.86em; color: var(--ink); }
.hot .ic { color: inherit; }
.compiler-says .message { font-family: var(--mono); font-size: clamp(12px, 3.3vw, 15px); line-height: 1.8; }
.compiler-says .message p { margin: 0; }
.compiler-says .message p code { color: var(--type); }
.compiler-says .hint { margin-top: 10px !important; color: #A8A0B8; }
.compiler-says .code { margin-top: 10px; padding-left: 28px; }

/* the counter: its source, then the same program running */
.demo { display: flex; flex-direction: column; align-items: center; gap: 40px; max-width: 100%; }
.running { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.counter { display: flex; align-items: center; gap: 24px; }
.counter output {
  min-width: 2ch; text-align: center;
  font-weight: 600; font-stretch: 125%; font-size: 88px; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.step {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(var(--orange-rgb) / 0.12); color: var(--ink);
  font-family: var(--mono); font-size: 22px;
  transition: background 0.15s;
}
.step:hover { background: rgb(var(--orange-rgb) / 0.28); }

.pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px 64px; max-width: 100%; }
.pair .code-figure { margin: 0; }

/* ---------- lists and figures ---------- */

.sizes { margin: 12px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 40px 80px; }
.sizes div { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 240px; }
.sizes dd {
  order: -1; margin: 0;
  font-weight: 600; font-stretch: 125%; font-size: clamp(42px, 5vw, 52px); line-height: 1; letter-spacing: -0.04em;
  color: var(--orange);
}
.sizes dt { font-size: 15px; color: var(--body); }

/* lists with a short orange dash before each item */
.ticks { list-style: none; gap: 14px; }
.ticks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 14px; align-items: baseline; }
.ticks li::before { content: ""; width: 12px; height: 2px; background: var(--orange); transform: translateY(-0.3em); }

.platforms {
  margin: 0;
  font-weight: 500; font-stretch: 112%; font-size: clamp(1.3rem, 2.2vw, 1.75rem); letter-spacing: -0.02em;
  color: var(--orange);
}
.platforms span { color: var(--faint); }

.finale > .glow { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.finale .lead { color: var(--body); max-width: 520px; }
.finale .eyebrow { margin: 0; }

/* ---------- footer ---------- */

.bottom { max-width: 1100px; margin: 0 auto; padding: 40px var(--gutter) 56px; }
.bottom nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 clamp(20px, 4vw, 48px); font-size: 17px; }
.bottom a { display: inline-flex; align-items: center; min-height: 44px; color: #B3ABC3; text-decoration: none; }
.bottom a:hover { color: var(--ink); }
.bottom a:first-child { font-weight: 600; font-stretch: 112%; color: var(--ink); }

/* ---------- editing tools (?edit; src/mode.js) ---------- */

#ui { position: fixed; top: 12px; right: 12px; z-index: 10; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#ui select, #ui button {
  border: 1px solid #3a383d; background: #1f1e22; color: #e9e6e2; border-radius: 8px;
  padding: 6px 12px; font: 600 13px var(--sans); cursor: pointer;
}
#ui select:hover, #ui button:hover { background: #2a292e; }
#picker { display: flex; }
#picker button { border-radius: 0; }
#picker button:first-child { border-radius: 8px 0 0 8px; }
#picker button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
#picker button[aria-pressed="true"] { background: #e9e6e2; color: #161518; }
body.visitor #ui { display: none; }
.lil-gui { --width: 280px; z-index: 10; }
/* the head view (?edit&model=head) is a full-window tool: the page steps aside */
body.tool { overflow: hidden; }
body.tool > :is(section, main, footer) { display: none; }
body.tool > canvas { position: fixed; inset: 0; }

/* ---------- the traced counter ---------- */

/* wide screens: the "?" note's label hangs out to the left of the code, so the block can't clip;
   narrower, the label sits above the markup and the code scrolls sideways as everywhere else */
.code.traced { position: relative; }
@media (min-width: 861px) { .code.traced { overflow: visible; } }

/* the model, live, beside its type */
.mj {
  position: absolute; left: 25ch; top: 0;
  display: inline-flex; align-items: center; gap: 12px; padding: 3px 12px; border-radius: 8px;
  border: 1px solid rgb(var(--orange-rgb) / 0.35); background: rgb(var(--orange-rgb) / 0.06);
  box-shadow: 0 0 24px rgb(var(--orange-rgb) / 0.08); white-space: nowrap;
}
.mj::before { content: ""; position: absolute; right: 100%; top: 50%; width: 5ch; border-top: 1px dashed rgb(var(--orange-rgb) / 0.45); }
.mj .lab { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); }
.mj [data-fx] { border-radius: 4px; padding: 0 3px; margin: 0 -3px; }
@media (max-width: 600px) {
  .code.traced { padding-top: 44px; }
  .mj { left: 0; }
  .mj::before { display: none; }
}
.num { display: inline-block; font-variant-numeric: tabular-nums; }

/* the trace: each part flashes in turn (p1-p4); a and b are the same animation under two names, so
   alternating them restarts it on every click */
.fx { border-radius: 4px; }
.fl { animation-duration: 1.6s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); animation-fill-mode: both; }
.fl.a { animation-name: flash-a; } .fl.b { animation-name: flash-b; }
.fl.p1 { animation-delay: 0s; } .fl.p2 { animation-delay: .28s; } .fl.p3 { animation-delay: .5s; } .fl.p4 { animation-delay: .78s; }
@keyframes flash-a {
  0% { background: rgb(var(--orange-rgb) / 0); box-shadow: 0 0 0 0 rgb(var(--orange-rgb) / 0); }
  9% { background: rgb(var(--orange-rgb) / 0.3); box-shadow: 0 0 0 3px rgb(var(--orange-rgb) / 0.2), 0 0 24px rgb(var(--orange-rgb) / 0.45); }
  100% { background: rgb(var(--orange-rgb) / 0); box-shadow: 0 0 0 0 rgb(var(--orange-rgb) / 0); }
}
@keyframes flash-b {
  0% { background: rgb(var(--orange-rgb) / 0); box-shadow: 0 0 0 0 rgb(var(--orange-rgb) / 0); }
  9% { background: rgb(var(--orange-rgb) / 0.3); box-shadow: 0 0 0 3px rgb(var(--orange-rgb) / 0.2), 0 0 24px rgb(var(--orange-rgb) / 0.45); }
  100% { background: rgb(var(--orange-rgb) / 0); box-shadow: 0 0 0 0 rgb(var(--orange-rgb) / 0); }
}
@keyframes roll-a { from { transform: translateY(-60%); opacity: 0; filter: blur(3px); } }
@keyframes roll-b { from { transform: translateY(-60%); opacity: 0; filter: blur(3px); } }

/* the "?" note: a frame draws itself around the view's markup, a light sweeps it, and a wire runs out
   to the label (.hl.on, toggled by page.js) */
.hl { position: relative; display: inline-block; vertical-align: top; }
.hl::before {
  content: ""; position: absolute; inset: -12px -18px; pointer-events: none;
  border: 1px solid rgb(var(--orange-rgb) / 0.42); border-radius: 2px;
  background: linear-gradient(90deg, rgb(var(--orange-rgb) / 0.05), rgb(var(--orange-rgb) / 0.015));
  box-shadow: 0 0 40px rgb(var(--orange-rgb) / 0.1), inset 0 0 24px rgb(var(--orange-rgb) / 0.05);
  opacity: 0; clip-path: inset(-2px -2px -2px calc(100% + 2px));
}
.hl.on::before { opacity: 1; clip-path: inset(-2px); }
/* corner brackets */
.hl::after {
  content: ""; position: absolute; inset: -15px -21px; pointer-events: none;
  --c: linear-gradient(var(--orange), var(--orange));
  background:
    var(--c) left top / 14px 1.5px no-repeat, var(--c) left top / 1.5px 14px no-repeat,
    var(--c) right top / 14px 1.5px no-repeat, var(--c) right top / 1.5px 14px no-repeat,
    var(--c) left bottom / 14px 1.5px no-repeat, var(--c) left bottom / 1.5px 14px no-repeat,
    var(--c) right bottom / 14px 1.5px no-repeat, var(--c) right bottom / 1.5px 14px no-repeat;
  filter: drop-shadow(0 0 4px rgb(var(--orange-rgb) / 0.8));
  opacity: 0; transform: scale(1.05);
}
.hl.on::after { opacity: 1; transform: none; }
.hl .scan { position: absolute; inset: -12px -18px; overflow: hidden; pointer-events: none; }
.hl .scan::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 35%;
  background: linear-gradient(90deg, rgb(var(--orange-rgb) / 0), rgb(var(--orange-rgb) / 0.16) 45%, rgb(255 220 180 / 0.32) 60%, rgb(var(--orange-rgb) / 0));
  transform: translateX(110%);
}
.hl-tag {
  position: absolute; right: calc(100% + 18px); top: 54%; width: clamp(100px, calc(50vw - 360px), 240px); height: 0;
  display: block; white-space: nowrap; visibility: hidden;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
.hl.on .hl-tag { visibility: visible; }
.hl-tag::after {
  content: ""; position: absolute; right: -3.5px; top: -3.5px; width: 6px; height: 6px;
  background: var(--orange); box-shadow: 0 0 10px rgb(var(--orange-rgb) / 0.9);
  transform: rotate(45deg) scale(0); opacity: 0;
}
.hl.on .hl-tag::after { transform: rotate(45deg) scale(1); opacity: 1; }
.hl-tag::before { content: ""; position: absolute; left: 0; top: -6px; width: 1px; height: 12px; background: rgb(var(--orange-rgb) / 0.8); opacity: 0; }
.hl.on .hl-tag::before { opacity: 1; }
.hl-tag .wire {
  position: absolute; left: 0; right: 0; top: -0.5px; display: block; height: 1px; overflow: hidden;
  background: linear-gradient(90deg, rgb(var(--orange-rgb) / 0.25), rgb(var(--orange-rgb) / 0.95));
  transform-origin: right center; transform: scaleX(0);
}
.hl.on .hl-tag .wire { transform: scaleX(1); }
.hl-tag .wire::after { content: ""; position: absolute; top: 0; right: -60px; width: 56px; height: 1px; background: linear-gradient(90deg, rgb(255 230 200 / 0), #FFE2C4, rgb(255 230 200 / 0)); }
.hl-tag .txt { position: absolute; right: 30%; bottom: 14px; line-height: 1.5; clip-path: inset(-6px -6px -6px 100%); opacity: 0; }
.hl.on .hl-tag .txt { clip-path: inset(-6px); opacity: 1; }
.hl-tag .txt::before {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 10px; vertical-align: 2px;
  background: var(--orange); box-shadow: 0 0 8px rgb(var(--orange-rgb) / 0.9);
}
.qbtn {
  position: absolute; left: calc(100% + 34px); top: 50%; margin-top: -22px; z-index: 2;
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange); font: 500 15px/1 var(--mono);
}
.qbtn::before {
  content: ""; position: absolute; inset: 8px; z-index: -1; border-radius: 50%;
  border: 1px solid rgb(var(--orange-rgb) / 0.6); background: rgb(var(--orange-rgb) / 0.08);
  box-shadow: 0 0 16px rgb(var(--orange-rgb) / 0.35);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.qbtn:hover::before, .hl.on .qbtn::before { background: rgb(var(--orange-rgb) / 0.22); border-color: var(--orange); box-shadow: 0 0 22px rgb(var(--orange-rgb) / 0.6); }
.qbtn:focus-visible { outline: none; }
.qbtn:focus-visible::before { border-color: #FFE2C4; box-shadow: 0 0 0 2px var(--orange), 0 0 22px rgb(var(--orange-rgb) / 0.6); }
@media (max-width: 1200px) { .hl-tag .txt { white-space: normal; width: 130px; } }
/* narrower: the label goes under the frame (the blank lines before main), the "?" onto its corner */
@media (max-width: 860px) {
  .hl-tag { right: auto; left: -18px; top: calc(100% + 16px); width: auto; }
  .hl-tag::before, .hl-tag::after, .hl-tag .wire { display: none; }
  .hl-tag .txt { right: auto; left: 0; width: auto; white-space: nowrap; bottom: auto; top: 0; }
  .qbtn { left: auto; right: -34px; top: -30px; }
}

/* ---------- the chart (illustrative until measured) ---------- */

.chart-figure { margin: 16px 0 0; width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: #221A2E; stroke-width: 1; }
.chart .axes line { stroke: #3A3149; stroke-width: 1.2; }
.chart text { font-family: var(--sans); font-weight: 600; font-size: 18px; }
.chart text.axis { font-family: var(--mono); font-weight: 400; font-size: 13px; letter-spacing: 1px; fill: var(--muted); }
.chart .line { fill: none; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 0; }
.chart .line.react { stroke: #9A8FB0; stroke-width: 3; }
.chart .line.vanilla { stroke: var(--markup); stroke-width: 2.5; }
.chart .line.beni { stroke: var(--orange); stroke-width: 3.5; }
.chart .line.beni-glow { stroke: var(--orange); stroke-width: 8; opacity: 0.6; }
.chart circle.react { fill: #9A8FB0; } .chart text.react { fill: #C9C2D6; }
.chart circle.beni, .chart text.beni { fill: var(--orange); }
.chart circle.vanilla, .chart text.vanilla { fill: var(--markup); }
.chart text.vanilla { font-size: 15px; font-weight: 500; }

/* ---------- motion (none of it with reduced motion) ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* light runs down the chapter line; the dot breathes; so do the glows behind the code */
  .node::before {
    background: linear-gradient(rgb(var(--violet-rgb) / 0) 0%, rgb(var(--violet-rgb) / 0.55) 30%, rgb(var(--orange-rgb) / 1) 45%,
      rgb(var(--violet-rgb) / 0.55) 60%, rgb(var(--violet-rgb) / 0.6) 80%, rgb(var(--orange-rgb) / 0.9) 100%);
    background-size: 100% 260%;
    animation: flow 3.2s linear infinite;
  }
  .node::after { animation: pulse 2.6s ease-in-out infinite; }
  .glow::before { animation: breathe 9s ease-in-out infinite alternate; }
  /* the tagline draws in once the dog has landed (src/logo.js: 2.6 s) */
  .tagline { animation: tag-in 1.6s cubic-bezier(.2, .7, .2, 1) 2.6s both; }

  /* chapters: their parts rise out of a blur in turn, the first time they scroll into view (page.js) */
  main > section > * { transition: opacity 1s cubic-bezier(.2, .7, .2, 1), transform 1s cubic-bezier(.2, .7, .2, 1), filter 1s ease; }
  main > section > :nth-child(2) { transition-delay: .08s; }
  main > section > :nth-child(3) { transition-delay: .16s; }
  main > section > :nth-child(4) { transition-delay: .24s; }
  main > section > :nth-child(5) { transition-delay: .32s; }
  main > section > :nth-child(6) { transition-delay: .4s; }
  main > section > :nth-child(n + 7) { transition-delay: .48s; }
  main > section.pre > * { opacity: 0; transform: translateY(48px); filter: blur(6px); }

  /* the chart draws its lines, then fills under beni's and labels the ends */
  .chart .line { transition: stroke-dashoffset 2.4s cubic-bezier(.45, .05, .25, 1) .5s; }
  .chart .line.react { transition-duration: 2s; }
  .chart .area, .chart .end { transition: opacity .8s ease 2.6s; }
  .pre .chart .line { stroke-dashoffset: 1000; transition: none; }
  .pre .chart .area, .pre .chart .end { opacity: 0; transition: none; }

  .num.ra { animation: roll-a .55s cubic-bezier(.2, .8, .2, 1); }
  .num.rb { animation: roll-b .55s cubic-bezier(.2, .8, .2, 1); }

  /* the "?" bobs until opened; opening runs frame, sweep, brackets, wire, label in sequence */
  .qbtn { animation: bob 1.8s cubic-bezier(.3, 0, .3, 1) infinite; }
  .hl.on .qbtn { animation: none; }
  .hl::before { transition: opacity .25s ease, clip-path 0s linear .25s; }
  .hl.on::before { transition: clip-path .8s cubic-bezier(.7, 0, .2, 1), opacity .2s ease; }
  .hl::after { transition: opacity .2s ease, transform .2s ease; }
  .hl.on::after { transition: opacity .4s ease .5s, transform .6s cubic-bezier(.2, .8, .2, 1) .5s; }
  .hl.on .scan::before { animation: sweep 1.1s cubic-bezier(.5, 0, .3, 1) .45s both; }
  .hl-tag { transition: visibility 0s linear .25s; }
  .hl.on .hl-tag { transition: visibility 0s; }
  .hl-tag::after, .hl-tag::before { transition: opacity .2s ease, transform .2s ease; }
  .hl.on .hl-tag::after { transition: opacity .3s ease .8s, transform .45s cubic-bezier(.2, .8, .2, 1) .8s; }
  .hl-tag .wire { transition: transform .25s ease; }
  .hl.on .hl-tag .wire { transition: transform .7s cubic-bezier(.7, 0, .2, 1) .85s; }
  .hl.on .hl-tag::before { transition: opacity .3s ease 1.45s; }
  .hl-tag .txt { transition: opacity .2s ease, clip-path 0s linear .25s; }
  .hl.on .hl-tag .txt { transition: clip-path .8s cubic-bezier(.7, 0, .2, 1) 1.4s, opacity .3s ease 1.4s; }
  .hl.on .hl-tag .wire::after { animation: travel 3.6s cubic-bezier(.45, 0, .55, 1) 2.4s infinite; }
}
@keyframes flow { from { background-position: 0 100%; } to { background-position: 0 0; } }
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 18px 4px rgb(var(--orange-rgb) / 0.45); }
  50% { transform: scale(1.35); box-shadow: 0 0 28px 8px rgb(var(--orange-rgb) / 0.6); }
}
@keyframes breathe { from { opacity: .65; transform: scale(.94); } to { opacity: 1; transform: scale(1.06); } }
@keyframes tag-in { from { opacity: 0; letter-spacing: 0.6em; filter: blur(4px); } to { opacity: 1; letter-spacing: 0.3em; filter: blur(0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 28% { transform: translateY(-9px); } 50% { transform: translateY(0); } 62% { transform: translateY(-3px); } 74% { transform: translateY(0); } }
@keyframes sweep { from { transform: translateX(110%); } to { transform: translateX(-300%); } }
@keyframes travel { 0% { right: -60px; } 45%, 100% { right: 100%; } }
