/* sudoX site — the brochure, not the terminal.
 *
 * The console is dark by default because it is read at three in the morning.
 * This site is read at a desk, by somebody deciding whether to trust the
 * thing, so it is paper first and ink second — and "Open the console" is the
 * one link that crosses from paper into the dark. Both share one ink palette
 * and one mark so they read as a family; they do not share a layout.
 *
 * Typography: Instrument Serif for display (an editorial voice with a sharp
 * italic that carries the product's own phrases), IBM Plex Sans for reading,
 * IBM Plex Mono for anything the machine said.
 *
 * Every simulation has a FIXED stage. Content that appears, grows or
 * disappears does so inside a box whose height was decided up front, so the
 * page never jumps under the reader's cursor while they are operating it.
 */

:root {
  /* Ink, biased blue — the console's own scale, in light order. */
  --ink-950: 11 13 18;
  --ink-900: 17 20 28;
  --ink-800: 29 34 48;
  --ink-700: 58 66 87;
  --ink-600: 91 101 127;
  --ink-500: 133 144 168;
  --ink-400: 181 188 202;
  --ink-300: 213 218 228;
  --ink-200: 229 232 239;
  --ink-100: 241 243 247;
  --ink-50: 250 250 252;

  --paper: 250 250 252;
  --paper-2: 244 245 249;
  --paper-3: 236 238 244;
  --text: 17 20 28;
  --text-2: 58 66 87;
  --text-3: 133 144 168;
  --rule: 213 218 228;
  --rule-2: 229 232 239;

  /* The gate. The only hue with meaning: it marks where a person is required. */
  --gate: 37 99 235;
  --gate-soft: 219 234 254;

  /* Semantic, separate from the accent. */
  --ok: 22 163 74;
  --warn: 180 83 9;
  --bad: 220 38 38;

  /* The one solid surface: near-black on paper, the gate blue on dark. A
     token, so components never reach for a theme selector themselves. */
  --solid: 17 20 28;
  --solid-fg: 250 250 252;
  /* The check inside the mark, drawn on the solid tile. */
  --mark-check: 96 165 250;
  --code-bg: 11 13 18;
  --code-fg: 229 232 239;

  --shadow: 0 1px 2px rgb(17 20 28 / 0.06), 0 8px 24px -16px rgb(17 20 28 / 0.25);
  --radius: 10px;

  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: 11 13 18;
    --paper-2: 17 20 28;
    --paper-3: 22 26 37;
    --text: 241 243 247;
    --text-2: 181 188 202;
    --text-3: 133 144 168;
    --rule: 38 44 61;
    --rule-2: 29 34 48;
    --gate: 96 165 250;
    --gate-soft: 23 37 84;
    --ok: 74 222 128;
    --warn: 251 191 36;
    --bad: 248 113 113;
    --shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.04), 0 1px 2px rgb(0 0 0 / 0.4);
    --solid: 96 165 250;
    --solid-fg: 11 13 18;
    --mark-check: 255 255 255;
    --code-bg: 17 20 28;
    --code-fg: 213 218 228;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: 11 13 18;
  --paper-2: 17 20 28;
  --paper-3: 22 26 37;
  --text: 241 243 247;
  --text-2: 181 188 202;
  --text-3: 133 144 168;
  --rule: 38 44 61;
  --rule-2: 29 34 48;
  --gate: 96 165 250;
  --gate-soft: 23 37 84;
  --ok: 74 222 128;
  --warn: 251 191 36;
  --bad: 248 113 113;
  --shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.04), 0 1px 2px rgb(0 0 0 / 0.4);
  --solid: 96 165 250;
  --solid-fg: 11 13 18;
  --mark-check: 255 255 255;
  --code-bg: 17 20 28;
  --code-fg: 213 218 228;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: rgb(var(--text));
  background: rgb(var(--paper));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: rgb(var(--gate)); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid rgb(var(--gate)); outline-offset: 3px; border-radius: 3px; }

