/* ==========================================================================
   SISF landing page · "The Blueprint"
   Light theme = whiteprint (ink on drafting film). Dark theme = cyanotype
   (pale lines on Prussian blue). One signal colour marks the issue and the
   active state; one fault colour marks failure and rollback. Fault is never
   carried by colour alone: it also gets an X, a dashed line or a text label.

   Line grammar used everywhere on the page:
     solid    = main line
     dashed   = conditional path (retry, rollback)
     dotted   = planned, not built yet
     dash-dot = factory boundary
     hatch    = trusted zone that agents cannot write

   Sections: 1 fonts · 2 tokens · 3 base · 4 header · 5 sheets · 6 buttons
   7 hero · 8 run the line · 9 what · 10 architecture · 11 rules
   12 tables · 13 roadmap · 14 get started · 15 docs + final · 16 footer
   17 no-js · 18 reduced motion
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, latin subset, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* Arrow and comparison glyphs live in a tiny extra file; declared after the
   main face so the browser checks it first for these code points only. */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-arrows-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+2190-2193, U+2264-2265;
}
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
/* One arrows file serves all three mono weights (same URL, fetched once). */
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-arrows-500.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+2190-2193, U+2264-2265; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-arrows-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+2190-2193, U+2264-2265; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-arrows-500.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+2190-2193, U+2264-2265; }
/* Metric-matched fallbacks keep layout shift small while the web fonts load. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("ArialMT");
  size-adjust: 102%; ascent-override: 86.08%; descent-override: 20.59%; line-gap-override: 0%;
}
@font-face {
  font-family: "Plex Mono Fallback";
  src: local("Menlo"), local("Courier New"), local("CourierNewPSMT");
  size-adjust: 99.8%; ascent-override: 102.7%; descent-override: 27.5%; line-gap-override: 0%;
}

/* ---------- 2. Tokens ---------- */
:root {
  --table: #E2E9F0;      /* drafting table behind the sheets (decorative) */
  --grid: #D2DCE6;       /* major grid on the table (decorative) */
  --grid-minor: #DCE4EC; /* minor grid (decorative) */
  --paper: #F3F6F9;      /* sheet surface */
  --paper-2: #E8EEF4;    /* filled cells */
  --ink: #0E2A47;        /* text and primary strokes, 13.4:1 on paper */
  --soft: #3F5A77;       /* secondary text, 6.6:1 on paper */
  --line: #687F99;       /* hairlines only, never text. 3.8:1 on paper */
  --signal: #B93C0A;     /* the issue, active state, focus. 5.2:1 on paper */
  --fault: #B42318;      /* failure and rollback. 6.1:1 on paper */
  --sans: "Archivo", "Archivo Fallback", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Plex Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --head-h: 61px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #061830; --grid: #0F2D50; --grid-minor: #0B2445;
    --paper: #0A2240; --paper-2: #0F2C50;
    --ink: #E8F0F8; --soft: #A9C0D8; --line: #6F90B4;
    --signal: #FF8A3D; --fault: #FF7A6E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --table: #061830; --grid: #0F2D50; --grid-minor: #0B2445;
  --paper: #0A2240; --paper-2: #0F2C50;
  --ink: #E8F0F8; --soft: #A9C0D8; --line: #6F90B4;
  --signal: #FF8A3D; --fault: #FF7A6E;
  color-scheme: dark;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  overflow-wrap: break-word;
  background-color: var(--table);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); }
h2 { font-weight: 800; font-size: clamp(2rem, 1.45rem + 2.1vw, 3rem); line-height: 1.06; letter-spacing: -.025em; }
h3 { font-weight: 700; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.01em; }
h4 { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; border: 1px solid var(--soft); border-bottom-width: 2px; text-align: center; line-height: 1.4; }
b, strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[id] { scroll-margin-top: calc(var(--head-h) + 12px); }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; display: inline-flex; align-items: center; min-height: 44px; background: var(--ink); color: var(--paper); padding: 0 16px; font: 600 15px var(--sans); }
.skip:focus { top: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.nw { white-space: nowrap; }
.mono { font-family: var(--mono); }
.wrap { max-width: 1240px; margin: 0 auto; }

/* shared text styles */
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); margin-bottom: 10px; }
.lead { font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem); line-height: 1.55; color: var(--soft); max-width: 40em; }
.fine { font-size: 14px; line-height: 1.55; color: var(--soft); }
.h-mini { font: 600 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 12px; }
.h-mini code { font-size: 1em; text-transform: none; letter-spacing: .02em; color: var(--ink); }
.h-mid { font-size: 1.375rem; font-weight: 800; letter-spacing: -.015em; }
.sec-head { display: grid; gap: 14px; margin-bottom: 28px; }
.sec-head .eyebrow { margin-bottom: -4px; }
@media (min-width: 1100px) {
  .sec-head { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: 48px; align-items: end; margin-bottom: 36px; }
  .sec-head .eyebrow, .sec-head h2 { grid-column: 1; }
  .sec-head .lead { grid-column: 2; grid-row: 1 / span 2; }
}

/* "not built yet" tag: always dotted, never a link */
.tag-na { display: inline-block; font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border: 1px dotted currentColor; color: var(--soft); white-space: nowrap; }

