/* Components and page layout. Depends on tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 48px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: var(--text-md)/var(--leading-body) var(--font-sans);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--accent-fg); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-2); }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { line-height: var(--leading-tight); margin: 0; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--text-3xl); letter-spacing: -0.025em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md); }
p { margin: 0 0 var(--s-4); max-width: var(--w-text); }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.25em; margin: 0 0 var(--s-4); max-width: var(--w-text); }
li { margin-bottom: var(--s-2); }
hr { border: 0; border-top: var(--line) solid var(--border); margin: var(--s-6) 0; }
code, kbd, samp, .mono { font-family: var(--font-mono); font-size: 0.92em; font-variant-ligatures: none; }
:not(pre) > code { background: var(--bg-sunken); border: var(--line) solid var(--border); border-radius: var(--r-1); padding: 0.05em 0.35em; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--fg-dim); }
.ok { color: var(--accent-fg); }
.bad { color: var(--fail); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.break { word-break: break-all; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--w-page); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-8) 0; border-top: var(--line) solid var(--border); }
.section:first-of-type { border-top: 0; }
.section > .wrap > h2 { margin-bottom: var(--s-4); }
.lead { font-size: var(--text-lg); color: var(--fg-dim); max-width: 60ch; }
.eyebrow {
  font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--fg-dim); margin-bottom: var(--s-3); display: block;
}
.eyebrow b { color: var(--accent-fg); font-weight: 500; }
.grid { display: grid; gap: var(--s-4); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.spacer { flex: 1; }
.page-head { padding-top: var(--s-8); padding-bottom: var(--s-6); }
.page-head h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); margin-bottom: var(--s-3); }
.prose h2 { margin: var(--s-7) 0 var(--s-4); font-size: var(--text-xl); }
.prose h3 { margin: var(--s-5) 0 var(--s-2); }
.prose > :first-child { margin-top: 0; }
.with-toc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 56px); font-size: var(--text-sm); }
.toc a { display: block; padding: var(--s-1) 0 var(--s-1) var(--s-3); color: var(--fg-dim); text-decoration: none; border-left: var(--line) solid var(--border); }
.toc a:hover { color: var(--fg); border-left-color: var(--accent-fg); }

/* ---------- header / footer ---------- */
.notice-strip {
  background: var(--bg-sunken); border-bottom: var(--line) solid var(--border);
  font-size: var(--text-xs); color: var(--fg-dim); padding: 6px 0; line-height: 1.45;
}
.notice-strip b { color: var(--fg); font-weight: 600; }
.site-header {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: var(--line) solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s-5); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--fg); text-decoration: none; font: 600 var(--text-md)/1 var(--font-mono); letter-spacing: 0.02em; white-space: nowrap; }
.lab-mark { width: 32px; height: 22px; flex: none; display: block; }
.lab-mark .pre { fill: var(--accent-fg); }
.tok-mark { width: 22px; height: 22px; flex: none; display: block; }
.tok-mark .on { fill: var(--accent-fg); }
.tok-mark .cell { fill: none; stroke: var(--fg-dim); stroke-width: 1; }
.brand-tile { display: grid; place-items: center; gap: var(--s-3); padding: var(--s-6); border: var(--line) solid var(--border); border-radius: var(--r-2); background: var(--bg-raised); min-height: 140px; }
.brand-tile.paper { background: #f5f4ef; color: #16181c; }
.brand-tile.ink { background: #0c0e11; color: #e9e7e0; }
.brand-tile .cap { font: 400 var(--text-xs)/1.4 var(--font-mono); color: var(--fg-dim); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.lab-mark .cell { fill: none; stroke: var(--fg-dim); stroke-width: 1; }
.brand .lab, .foot-brand .lab { font-weight: 600; letter-spacing: 0.01em; }
.brand .lab i, .foot-brand .lab i { font-style: normal; font-weight: 400; color: var(--fg-dim); }
.brand .div { width: 1px; height: 18px; background: var(--border-strong); margin: 0 var(--s-1); }
.brand .tok { color: var(--fg); }
.brand small { font-weight: 400; color: var(--fg-dim); font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.brand:hover .lab-mark .cell { stroke: var(--fg); }
.site-footer h4.foot-brand { color: var(--fg); font-size: var(--text-sm); display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-mono); text-transform: none; letter-spacing: 0.01em; }
@media (max-width: 520px) { .brand small { display: none; } }
@media (max-width: 380px) { .brand .lab i, .brand .div { display: none; } }
.nav { display: flex; gap: var(--s-1); align-items: center; margin-left: auto; }
.nav a { color: var(--fg-dim); text-decoration: none; font-size: var(--text-sm); padding: 6px 10px; border-radius: var(--r-2); white-space: nowrap; }
.nav a:hover { color: var(--fg); background: var(--bg-hover); }
.nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav .sep { width: 1px; height: 18px; background: var(--border); margin: 0 var(--s-2); }
.icon-btn { background: none; border: var(--line) solid var(--border); color: var(--fg-dim); border-radius: var(--r-2); width: 32px; height: 32px; display: inline-grid; place-items: center; cursor: pointer; font: inherit; padding: 0; flex: none; }
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.nav-toggle { display: none; margin-left: auto; }
.site-footer { border-top: var(--line) solid var(--border); padding: var(--s-7) 0; margin-top: var(--s-8); color: var(--fg-dim); font-size: var(--text-sm); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-6); }
.site-footer h4 { font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); margin-bottom: var(--s-3); }
.site-footer a { display: block; color: var(--fg); text-decoration: none; padding: 3px 0; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal { margin-top: var(--s-6); padding-top: var(--s-4); border-top: var(--line) solid var(--border); font-size: var(--text-xs); }
.site-footer .legal p { max-width: none; margin-bottom: var(--s-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4); border-radius: var(--r-2); cursor: pointer;
  font: 600 var(--text-sm)/1 var(--font-sans); text-decoration: none; white-space: nowrap;
  border: var(--line) solid var(--border-strong); background: transparent; color: var(--fg);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--bg-hover); border-color: var(--fg-dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--fg-dim); }
.btn.ghost:hover { color: var(--fg); background: var(--bg-hover); }
.btn.danger { border-color: var(--fail-line); color: var(--fail); }
.btn.danger:hover { background: var(--fail-soft); }
.btn.sm { height: 32px; padding: 0 var(--s-3); font-size: var(--text-xs); }
.btn.lg { height: 48px; padding: 0 var(--s-5); font-size: var(--text-md); }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; filter: none; }