code, kbd, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: rgb(var(--paper-3)); padding: 0.1em 0.35em; border-radius: 4px; }
pre {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.55;
  background: rgb(var(--code-bg)); color: rgb(var(--code-fg));
  padding: 1rem 1.1rem; border-radius: var(--radius); overflow-x: auto; margin: 0;
  border: 1px solid rgb(var(--rule));
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

/* ---------- layout ---------- */
.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.measure { max-width: 42rem; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.between { justify-content: space-between; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.aside { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .two, .three, .aside { grid-template-columns: 1fr; } }

/* ---------- the mark ---------- */
/* An open loop, closed by a check: watch, act, and the loop only closes
 * when the result is proven. The check leaves through the gap the loop
 * left. The same file is the console's favicon; the same paths are its
 * sidebar mark. */
.mark { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; }
.mark .o { stroke: currentColor; stroke-width: 3.2; }
.mark .v { stroke: rgb(var(--gate)); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: rgb(var(--text)); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.035em; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; color: rgb(var(--gate)); }
.brand-mark {
  width: 1.7rem; height: 1.7rem; border-radius: 7px; flex: 0 0 auto;
  background: rgb(var(--solid)); display: grid; place-items: center;
}
.brand-mark .mark { width: 72%; height: 72%; vertical-align: 0; }
.brand-mark .o { stroke: rgb(var(--solid-fg)); }
.brand-mark .v { stroke: rgb(var(--mark-check)); }
.brand-sub { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--text-3)); margin-top: 0.35rem; font-weight: 400; }

/* The hero mark draws its check after the loop: the proof arrives last. */
.hero-mark { width: min(38vw, 17rem); height: auto; color: rgb(var(--text)); display: block; margin-inline: auto; }
.hero-mark .o { stroke: currentColor; stroke-width: 2.4; }
.hero-mark .v { stroke: rgb(var(--gate)); stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 900ms cubic-bezier(.2,.7,.2,1) 500ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-mark .v { stroke-dashoffset: 0; animation: none; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(var(--paper) / 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(var(--rule-2));
}
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; }
.nav { display: flex; gap: 0.15rem; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: rgb(var(--text-2)); font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: 6px;
}
.nav a:hover { color: rgb(var(--text)); background: rgb(var(--paper-3)); text-decoration: none; }
.nav a[aria-current="page"] { color: rgb(var(--text)); font-weight: 500; }
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: inherit; font-size: 0.9rem; font-weight: 500;
  padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
  border: 1px solid rgb(var(--rule)); background: rgb(var(--paper)); color: rgb(var(--text));
  transition: background 120ms, border-color 120ms, transform 120ms;
}
.btn:hover { background: rgb(var(--paper-3)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-dark {
  background: rgb(var(--solid)); color: rgb(var(--solid-fg)); border-color: rgb(var(--solid));
}
.btn-dark:hover { filter: brightness(1.15); background: rgb(var(--solid)); }
.btn-gate { background: rgb(var(--gate)); color: white; border-color: rgb(var(--gate)); }
.btn-gate:hover { filter: brightness(1.06); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.theme-toggle { width: 2.1rem; height: 2.1rem; padding: 0; justify-content: center; border-radius: 999px; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } .hero-mark { width: 8rem; margin: 0; } }
.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgb(var(--text-3));
}
h1, h2, h3 { font-weight: 400; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.02; }
h2 { font-family: var(--display); font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.12; }
h3 { font-family: var(--body); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.005em; }
h1 em, h2 em, .display-em { font-style: italic; color: rgb(var(--gate)); }
.lede { font-size: 1.2rem; line-height: 1.55; color: rgb(var(--text-2)); max-width: 40rem; }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }

/* ---------- sections ---------- */
section.block { padding: clamp(2.5rem, 6vw, 5rem) 0; border-top: 1px solid rgb(var(--rule-2)); }
section.block > .wrap > .eyebrow { margin-bottom: 0.6rem; }
section.block h2 { margin-bottom: 1rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
.prose { color: rgb(var(--text-2)); }
.prose strong, .prose b { color: rgb(var(--text)); font-weight: 600; }
.prose h3 { margin: 1.75rem 0 0.5rem; color: rgb(var(--text)); }
.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.5rem; }
.pull {
  font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.25;
  color: rgb(var(--text)); margin: 0 0 1.25rem; max-width: 34rem;
}
.rule {
  border-left: 2px solid rgb(var(--gate)); padding-left: 1rem; color: rgb(var(--text-2));
  margin: 1.25rem 0;
}
.rule strong, .rule b { color: rgb(var(--text)); }
.where {
  display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; font-size: 0.85rem; color: rgb(var(--text-3));
  margin: 0.75rem 0 0;
}
.where .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.where code { color: rgb(var(--text-2)); }

/* ---------- cards & tables ---------- */
.card {
  background: rgb(var(--paper-2)); border: 1px solid rgb(var(--rule-2));
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4rem; }
.card p { color: rgb(var(--text-2)); font-size: 0.95rem; }
.card .eyebrow { margin-bottom: 0.35rem; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: rgb(var(--gate) / 0.6); }
a.card .go { color: rgb(var(--gate)); font-size: 0.85rem; margin-top: 0.5rem; display: block; }
.tablewrap { overflow-x: auto; }
table { width: 100%; min-width: 28rem; border-collapse: collapse; font-size: 0.93rem; }
th {
  text-align: left; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgb(var(--text-3)); font-weight: 500; padding: 0.55rem 0.7rem; border-bottom: 1px solid rgb(var(--rule));
}
td { padding: 0.6rem 0.7rem; border-bottom: 1px solid rgb(var(--rule-2)); vertical-align: top; color: rgb(var(--text-2)); }
td:first-child { font-family: var(--mono); font-size: 0.82rem; color: rgb(var(--text)); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--mono); font-size: 0.74rem; padding: 0.2rem 0.55rem;
  border: 1px solid rgb(var(--rule)); border-radius: 999px; color: rgb(var(--text-2));
}
.pill {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem; padding: 0.12rem 0.5rem;
  border-radius: 999px; border: 1px solid rgb(var(--rule)); color: rgb(var(--text-2)); white-space: nowrap;
}
.pill-ok { color: rgb(var(--ok)); border-color: rgb(var(--ok) / 0.4); }
.pill-warn { color: rgb(var(--warn)); border-color: rgb(var(--warn) / 0.4); }
.pill-bad { color: rgb(var(--bad)); border-color: rgb(var(--bad) / 0.4); }
.pill-gate { color: rgb(var(--gate)); border-color: rgb(var(--gate) / 0.5); background: rgb(var(--gate-soft) / 0.5); }
.pill-quiet { color: rgb(var(--text-3)); border-style: dashed; }