/* ---------- 4. Header ---------- */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.head-in { position: relative; max-width: 1400px; margin: 0 auto; min-height: 60px; padding: 0 12px; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-issue { fill: var(--signal); }
.brand-name { font: 800 19px/1 var(--sans); letter-spacing: .1em; }
.brand-sub { display: none; padding-left: 10px; border-left: 1px solid var(--line); font: 500 10px/1.25 var(--mono); letter-spacing: .1em; color: var(--soft); text-transform: uppercase; }
.nav-desk { display: none; }
.nav-desk a, .menu-panel a { display: flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; color: var(--soft); font: 500 14.5px/1.2 var(--sans); }
.nav-desk a { padding: 0 8px; }
.nav-desk a:hover, .menu-panel a:hover { color: var(--ink); text-decoration: underline; }
.idx { font: 500 10px var(--mono); letter-spacing: .06em; color: var(--soft); }
.head-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.iconbtn, .navbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 10px; border: 1.5px solid var(--ink);
  background: var(--paper); color: var(--ink); font: 600 13.5px/1 var(--sans);
  text-decoration: none; cursor: pointer;
}
.iconbtn:hover, .navbtn:hover { background: var(--paper-2); }
.iconbtn svg, .navbtn svg { width: 18px; height: 18px; flex: none; }
.navbtn .lbl { display: none; }
/* mobile menu: a native <details>, so it opens and closes without JS */
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: var(--paper); }
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 1.5px; padding: 4px 16px 12px;
  background: var(--paper); border-bottom: 1.5px solid var(--ink);
  max-height: calc(100vh - var(--head-h)); overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
.menu-panel a { border-bottom: 1px solid var(--line); font-size: 16px; color: var(--ink); }
.menu-panel .idx { width: 24px; }
@media (min-width: 600px) {
  .navbtn .lbl { display: inline; }
  .navbtn { padding: 0 14px; }
  .menu-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@media (min-width: 1100px) {
  .head-in { padding: 0 20px; }
  .nav-desk { display: flex; gap: 0; margin-left: 8px; }
  .menu { display: none; }
}
@media (min-width: 1380px) { .brand-sub { display: block; } .nav-desk a { padding: 0 10px; } }

/* ---------- 5. Drawing sheets ---------- */
.sheet { position: relative; margin: 8px; padding: 6px; border: 1px solid var(--line); background: var(--paper); }
.sheet-in { position: relative; border: 1.5px solid var(--ink); padding: 26px 14px 28px; }
.ruler-x, .ruler-y, .sheet-tab { display: none; }
@media (min-width: 768px) {
  .sheet { margin: 12px; padding: 20px; }
  .sheet + .sheet { margin-top: 18px; }
  .sheet-in { padding: 40px 28px 40px; }
  .ruler-x { position: absolute; left: 20px; right: 20px; top: 0; height: 20px; display: grid; grid-template-columns: repeat(6, 1fr); }
  .ruler-y { position: absolute; top: 20px; bottom: 20px; left: 0; width: 20px; display: grid; grid-template-rows: repeat(6, 1fr); }
  .ruler-x span, .ruler-y span { font: 500 10px/20px var(--mono); color: var(--soft); text-align: center; }
  .ruler-x span + span { border-left: 1px solid var(--line); }
  .ruler-y span { display: grid; place-items: center; }
  .ruler-y span + span { border-top: 1px solid var(--line); }
  .ruler-x span:nth-child(n+7) { display: none; }
  .sheet-tab { display: block; position: absolute; top: 0; left: 22px; transform: translateY(-50%); padding: 0 8px; background: var(--paper); font: 500 10px/1 var(--mono); letter-spacing: .14em; color: var(--soft); text-transform: uppercase; }
}
@media (min-width: 1100px) {
  .ruler-x { grid-template-columns: repeat(8, 1fr); }
  .ruler-x span:nth-child(n+7) { display: block; }
  .sheet-in { padding: 48px 40px 48px; }
  .sheet--lead .sheet-in { padding-top: 28px; }
}

/* ---------- 6. Buttons ----------
   Square plates. Hover lifts the plate off its print (hard offset shadow);
   press stamps it back down. */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 600 15.5px/1.1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background-color .16s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 0 var(--ink); }
.btn:active { transform: none; box-shadow: none; transition-duration: .05s; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { box-shadow: 3px 3px 0 0 var(--signal); }
/* planned control: dotted outline = not built yet. Never a link. */
.btn--planned { border: 2px dotted var(--soft); color: var(--soft); background: transparent; cursor: not-allowed; }
.btn--planned:hover, .btn--planned:active { transform: none; box-shadow: none; background: transparent; }
.cta-note, .credit { font: 400 12.5px/1.5 var(--mono); color: var(--soft); }
.cta-note.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 35% { background: var(--paper-2); color: var(--ink); box-shadow: 0 0 0 6px var(--paper-2); } }
@media (max-width: 420px) { .btn { padding: 0 15px; font-size: 15px; } .cta-row { gap: 10px; } }

