:root {
  --night: var(--cw-bg);
  --panel: var(--cw-bg-2);
  --slate: #18232f;
  --hair: rgba(211, 229, 238, 0.10);
  --hair2: rgba(211, 229, 238, 0.18);
  --steel: var(--cw-faint);
  --mist: var(--cw-muted);
  --ice: var(--cw-ice);
  --white: #f4f8fa;
  --blue: var(--cw-blue);
  --violet: var(--cw-violet);
  --sans: var(--cw-sans);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* the site's one column, the docs pages' too (tokens.css --cw-wrap): 1280px of content between gutters of 4vw (20 to 48px) */
  --pad: clamp(20px, 4vw, 48px);
  --col: calc(var(--cw-wrap, 1280px) + 2 * var(--pad));
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--night); color: var(--ice); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
p, h1, h2, h3, ul, dl, dd, figure, pre { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--ice); text-decoration-color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--white); text-decoration-color: var(--ice); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: 0.9em; color: var(--white); }
i { font-style: normal; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--white); color: var(--night); padding: 10px 14px; text-decoration: none; border-radius: 6px; }
.skip:focus { top: 12px; }

/* An action is a label on a tick, in the diagram's own hand: a short upright mark like the timeline's, the words in mono,
   and a hairline under them that draws in from the tick when pointed at. No box, no fill. */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 0; background: none; border: 0; border-radius: 0;
  font: 500 0.8rem/1 var(--mono); letter-spacing: 0.01em; color: #e6edf2; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn::before { content: ""; flex: none; width: 1px; height: 12px; background: currentColor; }