/* ---------- figures ---------- */
figure { margin: 1.5rem 0; }
.figbox {
  border: 1px solid rgb(var(--rule-2)); border-radius: var(--radius); background: rgb(var(--paper-2));
  padding: 1rem; overflow-x: auto;
}
.figbox svg { display: block; width: 100%; height: auto; min-width: 34rem; color: rgb(var(--text-2)); }
figcaption { font-size: 0.85rem; color: rgb(var(--text-3)); margin-top: 0.6rem; max-width: 42rem; }
/* The lifted architecture figures use the console's variable names. */
svg { --accent: var(--gate); --sev-ok: var(--ok); --sev-warn: var(--warn); --sev-critical: var(--bad); }

/* ---------- simulations ---------- */
.sim {
  border: 1px solid rgb(var(--rule)); border-radius: 14px; background: rgb(var(--paper-2));
  box-shadow: var(--shadow); overflow: hidden;
}
.sim-head {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; border-bottom: 1px solid rgb(var(--rule-2)); background: rgb(var(--paper-3) / 0.6);
  min-height: 3.1rem;
}
.sim-head .eyebrow { margin-right: auto; }
.sim-head label { font-size: 0.85rem; display: inline-flex; gap: 0.5rem; align-items: center; }
.sim-body { padding: 1rem; }
/* The stage: every simulation declares its height once, here, and never
 * changes it. --sim-h is set per instance in the markup. */
.sim-body.stage { min-height: var(--sim-h, 20rem); display: flex; flex-direction: column; gap: 1rem; }
/* Narrower viewports wrap more, so the stage is given a fifth more room
 * before the phone breakpoint hands height back to the content. */
@media (max-width: 900px) { .sim-body.stage { min-height: calc(var(--sim-h, 20rem) * 1.2); } }
.sim-status { font-size: 0.85rem; color: rgb(var(--text-2)); min-width: 11rem; }
.dial { display: inline-flex; border: 1px solid rgb(var(--rule)); border-radius: 999px; padding: 0.15rem; background: rgb(var(--paper)); }
.dial button {
  font: inherit; font-size: 0.8rem; font-family: var(--mono); padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 0; background: transparent; color: rgb(var(--text-2)); cursor: pointer;
}
.dial button[aria-pressed="true"] { background: rgb(var(--solid)); color: rgb(var(--solid-fg)); }
.dial button:focus-visible { outline-offset: 0; }
.dial.small button { font-size: 0.72rem; padding: 0.2rem 0.55rem; }
input[type="range"] { accent-color: rgb(var(--gate)); width: 8rem; }
.sim select, .sim input[type="text"] {
  font: inherit; font-size: 0.82rem; font-family: var(--mono); padding: 0.3rem 0.5rem; border-radius: 6px;
  border: 1px solid rgb(var(--rule)); background: rgb(var(--paper)); color: rgb(var(--text));
}
/* One chevron, drawn, on every select — and room for the longest option.
 * The browser's own control clipped "defaults only — reads alone, writes
 * wait" to "rites wait" inside a header label. A select is a sentence
 * the reader chose; it has to be readable after they chose it. */