/* ---------- 7. Hero ---------- */
.hero { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "status" "credit" "title" "lede" "cta"; padding-bottom: 8px; }
.h-status { grid-area: status; } .h-credit { grid-area: credit; } .h-title { grid-area: title; }
.h-lede { grid-area: lede; } .h-cta { grid-area: cta; }
@media (min-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; row-gap: 18px;
    grid-template-areas: "status credit" "title title" "lede cta"; }
  .h-credit { align-self: center; justify-self: end; text-align: right; }
  .h-cta { align-self: end; }
}
/* status: a revision cell, not a pill */
.status { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; border: 1.5px solid var(--ink); font: 500 12px/1.45 var(--mono); letter-spacing: .02em; }
.status-rev { display: flex; align-items: center; padding: 6px 10px; background: var(--ink); color: var(--paper); font-weight: 600; letter-spacing: .12em; }
.status-txt { display: flex; align-items: center; gap: 9px; padding: 6px 10px; flex: 1 1 0; min-width: 0; }
.status-sq { flex: none; width: 11px; height: 11px; border: 1.5px solid var(--signal); background: linear-gradient(90deg, var(--signal) 50%, transparent 50%); }
.credit strong { color: var(--ink); font-weight: 600; }
.h-title { font-weight: 800; font-size: clamp(2.5rem, 1.5rem + 3.6vw, 3.625rem); line-height: 1.02; letter-spacing: -.035em; }
.h-title span { display: block; font-weight: 300; color: var(--soft); letter-spacing: -.03em; }
@media (min-width: 1100px) { .h-title span { display: inline; } }
.h-lede { max-width: 40em; font-size: clamp(1.0625rem, .98rem + .3vw, 1.1875rem); line-height: 1.55; }
.h-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---------- 8. How it works: Run the line ---------- */
.how { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.how-head { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 1100px) {
  .how { margin-top: 30px; padding-top: 24px; }
  .how-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; align-items: end; margin-bottom: 14px; }
}
.how-body { display: grid; gap: 20px; }
@media (min-width: 900px) and (max-width: 1099.98px) {
  .how-body { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); column-gap: 32px; align-items: start; }
}
.line { margin: 0; min-width: 0; }
.line-stage { position: relative; }
.line-stage:focus-visible { outline-offset: 6px; }
.line-foot { display: grid; gap: 14px; align-items: start; min-width: 0; }
@media (min-width: 1100px) { .line-foot { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; } }

/* schematic: two layouts, one visible at a time */
.schem { display: block; width: 100%; height: auto; }
.schem--wide { display: none; }
.schem--tall { max-width: 440px; margin: 0 auto; }
@media (min-width: 1100px) { .schem--wide { display: block; } .schem--tall { display: none; } }