/* ---------- tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-1);
  font: 500 var(--text-xs)/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  border: var(--line) solid var(--border); color: var(--fg-dim); background: var(--bg-raised);
}
.tag.ok { color: var(--accent-fg); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.fail { color: var(--fail); border-color: var(--fail-line); background: var(--fail-soft); }
.tag.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.tag.info { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.tag .dot { width: 6px; height: 6px; background: currentColor; }

/* ---------- cards ---------- */
.card { background: var(--bg-raised); border: var(--line) solid var(--border); border-radius: var(--r-3); padding: var(--s-5); min-width: 0; }
.card.flat { background: transparent; }
.card.link { display: block; color: inherit; text-decoration: none; transition: border-color var(--t-fast) var(--ease); }
.card.link:hover { border-color: var(--accent-line); }
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--fg-dim); font-size: var(--text-sm); }
.card .card-foot { margin-top: var(--s-4); padding-top: var(--s-3); border-top: var(--line) solid var(--border); font-size: var(--text-xs); color: var(--fg-dim); }

/* ---------- stats ---------- */
.stat { background: var(--bg-raised); border: var(--line) solid var(--border); border-radius: var(--r-3); padding: var(--s-4); min-width: 0; }
.stat .k { font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); }
.stat .v { font: 600 var(--text-xl)/1.2 var(--font-mono); font-variant-numeric: tabular-nums; margin-top: var(--s-2); overflow-wrap: anywhere; }
.stat .v small { font-size: var(--text-sm); font-weight: 400; color: var(--fg-dim); }
.stat .s { font-size: var(--text-xs); color: var(--fg-dim); margin-top: var(--s-1); }
.stat.pending .v { color: var(--fg-faint); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: var(--line) solid var(--border); border-radius: var(--r-3); background: var(--bg-raised); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); padding: 10px var(--s-3); border-bottom: var(--line) solid var(--border); white-space: nowrap; background: var(--bg-sunken); }
table.data td { padding: 10px var(--s-3); border-bottom: var(--line) solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--bg-hover); }
table.data td.r, table.data th.r { text-align: right; }
table.data td.mono, table.data .mono { font-size: var(--text-xs); }
table.data td.empty { color: var(--fg-dim); text-align: center; padding: var(--s-5); }
table.data a { text-decoration: none; }
table.data a:hover { text-decoration: underline; }