.btn::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% + 12px); height: 1px; background: linear-gradient(currentColor, currentColor) 0 0 / 0% 100% no-repeat, rgba(229, 233, 240, 0.2); transition: background-size 0.25s ease; }
.btn:hover::after, .btn:focus-visible::after { background-size: 100% 100%, auto; }
.btn:active { color: var(--blue); }
.btn.ghost { color: #9aa6b2; }
.btn.ghost:hover, .btn.ghost:focus-visible { color: #e6edf2; }
.btn.on { color: var(--blue); }
.btn:focus-visible { outline-offset: 6px; }
@media (pointer: coarse) { .btn { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .btn::after { transition: none; } }

.eyebrow { font: 0.72rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.note { font-size: 0.82rem; line-height: 1.5; color: var(--steel); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(6, 8, 12, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hair); }
.top-in { max-width: var(--col); margin: 0 auto; height: 64px; padding: 0 calc(var(--pad) + env(safe-area-inset-right, 0px)) 0 calc(var(--pad) + env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 28px; }
.brand { display: block; fill: var(--ice); flex: none; padding: 6px 0; }
.brand svg { width: 126px; height: 28px; }
.top-nav { display: flex; gap: 22px; font-size: 14.5px; }
.top-nav a { color: var(--mist); text-decoration: none; padding: 8px 0; }
.top-nav a:hover { color: var(--white); }
.top-status { margin-left: auto; font-size: 0.9rem; color: var(--mist); white-space: nowrap; }
@media (max-width: 860px) { .top-status { display: none; } .top-nav { margin-left: auto; gap: 16px; } }
@media (max-width: 520px) {
  .top-in { gap: 12px; }
  .brand svg { width: 100px; height: 22px; }
  .top-nav { gap: 13px; font-size: 0.82rem; }
  .top-nav a:nth-child(4) { display: none; }
}

/* ---------- the frame: two rails the whole way down ---------- */
.frame { --gut: max(var(--pad), calc(50% - var(--col) / 2 + var(--pad))); }
.sec { position: relative; border-top: 1px solid var(--hair2); padding: 22px var(--gut) 112px; }
.sec h2, h1 { font-weight: 500; letter-spacing: -0.028em; color: var(--white); text-wrap: balance; }
.sec h2 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.75rem); line-height: 1.08; margin-top: 18px; max-width: 18em; }
.sub { margin-top: 16px; max-width: 34em; color: var(--mist); font-size: 1.02rem; text-wrap: pretty; }
.center { text-align: center; }
.center h2, .center .sub { margin-left: auto; margin-right: auto; }
.center h2 { max-width: 12em; font-size: clamp(2.1rem, 1.2rem + 3vw, 3.25rem); }
.center .sub { max-width: 30em; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 0 var(--pad) 88px; }
.horizon { width: calc(100% + 2 * var(--pad)); max-width: none; margin: 0 calc(-1 * var(--pad)); height: clamp(220px, 38vh, 372px); }
.ticker { font: 0.78rem/1.5 var(--mono); color: var(--steel); min-height: 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker b { color: var(--ice); font-weight: 500; }
.ticker i { margin: 0 0.5em; opacity: 0.6; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 10px; vertical-align: 0.05em; box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.16); }
h1 { font-size: clamp(2.5rem, 1.1rem + 5.2vw, 4.5rem); line-height: 1.04; margin-top: 22px; max-width: 13.2em; }
.lede { margin-top: 26px; max-width: 39em; color: var(--mist); font-size: clamp(1rem, 0.95rem + 0.2vw, 1.09rem); line-height: 1.6; text-wrap: pretty; }
.hero .eyebrow { margin-top: 36px; text-transform: none; letter-spacing: 0.02em; font-size: 0.76rem; }
.paste { margin-top: 12px; display: inline-flex; align-items: center; gap: 14px; max-width: 100%; min-height: 46px; padding: 0 8px 0 16px; background: #0d1219; border: 1px solid var(--hair2); border-radius: 6px; font-family: var(--mono); }
.paste-gt { color: var(--steel); }
.paste code { font-size: 0.9rem; color: var(--white); overflow-wrap: anywhere; padding: 10px 0; min-width: 0; }
.copy { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: none; border: 0; border-radius: 6px; color: var(--mist); cursor: pointer; }
.copy svg { fill: none; stroke: currentColor; stroke-width: 1.3; }
.copy:hover { color: var(--white); background: var(--slate); }
.copy-say { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); font: 0.75rem/1 var(--mono); color: var(--blue); white-space: nowrap; }
.under { margin-top: 20px; font-size: 0.86rem; color: var(--steel); }
.under i { margin: 0 0.6em; }
.under a { color: var(--mist); }

.rail { display: grid; grid-template-columns: repeat(4, 1fr); }
.rail li { padding: 26px 12px; text-align: center; font-size: 0.9rem; color: var(--mist); border-left: 1px solid var(--hair); }
.rail li:first-child { border-left: 0; }

/* ---------- the session viewer ---------- */
.viewer { margin-top: 64px; text-align: left; border: 1px solid var(--hair2); border-radius: 6px; background: var(--panel); overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; flex: 1 0 auto; min-height: 46px; padding: 0 18px; text-align: left;
  background: none; border: 0; border-right: 1px solid var(--hair); color: var(--steel);
  font: 0.78rem/1.2 var(--mono); cursor: pointer; white-space: nowrap;
}
.tabs button:last-child { border-right: 0; }
.tabs button:hover { color: var(--ice); }
.tabs button[aria-selected="true"] { color: var(--white); background: rgba(211, 229, 238, 0.045); }
.tabs button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--ice); transform: scaleX(0); transform-origin: 0 50%; }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.tabs.auto button[aria-selected="true"]::after { animation: tabfill var(--dwell, 8s) linear both; }
@keyframes tabfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tabs button:focus-visible { outline-offset: -3px; }
.pane { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); min-height: 470px; }
.pane-say { padding: 30px 28px; border-right: 1px solid var(--hair); display: flex; flex-direction: column; gap: 14px; }
.pane-n { font: 0.72rem/1 var(--mono); color: var(--steel); }
.pane h3 { font-size: 1.32rem; line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; color: var(--white); }
.pane-say > p:not(.pane-n):not(.note):not(.readout):not(.fork-do) { color: var(--mist); font-size: 0.95rem; }
.pane-say .note { margin-top: auto; }
.pane-show { padding: 28px; display: flex; flex-direction: column; gap: 14px; justify-content: center; min-width: 0; }
.code { background: #080c12; border: 1px solid var(--hair); border-radius: 6px; padding: 18px 20px; font-size: 0.76rem; line-height: 1.75; color: var(--mist); overflow-x: auto; white-space: pre; }
.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.code.small { padding: 12px 14px; font-size: 0.74rem; }
.ask { color: var(--white); }
.ans { color: var(--steel); }
.del { color: var(--steel); }
.add { color: var(--blue); }
mark { background: none; color: var(--blue); }
.wrap mark { color: var(--violet); }
.bubble { align-self: flex-start; max-width: 30em; background: var(--slate); color: var(--white); padding: 14px 18px; border-radius: 6px; font-size: 0.98rem; }
.pane-show.ask img { width: 100%; border: 1px solid var(--hair); border-radius: 6px; image-rendering: pixelated; }
.duo video { width: 100%; border: 1px solid var(--hair); border-radius: 6px; background: #0e1015; }
.duo figcaption { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; font: 0.74rem/1.3 var(--mono); color: var(--steel); }
.duo figcaption span + span { color: var(--blue); }
.readout { display: grid; gap: 6px; font: 0.78rem/1.3 var(--mono); color: var(--steel); margin-top: 6px; }
.readout b { color: var(--white); font-weight: 500; font-variant-numeric: tabular-nums; }
.readout.fork #b-state { color: var(--blue); }
.fork-do { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; }
.scrub { flex: 1 1 120px; display: flex; }
.scrub input { width: 100%; accent-color: var(--blue); min-height: 32px; }
.wall { position: relative; border: 1px solid var(--hair); border-radius: 6px; overflow: hidden; background: #0e1015; aspect-ratio: 2560 / 1004; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wall canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.src { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.forktile { position: absolute; left: 0; top: 0; width: 10px; height: 10px; outline: 2px solid var(--blue); outline-offset: -1px; pointer-events: none; }
@media (max-width: 860px) {
  .pane { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pane-say { border-right: 0; border-bottom: 1px solid var(--hair); padding: 22px 18px; }
  .pane-show { padding: 18px; }
  .code { font-size: 0.7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ---------- games ---------- */
.games { margin: 56px calc(-1 * var(--pad)) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.gtabs button { padding: 12px var(--pad); display: grid; gap: 4px; min-height: 60px; }   /* the first game's name stands on the column's left edge, like the text under it */
.gtabs button b { font: 500 0.95rem/1.2 var(--sans); color: inherit; }
.gtabs button span { font-size: 0.7rem; }
.gpane { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.gtext { padding: 36px var(--pad); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.gsay { font-size: 1.28rem; line-height: 1.32; color: var(--white); letter-spacing: -0.01em; text-wrap: pretty; }
.gfacts { font: 0.72rem/1.7 var(--mono); color: var(--steel); margin-top: auto; }
.gfacts i { margin: 0 0.45em; }
.gvid { width: 100%; height: 100%; min-height: 300px; object-fit: cover; background: #0b1118; border-left: 1px solid var(--hair); }
.shelf-head { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 calc(-1 * var(--pad)); padding: 14px var(--pad); font: 0.72rem/1.3 var(--mono); color: var(--steel); }
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 calc(-1 * var(--pad)) 18px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.shelf li { padding: 0 0 14px; border-left: 1px solid var(--hair); display: grid; gap: 4px; min-width: 0; }
.shelf li:first-child { border-left: 0; }
.shelf img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 8px; }
.shelf b { font-weight: 500; font-size: 0.92rem; color: var(--white); padding: 0 12px; }
.shelf code { font-size: 0.64rem; color: var(--steel); padding: 0 12px; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .gpane { grid-template-columns: minmax(0, 1fr); }
  .gvid { border-left: 0; border-top: 1px solid var(--hair); order: -1; min-height: 0; height: auto; aspect-ratio: auto; }
  .shelf { grid-template-columns: repeat(2, 1fr); }
  .shelf li { border-top: 1px solid var(--hair); }
  .shelf li:nth-child(odd) { border-left: 0; }
  .shelf-head { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ---------- inventory ---------- */
.inv { margin: 56px calc(-1 * var(--pad)) 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.grp { padding: 22px var(--pad) 26px; border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); }
.grp:nth-child(3n + 1) { border-left: 0; }
.grp h3 { display: flex; justify-content: space-between; font: 500 0.88rem/1.3 var(--sans); color: var(--ice); margin-bottom: 14px; }
.grp h3 span { font: 0.7rem/1.6 var(--mono); color: var(--steel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 0.68rem/1 var(--mono); color: var(--mist); background: none; border: 1px solid var(--hair2); border-radius: 3px; padding: 6px 7px; cursor: default; }
.chip:hover, .chip:focus-visible, .chip.on { color: var(--white); border-color: var(--ice); background: rgba(211, 229, 238, 0.06); }
.card { grid-column: span 2; padding: 24px var(--pad) 28px; border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); background: var(--panel); min-height: 150px; }
.card-name { font: 500 1.15rem/1.3 var(--mono); color: var(--white); margin-top: 12px; }
.card-what { margin-top: 8px; color: var(--mist); font-size: 0.92rem; max-width: 46em; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; font-size: 0.9rem; color: var(--mist); }
.counts b { color: var(--white); font-weight: 500; }
@media (max-width: 860px) {
  .inv { grid-template-columns: minmax(0, 1fr); }
  .grp, .card { border-left: 0; grid-column: auto; }
  .card { position: sticky; bottom: 0; order: 99; border-top: 1px solid var(--hair2); }
  .counts { grid-template-columns: 1fr; }
}

/* ---------- cost, status ---------- */
.split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: center; }
.receipt { border: 1px solid var(--hair2); border-radius: 6px; background: var(--panel); padding: 10px 24px; font: 0.82rem/1.4 var(--mono); }
.receipt div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--hair); color: var(--mist); }
.receipt dd { color: var(--white); }
.receipt .total { border-bottom: 0; color: var(--white); font-weight: 600; }
.links { display: grid; gap: 0; border-top: 1px solid var(--hair); }
.links a { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--hair); text-decoration: none; color: var(--ice); font-size: 0.98rem; }
.links a::after { content: ""; width: 7px; height: 7px; border-top: 1px solid var(--steel); border-right: 1px solid var(--steel); transform: rotate(45deg); align-self: center; }
.links a:hover { color: var(--white); }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* ---------- editor, porting ---------- */
.screen { margin-top: 52px; }
.screen img { width: 100%; border: 1px solid var(--hair2); border-radius: 6px; background: var(--panel); }
.screen figcaption { margin-top: 12px; font-size: 0.82rem; color: var(--steel); }
.origins { margin: 52px calc(-1 * var(--pad)) 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.origins div { padding: 24px 22px 8px; border-left: 1px solid var(--hair); }
.origins div:first-child { border-left: 0; padding-left: var(--pad); }
.origins dt { font-weight: 500; font-size: 1.05rem; color: var(--white); margin-bottom: 10px; }
.origins dd { color: var(--mist); font-size: 0.9rem; }
@media (max-width: 860px) { .origins { grid-template-columns: repeat(2, minmax(0, 1fr)); } .origins div { border-bottom: 1px solid var(--hair); padding-bottom: 22px; } .origins div:nth-child(odd) { border-left: 0; padding-left: var(--pad); } }

.foot { border-top: 1px solid var(--hair2); padding: 32px var(--gut) 44px; display: grid; gap: 8px; color: var(--steel); font-size: 0.82rem; border-bottom: 0; }
.foot a { color: var(--mist); }

@media (max-width: 700px) {
  .frame { border-left: 0; border-right: 0; }
  .sec { padding: 18px var(--gut) 72px; }
  .hero { padding-bottom: 56px; }
  .horizon { height: clamp(150px, 24vh, 240px); }
  .rail { grid-template-columns: repeat(2, 1fr); }
  .rail li { padding: 18px 8px; }
  .rail li:nth-child(odd) { border-left: 0; }
  .rail li:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .viewer { margin: 40px -8px 0; }
  .copy-say { left: auto; right: 0; top: -14px; }
  .origins { grid-template-columns: minmax(0, 1fr); }
  .origins div { border-left: 0; padding-left: var(--pad); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .horizon { height: 120px; }
  .frame { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tabs.auto button[aria-selected="true"]::after { animation: none; }
}
@media (min-width: 900px) { h1 span { display: block; white-space: nowrap; } h1 { max-width: none; } }
@media (max-width: 520px) { .paste { gap: 8px; padding-left: 12px; } .paste code { font-size: 0.78rem; white-space: nowrap; } }
/* the lower play area only: the sky of this level is left out of small pictures */
.pane-show.ask img { aspect-ratio: 960 / 330; object-fit: cover; object-position: 50% 100%; }
.shelf img { aspect-ratio: 16 / 7; object-position: 50% 100%; }
/* on a wide screen the shelf of templates sits exactly in the column: the first picture and its name start on the column's edge */
@media (min-width: 861px) { .shelf { margin-left: 0; margin-right: 0; } .shelf li:first-child b, .shelf li:first-child code { padding-left: 0; } }
/* without scripts: every step of the session is shown, one under another, and the horizon is a still line */
html:not(.js) .tabs { display: none; }
html:not(.js) .pane + .pane, html:not(.js) .gpane + .gpane { border-top: 1px solid var(--hair2); }
html:not(.js) .wall { background: #0e1015 url("assets/wall-tile.png") 0 100% / 25% auto repeat; }
.horizon { background: linear-gradient(to right, rgba(211,229,238,0), rgba(211,229,238,.45) 18%, rgba(211,229,238,.45) 82%, rgba(211,229,238,0)) 0 60% / 100% 1px no-repeat; }
html.js .horizon { background: none; }

/* ---------- determinism, live: the wall of real players, in this page's type and rules ---------- */
/* Nothing is written on a picture and nothing dims one: each screen's step and sum sit in a strip under it. */
.frame .cw-wall {
  --cw-bg: transparent; --cw-panel: #0b1118; --cw-line: #1f2832; --cw-steel: var(--steel); --cw-dim: var(--steel); --cw-text: var(--ice);
  --cw-mono: var(--mono); --cw-sans: var(--sans); --strips: 80px;
  max-width: min(100%, max(288px, calc((100vh - 400px) * 16 / 9))); margin-top: 56px; text-align: left; background: none;
}
.frame .cw-wall:not(.cw-built)::before { margin-bottom: calc(var(--cw-seek) + var(--cw-event) + var(--cw-note) + var(--strips)); }
.frame .cw-verdict, .frame .cw-k, .frame .cw-t, .frame .cw-b, .frame .cw-start { text-transform: none; letter-spacing: 0; }
.frame .cw-k { font: 400 12px/1 var(--mono); color: var(--white); }
.frame .cw-b, .frame .cw-start { border-radius: 5px; font: 500 0.8rem/1 var(--sans); height: 32px; background: none; }
.frame .cw-start { background: var(--white); border-color: var(--white); color: #06080c; padding: 0 18px; }
.frame .cw-start:disabled { background: none; color: var(--steel); border-color: var(--cw-line); }
.frame .cw-wall :focus-visible { outline: 2px solid var(--blue); }
.frame .cw-stage { aspect-ratio: auto; overflow: visible; }
.frame .cw-grid { position: static; }
.frame .cw-stage[data-cols] .cw-grid { grid-template-rows: none; grid-auto-rows: auto; }
.frame .cw-tile { background: var(--cw-panel); }
.frame .cw-tile::before { content: ""; display: block; aspect-ratio: 16 / 9; background: #0b0d14 var(--cw-poster) center / cover no-repeat; }
.frame .cw-tile[data-state="poster"] { filter: none; }
.frame .cw-tile iframe { inset: 0 0 auto 0; height: auto; aspect-ratio: 16 / 9; }
.frame .cw-read { position: static; height: calc(var(--strips) / 2); padding: 0 8px; align-items: center; background: var(--cw-panel); }
.frame .cw-stage[data-cols="3"] .cw-read { height: calc(var(--strips) / 3); }
.frame .cw-stage[data-cols="4"] .cw-read { height: calc(var(--strips) / 4); }
.frame .cw-stage[data-cols="5"] .cw-read { height: calc(var(--strips) / 5); }
.frame .cw-tile[data-state="fork"]::after { box-shadow: none; }
/* Start sits in the bar over the wall, where Pause and Rewind appear once it runs */
.frame .cw-cover { inset: auto 0 100% auto; height: var(--cw-head); flex-direction: row-reverse; background: none; }
.frame .cw-wall:not([data-state="live"]) .cw-buttons { visibility: hidden; }
.live-note { margin-top: 6px; }
.rec { display: none; margin-top: 56px; text-align: left; }
.rec .readout { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 14px; }
.rec .fork-do { margin: 14px 0; }
html:not(.js) .rec, .no-live .rec { display: block; }
html:not(.js) .cw-wall, html:not(.js) .live-note, html:not(.js) .live-say, .no-live .cw-wall, .no-live .live-note, .no-live .live-say { display: none; }
@media (max-width: 640px) { .frame .cw-cover { inset: auto auto 100% 0; height: 44px; } }

/* ================= Coldwave's own page: the horizon ================= */
/* One line runs across the whole page under the scene. Every section hangs from a line like it:
   a short bright stretch of the line marks where the section's name hangs. */
.sec::before { content: ""; position: absolute; top: -1px; left: var(--gut); width: 56px; height: 1px; background: var(--ice); }
.sec.center::before { left: calc(50% - 28px); }
.sec > .eyebrow:first-child { margin-bottom: 72px; }
.sec h2, .line { font-stretch: 84%; font-weight: 500; letter-spacing: -0.012em; }
.sec h2 { margin-top: 0; font-size: clamp(2.1rem, 1.3rem + 2.8vw, 3.4rem); line-height: 1.02; }
.center h2 { font-size: clamp(2.1rem, 1.3rem + 2.8vw, 3.4rem); max-width: 14em; }

.hero { padding: 0 0 96px; border: 0; }
.line { margin-top: 22px; font-size: clamp(1.7rem, 1rem + 2.6vw, 2.9rem); line-height: 1.05; color: var(--white); }
.hero .lede { margin-top: 18px; max-width: 44em; }
.under .cap { color: var(--steel); }
.handoff { margin-top: 56px; display: grid; justify-items: center; gap: 0; }
.handoff .eyebrow { text-transform: none; letter-spacing: 0.02em; }
.handoff .paste { text-align: left; }
.with { margin-top: 18px; font: 0.76rem/1.6 var(--mono); color: var(--steel); }
.with i { margin: 0 0.5em; opacity: 0.6; }
#status .sub { max-width: 30em; }
@media (max-width: 700px) {
  .sec > .eyebrow:first-child { margin-bottom: 44px; }
  .hero { padding-bottom: 64px; }
}
.split { align-items: start; padding-top: 22px; }
.split .eyebrow { margin-bottom: 72px; }
.split .links { margin-top: 96px; }
@media (max-width: 860px) { .split .eyebrow { margin-bottom: 44px; } .split .links { margin-top: 0; } }

/* the inventory: plain mono lines in columns, no boxes */
.chips { display: block; columns: 2; column-gap: 18px; }
.chip { display: block; width: 100%; border: 0; border-radius: 0; padding: 4px 0; text-align: left; font-size: 0.72rem; line-height: 1.3; break-inside: avoid; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover, .chip:focus-visible, .chip.on { background: none; color: var(--white); }
.chip.on { color: var(--blue); }

/* ================= the hero: the engine, drawn (the live site's sky, ring and horizon; the type sits on the line) ================= */
:root { --display: "SF Pro Display", "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
/* The hero is as tall as what is in it, never centred in leftover space: a gap under the header that follows the window's
   height, the name and the headline standing on the line, the rest under it, the status line last. --hz is where the line falls. */
.hero { --f: clamp(40px, 4.6vw, 68px); --gap: clamp(40px, calc(22svh - 96px), 116px); --nm: 0px; --hz: calc(var(--gap) + var(--nm) + 2.12 * var(--f) + 9px);
  position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; color: #e5e9f0;
  background: radial-gradient(34% 260px at var(--cx, 75.5%) calc(var(--hz) - 70px), rgba(166, 209, 221, 0.10), rgba(11, 14, 19, 0) 72%), radial-gradient(34% 260px at var(--cx, 75.5%) calc(var(--hz) + 90px), rgba(203, 177, 198, 0.09), rgba(11, 14, 19, 0) 72%), linear-gradient(#07090c, #0b0e13 60%, #0d1117); }
.engine { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the horizon runs the full width on purpose and evenly: full strength across the column, fading out to both edges */
.hz { order: 2; position: relative; flex: none; height: 1px; background: linear-gradient(to right, rgba(229, 233, 240, 0), rgba(229, 233, 240, 0.4) var(--gut), rgba(229, 233, 240, 0.4) calc(100% - var(--gut)), rgba(229, 233, 240, 0)); }
.still-mark { --sw: min(40svh, 30vw, 380px); position: absolute; left: calc(100% - var(--gut) - var(--sw) * 0.39); top: var(--hz); width: var(--sw); transform: translate(-50%, -50%); color: #eef3f6; }
html.engine-on .still-mark { display: none; }
.hero-over { order: 1; position: relative; align-self: flex-start; margin: var(--gap) 0 0 var(--gut); }
.hero .name { margin: 0 0 30px; line-height: 0; }
.hero .name svg { width: 168px; height: auto; fill: #dfe9ef; }
.hero h1 { margin: 0 0 9px; max-width: none; font: 300 var(--f)/1.06 var(--display); letter-spacing: -0.028em; color: #f4f7f9; }
.hero h1 span { display: block; white-space: nowrap; }
.hero-under { order: 3; position: relative; align-self: flex-start; margin: 43px 0 0 var(--gut); width: min(27.5em, 36vw); }
.hero .lede { margin: 0; max-width: none; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.6; color: #aeb8c3; }
/* The line to paste to an agent is the hero's first action: it is what the engine is for. It sits on its own hairline with
   the fork's blue tick before it; the docs and the reel follow as two labelled ticks. */
.paste-line { display: block; margin-top: 30px; font: 500 11px/1.5 var(--mono); color: #77838f; }
.paste-line .paste { display: flex; margin-top: 8px; min-height: 46px; padding: 0 2px 0 0; gap: 12px; background: none; border: 0; border-bottom: 1px solid rgba(229, 233, 240, 0.4); border-radius: 0; }
.paste-line .paste::before { content: ""; flex: none; width: 1px; height: 14px; background: var(--blue); }
.paste-line .paste code { flex: 1; font-size: clamp(0.8rem, 3.7vw, 0.95rem); color: #f4f7f9; padding: 10px 0; }
.paste-line .copy { width: 44px; height: 44px; color: #e6edf2; border-radius: 4px; }
.paste-line .copy:hover { background: rgba(229, 233, 240, 0.08); }
.buttons { display: flex; flex-wrap: wrap; gap: 6px 30px; margin: 18px 0 0; }
.buttons .btn { font-size: 0.84rem; }
.paste-line .paste-gt { display: none; }
/* on a narrow desktop the text column is slim, but the line to paste never breaks: it sits under the ring, so it may run wider than the lede */
@media (min-width: 760px) { .paste-line { width: max(100%, 380px); } .paste-line .paste code { white-space: nowrap; } }
.hero-foot { order: 4; position: relative; margin: clamp(28px, calc(16svh - 72px), 84px) var(--gut) 22px; display: flex; justify-content: space-between; gap: 24px; font: 500 11px/1.5 var(--mono); color: #77838f; }
.hero-foot i { margin: 0 0.5em; }
.hero-src { text-align: right; max-width: 46em; }
/* one COLDWAVE on screen: while the hero is in view the header's lockup is folded away and the menu starts at the page's left edge */
.brand { max-width: none; }   /* the site's lockup, always, as on every docs page; the hero carries no second wordmark */
.by-tap { display: none; }
@media (pointer: coarse) { .by-key { display: none; } .by-tap { display: inline; } }
@media (prefers-reduced-motion: reduce) { .by-key, .by-tap { display: none; } }
@media (max-width: 759px) {
  .hero { --ch: clamp(260px, 42svh, 380px); --hz: calc(var(--ch) / 2); display: block; padding: 0 0 28px; background: radial-gradient(70% 30% at 62% 22%, rgba(136, 192, 208, 0.07), rgba(11, 14, 19, 0) 72%), linear-gradient(#07090c, #0b0e13 60%, #0d1117); }
  .engine { position: relative; display: block; height: var(--ch); }
  .hz { position: absolute; left: 0; right: 0; top: var(--hz); }
  .still-mark { left: 50%; width: min(54vw, calc(var(--ch) * 0.62)); }
  .hero-over, .hero-under, .hero-foot { position: static; width: auto; margin: 0; padding: 0 var(--pad); }
  .hero-over { margin-top: 26px; }
  .hero .name { margin-bottom: 18px; } .hero .name svg { width: 132px; }
  .hero h1 { margin: 0; font-size: clamp(34px, 10vw, 44px); }
  .hero-under { margin-top: 18px; }
  .hero-foot { margin-top: 30px; flex-direction: column; gap: 6px; } .hero-src { text-align: left; }

}
@media (max-height: 560px) and (min-width: 760px) { .hero { --f: 34px; --nm: 0px; } .hero .name { display: none; } .buttons { margin-top: 16px; } .paste-line, .hero-src { display: none; } }

/* sections hang left-aligned from the horizon hairline: no centred stacks */
.sec.center { text-align: left; }
.sec.center::before { left: var(--gut); }
.center h2, .center .sub { margin-left: 0; margin-right: 0; }
.sec h2, .center h2 { font: 400 clamp(30px, 3.2vw, 44px)/1.12 var(--display); letter-spacing: -0.022em; font-stretch: normal; max-width: 22ch; }
.frame .cw-wall { margin-left: 0; }
.with { margin-top: 28px; }
html:not(.js) .hero-src { display: none; }

/* the instrument's texture, carried down the page sparingly: dots, not solid strokes */
.sec::before { top: -2px; height: 3px; width: 60px; background: repeating-linear-gradient(to right, var(--ice) 0 3px, transparent 3px 4px); }
.tabs button::after { height: 3px; background: repeating-linear-gradient(to right, var(--ice) 0 3px, transparent 3px 4px); }
.readout b { padding-bottom: 3px; background: repeating-linear-gradient(to right, rgba(211, 229, 238, 0.45) 0 1px, transparent 1px 4px) 0 100% / 100% 1px no-repeat; }


/* the ruled blocks (games, templates, commands, ports) sit exactly in the column on a wide screen: their hairlines and
   pictures stop on its edges, and the first cell's words start on its left edge */
@media (min-width: 861px) {
  .games, .shelf-head, .inv, .origins { margin-left: 0; margin-right: 0; }
  .gtabs button:first-child, .gtext, .shelf-head { padding-left: 0; }
  .shelf-head { padding-right: 0; }
  .inv > .grp:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .origins div:first-child { padding-left: 0; }
}

/* ---------- clean: one idea a screen, type doing the work ---------- */
.sec::before, .sec.center::before { display: none; }          /* no dotted marks on the section lines */
.tabs button::after { height: 1px; background: var(--ice); }  /* the chosen tab: one plain line */
.rec .readout { display: none; }                                 /* the recording's step and checksum: numbers, not meaning, at a glance */
.sec { padding-top: 104px; padding-bottom: 120px; }
.sec h2 { margin-top: 0; }
.counts a { color: var(--ice); }
@media (max-width: 700px) { .sec { padding-top: 64px; padding-bottom: 72px; } }

/* ================= colour: Nord's palette in its pastel register, each colour meaning one thing =================
   frost  #a6d1dd  the run, and what you can do: the line to paste, links, focus
   lilac  #cbb1c6  the replay, and anything recorded: the ring's lower half, the twelve-screen recording, Watch the reel
   peach  #e0aa98  live: a change made while the game plays (Change it live, the reloaded copy, Scrap Riot)
   sage   #bed2ad  the same / it passes: the proof, an accepted run, and the project's open status
   rose   #d68d94  a difference found: a failed check, a removed line (used sparingly)
   sea    #a9cfce  worlds to make: the games and the templates (Caravan)
   mist   #a3bbd4  talking to the engine: the agent session and its commands
   slate  #8aa5c6  the editor
   All are light pastels on the night ground: every one passes AA for text (over 7:1 on #0b0e13). No yellow. */
:root { --frost: #a6d1dd; --lilac: #cbb1c6; --peach: #e0aa98; --sage: #bed2ad; --rose: #d68d94; --sea: #a9cfce; --mist2: #a3bbd4; --slate2: #8aa5c6; }
.paste-line .paste::before { background: var(--frost); }
.buttons .btn:not(.ghost)::before { background: var(--frost); }
.buttons .btn.ghost::before { background: var(--lilac); }
:focus-visible { outline-color: var(--frost); }
.still-mark g > circle + circle { stroke: var(--lilac); opacity: 0.85; }

/* each section carries one soft wash of its colour from its top left, and a short line of it on the section's rule */
.sec, .sec.center { --tint: 166, 209, 221; --wash: 94, 129, 172; background: radial-gradient(80% 520px at 0% 0%, rgba(var(--wash), 0.13), rgba(var(--wash), 0) 70%); }   /* the wash is the Nord colour itself, very thin; the line is its pastel */
.sec::after { content: ""; position: absolute; top: -1px; left: var(--gut); width: 64px; height: 2px; background: rgb(var(--tint)); opacity: 0.9; }
#how { --tint: 163, 187, 212; --wash: 94, 129, 172; }        /* mist: talking to the engine */
#live { --tint: 203, 177, 198; --wash: 180, 142, 173; }       /* lilac: recorded */
#games { --tint: 169, 207, 206; --wash: 143, 188, 187; }      /* sea: worlds to make */
#inventory { --tint: 163, 187, 212; --wash: 129, 161, 193; }  /* mist: commands */
#editor { --tint: 138, 165, 198; --wash: 94, 129, 172; }     /* slate: the editor */
#from { --tint: 224, 170, 152; --wash: 208, 135, 112; }       /* peach: bringing a game across, a warm welcome */
#status { --tint: 190, 210, 173; --wash: 163, 190, 140; }     /* sage: free and open */
.sec.center::after { left: var(--gut); }

/* the agent session: each step has its colour on its tab and as a faint tint on its panel */
.viewer { border-color: rgba(163, 187, 212, 0.22); border-radius: 10px; }
#t-ask, #t-read { --c: 163, 187, 212; } #t-change { --c: 224, 170, 152; } #t-prove { --c: 190, 210, 173; }
.tabs button[role="tab"][aria-selected="true"] { background: rgba(var(--c, 211, 229, 238), 0.08); }
.tabs button[role="tab"]::after { background: rgb(var(--c, 211, 229, 238)); }
#p-ask, #p-read { --c: 163, 187, 212; } #p-change { --c: 224, 170, 152; } #p-prove { --c: 190, 210, 173; }
.pane { background: linear-gradient(180deg, rgba(var(--c, 0, 0, 0), 0.10), rgba(var(--c, 0, 0, 0), 0) 320px); }
.bubble { background: rgba(163, 187, 212, 0.14); border: 1px solid rgba(163, 187, 212, 0.22); border-radius: 14px 14px 14px 4px; }
.code .del { color: var(--rose); }
.code .add { color: var(--sage); }
#p-read mark { color: var(--frost); }
#p-prove mark { color: var(--rose); }
.duo figcaption span + span { color: var(--peach); }
.with { color: #8e9aa6; }

/* the recording: lilac */
.scrub input { accent-color: var(--lilac); }
.forktile { outline-color: var(--peach); }
#live .btn { color: var(--lilac); }

/* the games: one colour each; the templates: sea */
#g-scrap, #gp-scrap { --c: 224, 170, 152; } #g-caravan, #gp-caravan { --c: 169, 207, 206; }
.gtabs button[aria-selected="true"] b { color: rgb(var(--c)); }
.gpane { background: linear-gradient(90deg, rgba(var(--c, 0, 0, 0), 0.11), rgba(var(--c, 0, 0, 0), 0) 60%); }
.gpane .gfacts { color: rgb(var(--c, 160, 170, 180)); opacity: 0.9; }
.shelf li { transition: background 0.2s ease; }
.shelf li:hover { background: rgba(169, 207, 206, 0.06); }

/* commands, editor, porting, status */
.counts b { color: var(--mist2); }
.counts a { color: var(--frost); }
.screen img { border-radius: 10px; box-shadow: 0 30px 80px -30px rgba(138, 165, 198, 0.28); }
.origins dt { color: var(--peach); }
.links a:hover { color: var(--sage); }
.links a:hover::after { border-color: var(--sage); }
@media (prefers-reduced-motion: reduce) { .shelf li { transition: none; } }

/* ================= the hero's picture: a film the engine drew (Frozen Horizon, or Embers mirrored), not a drawing =================
   Beside the words on a wide screen, behind them as a soft backdrop at middle widths, above them on a phone; its own horizon
   sits on the page's horizon line. The whole hero fits the first screen: the gaps follow the window's height. */
.hero { --gap: clamp(28px, calc(22svh - 110px), 116px); --fh: calc(var(--hz) * 2 - 24px); }
.hero-under { margin-top: clamp(26px, 5svh, 43px); }
.paste-line { margin-top: clamp(16px, 3.2svh, 30px); }
.buttons { margin-top: clamp(10px, 2svh, 18px); }
.hero-foot { margin-top: clamp(20px, calc(12svh - 64px), 84px); }
.hero-over, .hero-under, .hero-foot, .hz { z-index: 1; }
.film { position: absolute; z-index: 0; pointer-events: none; right: var(--gut); top: calc(var(--hz) - var(--fh) / 2); height: var(--fh);
  width: min(calc(100% - 2 * var(--gut)), calc(var(--fh) * 16 / 9));
  -webkit-mask-image: radial-gradient(ellipse 50% 52% at 55% 50%, #000 38%, rgba(0, 0, 0, 0.5) 68%, transparent 97%);
          mask-image: radial-gradient(ellipse 50% 52% at 55% 50%, #000 38%, rgba(0, 0, 0, 0.5) 68%, transparent 97%); }
.film video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the page's line runs into the film's own horizon and gives way to it */
.hero .hz { background: linear-gradient(to right, rgba(229, 233, 240, 0), rgba(229, 233, 240, 0.4) var(--gut), rgba(229, 233, 240, 0.4) 34%, rgba(229, 233, 240, 0) 52%); }
/* Embers mirrored: the film above the line, the same frames reflected below it (CSS; a browser without box-reflect shows the film alone) */
.film.mirror { width: min(calc(100% - 2 * var(--gut)), calc(var(--fh) / 2 * 2.449)); }
.film.mirror video { height: 50%; object-position: 50% 100%; -webkit-box-reflect: below 0 linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.5)); filter: saturate(0.9); }
/* middle widths: the film behind the words, darkened toward them so every line keeps its contrast */
@media (min-width: 760px) and (max-width: 1199px) {
  .film { width: calc(100% - var(--gut)); right: 0; }
  .film::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(8, 10, 14, 0.92) 0%, rgba(8, 10, 14, 0.78) 38%, rgba(8, 10, 14, 0.15) 70%, rgba(8, 10, 14, 0) 100%); }
}
@media (max-width: 759px) {
  .hero { --ch: clamp(170px, 28svh, 280px); --hz: calc(64px * 0 + var(--ch) / 2); }
  .film { position: relative; left: 0; right: 0; top: auto; width: auto; height: var(--ch);
    -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.2), #000 18%, #000 72%, transparent);
            mask-image: linear-gradient(rgba(0, 0, 0, 0.2), #000 18%, #000 72%, transparent); }
  .hero .hz { background: linear-gradient(to right, rgba(229, 233, 240, 0), rgba(229, 233, 240, 0.3) 20%, rgba(229, 233, 240, 0.3) 80%, rgba(229, 233, 240, 0)); }
  .hero-over { margin-top: 18px; }
  .hero-under { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { .film video { animation: none; } }
html:not([data-film="mirror"]) .film.mirror, html[data-film="mirror"] .film.horizon { display: none; }   /* the preview's two films; a real build keeps one */

/* the moon you move: the poster first, the live scene fading in over it (no shift: both fill the same box) */
.film.moon { pointer-events: auto; }
.film.moon .film-poster, .film.moon .film-live, .film.moon .film-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.film.moon .film-live { opacity: 0; transition: opacity 0.9s ease; background: transparent; }
.film.moon.live .film-live { opacity: 1; }
.moon-go { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); z-index: 2; font-size: 0.84rem; color: #e6edf2; }
.moon-go::before { background: var(--frost); }
.moon-say { color: var(--frost); opacity: 0.85; }
.hero-foot .moon-say[hidden] { display: none; }
@media (min-width: 760px) and (max-width: 1199px) { .film.moon::after { pointer-events: none; z-index: 1; } }
@media (max-width: 759px) { .moon-say { display: block; } }
/* the live scene keeps the game's own 16:9 frame and covers the box the way the poster does (centred, cropped), so the
   two line up exactly and the frame is never letterboxed */
.film { --bh: var(--fh); }
@media (max-width: 759px) { .film { --bh: var(--ch); } }
.film.moon .film-live { inset: auto; left: 50%; top: 50%; width: max(100%, calc(var(--bh) * 16 / 9)); height: auto; aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
/* middle widths: the whole ring and its moon stand beside the words, never cropped: the scene's frame is sized so the
   ring fits the hero's height with its horizon on the line, and slid right so the ring's middle sits at 72% of the width;
   the box round it is taller, so its soft edge falls outside the ring; the left, under the words, is darkened */
@media (min-width: 760px) and (max-width: 1199px) {
  .hero { --fh: calc(var(--hz) * 2.1); }
  .film { --bh: var(--fh); width: 100%; right: 0; top: calc(var(--hz) - var(--fh) / 2 - 70px); height: calc(var(--fh) + 140px);
    -webkit-mask-image: none; mask-image: none; }
  .film::after { background: linear-gradient(to right, rgba(8, 10, 14, 0.92) 0%, rgba(8, 10, 14, 0.8) 40%, rgba(8, 10, 14, 0) 55%); }
  .film.moon .film-poster, .film.moon .film-live, .film.moon .film-v { inset: auto; top: 70px; height: var(--fh); width: auto; aspect-ratio: 16 / 9; transform: none;
    left: calc(72% - 0.495 * var(--fh) * 16 / 9); object-fit: cover;
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
            mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%); }
}
.film.moon .film-v { object-fit: cover; }
