/* Paratenic site — "specimen plate" under darkfield.
   Fraunces for display, IBM Plex Sans for reading, IBM Plex Mono for code and labels.
   Every colour is a token; diagrams are inline SVG styled by the same tokens. */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-var-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-var.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --field: #090d0e;
  --field-2: #0d1314;
  --panel: #111819;
  --panel-2: #162021;
  --rule: #233032;
  --rule-2: #31413f;
  --ink: #e8ede6;
  --ink-2: #a9b6b1;
  --ink-3: #7d8c87;
  /* stains: one role each */
  --stain: #5fe0c0;      /* the host, links, brand */
  --amber: #f0b44c;      /* runtimes: where agents actually run */
  --peri: #9aa8ff;       /* clients and AHP */
  --coral: #ff7d66;      /* inbox */
  --leaf: #8fd17a;       /* settled / ok */
  --blood: #f06272;      /* error / refused */
  --slate: #8796a8;      /* external hosts and systems */
  --lilac: #c69cf2;      /* protocols other than AHP */

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 66ch;
  --wide: 1240px;
  --gutter: clamp(1.1rem, 4vw, 3rem);
  --r: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  background-color: var(--field);
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--rule) 35%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--rule) 35%, transparent) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in oklab, var(--stain) 35%, transparent); }
a { color: var(--stain); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--stain); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
code, kbd, samp { font-family: var(--mono); font-size: .88em; }
:root { --code-ink: #cfe9e1; }
:not(pre) > code { color: var(--code-ink); background: color-mix(in oklab, var(--stain) 9%, var(--panel)); border: 1px solid var(--rule); padding: .06em .32em; border-radius: var(--r); overflow-wrap: break-word; }
pre { margin: 1.2rem 0; padding: 1rem 1.15rem; overflow-x: auto; background: var(--field-2); border: 1px solid var(--rule); border-left: 2px solid var(--stain); border-radius: var(--r); font: 400 14px/1.6 var(--mono); color: var(--code-ink); tab-size: 2; }
pre .c { color: var(--ink-3); }
pre .p { color: var(--stain); user-select: none; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: .6rem .9rem; background: var(--stain); color: #04120e; font-weight: 600; border-radius: var(--r); }
.skip:focus { top: .8rem; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--field) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
}
.masthead-in { max-width: var(--wide); margin: 0 auto; display: flex; align-items: center; gap: 2rem; padding: .7rem var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; flex: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand b { font: 560 1.22rem/1 var(--display); letter-spacing: -.01em; }
.brand:hover b { color: var(--stain); }
.masthead nav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.masthead nav::-webkit-scrollbar { display: none; }
.masthead nav a { flex: none; padding: .38rem .7rem; color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500; border-radius: 999px; border: 1px solid transparent; }
.masthead nav a:hover { color: var(--ink); border-color: var(--rule-2); }
.masthead nav a[aria-current="page"] { color: var(--field); background: var(--stain); }

/* ------------------------------------------------------------------ folio */
.folio { max-width: var(--wide); margin: 0 auto; padding: clamp(3rem, 8vw, 6.5rem) var(--gutter) 2.5rem; }
.plate-no { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.4rem; font: 500 .78rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--stain); }
.plate-no::after { content: ""; flex: 0 1 9rem; height: 1px; background: linear-gradient(to right, var(--stain), transparent); }
h1, h2, h3 { font-family: var(--display); font-weight: 420; letter-spacing: -.015em; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5.4rem); max-width: 17ch; font-weight: 380; }
h1 em, h2 em { font-style: italic; color: var(--stain); font-weight: 340; }
.lede { margin: 1.6rem 0 0; max-width: 58ch; font-size: clamp(1.08rem, 1.6vw, 1.28rem); line-height: 1.55; color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 560; }

/* ------------------------------------------------------------- page layout */
.sheet { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3.5rem; }
@media (min-width: 1120px) { .sheet.indexed { grid-template-columns: minmax(0, 1fr) 13.5rem; } }
.plates, .hero > *, .steps > li, .facts > div { min-width: 0; }
.plate-index { order: -1; margin: 0 0 2rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); background: color-mix(in oklab, var(--panel) 80%, transparent); font: 400 .82rem/1.45 var(--mono); }
.plate-index p { margin: 0 0 .5rem; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }
.plate-index ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.plate-index a { color: var(--ink-2); text-decoration: none; }
.plate-index a span { color: var(--ink-3); margin-right: .45rem; }
.plate-index a:hover, .plate-index a.here { color: var(--stain); }
@media (min-width: 1120px) {
  .plate-index { order: 2; position: sticky; top: 5.2rem; align-self: start; margin: 0; padding: 0 0 0 1.1rem; border: 0; border-left: 1px solid var(--rule); border-radius: 0; background: none; }
  .plate-index ol { display: block; }
  .plate-index li { margin: 0 0 .5rem; }
}