/* ---------- code ---------- */
pre.code {
  margin: 0 0 var(--s-4); background: var(--bg-sunken); border: var(--line) solid var(--border); border-radius: var(--r-3);
  padding: var(--s-4); overflow-x: auto; font: var(--text-sm)/1.6 var(--font-mono); color: var(--fg); tab-size: 2;
}
pre.code .c { color: var(--fg-dim); }
pre.code .hl { color: var(--accent-fg); }
.code-head { display: flex; justify-content: space-between; align-items: center; font: 500 var(--text-xs)/1 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); padding: var(--s-2) var(--s-4); border: var(--line) solid var(--border); border-bottom: 0; border-radius: var(--r-3) var(--r-3) 0 0; background: var(--bg-raised); }
.code-head + pre.code { border-radius: 0 0 var(--r-3) var(--r-3); }

/* ---------- alerts ---------- */
.alert { border: var(--line) solid var(--border-strong); border-left-width: 3px; border-radius: var(--r-2); padding: var(--s-3) var(--s-4); background: var(--bg-raised); font-size: var(--text-sm); }
.alert > strong:first-child, .alert .alert-title { display: block; font: 600 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; margin-bottom: var(--s-1); }
.alert p { max-width: none; margin-bottom: var(--s-2); }
.alert.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-soft); }
.alert.warn > strong:first-child { color: var(--warn); }
.alert.danger { border-color: var(--fail-line); border-left-color: var(--fail); background: var(--fail-soft); }
.alert.danger > strong:first-child { color: var(--fail); }
.alert.info { border-color: var(--info-line); border-left-color: var(--info); background: var(--info-soft); }
.alert.info > strong:first-child { color: var(--info); }
.alert.plain > strong:first-child { color: var(--fg); }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; max-width: none; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 var(--s-5) calc(32px + var(--s-4)); margin: 0; }
.steps > li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  display: grid; place-items: center; border: var(--line) solid var(--border-strong); border-radius: var(--r-1);
  font: 600 var(--text-xs)/1 var(--font-mono); color: var(--fg); background: var(--bg-raised);
}
.steps > li::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--border); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps > li.done::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps > li.todo::before { border-style: dashed; color: var(--fg-dim); }
.steps h3 { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; min-height: 32px; margin-bottom: var(--s-2); }
.steps p, .steps ul { color: var(--fg-dim); font-size: var(--text-sm); }
.steps.zero { counter-reset: step -1; }
.steps.horizontal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.steps.horizontal > li { padding: calc(32px + var(--s-3)) 0 0 0; }
.steps.horizontal > li::after { left: 40px; right: calc(-1 * var(--s-4) + 8px); top: 15.5px; bottom: auto; width: auto; height: 1px; }
.steps.horizontal > li:last-child::after { display: none; }

/* ---------- progress / difficulty ---------- */
.meter { height: 8px; background: var(--bg-sunken); border: var(--line) solid var(--border); border-radius: var(--r-1); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width var(--t-base) var(--ease); }
.meter.dim > i { background: var(--fg-faint); }
.meter-label { display: flex; justify-content: space-between; font: var(--text-xs)/1.4 var(--font-mono); color: var(--fg-dim); margin-bottom: var(--s-1); gap: var(--s-3); }