.sim select, .step select {
  appearance: none; -webkit-appearance: none;
  padding-right: 1.9rem; min-width: 12rem; max-width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23858fa8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 0.55rem center; background-size: 0.85rem;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.sim-head label { min-width: 0; flex: 0 1 auto; max-width: 100%; }
.sim-head label select { flex: 1 1 auto; }
.sim input[type="text"] { font-family: var(--body); font-size: 0.9rem; padding: 0.45rem 0.6rem; min-width: 11rem; }

/* The tape: a terminal-shaped strip of what the platform did, in order.
 * Its height is fixed by class, never by content. */
.tape {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.55;
  background: rgb(var(--ink-950)); color: rgb(var(--ink-300));
  border-radius: 10px; padding: 0.9rem 1rem; height: 16rem; overflow-y: auto;
  border: 1px solid rgb(var(--ink-800));
}
.tape.h-s { height: 10rem; } .tape.h-m { height: 13rem; } .tape.h-l { height: 18rem; }
.tape .l { display: flex; gap: 0.75rem; white-space: pre-wrap; animation: rise 260ms ease-out; }
.tape .t { color: rgb(var(--ink-600)); flex: 0 0 auto; }
.tape .k { color: rgb(var(--ink-500)); flex: 0 0 5.5rem; }
.tape .k.w { flex-basis: 7.5rem; }
.tape .learn { color: rgb(var(--ink-400)); }
.tape .signal { color: rgb(var(--ink-200)); }
.tape .spike { color: rgb(251 191 36); }
.tape .incident { color: rgb(248 113 113); }
.tape .plan { color: rgb(125 178 252); }
.tape .gate { color: rgb(96 165 250); font-weight: 600; }
.tape .ok { color: rgb(74 222 128); }
.tape .quiet { color: rgb(var(--ink-600)); font-style: italic; }
.tape .head { color: rgb(var(--ink-500)); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.3rem; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Charts: a canvas with a height decided in CSS and honoured in JS. */
.chart { display: block; width: 100%; height: 15rem; border-radius: 10px; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); }
.chart.tall { height: 19rem; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: rgb(var(--text-3)); }
.legend i { display: inline-block; width: 0.9rem; height: 0.2rem; border-radius: 2px; vertical-align: middle; margin-right: 0.35rem; }

.gate-card {
  border: 1.5px solid rgb(var(--gate)); border-radius: 10px; padding: 0.9rem 1rem; background: rgb(var(--gate-soft) / 0.35);
  display: flex; flex-direction: column; gap: 0.6rem;
}
/* The gate slot is always the size of the card it may hold. */
.gate-slot { min-height: 9.75rem; display: flex; flex-direction: column; }
.gate-slot .dormant {
  flex: 1; border: 1.5px dashed rgb(var(--rule)); border-radius: 10px; display: grid; place-items: center;
  color: rgb(var(--text-3)); font-size: 0.85rem; text-align: center; padding: 1rem;
}
.step-list { display: flex; flex-direction: column; gap: 0.4rem; min-height: 12.9rem; }
.step {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center;
  border: 1px solid rgb(var(--rule-2)); border-radius: 8px; padding: 0.5rem 0.7rem; background: rgb(var(--paper));
  font-size: 0.9rem; min-height: 2.9rem;
}
.step select { font: inherit; font-size: 0.82rem; font-family: var(--mono); padding: 0.3rem 0.5rem; border-radius: 6px; border: 1px solid rgb(var(--rule)); background: rgb(var(--paper)); color: rgb(var(--text)); }
.verdict {
  border-radius: 10px; padding: 0.9rem 1rem; border: 1px solid rgb(var(--rule));
  display: flex; flex-direction: column; gap: 0.35rem; background: rgb(var(--paper)); min-height: 8.6rem;
}
.verdict .big { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.verdict[data-decision="autonomous"] .big, .verdict[data-decision="allowed"] .big { color: rgb(var(--ok)); }
.verdict[data-decision="approval"] .big { color: rgb(var(--gate)); }
.verdict[data-decision="two_person"] .big, .verdict[data-decision="denied"] .big { color: rgb(var(--bad)); }
.verdict[data-decision="notfound"] .big { color: rgb(var(--text-3)); }
.mode-readout { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.6rem; align-items: center; text-align: center; }
.mode-readout .box { border: 1px solid rgb(var(--rule)); border-radius: 10px; padding: 0.7rem; background: rgb(var(--paper)); min-height: 5.6rem; }
.mode-readout .box .eyebrow { margin-bottom: 0.3rem; }
.mode-readout .box .val { font-family: var(--mono); font-size: 1.05rem; line-height: 2.1rem; }
.mode-readout .op { font-family: var(--display); font-size: 1.6rem; color: rgb(var(--text-3)); }
.mode-readout .box.eff { border-color: rgb(var(--gate)); }
.consequence { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem; }
.consequence .c { border-radius: 8px; padding: 0.6rem 0.75rem; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); font-size: 0.9rem; min-height: 4.4rem; }
.consequence .c b { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(var(--text-3)); margin-bottom: 0.2rem; }
.consequence .c[data-on="true"] { border-color: rgb(var(--ok) / 0.5); }
.consequence .c[data-on="false"] { opacity: 0.6; }
.toggles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toggles label { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid rgb(var(--rule)); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.85rem; cursor: pointer; background: rgb(var(--paper)); }
.toggles label:has(input:checked) { border-color: rgb(var(--gate) / 0.6); }
.proposal { display: flex; flex-direction: column; gap: 0.35rem; min-height: 17rem; }
.proposal .p { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: 7px; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); }
.proposal .p .why { color: rgb(var(--text-3)); font-size: 0.82rem; }
.proposal .skip { color: rgb(var(--text-3)); font-size: 0.85rem; padding: 0.2rem 0.6rem; }
.stepper { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; min-height: 2.2rem; }
.stepper .s { font-family: var(--mono); font-size: 0.78rem; padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid rgb(var(--rule)); color: rgb(var(--text-3)); }
.stepper .s[data-at="true"] { background: rgb(var(--solid)); color: rgb(var(--solid-fg)); border-color: rgb(var(--solid)); }
.stepper .arrow { color: rgb(var(--text-3)); }
.note { font-size: 0.9rem; color: rgb(var(--text-2)); border-radius: 8px; padding: 0.7rem 0.85rem; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); min-height: 5.4rem; margin: 0; }
.note.bad { border-color: rgb(var(--bad) / 0.5); }
.note.ok { border-color: rgb(var(--ok) / 0.5); }
.note.short { min-height: 3.6rem; }