.schem text { font-family: var(--mono); fill: var(--ink); }
.t-lane { font-size: 10px; font-weight: 600; letter-spacing: .1em; }
.t-lane--sm { font-size: 8.5px; letter-spacing: .04em; }
.schem .t-zone { font-family: var(--sans); font-weight: 800; font-size: 22px; }
.t-zone--sm { font-size: 16px; }
.schem .t-note { font-size: 9px; fill: var(--soft); letter-spacing: .02em; }
.schem .t-ink { fill: var(--ink); font-weight: 600; }
.schem .t-fault { fill: var(--fault); font-weight: 600; }
.t-l1 { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-anchor: middle; }
.schem .t-l2 { font-size: 10px; fill: var(--soft); text-anchor: middle; }
.schem--tall .t-l1 { font-size: 11px; letter-spacing: 0; }
.schem--tall .t-l2 { font-size: 9.5px; }
.t-bal { font-size: 9px; font-weight: 600; text-anchor: middle; }
.boundary { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-dasharray: 18 4 3 4; }
.lane-line { stroke: var(--line); stroke-width: 1; }
.label-bg { fill: var(--paper); }
.st-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; transition: stroke .2s, fill .2s; }
.balloon { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.eq-box { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.schem .eq-l1 { font-size: 10px; font-weight: 600; letter-spacing: .08em; fill: var(--soft); }
.schem .eq-l2 { font-size: 9.5px; fill: var(--soft); }
.hatch { fill: url(#hatch); stroke: var(--ink); stroke-width: 1; }
.hatch-bg { fill: var(--paper); }
.hatch-ln { stroke: var(--soft); stroke-width: 1.1; }
.route { fill: none; stroke: var(--soft); stroke-width: 2; }
.trail, .rb-trail { fill: none; stroke-width: 3; opacity: 0; }
.trail { stroke: var(--signal); }
.rb-trail { stroke: var(--fault); }
.trail[data-ready], .rb-trail[data-ready] { opacity: 1; }
.retry { fill: none; stroke: var(--soft); stroke-width: 1; stroke-dasharray: 4 3; }
.rb-path { fill: none; stroke: var(--fault); stroke-width: 1.25; stroke-dasharray: 6 4; }
.ar-soft { fill: var(--soft); }
.ar-fault { fill: var(--fault); }
.port { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.leader, .dim line, .dim path { stroke: var(--soft); stroke-width: 1; fill: none; }
.stamp rect { fill: none; stroke: var(--signal); stroke-width: 2; }
.stamp .stamp-in { stroke-width: .75; }
.schem .t-stamp { font-family: var(--sans); font-weight: 800; font-size: 15px; letter-spacing: .24em; fill: var(--signal); text-anchor: middle; }
.schem .t-stamp2 { font-size: 8.5px; font-weight: 600; letter-spacing: .08em; fill: var(--signal); text-anchor: middle; }
.schem--tall .t-stamp { font-size: 13px; }
.schem--tall .t-stamp2 { font-size: 8px; letter-spacing: 0; }

/* live states, driven by app.js */
.st.is-active .st-box { stroke: var(--signal); stroke-width: 2.5; }
.st.is-active .t-l1 { fill: var(--signal); }
.st.is-fault .st-box { stroke: var(--fault); }
.st.is-fault .t-l1 { fill: var(--fault); }
.st.is-done .st-box { fill: var(--ink); }
.schem .st.is-done text { fill: var(--paper); }
.seg { fill: transparent; stroke: var(--line); stroke-width: 1; transition: fill .25s, stroke .25s; }
.seg[data-seg="1"] { transition-delay: .48s; }
.seg[data-seg="2"] { transition-delay: .96s; }
.seg.is-on { fill: var(--signal); stroke: var(--signal); }
.seg.is-fault { fill: var(--fault); stroke: var(--fault); transition-delay: 0s; }
.receipt, .tag-rb, .tag-blocked { opacity: 0; transition: opacity .25s; }
.receipt.is-on, .tag-rb.is-on, .tag-blocked.is-on { opacity: 1; }
.receipt rect, .tag-rb rect, .tag-blocked rect { fill: var(--paper); stroke-width: 1.25; }
.receipt rect { stroke: var(--signal); }
.tag-rb rect, .tag-blocked rect { stroke: var(--fault); }
.schem .receipt text, .schem .tag-rb text, .schem .tag-blocked text { font-size: 8px; font-weight: 600; letter-spacing: .06em; text-anchor: middle; }
.schem .receipt text { fill: var(--signal); letter-spacing: .01em; }
.schem .tag-rb text, .schem .tag-blocked text { fill: var(--fault); }
.schem--tall .receipt text { font-size: 7.5px; letter-spacing: 0; }
.token-body { fill: var(--signal); stroke: var(--paper); stroke-width: 1.5; }
.token-halo { fill: none; stroke: var(--signal); stroke-width: 1.25; opacity: 0; transform-box: fill-box; transform-origin: center; }
.token-x { stroke: var(--paper); stroke-width: 1.8; opacity: 0; }
.token.is-dwell .token-halo { animation: halo 1.3s ease-out infinite; }
.token.is-fault .token-body { fill: var(--fault); }
.token.is-fault .token-halo { stroke: var(--fault); }
.token.is-fault .token-x { opacity: 1; }
@keyframes halo { 0% { opacity: .9; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.35); } }

/* intro: the sheet drafts itself. Solid lines draw, parts fade in. */
.d0 { --i: 0; } .d1 { --i: 1; } .d2 { --i: 2; } .d3 { --i: 3; } .d4 { --i: 4; } .d5 { --i: 5; }
.d6 { --i: 6; } .d7 { --i: 7; } .d8 { --i: 8; } .d9 { --i: 9; } .d10 { --i: 10; }
.js .schem .lane-line, .js .schem .route { animation: draw .9s var(--ease) both; }
.js .schem .route { animation-duration: 1.2s; animation-delay: .55s; }
.js .schem .fade { animation: fadein .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
@keyframes draw { 0% { stroke-dasharray: 1; stroke-dashoffset: 1; } 99% { stroke-dasharray: 1; stroke-dashoffset: 0; } 100% { stroke-dasharray: none; stroke-dashoffset: 0; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
/* off screen, every animation in the drawing holds still (class set by app.js) */
.line.is-off .schem, .line.is-off .schem * { animation-play-state: paused; }

/* readout */
.readout { border: 1.5px solid var(--ink); background: var(--paper); min-width: 0; }
.ro-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 12px 6px; }
.ro-k { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.ro-state { font: 600 17px/1.2 var(--mono); overflow-wrap: anywhere; }
.ro-zone { margin-left: auto; font: 500 11px var(--mono); letter-spacing: .06em; color: var(--soft); text-transform: uppercase; }
.ro-note { padding: 0 12px 12px; min-height: calc(4 * 1.5em + 12px); font-size: 15px; line-height: 1.5; color: var(--soft); }
@media (min-width: 600px) { .ro-note { min-height: calc(3 * 1.5em + 12px); } }
.ruler { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)) 6px repeat(2, minmax(0, 1fr)); }
.ruler li { padding: 6px 0 5px; border: 1px solid var(--line); border-left-width: 0; font: 500 8px/1 var(--mono); color: var(--soft); text-align: center; overflow: hidden; }
.ruler li:first-child { border-left-width: 1px; }
.ruler li:nth-child(14) { grid-column: 15; border-left-width: 1px; }
.ruler li.fail { border-style: dashed; border-color: var(--fault); }
.ruler li.is-done { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 -3px 0 var(--signal); }
.ruler li.is-cur { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.ruler li.fail.is-done { box-shadow: inset 0 -3px 0 var(--fault); }
.ruler li.fail.is-cur { background: var(--fault); border-color: var(--fault); color: var(--paper); }
@media (min-width: 480px) { .ruler li { font-size: 9px; } }
.controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.ctl:hover { background: var(--paper-2); }
.ctl:active { transform: translateY(1px); }
.ctl svg { width: 12px; height: 12px; flex: none; }
.ctl .i-play { display: none; }
.ctl[data-state="paused"] .i-play { display: inline; }
.ctl[data-state="paused"] .i-pause { display: none; }
.ctl-box { width: 12px; height: 12px; border: 1.5px solid currentColor; flex: none; }
.ctl[aria-pressed="true"] { background: var(--fault); border-color: var(--fault); color: var(--paper); }
.ctl[aria-pressed="true"] .ctl-box { background: linear-gradient(45deg, transparent 43%, currentColor 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, currentColor 43% 57%, transparent 57%); }
@media (max-width: 380px) { .ctl { padding: 0 11px; } }
.keys { padding: 0 12px 12px; font: 400 12px/1.7 var(--mono); color: var(--soft); }
.keys kbd { font-size: 11px; color: var(--ink); }

/* title block */
.tblock { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: 1.5px; background: var(--ink); border: 1.5px solid var(--ink); min-width: 0; }
.tb { background: var(--paper); padding: 7px 10px 8px; min-width: 0; }
.tb dt { font: 500 9.5px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.tb dd { margin: 2px 0 0; font: 500 14px/1.4 var(--sans); }
.tb dd.mono { font: 600 14px/1.35 var(--mono); letter-spacing: .04em; }
.tb.s2, .tb.s3, .tb.s4 { grid-column: 1 / -1; }
.tb.half { grid-column: auto; }
@media (min-width: 600px) {
  .tblock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb.s2 { grid-column: span 2; } .tb.s3 { grid-column: span 3; } .tb.s4 { grid-column: 1 / -1; }
}
@media (min-width: 900px) and (max-width: 1099.98px) {
  .tblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb.s2, .tb.s3, .tb.s4 { grid-column: 1 / -1; }
  .tb.half { grid-column: auto; }
}
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 11.5px/1.5 var(--mono); color: var(--soft); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 26px; height: 8px; flex: none; }
.legend line { stroke: var(--ink); stroke-width: 1.5; }

/* state schedule: the readable list of all 15 states (and the no-JS fallback) */
.schedule { margin-top: 22px; border: 1.5px solid var(--ink); }
.schedule > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-height: 52px; padding: 12px 48px 12px 14px; cursor: pointer; list-style: none; position: relative; }
.schedule > summary::-webkit-details-marker { display: none; }
.schedule > summary h3 { font-size: 1.0625rem; }
.sum-meta { font: 500 11.5px/1.4 var(--mono); color: var(--soft); letter-spacing: .04em; }
.schedule > summary:hover { background: var(--paper-2); }
/* plus / minus drawn as two strokes */
.schedule > summary::after, .rule-tog { content: ""; position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: linear-gradient(currentColor, currentColor) center / 16px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 16px no-repeat; }
.schedule[open] > summary::after, .rule[open] .rule-tog { background: linear-gradient(currentColor, currentColor) center / 16px 2px no-repeat; }
.states { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.states li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.states li:first-child { border-top: 0; }
.s-n { grid-row: 1 / span 3; font: 600 12px/1.6 var(--mono); color: var(--soft); }
.s-name { font: 600 15px/1.4 var(--mono); }
.s-zone { font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.s-note { grid-column: 2; margin-top: 4px; font-size: 15px; line-height: 1.5; }
.s-next { grid-column: 2; margin-top: 2px; font: 400 12.5px/1.5 var(--mono); color: var(--soft); }
.states li.is-fail { border-left: 3px dashed var(--fault); padding-left: 11px; }
.states li.is-fail .s-name { color: var(--fault); }
.states li.is-cur { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--signal); }
@media (min-width: 768px) {
  .states li { grid-template-columns: 40px 190px 170px minmax(0, 1fr); column-gap: 16px; }
  .s-n { grid-row: auto; }
  .s-name, .s-zone { padding-top: 1px; }
  .s-note { grid-column: 4; grid-row: 1; margin-top: 0; }
  .s-next { grid-column: 4; }
}

/* ---------- 9. What SISF is ---------- */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5px; background: var(--ink); border: 1.5px solid var(--ink); }
.notes li { position: relative; background: var(--paper); padding: 18px 16px 20px 58px; }
.note-n { position: absolute; left: 14px; top: 17px; display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid var(--ink); border-radius: 50%; font: 600 11px var(--mono); }
.notes h3 { margin-bottom: 6px; }
.notes p { color: var(--soft); }
@media (min-width: 768px) { .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .notes { grid-template-columns: repeat(4, minmax(0, 1fr)); } .notes li { padding: 20px 18px 22px; } .note-n { position: static; margin-bottom: 14px; } }
.what-foot { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 900px) { .what-foot { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 40px; align-items: start; } }
.xlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.xlist li { position: relative; padding-left: 28px; }
/* an X: excluded from the first release */
.xlist li::before { content: ""; position: absolute; left: 2px; top: .42em; width: 13px; height: 13px;
  background: linear-gradient(45deg, transparent 43%, var(--soft) 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, var(--soft) 43% 57%, transparent 57%); }
.plate { border: 1.5px solid var(--ink); padding: 20px; display: grid; gap: 8px; background: var(--paper-2); box-shadow: 6px 6px 0 0 var(--ink); margin-right: 6px; }
.plate-big { font: 800 clamp(1.5rem, 1.2rem + 1vw, 1.875rem)/1.1 var(--sans); letter-spacing: -.02em; }
.plate-sub { font: 600 13px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--signal); }
.plate-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---------- 10. Architecture ---------- */
.detail { border-top: 1.5px solid var(--ink); padding: 28px 0 36px; display: grid; gap: 20px; }
.detail:last-child { padding-bottom: 0; }
.detail-head { display: grid; gap: 10px; }
.detail-head p:not(.detail-tag) { color: var(--soft); max-width: 44em; }
.detail-tag { justify-self: start; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 6px 9px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); }
@media (min-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 48px; align-items: start; }
  .detail > :not(.detail-head) { grid-column: 2; }
  .detail-head { grid-row: 1 / span 4; position: sticky; top: calc(var(--head-h) + 24px); }
}

/* Detail A: zone plan */
.plan { display: grid; gap: 14px; min-width: 0; }
.plan-gh { justify-self: start; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1.5px solid var(--ink); font: 400 13px/1.4 var(--mono); color: var(--soft); }
.plan-gh span { font-weight: 600; color: var(--ink); letter-spacing: .1em; text-transform: uppercase; }
/* dash-dot outline = factory boundary (CSS borders cannot draw dash-dot) */
.dd { position: relative; }
.dd::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  --dd: var(--ink) 0 18px, transparent 18px 22px, var(--ink) 22px 25px, transparent 25px 29px;
  background:
    repeating-linear-gradient(90deg, var(--dd)) top left / 100% 1.5px no-repeat,
    repeating-linear-gradient(90deg, var(--dd)) bottom left / 100% 1.5px no-repeat,
    repeating-linear-gradient(180deg, var(--dd)) top left / 1.5px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--dd)) top right / 1.5px 100% no-repeat; }