/* target bar: the 256-bit number line. Left of the marker = accepted. */
.target { position: relative; height: 28px; border: var(--line) solid var(--border-strong); border-radius: var(--r-1); background:
  repeating-linear-gradient(90deg, transparent 0 calc(6.25% - 1px), var(--border) calc(6.25% - 1px) 6.25%), var(--bg-sunken); }
.target .accept { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-right: 2px solid var(--accent-fg); }
.target .pin { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--fg); transform: translateX(-1px); }
.target .pin.ok { background: var(--accent-fg); }
.target .pin.bad { background: var(--fail); }
.target-scale { display: flex; justify-content: space-between; font: var(--text-xs)/1.4 var(--font-mono); color: var(--fg-dim); margin-top: var(--s-1); }

/* byte ruler: one cell per byte of a signature; the limit is where it must end */
.ruler { display: flex; align-items: center; gap: var(--s-2); font: var(--text-xs)/1 var(--font-mono); min-width: 0; }
.ruler .cells { display: flex; gap: 1px; flex: 1; min-width: 0; height: 12px; }
.ruler .cells i { flex: 1; min-width: 0; background: var(--fg-faint); opacity: 0.55; }
.ruler .cells i.cut { background: transparent; outline: 1px dashed var(--border-strong); outline-offset: -1px; opacity: 1; }
.ruler .cells i.over { background: var(--fail); opacity: 1; }
.ruler.pass .cells i:not(.cut) { background: var(--accent); opacity: 1; }
.ruler .len { width: 5.5ch; text-align: right; color: var(--fg-dim); flex: none; }
.ruler .pos { width: 3ch; color: var(--fg-dim); flex: none; }
.ruler.pass .len { color: var(--accent-fg); }
.ruler.miss .len { color: var(--fail); }

/* hex strings */
.hex { font: var(--text-sm)/1.5 var(--font-mono); word-break: break-all; color: var(--fg-dim); }
.hex b { color: var(--accent-fg); font-weight: 600; }
.hex .z { color: var(--fg); }

/* checklist rows (indexer verdicts) */
.checks { list-style: none; padding: 0; margin: 0; max-width: none; font-size: var(--text-sm); line-height: 1.5; }
.checks li::before { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.7; }
.checks li { position: relative; padding: 6px 0 6px 7ch; border-bottom: var(--line) dashed var(--border); margin: 0; }
.checks li:last-child { border-bottom: 0; }
.checks li::before { content: "····"; color: var(--fg-faint); position: absolute; left: 0; top: 6px; }
.checks li.pass::before { content: "PASS"; color: var(--accent-fg); }
.checks li.fail::before { content: "FAIL"; color: var(--fail); }
.checks li.na::before { content: "—"; }