.plate { padding: 3.2rem 0 0; }
.plate + .plate { border-top: 1px solid var(--rule); margin-top: 3.2rem; }
.plate > header { margin-bottom: 1.5rem; }
.plate > header .plate-no { margin-bottom: .9rem; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); max-width: 24ch; }
h3 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; font-weight: 480; }
h4 { font: 600 .8rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 1.8rem 0 .5rem; }
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05rem; }
.prose li { margin: .3rem 0; }
.prose li::marker { color: var(--stain); }
.prose strong { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------- specimen figures */
.specimen { position: relative; margin: 2rem 0 2.4rem; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
.specimen::before, .specimen::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--stain); pointer-events: none; }
.specimen::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.specimen::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.fig-body { overflow-x: auto; padding: .4rem; scrollbar-color: var(--rule-2) transparent; }
.fig-body svg { display: block; width: 100%; height: auto; min-width: var(--fig-min, 0px); margin: 0 auto; }
.fig-body:focus-visible { outline-offset: -3px; }
.specimen figcaption { display: flex; gap: .9rem; align-items: baseline; padding: .75rem 1rem .85rem; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.specimen figcaption b { flex: none; font: 500 .74rem/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--stain); }
.specimen[data-scrolls] .fig-body { mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.specimen[data-scrolls] .fig-body[data-end] { mask-image: none; }
.specimen[data-scrolls] figcaption::after { content: "⟷ drag to pan"; margin-left: auto; flex: none; font: 500 .7rem/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.specimen.bleed { margin-left: calc(-1 * min(var(--gutter), 2rem)); margin-right: calc(-1 * min(var(--gutter), 2rem)); }

/* --------------------------------------------------------------- diagrams */
.dg { font-family: var(--sans); --k: var(--slate); }
.dg .k-host { --k: var(--stain); }
.dg .k-runtime { --k: var(--amber); }
.dg .k-client { --k: var(--peri); }
.dg .k-ext { --k: var(--slate); }
.dg .k-need { --k: var(--coral); }
.dg .k-ok { --k: var(--leaf); }
.dg .k-err { --k: var(--blood); }
.dg .k-proto { --k: var(--lilac); }
.dg .k-muted { --k: var(--ink-3); }
.dg .ground { fill: var(--panel); }
.dg .node { fill: color-mix(in oklab, var(--k) 11%, var(--panel)); stroke: var(--k); stroke-width: 1.4; }
.dg .node.ghost { fill: none; stroke-dasharray: 4 4; }
.dg .node.hollow { fill: var(--panel); }
.dg .node.solid { fill: var(--k); }
.dg .lbl { fill: var(--ink); font-weight: 600; }
.dg .sub { fill: var(--ink-2); }
.dg .tag { fill: var(--k); font-family: var(--mono); font-weight: 500; letter-spacing: .08em; }
.dg .m { font-family: var(--mono); }
.dg .edge { fill: none; stroke: var(--k); stroke-width: 1.5; }
.dg .edge.dash { stroke-dasharray: 6 5; }
.dg .edge.dot { stroke-dasharray: 2 4; }
.dg .tip { fill: var(--k); }
.dg .tip.open { fill: none; stroke: var(--k); stroke-width: 1.6; }
.dg .elabel { fill: var(--k); }
.dg .elabel.plain { fill: var(--ink-2); }
.dg .plate-bg { fill: var(--panel); fill-opacity: .94; }
.dg .grp { fill: color-mix(in oklab, var(--k) 5%, transparent); stroke: color-mix(in oklab, var(--k) 50%, transparent); stroke-width: 1.1; }
.dg .grp.dash { stroke-dasharray: 5 5; }
.dg .grp-t { fill: var(--k); font-family: var(--mono); font-weight: 500; letter-spacing: .1em; }
.dg .halo { stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; }
.dg .life { stroke: var(--rule-2); stroke-width: 1.3; stroke-dasharray: 3 5; }
.dg .note { fill: color-mix(in oklab, var(--k) 10%, var(--panel)); stroke: color-mix(in oklab, var(--k) 55%, transparent); }
.dg .note-t { fill: var(--k); }
.dg .frame { fill: color-mix(in oklab, var(--k) 4%, transparent); stroke: color-mix(in oklab, var(--k) 45%, transparent); }
.dg .frame-tag { fill: color-mix(in oklab, var(--k) 40%, var(--panel)); }
.dg .badge { fill: var(--panel); stroke: var(--k); stroke-width: 1.2; }
.dg .badge-t { fill: var(--k); font-weight: 600; }
.dg .key { fill: var(--ink-3); }
.dg .live { transform-box: fill-box; transform-origin: center; animation: breathe 2.6s ease-in-out infinite; }
.dg .ripple { transform-box: fill-box; transform-origin: center; animation: ripple 2.2s ease-out infinite; }
.dg .flow { stroke-dasharray: 3 9; animation: flow 1.6s linear infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes ripple { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .dg .live, .dg .ripple, .dg .flow { animation: none; } .dg .ripple { opacity: .35; } }

/* ---------------------------------------------------------------- ledgers */
.ledger-wrap { overflow-x: auto; margin: 1.4rem 0 2rem; border: 1px solid var(--rule); border-radius: var(--r); }
table.ledger { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--panel); }
.ledger th, .ledger td { padding: .6rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ledger thead th { font: 500 .72rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); background: var(--field-2); }
.ledger tbody tr:last-child td, .ledger tbody tr:last-child th { border-bottom: 0; }
.ledger tbody th { font-weight: 600; color: var(--ink); }
.ledger td { color: var(--ink-2); }
.ledger .y, .ledger .n, .ledger .p { font: 500 .8rem/1 var(--mono); white-space: nowrap; }
.ledger .y { color: var(--leaf); }
.ledger .n { color: var(--blood); }
.ledger .p { color: var(--amber); }

/* -------------------------------------------------------------- callouts */
.caution { max-width: var(--measure); margin: 1.6rem 0; padding: .9rem 1.1rem; border: 1px solid color-mix(in oklab, var(--coral) 45%, transparent); border-left: 3px solid var(--coral); background: color-mix(in oklab, var(--coral) 6%, var(--panel)); border-radius: var(--r); }
.caution b { color: var(--coral); }
.caution p { margin: .3rem 0 0; color: var(--ink-2); }


/* ------------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 3rem; align-items: center; padding-bottom: 1rem; }
@media (min-width: 1020px) { .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); padding-top: clamp(2.5rem, 5vw, 4.5rem); } }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 5rem); }
.nameplate { margin: 0 0 1.6rem; max-width: 46ch; font: italic 400 1rem/1.5 var(--display); color: var(--ink-2); }
.nameplate dfn { font-style: normal; font-weight: 560; color: var(--ink); letter-spacing: .02em; }
.nameplate i { color: var(--ink-3); margin-right: .2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2rem 0 0; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .62rem 1.05rem; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; background: color-mix(in oklab, var(--panel) 70%, transparent); }
.btn:hover { border-color: var(--stain); color: var(--stain); }
.btn.primary { background: var(--stain); border-color: var(--stain); color: #04120e; }
.btn.primary:hover { background: #8bf0d6; color: #04120e; }
.hero-dish { margin: 0; }
.dish-wrap svg { display: block; width: 100%; height: auto; max-width: 620px; margin: 0 auto; }
.dish-wrap .dg .ground, .dish-wrap .dg .halo { stroke: var(--field); }
.dish-key { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin-top: .4rem; font: 400 .8rem/1.4 var(--mono); color: var(--ink-2); text-align: center; }
.dish-key span { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .25rem 0; }
.sw { display: inline-block; width: 12px; height: 12px; margin: 0 .38rem 0 .95rem; border-radius: 50%; vertical-align: -1px; }
.sw:first-child { margin-left: 0; }
.sw.ring { border: 1.6px solid var(--c); }
.sw.ring.dashed { border-style: dashed; }
.sw.pill { width: 20px; border-radius: 7px; border: 1.4px solid var(--c); background: color-mix(in oklab, var(--c) 14%, transparent); }
.sw.core { background: radial-gradient(circle, var(--c) 0 30%, transparent 32%); border: 1.4px solid var(--rule-2); }
.sw.core.big { background: radial-gradient(circle, var(--c) 0 44%, transparent 46%); }
.sw.need { border: 1.4px solid var(--coral); background: radial-gradient(circle, var(--coral) 0 34%, transparent 36%); box-shadow: 0 0 0 3px color-mix(in oklab, var(--coral) 25%, transparent); }

/* ------------------------------------------------------------------ facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0; margin: 2.2rem 0 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.facts div { padding: 1rem 1.1rem 1.1rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: color-mix(in oklab, var(--panel) 60%, transparent); }
.facts dt { font: 380 2.3rem/1 var(--display); color: var(--stain); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.02em; }
.facts dt small { font-size: .5em; color: var(--ink-3); margin-left: .05em; }
.facts dd { margin: .45rem 0 0; color: var(--ink-2); font-size: .88rem; line-height: 1.35; }

/* --------------------------------------------------------- ledger extras */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ledger.tenancy { min-width: 40rem; }
.ledger code { overflow-wrap: normal; white-space: nowrap; }
.ledger-wrap[data-scrolls]:not([data-end]) { mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.ledger.tenancy thead th { font: 600 1rem/1.2 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink); vertical-align: middle; }
.ledger.tenancy thead th:first-child { width: 9.5rem; }
.tg { width: 22px; height: 22px; vertical-align: -6px; margin-right: .5rem; }
.ledger tbody th { font: 500 .78rem/1.35 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.ledger.proto tbody th { width: 7rem; }
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font: 500 .78rem/1.4 var(--mono); letter-spacing: .04em; text-transform: none; color: var(--k); border: 1px solid color-mix(in oklab, var(--k) 55%, transparent); background: color-mix(in oklab, var(--k) 10%, transparent); }
.chip.k-client { --k: var(--peri); } .chip.k-proto { --k: var(--lilac); } .chip.k-runtime { --k: var(--amber); } .chip.k-host { --k: var(--stain); }
.more { margin: 1.2rem 0 0; font-size: .95rem; color: var(--ink-3); }
.more a { font-weight: 500; }
.more a::after { content: " →"; }

/* --------------------------------------------------------- device strip */
.device-strip { display: flex; align-items: flex-end; justify-content: center; gap: clamp(.8rem, 3vw, 2.4rem); margin: 2rem 0 0; padding: 2.2rem 1rem 1.6rem; border: 1px solid var(--rule); border-radius: var(--r); background: radial-gradient(ellipse at 50% 120%, color-mix(in oklab, var(--peri) 12%, transparent), transparent 70%), var(--panel); }
.dev { display: block; height: auto; border: 6px solid #1b2224; outline: 1px solid var(--rule-2); box-shadow: 0 24px 60px -24px #000; background: #000; }
.dev.phone { width: min(24%, 230px); border-radius: 26px; }
.dev.watch { width: min(15%, 140px); border-radius: 34px; border-width: 8px; }
.dev.round { width: min(15%, 140px); border-radius: 50%; border-width: 9px; }

/* ------------------------------------------------------------------ steps */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 0; max-width: 52rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.6rem 3.4rem; border-left: 1px solid var(--rule-2); margin-left: 1rem; }
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: -1rem; top: -.1rem; width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid var(--stain); border-radius: 50%; background: var(--field); font: 500 .75rem/1 var(--mono); color: var(--stain); }
.steps h3 { margin: 0 0 .6rem; font-size: 1.25rem; }
.steps pre { margin: .4rem 0 .6rem; }
.steps p { margin: 0; color: var(--ink-2); max-width: var(--measure); font-size: .95rem; }

.boundary { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.boundary li { position: relative; padding: .7rem 0 .7rem 1.8rem; border-bottom: 1px dashed var(--rule-2); color: var(--ink-2); }
.boundary li::before { content: ""; position: absolute; left: .2rem; top: 1.15rem; width: 10px; height: 10px; border: 1.4px dashed var(--ink-3); border-radius: 50%; }
@media (max-width: 760px) {
  /* phones: crop to the dish itself; the rim of clients is named in the lede */
  .dish-wrap { overflow: hidden; }
  .dish-wrap svg { width: 142%; max-width: none; margin: -17% -21% -17%; }
  .dish-wrap .rim, .dish-key .k-rim { display: none; }
  .dev.phone { width: 38%; border-width: 4px; border-radius: 18px; }
  .device-strip { flex-wrap: wrap; }
  .dev.watch, .dev.round { width: 26%; }
  .steps li { padding-left: 2.4rem; }
  .facts dt { font-size: 1.9rem; }
}

/* ------------------------------------------------------------- laws */
.laws { list-style: none; counter-reset: law; margin: 0; padding: 0; max-width: 54rem; display: grid; gap: 0; }
.laws li { counter-increment: law; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.laws li::before { content: counter(law, upper-roman); grid-row: 1 / span 2; grid-column: 1; font: italic 400 1.6rem/1 var(--display); color: var(--stain); text-align: right; padding-top: .1rem; }
.laws b, .laws li > span { grid-column: 2; }
.laws b { display: block; color: var(--ink); font: 500 1.15rem/1.3 var(--display); margin-bottom: .2rem; }
.ledger.survive td { white-space: normal; min-width: 8.5rem; }
.ledger.can { min-width: 38rem; }
.ledger.opts tbody th, .ledger.cli tbody th, .ledger.trouble tbody th { text-transform: none; letter-spacing: 0; font: 400 .9rem/1.4 var(--sans); color: var(--ink); white-space: normal; width: 34%; }
.ledger.cli, .ledger.trouble { min-width: 36rem; }
.ledger.protos { min-width: 52rem; } .ledger.protos td.y, .ledger.protos td.p, .ledger.protos td.o { font: 400 .9rem/1.4 var(--sans); white-space: normal; } .ledger.protos td.y { color: var(--leaf); } .ledger.protos td.p { color: var(--amber); } .ledger.protos td.o { color: var(--ink-3); }
.ledger.limits { min-width: 36rem; } .ledger.limits td.num { font: 400 1.15rem/1.2 var(--display); color: var(--stain); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.ledger.limits tbody th { text-transform: none; letter-spacing: 0; font: 500 .92rem/1.35 var(--sans); color: var(--ink); white-space: normal; } .ledger.vis { min-width: 44rem; } .ledger.paths { min-width: 44rem; }
.ledger.can td.y, .ledger.can td.n, .ledger.can td.p, .ledger.can td.o { font: 400 .9rem/1.4 var(--sans); white-space: normal; }
.ledger.can td.y::before, .ledger.can td.n::before, .ledger.can td.p::before { display: inline-block; width: 1.1rem; font: 600 .9rem/1 var(--mono); }
.ledger.can td.y::before { content: "✓"; color: var(--leaf); } .ledger.can td.n::before { content: "×"; color: var(--blood); } .ledger.can td.p::before { content: "◐"; color: var(--amber); } .ledger.can td.o { color: var(--ink-3); }
.ledger.can tbody th, .ledger.paths tbody th { text-transform: none; letter-spacing: 0; font: 500 .92rem/1.35 var(--sans); color: var(--ink); white-space: normal; }
.ledger.paths tbody th a { color: var(--ink); text-decoration-color: var(--stain); }
.ledger.survive td.y, .ledger.survive td.n, .ledger.survive td.p, .ledger.survive td.o { font: 400 .88rem/1.4 var(--sans); white-space: normal; }
.ledger.survive td.y::before, .ledger.survive td.n::before, .ledger.survive td.p::before { display: inline-block; width: 1.1rem; font: 600 .9rem/1 var(--mono); }
.ledger.survive td.y::before { content: "✓"; color: var(--leaf); }
.ledger.survive td.n::before { content: "×"; color: var(--blood); }
.ledger.survive td.p::before { content: "◐"; color: var(--amber); }
.ledger.survive td.o { color: var(--ink-3); }
.ledger.survive { min-width: 44rem; }
.ledger.survive tbody th { text-transform: none; letter-spacing: 0; font: 500 .9rem/1.35 var(--sans); color: var(--ink); white-space: normal; }
.ledger.isnot tbody th { text-transform: none; letter-spacing: 0; font: italic 500 1.05rem/1.3 var(--display); color: var(--ink); width: 13rem; }

/* ---------------------------------------------------------- culture */
.screen { margin: 1.4rem 0; border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden; background: #070a0b; box-shadow: 0 30px 70px -38px #000; }
.screen::before { content: ""; display: block; height: 22px; border-bottom: 1px solid var(--rule); background:
  radial-gradient(circle at 14px 11px, var(--rule-2) 0 3.5px, transparent 4.5px),
  radial-gradient(circle at 28px 11px, var(--rule-2) 0 3.5px, transparent 4.5px),
  radial-gradient(circle at 42px 11px, var(--rule-2) 0 3.5px, transparent 4.5px), var(--panel-2); }
.screen img { display: block; width: 100%; height: auto; }
.screen figcaption { padding: .55rem .85rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-3); }
.screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.screens .screen { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.split .screen { margin: 0; }
.stack { display: grid; gap: 1rem; }
.split.petri { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; margin: 1.2rem 0; }
.split.petri .device-strip { align-items: center; }
.split.petri .ledger-wrap { margin: 0; }
.facets { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.facets li { padding: .9rem 1rem .95rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: .95rem; }
.facets li:nth-child(odd) { padding-right: 1.6rem; }
.facets b { display: block; margin-bottom: .2rem; font: 500 1.08rem/1.3 var(--display); color: var(--ink); }
kbd { display: inline-block; min-width: 1.5em; padding: .05em .4em; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); font: 500 .8em/1.4 var(--mono); color: var(--ink); text-align: center; }
.device-strip.slim { padding: 1.4rem .8rem 1.1rem; margin: 0; }
.device-strip.slim .dev.phone { width: min(30%, 170px); }
.ledger.keys { min-width: 24rem; }
.ledger.keys tbody th { text-transform: none; letter-spacing: 0; font: 400 .9rem/1.35 var(--sans); color: var(--ink); }
.lab { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 1.6rem; align-items: start; margin-top: 1rem; }
.lab > .dev.live { width: 100%; justify-self: center; align-self: center; }
.lab .prose .device-strip { margin-top: 1rem; }
@media (max-width: 760px) {
  .screens, .split, .split.petri, .facets, .lab { grid-template-columns: minmax(0, 1fr); }
  .facets li:nth-child(odd) { padding-right: 0; }
  .lab > .dev.live { width: 60%; }
}

/* ---------------------------------------------------------------- footer */
.colophon { border-top: 1px solid var(--rule); background: var(--field-2); }
.colophon-in { max-width: var(--wide); margin: 0 auto; padding: 2.6rem var(--gutter) 3rem; display: grid; gap: 1.6rem 3rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.colophon dfn { font: italic 400 1.35rem/1.3 var(--display); color: var(--ink); }
.colophon .def { margin: .45rem 0 0; max-width: 52ch; color: var(--ink-2); font-size: .95rem; }
.colophon .def i { color: var(--ink-3); }
.colophon ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: .35rem 2rem; font-size: .92rem; }
.colophon ul a { color: var(--ink-2); text-decoration: none; }
.colophon ul a:hover { color: var(--stain); }
.colophon small { grid-column: 1 / -1; color: var(--ink-3); font: 400 .78rem/1.5 var(--mono); }
@media (max-width: 760px) { .colophon-in { grid-template-columns: minmax(0, 1fr); } }

/* ----------------------------------------------------------- responsive */
@media (max-width: 760px) {
  body { font-size: 16px; background-size: 64px 64px; }
  .masthead-in { flex-wrap: wrap; gap: .4rem 1rem; padding-top: .6rem; padding-bottom: .5rem; }
  .masthead nav { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); width: calc(100% + 2 * var(--gutter));
    mask-image: linear-gradient(to right, #000 calc(100% - 3.5rem), transparent); }
  .masthead nav[data-end] { mask-image: none; }
  .plate-index { padding: .6rem 0; border-width: 1px 0; border-radius: 0; background: none; }
  .specimen figcaption::after { margin-left: 0; }
  .masthead nav a { padding: .32rem .6rem; font-size: .86rem; }
  html { scroll-padding-top: 7rem; }
  .specimen figcaption { flex-direction: column; gap: .2rem; }
  .specimen[data-scrolls] .fig-body { mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.specimen[data-scrolls] .fig-body[data-end] { mask-image: none; }
.specimen[data-scrolls] figcaption::after { content: "⟷ drag to pan"; margin-left: auto; flex: none; font: 500 .7rem/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.specimen.bleed { margin-left: 0; margin-right: 0; }
}

/* ----------------------------------------------------------------- print */
@media print {
  :root { color-scheme: light; --code-ink: #14302a; --field: #fff; --field-2: #fff; --panel: #fff; --panel-2: #f4f4f2; --rule: #c9cfcc; --rule-2: #9aa5a1; --ink: #111; --ink-2: #333; --ink-3: #555; --stain: #0b7a64; --amber: #9a6100; --peri: #3d4fc4; --coral: #c43a22; --leaf: #2f7a1f; --blood: #b0182c; --slate: #4d5b6b; --lilac: #7a3fb8; }
  body { background: #fff; font-size: 11pt; }
  .masthead, .plate-index, .skip { display: none; }
  .specimen, pre, .ledger-wrap { break-inside: avoid; }
  a { color: inherit; }
}