.plan-boundary { padding: 30px 12px 12px; }
.plan-label code { font-size: 1em; text-transform: none; }
.plan-label { position: absolute; top: -8px; left: 14px; padding: 0 6px; background: var(--paper); font: 600 11px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.zones { display: grid; gap: 12px; }
@media (min-width: 900px) { .zones { grid-template-columns: repeat(3, minmax(0, 1fr)); } .plan-boundary { padding: 32px 16px 16px; } }
.zone { border: 1.5px solid var(--ink); padding: 14px; display: grid; gap: 8px; align-content: start; background: var(--paper); }
.zone-k { font: 800 26px/1 var(--sans); }
.zone-k--sm { font-size: 13px; font-family: var(--mono); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.zone-d { font-size: 14.5px; color: var(--soft); }
.units { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.units li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--soft); }
.units code { font-size: 13px; font-weight: 600; color: var(--ink); }
/* hatch = trusted zone that agents cannot write */
.unit--trusted { border: 1.5px solid var(--ink) !important; padding-left: 26px !important; position: relative;
  background: repeating-linear-gradient(45deg, var(--soft) 0 1px, transparent 1px 6px) left / 16px 100% no-repeat; }
.shared { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
@media (min-width: 900px) { .units--row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Detail B: QA */
.qa-grid { display: grid; gap: 28px; min-width: 0; }
@media (min-width: 768px) { .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } .receipt-card { grid-column: 1 / -1; } }
.rubric { position: relative; display: grid; grid-template-columns: 30fr 25fr 20fr 15fr 10fr; border: 1.5px solid var(--ink); margin-top: 4px; }
.rubric span { padding: 10px 2px 10px 7px; font: 600 14px/1 var(--mono); text-align: left; }
/* numbers sit left in each cell so the 85* marker (inside the 15 cell) never crosses one */
.rubric span + span { border-left: 1px solid var(--ink); }
.rubric span:nth-child(odd) { background: var(--paper-2); }
.rubric::after { content: ""; position: absolute; left: 85%; top: -7px; bottom: -12px; border-left: 2px solid var(--signal); }
.pass { position: relative; height: 26px; }
.pass span { position: absolute; right: calc(15% + 6px); top: 6px; font: 600 11.5px/1 var(--mono); color: var(--signal); white-space: nowrap; }
.rubric-legend { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.rubric-legend b { display: inline-block; width: 30px; font: 600 13px var(--mono); }
.gate-list { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: g; display: grid; gap: 6px; }
@media (min-width: 480px) and (max-width: 767.98px) { .gate-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gate-list li { counter-increment: g; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1.5px solid var(--ink); font-size: 14.5px; line-height: 1.3; }
.gate-list li::before { content: "G" counter(g); flex: none; width: 26px; font: 600 11px var(--mono); color: var(--fault); }
.receipt-card { border: 1.5px solid var(--signal); padding: 16px; position: relative; }
.receipt-card .h-mini { color: var(--signal); }
.receipt-dl { margin: 0 0 12px; display: grid; gap: 0; font-family: var(--mono); font-size: 13px; }
.receipt-dl div { display: grid; grid-template-columns: minmax(0, 1fr); padding: 6px 0; border-top: 1px dashed var(--line); }
.receipt-dl dt { font-weight: 600; }
.receipt-dl dd { margin: 0; color: var(--soft); overflow-wrap: anywhere; }
@media (min-width: 600px) { .receipt-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } .receipt-dl div { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; } }
@media (min-width: 1100px) { .receipt-dl { grid-template-columns: repeat(3, minmax(0, 1fr)); } .receipt-dl div { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Detail C: canary */
.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: p; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.pipeline li { counter-increment: p; position: relative; display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1.5px solid var(--ink); font: 500 13px/1.35 var(--mono); }
.pipeline li + li { margin-top: 14px; }
.pipeline li + li::before { content: ""; position: absolute; left: 22px; top: -15.5px; height: 14px; border-left: 1.5px solid var(--ink); }
.pipeline li::after { content: counter(p, decimal-leading-zero); order: -1; font-size: 11px; color: var(--soft); }
@media (min-width: 768px) {
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .pipeline li + li { margin-top: 0; }
  .pipeline li + li::before { display: none; }
  .pipeline li { flex-direction: column; gap: 4px; }
}
@media (min-width: 1100px) {
  .pipeline { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
  .pipeline li + li::before { display: block; left: -11.5px; top: 50%; width: 10px; height: 0; border-left: 0; border-top: 1.5px solid var(--ink); }
}
.canary-grid { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 900px) { .canary-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 32px; align-items: start; } }
.chart { margin: 0; display: grid; gap: 8px; }
.chart svg { display: block; width: 100%; height: auto; max-width: 460px; border: 1px solid var(--line); background: var(--paper); }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--soft); }
.ch-steps rect { fill: var(--paper-2); stroke: var(--line); stroke-width: 1; }
.chart .ch-steps text { fill: var(--ink); font-weight: 600; text-anchor: middle; }
.ch-axis { stroke: var(--ink); stroke-width: 1.25; }
.ch-thr { stroke: var(--fault); stroke-width: 1.25; stroke-dasharray: 6 4; }
.ch-base { stroke: var(--line); stroke-width: 1; }
.chart .ch-lbl--fault { fill: var(--fault); font-weight: 600; }
.ch-ok { fill: none; stroke: var(--ink); stroke-width: 2; }
.ch-bad { fill: none; stroke: var(--fault); stroke-width: 2; stroke-dasharray: 5 3; }
.ch-x { fill: var(--paper); stroke: var(--fault); stroke-width: 2; }
.ch-rb { fill: none; stroke: var(--fault); stroke-width: 1.25; stroke-dasharray: 5 3; }
.rules-dl { margin: 0; display: grid; gap: 0; }
.rules-dl div { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.rules-dl div:first-child { border-top: 1.5px solid var(--ink); }
.rules-dl dt { font: 600 11.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.rules-dl dd { margin: 0; font-size: 15px; color: var(--soft); }
@media (min-width: 600px) { .rules-dl div { grid-template-columns: 150px minmax(0, 1fr); gap: 16px; } }

/* Detail D: section cut */
.cut { display: grid; grid-template-columns: minmax(0, 1fr); border: 1.5px solid var(--ink); }
.cut-side { padding: 16px; }
.cut-k { font: 600 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.cut-side--sup .cut-k { color: var(--ink); }
.cut-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.cut-wall { display: flex; justify-content: space-between; align-items: center; min-height: 30px; padding: 0 8px;
  border-block: 1.5px solid var(--ink);
  background: repeating-linear-gradient(45deg, var(--soft) 0 1.5px, var(--paper) 1.5px 7px); }
.cut-wall span { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); font: 600 11px var(--mono); }
@media (min-width: 600px) {
  .cut { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); }
  .cut-wall { flex-direction: column; padding: 8px 0; border-block: 0; border-inline: 1.5px solid var(--ink); }
}
.cond { list-style: none; margin: 0; padding: 0; counter-reset: c; display: grid; gap: 10px; }
@media (min-width: 768px) { .cond { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; } }
.cond li { counter-increment: c; position: relative; padding: 0 0 0 40px; font-size: 15px; }
.cond li::before { content: counter(c); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border: 1.5px solid var(--ink); font: 600 12px var(--mono); }

/* Detail E: five surfaces on one bus */
.ports { display: grid; gap: 0; min-width: 0; }
.port-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.port-list li { position: relative; display: grid; gap: 4px; padding: 12px; border: 1.5px solid var(--ink); background: var(--paper); font-size: 14px; color: var(--soft); }
.port-list b { font: 600 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.bus { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 14px; background: var(--ink); color: var(--paper); font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.ports .fine { margin-top: 14px; }
@media (min-width: 600px) { .port-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .port-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .port-list li::after { content: ""; position: absolute; left: 50%; bottom: -21.5px; height: 20px; border-left: 1.5px solid var(--ink); }
  .bus { margin-top: 20px; }
}

/* ---------- 11. Philosophy: seven rules ---------- */
.rules-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.rules { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.rules > li { border-bottom: 1.5px solid var(--ink); }
.rule > summary { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; align-items: baseline; min-height: 64px; padding: 18px 48px 18px 0; cursor: pointer; list-style: none; }
.rule > summary::-webkit-details-marker { display: none; }
.rule > summary:hover .rule-t h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.rule-n { font: 800 22px/1.15 var(--sans); color: var(--signal); }
.rule-t { display: grid; gap: 4px; min-width: 0; }
.rule-t h3 { font-size: clamp(1.1875rem, 1.05rem + .6vw, 1.5rem); font-weight: 800; letter-spacing: -.015em; }
.rule-g { color: var(--soft); overflow-wrap: anywhere; }
.rule-tog { right: 8px; }
@media (min-width: 768px) {
  .rule > summary { grid-template-columns: 76px minmax(0, 1fr); padding: 22px 56px 22px 0; }
  .rule-n { font-size: 28px; }
}
/* the contract note: a spec clause, set like a drawing note */
.contract { margin: 0 0 22px; border: 1.5px solid var(--ink); display: grid; background: var(--paper); }
.contract div { display: grid; gap: 4px; padding: 10px 14px; border-top: 1px solid var(--line); }
.contract div:first-child { border-top: 0; }
.contract dt { font: 600 11px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.contract dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .contract { margin-left: 88px; }
  .contract div { grid-template-columns: 160px minmax(0, 1fr); gap: 16px; }
}
.tid { display: inline-block; margin-right: 6px; padding: 1px 6px; border: 1.5px solid var(--ink); font: 600 12px/1.5 var(--mono); letter-spacing: .04em; }
.status-dd { justify-self: start; font: 600 12px/1.4 var(--mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 4px 8px; border: 1.5px dotted var(--soft); }
.foundation { margin-top: 40px; display: grid; gap: 12px; }

/* ---------- 12. Spec tables (stack into labelled rows on small screens) ---------- */
.spec, .rev { width: 100%; border-collapse: collapse; border: 1.5px solid var(--ink); font-size: 15px; }
.spec th, .rev thead th { font: 600 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); text-align: left; background: var(--paper-2); }
.spec th, .spec td, .rev th, .rev td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; text-align: left; }
.spec thead th, .rev thead th { border-top: 0; border-bottom: 1.5px solid var(--ink); }
.spec td + td, .spec th + th, .rev td, .rev thead th + th { border-left: 1px solid var(--line); }
.spec code { font-size: 14px; font-weight: 600; }
@media (max-width: 767.98px) {
  .resp, .resp tbody, .resp tr, .resp td, .resp tbody th { display: block; width: 100%; }
  .resp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .resp tr { border-top: 1.5px solid var(--ink); padding: 8px 0; }
  .resp tr:first-child { border-top: 0; }
  .resp td, .resp tbody th { border: 0 !important; padding: 4px 14px; }
  .resp td::before, .resp tbody th::before { content: attr(data-label); display: block; font: 600 10.5px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
}

/* ---------- 13. Roadmap ---------- */
.rev tbody th { font: 700 18px/1.3 var(--mono); width: 72px; }
.rev td:last-child { white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px; font: 600 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid var(--ink); }
.chip--prog::before { content: ""; width: 10px; height: 10px; border: 1.5px solid var(--signal); background: linear-gradient(90deg, var(--signal) 50%, transparent 50%); }
.chip--plan { border-style: dotted; border-color: var(--soft); color: var(--soft); }
.modes { margin-top: 32px; display: grid; gap: 14px; }
.plates { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.plates li { display: grid; gap: 2px; min-width: 132px; padding: 10px 14px; border: 1.5px solid var(--ink); }
.plates b { font-weight: 700; font-size: 16px; }
.plates span { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.plates li.planned { border: 2px dotted var(--soft); }
.plates li.planned b { color: var(--soft); font-weight: 600; }

/* ---------- 14. Get started ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.steps > li { position: relative; display: grid; align-content: start; gap: 10px; padding: 20px 16px 16px; border: 1.5px solid var(--ink); min-width: 0; }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 50%; font: 700 14px var(--mono); }
.steps p { color: var(--soft); }
.links { list-style: none; margin: 0; padding: 0; display: grid; }
.links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.links a::after { content: "→"; font-family: var(--mono); font-weight: 500; }
.cmd { display: flex; align-items: stretch; border: 1.5px solid var(--ink); background: var(--paper-2); min-width: 0; }
.cmd code { flex: 1 1 auto; min-width: 0; padding: 12px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cmd code::before { content: "$ "; color: var(--soft); }
.copy { flex: none; min-width: 64px; min-height: 44px; padding: 0 12px; border: 0; border-left: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.copy:hover { background: var(--soft); }
.copy-status { min-height: 1.5em; font: 400 12.5px/1.5 var(--mono); color: var(--soft); }
.soon { margin-top: 28px; border: 2px dotted var(--soft); padding: 20px 16px; display: grid; gap: 14px; }
.soon-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.soon .h-mid { color: var(--soft); }
.cmd--planned { align-self: start; border: 2px dotted var(--soft); background: transparent; align-items: center; padding-right: 10px; }
.cmd--planned code { color: var(--soft); }
.soon-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--soft); }
.soon-tose { display: grid; justify-items: start; gap: 10px; }
@media (min-width: 900px) { .soon { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; padding: 24px; } .soon-head, .soon-tose { grid-column: 1 / -1; } }

/* ---------- 15. Docs index + final CTA ---------- */
.index { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.index li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ix-n { font: 600 12px/44px var(--mono); color: var(--soft); }
.ix-t { display: inline-flex; align-items: center; justify-self: start; min-height: 44px; font-weight: 700; font-size: 1.0625rem; }
.ix-d { grid-column: 2; font-size: 14.5px; color: var(--soft); }
@media (min-width: 900px) {
  .index li { grid-template-columns: 64px minmax(0, 5fr) minmax(0, 7fr); column-gap: 20px; align-items: center; }
  .ix-d { grid-column: 3; }
}
.final { margin-top: 44px; position: relative; display: grid; gap: 22px; padding: 26px 18px; border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 4px; }
.final:focus-within { outline-color: var(--ink); }
.final h2 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); }
.final .lead { margin-top: 12px; }
.final-cta { display: grid; justify-items: start; gap: 12px; }
@media (min-width: 1100px) { .final { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; align-items: end; padding: 36px 40px; } }

/* ---------- 16. Footer: a title block ---------- */
.site-foot { margin: 18px 8px 8px; border: 1.5px solid var(--ink); background: var(--paper); }
@media (min-width: 768px) { .site-foot { margin: 18px 12px 12px; } }
.foot-in { display: grid; gap: 1.5px; background: var(--ink); }
.fc { background: var(--paper); padding: 18px 16px; min-width: 0; font-size: 14.5px; }
.fk { font: 600 10.5px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; }
.fk--gap { margin-top: 14px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.foot-brand svg { width: 22px; height: 22px; flex: none; }
.foot-tag { margin-top: 6px; color: var(--soft); }
.foot-credit { margin-top: 10px; font: 500 13px/1.5 var(--mono); }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.foot-note { display: block; margin-top: -8px; padding-bottom: 6px; font-size: 13px; color: var(--soft); }
@media (min-width: 900px) { .foot-in { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); } .fc { padding: 22px 24px; } }

/* ---------- 17. Without JavaScript ----------
   Everything stays readable: the state schedule is open, the drawing shows
   the whole line, and controls that need JS are hidden. */
.no-js [data-theme-toggle], .no-js .controls, .no-js .keys, .no-js [data-expand-all], .no-js .copy, .no-js .copy-status { display: none; }

/* ---------- 18. Reduced motion: nothing moves on its own ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover, .ctl:active { transform: none; }
}

/* ---------- Print: the sheets print as drawings ---------- */
@media print {
  body { background: #fff; }
  .site-head, .controls, .keys, .skip, .menu, .copy { display: none !important; }
  .sheet { margin: 0 0 12px; break-inside: avoid-page; }
  /* a drawing never scrolled into view still holds its intro at frame zero: print it finished */
  .schem, .schem * { animation: none !important; }
}
