/* Flagsmith for Unity: site styles. Colours are Flag Runner's own: night navy, the amber player, the red spikes. */
:root {
  --bg: #e9ebf0;
  --surface: #dde0e8;
  --surface-2: #d0d4de;
  --ink: #141721;
  --muted: #4d5467;
  --stage: #141721;
  --stage-2: #262b3d;
  --stage-ink: #e8eaf2;
  --stage-muted: #a3a9bd;
  --accent: #ffb020;
  --accent-ink: #141721;
  --spike: #e5484d;
  --sky: #c3e3ff;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.75rem, 1.2rem + 5.4vw, 6.25rem);
  --m: clamp(20px, 2.4vw, 36px);
  --gap: 24px;
  --r: 6px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --code-bg: #141721;
  --code-ink: #e8eaf2;
}
html.winter { --sky: #b4d2ff; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.5 "Albert Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.0; margin: 0; text-wrap: balance; }
p { margin: 0; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 20px 22px; border-radius: var(--r); overflow-x: auto; line-height: 1.55; }
:not(pre) > code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.tok-k { color: #ff8fa3; } .tok-s { color: #ffd27a; } .tok-c { color: #8a91a8; } .tok-t { color: #7fd8e6; }

.wrap { padding-inline: var(--m); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: one shape, square-ish corners, flat fill */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--r);
  font: 600 var(--step-body)/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s;
}
.btn:hover { background: #ffc04d; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.ink:hover { background: #2a3045; }
.link { font-weight: 500; }

/* Bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px var(--m); }
.mark { font-weight: 600; letter-spacing: -0.02em; text-decoration: none; font-size: 1.0625rem; display: inline-flex; align-items: center; gap: 10px; }
.mark svg { width: 22px; height: 22px; }
.bar nav { display: flex; gap: 28px; align-items: center; }
.bar nav a { text-decoration: none; font-weight: 500; }
.bar nav a:hover, .bar nav a[aria-current] { text-decoration: underline; }
@media (max-width: 720px) { .bar nav .hide-s { display: none; } .bar nav { gap: 18px; } }

/* Hero: the game's own sky, and its character running along the top of the stage */
.home .bar, .hero { background: var(--sky); transition: background-color .6s var(--ease); }
.hero { padding: clamp(24px, 4vw, 56px) var(--m) clamp(64px, 8vw, 120px); }
.hero-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.hero h1 { grid-column: 1 / span 7; font-size: var(--step-display); }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero h1 .line > span { display: block; }
.hero-side { grid-column: 8 / span 5; display: grid; gap: 24px; padding-bottom: 6px; }
.hero-side p { font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; }
.hero-side .acts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
@media (max-width: 900px) { .hero h1, .hero-side { grid-column: 1 / -1; } }

.turf {
  position: relative; height: 36px; margin-top: clamp(96px, 9vw, 132px); container-type: inline-size; overflow-x: clip;
  background: url("art/terrain_grass_block_top.svg") 0 0 / 36px 36px repeat-x; border-radius: calc(var(--r) + 4px) calc(var(--r) + 4px) 0 0;
}
html.winter .turf { background-image: url("art/terrain_snow_block_top.svg"); }
.runner { position: absolute; left: 0; bottom: 100%; width: clamp(64px, 7vw, 96px); aspect-ratio: 1; margin-bottom: -4%; animation: run 10s linear infinite; }
.runner .hop { display: block; position: relative; height: 100%; }
.runner img { position: absolute; inset: 0; width: 100%; height: 100%; animation: step .36s steps(1) infinite; }
.runner img:first-child { animation-delay: -.18s; }
.runner.hopping .hop { animation: hop .6s var(--ease); }
@keyframes run { from { transform: translateX(-100%); } to { transform: translateX(100cqw); } }
@keyframes step { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes hop { 40% { transform: translateY(-70%) rotate(-10deg); } }
.play { display: grid; grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr); gap: 8px; background: var(--stage); padding: 8px; border-radius: 0 0 calc(var(--r) + 4px) calc(var(--r) + 4px); }
.play-game { position: relative; aspect-ratio: 16 / 10; background: #141721; border-radius: var(--r); overflow: hidden; }
.play-game iframe { width: 100%; height: 100%; border: 0; }
.play-game .start {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; color: var(--stage-ink);
  background: #141721 url("../media/flag-runner.png") center / cover no-repeat;
}
.play-game .start .btn { min-height: 64px; padding: 0 34px; font-size: var(--step-lead); }
.play-game .start p { background: var(--stage); color: var(--stage-ink); font-size: var(--step-small); padding: 6px 12px; border-radius: var(--r); margin-inline: 12px; }
.play-note { grid-column: 1 / -1; color: var(--stage-muted); font-size: var(--step-small); padding: 6px 8px 4px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.play-note span { max-width: 75ch; }
.play-note b { color: var(--stage-ink); font-weight: 500; }
/* One column: the game stays in view while you work the panel under it (sticky needs a block parent, not a grid area). */
@media (max-width: 980px) {
  .play { display: block; }
  .play > * + * { margin-top: 8px; }
}
@media (max-width: 980px) and (min-height: 560px) { .play-game { position: sticky; top: 8px; z-index: 3; } }

/* The Flagsmith-style panel (a product fragment: its own conventions apply inside) */
.panel { background: #1b1f2d; color: var(--stage-ink); border-radius: var(--r); padding: 6px 0; font-size: 14px; display: flex; flex-direction: column; min-width: 0; }
.panel h2 { font-size: 15px; letter-spacing: 0; line-height: 1.3; padding: 12px 16px 10px; display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.panel h2 span { color: var(--stage-muted); font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 9px 16px; }
.row + .row { border-top: 1px solid #262b3d; } /* taste-skill-ignore: inside the data-ui panel fragment */
.row label, .row .name { font-weight: 500; }
.row output, .row .val { font-variant-numeric: tabular-nums; color: var(--accent); min-width: 3.5ch; text-align: right; }
.row input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 22px; margin: 0; }
.row.changed { animation: flash .9s var(--ease); }
@keyframes flash { from { background: rgba(255, 176, 32, .22); } to { background: transparent; } }
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; border: 0; padding: 0; cursor: pointer; background: #3a4058; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch[aria-checked=true] { background: var(--accent); }
.switch:active::after { width: 24px; }
.switch[aria-checked=true]:active::after { transform: translateX(14px); }
.switch[aria-checked=true]::after { transform: translateX(18px); }
.swatches { grid-column: 1 / -1; display: flex; gap: 6px; }
.swatches button { flex: 1; max-width: 56px; aspect-ratio: 1; border-radius: var(--r); border: 2px solid transparent; background: #262b3d; cursor: pointer; padding: 2px; transition: transform .12s, background-color .15s; }
.swatches img { width: 100%; }
.swatches button:hover { background: #3a4058; }
.swatches button:active { transform: scale(.94); }
.swatches button[aria-pressed=true] { border-color: var(--accent); background: #3a4058; }
.seg { display: inline-flex; background: #262b3d; border-radius: 4px; padding: 2px; }
.seg button { background: none; border: 0; color: var(--stage-muted); font: 500 13px/1 inherit; font-family: inherit; padding: 6px 10px; border-radius: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.seg button:hover { color: var(--stage-ink); }
.seg button:active { transform: scale(.96); }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.feed { margin-top: auto; border-top: 1px solid #262b3d; /* taste-skill-ignore: data-ui fragment */ padding: 10px 16px 6px; }
.feed h3 { font-size: 13px; letter-spacing: 0; font-weight: 600; color: var(--stage-muted); line-height: 1.4; }
.feed ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; min-height: 60px; }
.feed li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; animation: rise .4s var(--ease); }
.feed li span { color: var(--stage-muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* Sections */
section { position: relative; }
.gapped { margin-top: clamp(120px, 14vw, 220px); }
.h2 { font-size: var(--step-head); }

/* The problem: a narrow column and the footage */
.why { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.why-text { grid-column: 1 / span 4; display: grid; gap: 1em; }
.why-text h2 { font-size: var(--step-head); }
.why-text p { color: var(--muted); }
.why-text p.first { color: var(--ink); font-weight: 500; }
.why-media { grid-column: 6 / -1; }
.why-media video, .why-media img { width: 100%; border-radius: var(--r); background: var(--stage); aspect-ratio: 960 / 580; object-fit: cover; }
.why-media video { aspect-ratio: 960 / 600; }
figure { margin: 0; } /* the browser default (40px each side) made every picture narrower than the text on phones */
figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 10px; }
@media (max-width: 900px) { .why-text, .why-media { grid-column: 1 / -1; } }

/* Kill switch, blown up */
.kill { min-height: 92svh; overflow: hidden; background: var(--stage); color: var(--stage-ink); padding: clamp(48px, 6vw, 88px) var(--m); transition: background-color .45s var(--ease), color .45s; display: grid; align-content: start; }
.kill.off { background: var(--accent); color: var(--accent-ink); }
.kill h2 { font-size: var(--step-head); max-width: 14ch; }
.k-wall { display: flex; margin-top: clamp(24px, 3.5vw, 44px); }
.k-wall img { width: clamp(56px, 8vw, 120px); transition: transform .5s var(--ease), opacity .35s; }
.k-wall img + img { transition-delay: 70ms; }
.kill.off .k-wall img { transform: scale(.2) rotate(50deg); opacity: 0; }
.kill p { margin-top: 20px; max-width: 40ch; font-size: var(--step-body); }
.kill .k-sub { color: var(--stage-muted); transition: color .45s; }
.kill.off .k-sub { color: #3b2a05; }
.big-switch {
  position: absolute; right: var(--m); bottom: 9svh; font-size: clamp(40px, 9.5vw, 150px);
  display: grid; gap: .25em; justify-items: start; color: inherit;
}
.big-switch .lbl { font-size: .32em; font-weight: 600; letter-spacing: -0.01em; display: flex; gap: .6em; align-items: baseline; }
.big-switch .lbl span { font-weight: 400; opacity: .75; }
.big-switch button {
  font: inherit;
  width: 4.6em; height: 2.4em; border-radius: 1.2em; border: 0; padding: 0; cursor: pointer; position: relative;
  background: var(--accent); transition: background-color .3s;
}
.kill.off .big-switch button { background: var(--stage); }
.big-switch button::after { content: ""; position: absolute; top: .2em; left: .2em; width: 2em; height: 2em; border-radius: 50%; background: #fff; transform: translateX(2.2em); transition: transform .35s var(--ease); }
.kill.off .big-switch button::after { transform: translateX(0); }
.big-switch button:active::after { width: 2.3em; }
@media (max-width: 720px) {
  .kill { min-height: 86svh; }
  .big-switch { right: auto; left: var(--m); bottom: 6svh; font-size: 24vw; }
}

/* How it works: the section holds still while the scroll walks through the four stages.
   Without script, or with reduced motion, it stays a normal section driven by the slider. */
@media (prefers-reduced-motion: no-preference) {
  .js .pin { height: 340svh; }
  .js .pin .stages { position: sticky; top: 0; height: 100svh; min-height: 0; }
}
.stages { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; }
.stages .left, .stages .right { min-width: 0; } /* a wide code block must scroll inside itself, not widen the page */
.stages .right { grid-template-columns: minmax(0, 1fr); }
.stages .left { background: var(--surface); padding: clamp(40px, 5vw, 72px) var(--m) 180px; position: relative; }
.stages .right { background: var(--stage); display: grid; place-items: center; padding: 48px var(--m) 180px; color: var(--stage-ink); }
.stages h2 { font-size: clamp(2.5rem, 1.2rem + 3.4vw, 4.75rem); max-width: 10ch; transition: opacity .2s; }
.stages .left p { margin-top: 24px; max-width: 36ch; transition: opacity .2s; }
.frag { width: min(620px, 100%); transition: opacity .2s; }
.frag[hidden] { display: none; }
.frag img { border-radius: var(--r); width: 100%; }
.frag pre { font-size: 14px; }
.track { position: absolute; left: var(--m); right: var(--m); bottom: 40px; display: grid; gap: 14px; }
.stages { position: relative; }
.stages .track { left: var(--m); right: var(--m); }
.track input { width: 100%; appearance: none; -webkit-appearance: none; height: 8px; background: var(--surface-2); border-radius: 0; cursor: pointer; }
.track input::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; background: var(--accent); border: 0; border-radius: 0; }
.track input::-moz-range-thumb { width: 32px; height: 32px; background: var(--accent); border: 0; border-radius: 0; }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); font-size: 16px; color: var(--muted); }
.track ol li:nth-child(2) { text-align: center; } .track ol li:nth-child(3) { text-align: center; } .track ol li:last-child { text-align: right; }
.track ol li { cursor: pointer; }
.track ol li.on { color: var(--ink); font-weight: 500; }
.stages-track-bg { position: absolute; left: 0; right: 0; bottom: 0; height: 130px; background: var(--bg); }
@media (max-width: 900px) {
  .stages { grid-template-columns: 1fr; }
  .stages .right { order: -1; padding: 40px var(--m); min-height: 46svh; }
  .stages .left { padding-bottom: 200px; }
  .track ol { font-size: 14px; }
}

/* Experiments and the Editor window: 5/7 splits */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.split .txt { grid-column: 1 / span 5; display: grid; gap: 22px; align-content: start; }
.split .fig { grid-column: 6 / -1; }
.split.flip .txt { grid-column: 8 / -1; order: 2; }
.split.flip .fig { grid-column: 1 / span 7; order: 1; }
.split .txt p { max-width: 42ch; }
.fig img { width: 100%; border-radius: var(--r); background: var(--surface); }
.fig video { width: 100%; border-radius: var(--r); background: var(--stage); }
.fig.framed { background: var(--surface); padding: clamp(16px, 2.4vw, 36px); border-radius: calc(var(--r) + 4px); }
@media (max-width: 900px) { .split .txt, .split .fig, .split.flip .txt, .split.flip .fig { grid-column: 1 / -1; order: 0; } }

/* Proof tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 24px; aspect-ratio: 3 / 2; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.tile b { font-size: clamp(1.5rem, 1rem + 1.2vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.tile span { color: var(--muted); font-size: var(--step-small); line-height: 1.4; }
.tile.head { grid-column: span 2; aspect-ratio: auto; background: var(--accent); }
.tile.head h2 { font-size: clamp(2rem, 1rem + 2.6vw, 3.25rem); max-width: 10ch; }
.tile.head p { font-size: var(--step-body); max-width: 40ch; color: #3b2a05; }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; gap: 6px; } .tile.head { grid-column: 1 / -1; } .tile { aspect-ratio: auto; min-height: 140px; } .tile b { font-size: 1.25rem; } }

/* Get started: tabs and bands */
.start-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.start-head h2 { font-size: clamp(2.25rem, 1.2rem + 2.6vw, 3.75rem); }
.start-head h2 .soft { color: var(--muted); display: block; }
.tabs { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; margin-top: 56px; }
.tablist { display: grid; gap: 6px; align-content: start; }
.tablist button { text-align: left; min-height: 64px; padding: 10px 16px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); font: 500 16px/1.25 inherit; font-family: inherit; cursor: pointer; transition: background-color .15s; }
.tablist button small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.tablist button:hover { background: var(--surface-2); }
.tablist button[aria-selected=true] { background: var(--ink); color: var(--bg); }
.tablist button[aria-selected=true] small { color: #b7bccb; }
.bands { display: grid; gap: 4px; align-content: start; }
.band { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: center; padding: 18px 20px; border-radius: var(--r); background: var(--surface); }
.band:nth-child(even) { background: var(--surface-2); }
.band h3 { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.band p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.band pre { font-size: 13.5px; padding: 12px 14px; }
.bands[hidden] { display: none; }
@media (max-width: 900px) {
  .tabs { grid-template-columns: 1fr; gap: 20px; }
  .tablist { grid-template-columns: 1fr 1fr; }
  .tablist button { min-height: 56px; }
  .band { grid-template-columns: 1fr; gap: 12px; }
}

/* Install: a sentence with a blank */
.cta { display: grid; gap: 22px; }
.cta .sentence { font-size: clamp(1.75rem, 1rem + 2.4vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.3; max-width: 26ch; }
.cta .fill { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; max-width: 1100px; }
.cta input { flex: 1 1 520px; min-height: 64px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 0 20px; font: 500 clamp(1rem, 0.85rem + 0.5vw, 1.25rem)/1 "Albert Sans", system-ui, sans-serif; min-width: 0; }
.cta .btn { min-height: 64px; padding: 0 30px; font-size: 1.125rem; }
.cta .note { color: var(--muted); font-size: 16px; }

/* Footer of tiles */
.foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; padding: 10px; margin-top: clamp(120px, 14vw, 220px); }
.foot > * { background: var(--surface); border-radius: var(--r); padding: 24px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.foot .stmt { grid-column: 1 / span 4; } .foot .stmt p:first-child { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
.foot .nav { grid-column: 5 / span 3; } .foot .nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot .nav a { text-decoration: none; } .foot .nav a:hover { text-decoration: underline; }
.foot .made { grid-column: 8 / span 2; }
.foot .repo { grid-column: 10 / span 3; } .foot .repo a { font-size: 20px; font-weight: 500; }
.foot .word { grid-column: 1 / span 8; background: var(--ink); color: var(--bg); min-height: 320px; justify-content: center; }
.foot .word span { font-size: clamp(2.5rem, 0.5rem + 6.6vw, 7.5rem); font-weight: 600; letter-spacing: -0.045em; line-height: .95; }
.foot .go { grid-column: 9 / span 4; background: var(--accent); color: var(--accent-ink); min-height: 320px; text-decoration: none; transition: background-color .15s; }
.foot .go:hover { background: #ffc04d; }
.foot .go b { font-size: 28px; letter-spacing: -0.02em; font-weight: 600; }
.foot .go svg { align-self: flex-end; width: 64px; height: 64px; transition: transform .2s var(--ease); }
.foot .go:hover svg { transform: translate(4px, -4px); }
.foot small { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; } /* minmax(0): a long word must not widen the page */
  .foot > * { overflow-wrap: anywhere; }
  .foot > * { min-height: 0; padding: 20px; }
  .foot .word { grid-column: 1 / -1; order: -2; min-height: 160px; }
  .foot .go { grid-column: 1 / -1; order: -1; min-height: 160px; }
  .foot .nav, .foot .repo, .foot .made, .foot .stmt { grid-column: span 1; }
  .foot .stmt, .foot .repo { grid-column: 1 / -1; }
}

/* Motion: entrances, never hiding content when scripts fail */
.js .reveal > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal.in > :nth-child(2) { transition-delay: 80ms; } .js .reveal.in > :nth-child(3) { transition-delay: 160ms; } .js .reveal.in > :nth-child(4) { transition-delay: 240ms; } .js .reveal.in > :nth-child(5) { transition-delay: 320ms; }
.js .hero h1 .line > span { transform: translateY(105%); animation: up .9s var(--ease) forwards; }
.js .hero h1 .line:nth-child(2) > span { animation-delay: .11s; }
.js .hero-side { opacity: 0; animation: fade .7s .45s var(--ease) forwards; }
@keyframes up { to { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal > *, .js .hero h1 .line > span, .js .hero-side { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .row.changed, .feed li { animation: none; }
  .runner { animation: none; transform: translateX(12cqw); }
  .runner img { animation: none; } .runner img + img { display: none; }
  .runner.hopping .hop { animation: none; }
}

/* Docs pages */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); padding: 24px var(--m) 0; align-items: start; }
.docs-nav { position: sticky; top: 16px; display: grid; gap: 2px; font-size: 15px; max-height: calc(100vh - 32px); overflow-y: auto; padding-bottom: 24px; }
.docs-nav b { font-size: 15px; margin: 6px 0 8px; }
.docs-nav a { text-decoration: none; padding: 7px 12px; border-radius: var(--r); color: var(--muted); }
.docs-nav a:hover { background: var(--surface); color: var(--ink); }
.docs-nav a[aria-current] { background: var(--ink); color: var(--bg); }
.doc { max-width: 76ch; min-width: 0; }
.doc h1 { font-size: clamp(2.25rem, 1.4rem + 2.4vw, 3.5rem); margin-bottom: 28px; }
.doc h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 56px 0 16px; letter-spacing: -0.025em; line-height: 1.15; }
.doc h3 { font-size: 1.25rem; margin: 36px 0 12px; letter-spacing: -0.015em; line-height: 1.25; }
.doc p, .doc ul, .doc ol { margin: 0 0 1em; }
.doc li { margin: 0.3em 0; }
.doc pre { margin: 0 0 1.4em; font-size: 14.5px; }
.doc img { border-radius: var(--r); margin: 8px 0 6px; background: var(--surface); }
.doc img + em, .doc p > em:only-child { display: block; font-style: normal; font-size: var(--step-small); color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; margin: 0 0 1.6em; font-size: 15.5px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--surface-2); }
.doc th { font-weight: 600; background: var(--surface); }
.doc blockquote { margin: 0 0 1.2em; padding: 14px 18px; background: var(--surface); border-radius: var(--r); }
.doc blockquote p:last-child { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 64px 0 0; }
.pager a { flex: 1; background: var(--surface); border-radius: var(--r); padding: 16px 20px; text-decoration: none; display: grid; gap: 2px; transition: background-color .15s; }
.pager a:hover { background: var(--surface-2); }
.pager a small { color: var(--muted); font-size: 13px; }
.pager a.next { text-align: right; }
.copy { position: relative; }
.copy pre { padding-right: 84px; }
.copy button { position: absolute; top: 8px; right: 8px; background: #262b3d; color: var(--stage-ink); border: 0; border-radius: 4px; font: 500 12.5px/1 inherit; font-family: inherit; padding: 7px 10px; cursor: pointer; opacity: .85; }
.copy button:hover { opacity: 1; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; display: none; }
  .docs-nav.open { display: grid; }
  .menu-btn { display: inline-flex; min-height: 44px; }
}