/* ---------- forms ---------- */
.input, .textarea, .select {
  width: 100%; background: var(--bg-sunken); color: var(--fg); border: var(--line) solid var(--border-strong); border-radius: var(--r-2);
  padding: 0 var(--s-3); height: 40px; font: var(--text-sm)/1.4 var(--font-mono);
}
.textarea { height: auto; padding: var(--s-3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--fg-faint); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent-fg); box-shadow: var(--focus); }
.field { display: block; margin-bottom: var(--s-4); }
.field > span { display: block; font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); margin-bottom: var(--s-1); }
input[type="range"] { accent-color: var(--accent-fg); width: 100%; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: var(--s-5); border-bottom: var(--line) solid var(--border); overflow-x: auto; }
.tabs a, .tabs button { background: none; border: 0; padding: var(--s-3) 0; color: var(--fg-dim); font: 600 var(--text-sm)/1 var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs .on, .tabs [aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.tabs b { font: 400 var(--text-xs)/1 var(--font-mono); color: var(--fg-dim); margin-left: 6px; }

/* ---------- modal / toast ---------- */
.mask { position: fixed; inset: 0; background: #000000a6; display: none; place-items: center; z-index: 40; padding: var(--s-4); }
.mask.on { display: grid; }
.modal { width: min(580px, 100%); max-height: 90vh; overflow: auto; background: var(--bg-raised); border-radius: var(--r-3); padding: var(--s-5); box-shadow: var(--shadow-pop); }
.modal h3 { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
#toast { position: fixed; top: calc(var(--header-h) + 44px); right: var(--s-4); z-index: 60; display: flex; flex-direction: column; gap: var(--s-2); max-width: min(400px, calc(100vw - 32px)); }
#toast div { background: var(--bg-raised); border: var(--line) solid var(--border-strong); border-left: 3px solid var(--accent-fg); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); font-size: var(--text-sm); box-shadow: var(--shadow-pop); }
#toast div.bad { border-left-color: var(--fail); }

/* ---------- hero + demo (home) ---------- */
.hero { padding: var(--s-8) 0 var(--s-7); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s-7); align-items: start; }
.hero h1 { margin-bottom: var(--s-4); }
.hero .lead { margin-bottom: var(--s-5); }
.hero-facts { list-style: none; padding: 0; margin: var(--s-4) 0 0; font-size: var(--text-sm); color: var(--fg-dim); max-width: none; }
.hero-facts li { position: relative; padding-left: var(--s-4); margin-bottom: var(--s-2); }
.hero-facts li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; background: var(--fg-faint); }
.demo { border: var(--line) solid var(--border-strong); border-radius: var(--r-3); background: var(--bg-raised); min-width: 0; }
.demo-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: var(--line) solid var(--border); flex-wrap: wrap; }
.demo-head .title { font: 600 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.demo-body { padding: var(--s-4); display: grid; gap: var(--s-4); }
.demo-foot { padding: var(--s-3) var(--s-4); border-top: var(--line) solid var(--border); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.kv { display: grid; grid-template-columns: 11ch minmax(0, 1fr); gap: var(--s-1) var(--s-3); font: var(--text-sm)/1.5 var(--font-mono); }
.kv dt { color: var(--fg-dim); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd .chg { color: var(--accent-fg); }
.rulers { display: grid; gap: 5px; }
.verdict { font: 600 var(--text-sm)/1.4 var(--font-mono); padding: var(--s-3); border: var(--line) dashed var(--border-strong); border-radius: var(--r-2); color: var(--fg-dim); min-height: 3.6em; }
.verdict.valid { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-fg); }
.verdict small { display: block; font-weight: 400; color: var(--fg-dim); margin-top: 2px; }

/* ---------- diagrams ---------- */
.figure { border: var(--line) solid var(--border); border-radius: var(--r-3); background: var(--bg-raised); padding: var(--s-4); margin: 0 0 var(--s-5); overflow-x: auto; }
.figure svg { display: block; width: 100%; min-width: 640px; height: auto; }
.figure figcaption { font-size: var(--text-xs); color: var(--fg-dim); margin-top: var(--s-3); max-width: var(--w-text); }
.dg text { font-family: var(--font-mono); font-size: 12px; fill: var(--fg); }
.dg .t-dim { fill: var(--fg-dim); }
.dg .t-acc { fill: var(--accent-fg); }
.dg .t-bad { fill: var(--fail); }
.dg .t-sm { font-size: 10.5px; }
.dg .t-h { font-weight: 600; font-size: 13px; }
.dg .box { fill: var(--bg-sunken); stroke: var(--border-strong); stroke-width: 1; }
.dg .box-acc { fill: var(--accent-soft); stroke: var(--accent-fg); stroke-width: 1; }
.dg .box-bad { fill: var(--fail-soft); stroke: var(--fail); stroke-width: 1; }
.dg .ln { stroke: var(--fg-dim); stroke-width: 1; fill: none; }
.dg .ln-acc { stroke: var(--accent-fg); stroke-width: 1.5; fill: none; }
.dg .ln-dash { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.dg .fill-acc { fill: var(--accent); }
.dg .fill-dim { fill: var(--fg-faint); }
.dg .fill-fg { fill: var(--fg-dim); }

/* ---------- timeline (launch) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; max-width: none; }
.timeline > li { display: grid; grid-template-columns: 150px 20px minmax(0, 1fr); gap: var(--s-4); padding-bottom: var(--s-5); margin: 0; position: relative; }
.timeline .when { font: var(--text-sm)/1.5 var(--font-mono); color: var(--fg-dim); text-align: right; padding-top: 1px; }
.timeline .when b { display: block; color: var(--fg); font-weight: 600; }
.timeline .node { position: relative; }
.timeline .node::before { content: ""; position: absolute; left: 5px; top: 5px; width: 9px; height: 9px; border: var(--line) solid var(--fg-dim); background: var(--bg); }
.timeline .node::after { content: ""; position: absolute; left: 9.5px; top: 20px; bottom: calc(-1 * var(--s-5)); width: 1px; background: var(--border); }
.timeline > li:last-child .node::after { display: none; }
.timeline > li.now .node::before { background: var(--accent); border-color: var(--accent); }
.timeline > li.past .node::before { background: var(--fg-dim); }
.timeline h3 { margin-bottom: var(--s-1); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.timeline p, .timeline ul { color: var(--fg-dim); font-size: var(--text-sm); }

/* ---------- FAQ ---------- */
details.faq { border-bottom: var(--line) solid var(--border); }
details.faq summary { cursor: pointer; padding: var(--s-4) 0; font-weight: 600; list-style: none; display: flex; gap: var(--s-3); align-items: baseline; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "+"; font-family: var(--font-mono); color: var(--accent-fg); width: 1ch; flex: none; }
details.faq[open] summary::before { content: "−"; }
details.faq .a { padding: 0 0 var(--s-4) calc(1ch + var(--s-3)); color: var(--fg-dim); }

/* ---------- swatches (styleguide) ---------- */
.swatch { border: var(--line) solid var(--border); border-radius: var(--r-3); overflow: hidden; background: var(--bg-raised); }
.swatch i { display: block; height: 56px; border-bottom: var(--line) solid var(--border); }
.swatch div { padding: var(--s-2) var(--s-3); font: var(--text-xs)/1.5 var(--font-mono); color: var(--fg-dim); }
.swatch div b { display: block; color: var(--fg); font-weight: 500; }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.sg-block { margin-bottom: var(--s-7); }
.sg-block > h2 { font-size: var(--text-xl); margin-bottom: var(--s-2); padding-bottom: var(--s-2); border-bottom: var(--line) solid var(--border); }
.sg-block > h3 { margin: var(--s-5) 0 var(--s-3); font: 500 var(--text-xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fg-dim); }
.space-bar { height: 12px; background: var(--accent); border-radius: var(--r-1); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps.horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps.horizontal > li::after { display: none; }
  .with-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: inline-grid; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg); border-bottom: var(--line) solid var(--border); flex-direction: column; align-items: stretch; padding: var(--s-2) var(--s-4) var(--s-4); margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: var(--s-3) var(--s-2); font-size: var(--text-md); }
  .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); }
  .nav .sep { width: auto; height: 1px; margin: var(--s-2) 0; }
  .nav .icon-btn { margin: var(--s-2); }
  .site-header .wrap { position: relative; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 var(--s-4); }
  .section { padding: var(--s-7) 0; }
  .hero { padding: var(--s-6) 0; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .steps.horizontal { grid-template-columns: minmax(0, 1fr); }
  .timeline > li { grid-template-columns: 20px minmax(0, 1fr); }
  .timeline .when { grid-column: 2; grid-row: 1; text-align: left; }
  .timeline .when b { display: inline; margin-right: var(--s-2); }
  .timeline .node { grid-column: 1; grid-row: 1 / span 2; }
  .timeline .what { grid-column: 2; }
  .site-footer .cols { grid-template-columns: 1fr; gap: var(--s-5); }
  .kv { grid-template-columns: 9ch minmax(0, 1fr); font-size: var(--text-xs); }
  .card { padding: var(--s-4); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .notice-strip, .site-footer, .nav { display: none; }
}