/* Rows: a fixed number of same-height lines, so a list re-rendered with
 * different content stays exactly where it was. */
.rows { display: flex; flex-direction: column; gap: 0.35rem; }
.rows .r {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; align-items: center;
  border: 1px solid rgb(var(--rule-2)); border-radius: 8px; padding: 0.45rem 0.65rem; background: rgb(var(--paper));
  font-size: 0.88rem; min-height: 2.75rem;
}
.rows .r .m { font-family: var(--mono); font-size: 0.78rem; color: rgb(var(--text)); white-space: pre; }
.rows .r .d { color: rgb(var(--text-3)); font-size: 0.8rem; }
.rows .r[data-state="held"] { opacity: 0.55; }
.rows .r[data-state="ran"] { border-color: rgb(var(--ok) / 0.5); }
.rows .r[data-state="skipped"] { border-color: rgb(var(--rule)); }
.rows .r[data-state="regated"] { border-color: rgb(var(--warn) / 0.5); }
.rows .r[data-state="new"] { border-color: rgb(var(--warn) / 0.6); }
.rows .r[data-state="late"] { border-color: rgb(var(--bad) / 0.5); }
.rows .r[data-state="dup"] { opacity: 0.5; text-decoration: line-through; }
.rows .r .stack-2 { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.rows .r .ell { overflow: hidden; text-overflow: ellipsis; }
.rows .r .d.ell { white-space: nowrap; }

/* Four phases of the first look, each a card of fixed height. */
.phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
@media (max-width: 760px) { .phases { grid-template-columns: 1fr 1fr; } }
.phase-card { border: 1px solid rgb(var(--rule-2)); border-radius: 10px; padding: 0.7rem 0.8rem; background: rgb(var(--paper)); min-height: 12.5rem; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.phase-card .eyebrow { margin: 0; }
.phase-card h4 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.phase-card .out { color: rgb(var(--text-2)); }
.phase-card[data-state="idle"] { opacity: 0.55; }
.phase-card[data-state="running"] { border-color: rgb(var(--gate)); }
.phase-card[data-state="done"] { border-color: rgb(var(--ok) / 0.5); }
.phase-card[data-state="skipped"] { border-color: rgb(var(--warn) / 0.5); }
.phase-card[data-state="gap"] { border-color: rgb(var(--bad) / 0.5); }

/* The log-pattern catalog. */
.catalog { display: flex; flex-direction: column; gap: 0.3rem; height: 13rem; overflow-y: auto; }
.catalog .pat { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.78rem; padding: 0.35rem 0.55rem; border-radius: 6px; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); }
.catalog .pat .n { color: rgb(var(--text-3)); }
.catalog .pat[data-new="true"] { border-color: rgb(var(--warn) / 0.7); }
.catalog .pat .tpl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pattern-var { color: rgb(var(--gate)); }

/* The grant checklist and what the product says when one is missing. */
.says { display: flex; flex-direction: column; gap: 0.35rem; min-height: 15.5rem; }
.says .s { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 0.6rem; align-items: baseline; font-size: 0.88rem; padding: 0.4rem 0.6rem; border-radius: 7px; background: rgb(var(--paper)); border: 1px solid rgb(var(--rule-2)); min-height: 2.5rem; }
.says .s code { font-size: 0.78rem; }

/* Graph canvas legend list */
.kv { display: grid; grid-template-columns: 1fr; gap: 0.1rem 0.75rem; font-size: 0.85rem; align-content: start; height: 19rem; overflow-y: auto; }
.kv .k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(var(--text-3)); padding-top: 0.15rem; }
.kv .v { color: rgb(var(--text-2)); min-height: 1.3rem; margin-bottom: 0.5rem; }

/* The index of simulations on the home page. */
.sim-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.75rem; }
.sim-index a.card { padding: 0.9rem 1rem; }
.sim-index h3 { font-size: 0.98rem; }
.sim-index p { font-size: 0.88rem; margin: 0; }

/* ---------- misc ---------- */
.principles { counter-reset: p; }
.principle { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid rgb(var(--rule-2)); }
.principle .n { font-family: var(--display); font-size: 2.2rem; line-height: 1; color: rgb(var(--text-3)); }
.principle h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 0.3rem; }
.principle p { color: rgb(var(--text-2)); margin: 0; max-width: 40rem; }
.timeline { display: grid; gap: 0.75rem; }
.phase { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid rgb(var(--rule-2)); }
.phase .ph { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: rgb(var(--text-3)); text-transform: uppercase; padding-top: 0.25rem; }
.phase h3 { margin-bottom: 0.25rem; }
.phase p { color: rgb(var(--text-2)); font-size: 0.95rem; margin: 0; }
.doc-nav { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; padding: 1.5rem 0; border-top: 1px solid rgb(var(--rule-2)); font-size: 0.95rem; }
.site-footer { border-top: 1px solid rgb(var(--rule-2)); padding: 2rem 0 3rem; color: rgb(var(--text-3)); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.site-footer .brand { font-size: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  .mode-readout { grid-template-columns: 1fr; }
  .mode-readout .op { transform: rotate(90deg); }
  .principle, .phase { grid-template-columns: 1fr; gap: 0.25rem; }
  .nav a { padding: 0.35rem 0.45rem; font-size: 0.85rem; }
  .sim-body.stage { min-height: 0; }
}

/* The nine architecture figures were drawn against the console's token
 * names, which run in DARK order (--ink-50 is the lightest text). Rather
 * than rewrite eighty attributes, the figure box translates that vocabulary
 * into this site's theme-aware tokens, so the same drawings read correctly
 * on paper and in the dark. */
.figbox svg {
  --ink-50: var(--text); --ink-100: var(--text); --ink-200: var(--text-2); --ink-300: var(--text-2);
  --ink-400: var(--text-3); --ink-500: var(--text-3); --ink-600: var(--rule); --ink-700: var(--rule);
  --surface: var(--paper); --surface-raised: var(--paper-3); --surface-sunken: var(--paper-2);
  --accent: var(--gate); --accent-subtle: var(--gate-soft);
  --sev-ok: var(--ok); --sev-warn: var(--warn); --sev-critical: var(--bad); --sev-info: var(--gate);
}
