/* Bo site, "Record": a daily record printed on paper.
   Light by default, the dark Record palette under prefers-color-scheme: dark. No theme
   switch, nothing stored in the browser. Inter and IBM Plex Mono are served from fonts/
   (SIL Open Font License 1.1; the licence files are beside them). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght.woff2") format("woff2-variations"), url("fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #F3F5F4;      /* the ground */
  --sheet: #FAFBFA;      /* a sheet laid on it */
  --sunk: #E8EBEA;       /* a recessed band */
  --ink: #16181B;
  --ink2: #33383F;
  --ink3: #4A5058;
  --rule: #C4C9CF;
  --grid: rgba(22, 24, 27, .055);
  --blue: #1F4FBF;
  --blue-h: #163A8F;
  --amber: #9A4A06;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1200px;
  --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121416;
    --sheet: #171A1D;
    --sunk: #1D2125;
    --ink: #ECEEF0;
    --ink2: #C3C9D1;
    --ink3: #A7AEB8;
    --rule: #343940;
    --grid: rgba(236, 238, 240, .04);
    --blue: #9DBBFF;
    --blue-h: #C3D5FF;
    --amber: #F2B077;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16.5px/1.6 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--blue-h); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
strong, b { font-weight: 650; }
em { font-style: normal; }
code, .mono { font-family: var(--mono); }
::selection { background: var(--blue); color: var(--paper); }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; border-radius: 3px; }
.skip:focus { top: 12px; color: var(--paper); }
.muted { color: var(--ink3); }
.caps { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }

/* a stamp scaling in near the right edge must not give the page a sideways scroll */
html { overflow-x: clip; }
/* ---------- Bo, the mascot ---------- */
.bo { display: block; overflow: visible; }
/* the cream edge belongs to the dark ground only (the <img> files carry the same rule inside) */
.bo .m-edge { display: none; }
@media (prefers-color-scheme: dark) { .bo .m-edge { display: inline; } }
/* the hero's drawing is inline, so its eyes can follow the pointer and blink; nothing in the face is redrawn */
/* only the iris moves, behind the lids */
.bo .m-iris { transition: transform .45s var(--ease); transform: translate(var(--ex, 0px), var(--ey, 0px)); }
.bo .m-eye { transform-box: view-box; transition: transform .08s ease-in; }
.bo.blink .m-eye { transform: scaleY(.08); }
.mark { width: 30px; height: auto; flex: none; }

/* ---------- Masthead ---------- */
.mast { padding-top: 18px; }
.mast-top { display: flex; align-items: center; gap: 24px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-name { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--ink3); padding-left: 12px; border-left: 1px solid var(--rule); margin-left: 2px; }
.site-nav ul { display: flex; gap: 26px; list-style: none; }
.site-nav a { color: var(--ink2); text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 6px 0; border-bottom: 1.5px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink); width: 40px; height: 36px; padding: 0; cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; display: block; margin: auto; }
.mast-line { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 8px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); font: 400 12px/1.4 var(--mono); color: var(--ink3); }

/* ---------- Buttons and links ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 3px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 15px; text-decoration: none; border: 1.5px solid var(--ink); transition: background-color .2s, border-color .2s, transform .2s var(--ease); }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.text-link { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1.5px; text-underline-offset: .3em; }
.text-link:hover { color: var(--ink); text-decoration-color: var(--ink); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin: 0; }

/* ---------- Tags and stage labels ---------- */
.tag {
  --rot: -1deg;
  display: inline-block; padding: 2px 7px 1px; border: 1.5px solid currentColor; border-radius: 3px;
  color: var(--ink2); font: 700 11px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  transform: rotate(var(--rot));
  text-shadow: .5px .4px 0 color-mix(in srgb, currentColor 30%, transparent);
  box-shadow: .8px .6px 0 color-mix(in srgb, currentColor 22%, transparent);
}
.tag.refused { color: var(--blue); }
.tag.back { color: var(--amber); }
tr:nth-child(2n) .tag, .entry:nth-child(2n) .tag { --rot: .8deg; }
tr:nth-child(3n) .tag, .entry:nth-child(3n) .tag { --rot: -1.8deg; }
.stage { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.4 var(--mono); color: var(--ink2); }
.stage svg { width: 13px; height: 13px; flex: none; }
.stage.built { color: var(--ink); }
.stage.planned { color: var(--ink3); }
.stages { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(28px, 4vw, 48px) 0 clamp(56px, 8vw, 104px);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  border-bottom: 1px solid var(--rule);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 21vw, 270px); gap: clamp(24px, 4vw, 64px); align-items: end; }
.hero-copy { padding-bottom: clamp(24px, 3vw, 40px); }
.status { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 12.5px/1.4 var(--mono); color: var(--ink2); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--amber); position: relative; }
.status-dot::after { content: ""; position: absolute; inset: 1.5px; border-radius: 50%; background: var(--amber); }
.hero h1 { font-size: clamp(42px, 5.7vw, 80px); line-height: 1; letter-spacing: -.035em; max-width: 15ch; margin-bottom: 22px; }
.lede { font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.55; color: var(--ink2); max-width: 60ch; margin-bottom: 26px; }
.hero-mascot { position: relative; align-self: end; margin-bottom: -3px; z-index: 2; }
.hero-mascot .bo { width: 100%; height: auto; }

/* The sheet: one day of the record, laid on the grid */
.sheet {
  position: relative; background: var(--sheet); border: 1px solid var(--ink); border-top-width: 2px;
  padding: clamp(18px, 2.6vw, 34px) clamp(16px, 3vw, 44px) clamp(16px, 2vw, 24px);
  box-shadow: 7px 7px 0 -1px var(--paper), 7px 7px 0 0 var(--rule);
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.sheet-head p { margin: 0; }
.sheet-head .mono { font-size: 12px; color: var(--ink3); }
.sheet-lead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 40px; align-items: center; padding: 22px 0 18px; }
.sheet-lead h2 { font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -.025em; margin-bottom: 10px; }
.sheet-lead p { margin: 0; color: var(--ink2); max-width: 58ch; }
.stamp {
  --rot: -4deg;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 16px 9px; min-width: 150px;
  border: 2px solid var(--blue); border-radius: 4px; color: var(--blue);
  transform: rotate(var(--rot));
  box-shadow: 1.2px 1px 0 color-mix(in srgb, var(--blue) 25%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--blue) 12%, transparent);
  filter: url(#ink-rough);
}
.stamp b { font-size: 12px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.stamp span { font: 500 12px/1.3 var(--mono); }

.ledger { width: 100%; border-collapse: collapse; }
.ledger th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.ledger td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger .no { font: 400 12px var(--mono); color: var(--ink3); width: 44px; }
.ledger .t { font: 500 12.5px var(--mono); width: 64px; }
.ledger .who { font: 400 12.5px var(--mono); color: var(--ink2); width: 130px; white-space: nowrap; }
.ledger .what { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.ledger .out { width: 112px; }
.sheet-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding-top: 14px; margin-top: -1px; border-top: 1px solid var(--ink); }
.sheet-foot p { margin: 0; font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.sheet-foot p.muted { color: var(--ink3); }
.seal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3px var(--blue); margin: 0 4px 0 3px; flex: none; }

/* typing: the full text keeps the row's height; the typed copy lies over it */
.typing-stack { display: grid; }
.typing-stack > * { grid-area: 1 / 1; }
.typing-stack .ghost { color: transparent; }
.typing-stack .typed.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -.15em; background: var(--blue); animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.rec-anim .ledger tbody tr { opacity: 0; }
.rec-anim .ledger tbody tr.on { opacity: 1; transition: opacity .25s; }
.rec-anim .ledger .tag, .rec-anim .stamp, .rec-anim .sheet-foot p, .chain-anim .entry .tag, .seal-anim .seal { opacity: 0; }
.rec-anim .ledger tr.stamped .tag, .chain-anim .entry.done .tag { animation: press .55s var(--ease) both; }
.rec-anim .stamp.landed { animation: land .7s var(--ease) both; }
.rec-anim .sheet-foot.sealed p { opacity: 1; transition: opacity .5s; }
.rec-anim .sheet-foot.sealed .seal-dot { animation: press .6s var(--ease) both; }
@keyframes press {
  0% { opacity: 0; transform: scale(1.9) rotate(calc(var(--rot) - 8deg)); }
  55% { opacity: 1; transform: scale(.92) rotate(var(--rot)); }
  75% { transform: scale(1.03) rotate(var(--rot)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--rot)); }
}
@keyframes land {
  0% { opacity: 0; transform: translateY(-24px) scale(1.5) rotate(-14deg); }
  50% { opacity: 1; transform: scale(.95) rotate(var(--rot)); }
  70% { transform: scale(1.02) rotate(var(--rot)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--rot)); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 136px) 0 0; }
.sec-head { border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: clamp(32px, 4.5vw, 56px); }
.sec-no { display: flex; align-items: baseline; gap: 14px; margin: 0 0 clamp(20px, 3vw, 34px); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink2); }
.sec-no span { font: 500 12px var(--mono); letter-spacing: 0; color: var(--blue); }
.sec-head h2, .closing h2 { font-size: clamp(32px, 4.6vw, 58px); letter-spacing: -.03em; line-height: 1.04; max-width: 19ch; }
.sec-head .lede { margin: 22px 0 0; }

.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.big { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.32; font-weight: 500; letter-spacing: -.015em; }
.big em { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.body { color: var(--ink2); border-left: 1px solid var(--rule); padding-left: clamp(20px, 3vw, 36px); }
.kicker { color: var(--ink); font-weight: 650; font-size: 18px; margin: 1.4em 0 0; display: flex; align-items: center; gap: 12px; }
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--ink); }

/* ---------- The attack as ledger entries ---------- */
.chain-bar, .entry { display: grid; grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1fr) 112px; gap: clamp(20px, 3vw, 40px); }
.chain-bar { padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); }
.chain { list-style: none; }
.entry { padding: clamp(24px, 3vw, 36px) 0; border-bottom: 1px solid var(--rule); align-items: start; }
.e-no { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.e-no b { font: 500 13px var(--mono); }
.e-no span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.e-label { display: none; }
.e-attack h3 { font-size: clamp(18px, 1.6vw, 21px); font-weight: 600; line-height: 1.3; margin-bottom: 10px; color: var(--ink3); }
.e-attack p { color: var(--ink3); margin: 0; font-size: 15.5px; }
.strike { background: linear-gradient(currentColor, currentColor) no-repeat 0 58% / 100% 1.5px; }
.e-answer h4 { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.3; margin-bottom: 10px; }
.e-answer p { color: var(--ink2); margin: 0; font-size: 15.5px; }
.e-answer .stages { margin-top: 14px; }
.e-out { margin: 2px 0 0; }
.e-bo { width: 104px; height: auto; margin: 18px 0 0 -6px; }
.chain-anim .entry .strike { background-size: 0% 1.5px; transition: background-size .6s var(--ease); }
.chain-anim .entry .e-attack h3, .chain-anim .entry .e-attack p { color: var(--ink); transition: color .5s; }
.chain-anim .entry .e-answer { opacity: 0; transform: translateY(8px); transition: opacity .5s .35s, transform .5s .35s var(--ease); }
.chain-anim .entry.done .strike { background-size: 100% 1.5px; }
.chain-anim .entry.done .e-attack h3, .chain-anim .entry.done .e-attack p { color: var(--ink3); }
.chain-anim .entry.done .e-answer { opacity: 1; transform: none; }
.chain-anim .entry.done .tag { animation-delay: .75s; }
.chain-foot { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 12.5px; color: var(--ink2); }
.chain-foot .seal-dot { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--blue); }

/* ---------- Layers ---------- */
.layers-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.js .tabs { gap: 6px; position: relative; z-index: 1; margin-bottom: -1px; }
.tab { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--rule); border-bottom-color: var(--ink); border-radius: 4px 4px 0 0; color: var(--ink2); font: 600 14px var(--sans); cursor: pointer; }
.tab b { font: 600 11px var(--mono); width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 2px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--sheet); border-color: var(--ink); border-bottom-color: var(--sheet); color: var(--ink); }
.tab[aria-selected="true"] b { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.tabs { display: none; }
.js .tabs { display: flex; }
.panel + .panel { margin-top: 12px; }
.js .panel + .panel { margin-top: 0; }
.panel { background: var(--sheet); border: 1px solid var(--ink); padding: clamp(20px, 3vw, 32px); border-radius: 0 4px 4px 4px; }
.panel h3 { font-size: 24px; margin: 14px 0 10px; }
.panel p { color: var(--ink2); }
.panel p:last-child { margin-bottom: 0; }
.ticks { list-style: none; display: grid; gap: 10px; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 26px; color: var(--ink2); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 12px; height: 6px; border-left: 1.8px solid var(--ink); border-bottom: 1.8px solid var(--ink); transform: rotate(-45deg) translateY(-50%); }
.ticks li strong { color: var(--ink); }
.layers-art .lz { width: 100%; height: auto; display: block; }
.lz .box { fill: none; stroke: var(--rule); stroke-width: 1.5; transition: stroke .3s, stroke-width .3s; }
.lz .t { font: 500 13px var(--mono); fill: var(--ink3); transition: fill .3s; }
.lz .agent rect { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; }
.lz .agent text { font: 600 16px var(--sans); fill: var(--ink); }
.lz .daemon rect { fill: var(--sheet); stroke: var(--blue); stroke-width: 2; }
.lz .daemon text { font: 600 14px var(--sans); fill: var(--blue); }
.lz .wire { fill: none; stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 4 5; transition: stroke .3s; }
.lz[data-layer="a"] .la .box, .lz[data-layer="b"] .lb .box, .lz[data-layer="c"] .lc .box { stroke: var(--ink); stroke-width: 2.5; }
.lz[data-layer="a"] .la .t, .lz[data-layer="b"] .lb .t, .lz[data-layer="c"] .lc .t { fill: var(--ink); font-weight: 600; }
.lz[data-layer="c"] .lc .box { stroke-dasharray: 8 6; }
.lz[data-layer="a"] .wa, .lz[data-layer="b"] .wb, .lz[data-layer="c"] .wc { stroke: var(--blue); animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -18; } }

.slip-wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); margin-top: clamp(72px, 9vw, 120px); align-items: center; }
.slip-wrap h3 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em; margin: 14px 0 12px; }
.slip-wrap p { color: var(--ink2); }
.slip-bo { width: clamp(120px, 13vw, 168px); height: auto; margin-top: 22px; }
.slip { background: var(--sheet); border: 1px solid var(--ink); box-shadow: 6px 6px 0 -1px var(--paper), 6px 6px 0 0 var(--rule); }
.slip-head { display: flex; justify-content: space-between; margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--rule); font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.slip pre { margin: 0; padding: 18px 16px 20px; font: 400 13.5px/1.7 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink); min-height: 10.5em; }
.slip .pr { color: var(--ink3); }
.slip .cm { color: var(--ink3); }
.slip .no { color: var(--blue); font-weight: 500; }
.slip-entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 10px 16px; border-top: 1px dashed var(--rule); font-size: 12px; color: var(--ink2); }
.term-anim .slip-entry { opacity: 0; transform: translateY(-4px); transition: opacity .4s, transform .4s var(--ease); }
.term-anim .slip-entry.on { opacity: 1; transform: none; }
.slip-note { font: 400 12px var(--mono); color: var(--ink3); margin: 12px 0 0; }

/* ---------- Stages ---------- */
.stages-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stage-col { padding: 4px clamp(18px, 2.6vw, 34px) 8px; border-left: 1px solid var(--rule); }
.stage-col:first-child { border-left: 0; padding-left: 0; }
.stage-col h3 { font-size: 24px; margin: 16px 0 8px; }
.stage-col > p { color: var(--ink2); }
.stage-col.planned h3 { color: var(--ink2); }
.numbered { list-style: none; counter-reset: n; border-top: 1px solid var(--ink); }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 34px 1fr; padding: 10px 0; border-bottom: 1px solid var(--rule); color: var(--ink2); font-size: 15.5px; }
.numbered li::before { content: counter(n, decimal-leading-zero); font: 400 12px/2 var(--mono); color: var(--ink3); }

/* ---------- Facts ---------- */
.facts { margin: 0; border-top: 1px solid var(--ink); }
.facts > div { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); padding-top: 4px; }
.facts dd { margin: 0; font-size: 17.5px; max-width: 60ch; }

/* ---------- Closing ---------- */
.closing-sec { padding-bottom: clamp(56px, 7vw, 96px); }
.closing { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 14px 0 0; }
.closing-copy { padding-bottom: clamp(32px, 5vw, 64px); }
.closing h2 { margin-bottom: 18px; }
.closing p { color: var(--ink2); max-width: 54ch; }
.closing .cta { margin-top: 28px; }
.closing-art { position: relative; display: flex; justify-content: center; align-items: end; min-height: 280px; }
.closing-art .bo { width: clamp(160px, 18vw, 220px); height: auto; margin-bottom: -2px; }
.seal { position: absolute; right: 0; top: 34px; width: clamp(120px, 13vw, 160px); height: auto; transform: rotate(-12deg); color: var(--blue); filter: url(#ink-rough); }
.seal .ring { fill: none; stroke: currentColor; stroke-width: 3; }
.seal .ring.thin { stroke-width: 1.5; }
.seal-text { font: 600 13.5px var(--mono); letter-spacing: .14em; fill: currentColor; }
.seal-mid { font: 800 19px var(--sans); letter-spacing: .16em; fill: currentColor; }
.seal-sub { font: 500 11px var(--mono); fill: currentColor; }
.seal-anim .seal.landed { --rot: -12deg; animation: land .8s var(--ease) both; }

/* ---------- Footer ---------- */
.site-footer { padding: 22px 0 44px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px 28px; }
.site-footer p { margin: 0; display: flex; align-items: center; gap: 10px; font: 400 12.5px var(--mono); color: var(--ink2); }
.site-footer .mark { width: 22px; }
.site-footer ul { display: flex; gap: 22px; list-style: none; }
.site-footer a { color: var(--ink2); font-size: 13px; font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Document pages ---------- */
.page-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--rule); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
.page-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 5vw, 72px); align-items: center; }
.page-hero h1 { font-size: clamp(40px, 5.6vw, 72px); letter-spacing: -.035em; line-height: 1.02; margin-bottom: 20px; }
.page-hero p:not(.sec-no) { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink2); max-width: 54ch; margin: 0; }
.page-hero .sec-no { margin-bottom: 22px; }
.art { width: 100%; height: auto; display: block; }
.art .box { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.6; }
.art .box.planned { fill: none; stroke: var(--ink3); stroke-dasharray: 6 5; }
.art .core { fill: var(--sheet); stroke: var(--blue); stroke-width: 2.2; }
.art .lbl { font: 600 13px var(--sans); fill: var(--ink); }
.art .sub { font: 400 11.5px var(--mono); fill: var(--ink3); }
.art .core-l { font: 700 15px var(--sans); fill: var(--blue); }
.art .wire { fill: none; stroke: var(--ink3); stroke-width: 1.4; stroke-dasharray: 4 5; animation: march 1.2s linear infinite; }
.art .wire.planned { animation: none; opacity: .6; }
.art .cap { font: 500 11px var(--mono); letter-spacing: .08em; fill: var(--ink3); }
.art .out { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-dasharray: 4 6; animation: march 1.4s linear infinite; }

.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(64px, 8vw, 112px); }
.toc { position: sticky; top: 24px; align-self: start; }
.toc h2 { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink3); padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.toc ol { list-style: none; counter-reset: t; }
.toc li { counter-increment: t; border-bottom: 1px solid var(--rule); }
.toc a { display: grid; grid-template-columns: 26px 1fr; padding: 8px 0; color: var(--ink2); text-decoration: none; font-size: 14px; line-height: 1.35; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 400 11.5px/1.7 var(--mono); color: var(--ink3); }
.toc a:hover, .toc a.active { color: var(--ink); }
.toc a.active::before { color: var(--blue); }
.doc-body { counter-reset: s; min-width: 0; }
.doc-section { padding: 0 0 clamp(48px, 6vw, 72px); }
.doc-section > h2 { font-size: clamp(26px, 2.8vw, 36px); letter-spacing: -.025em; margin-bottom: 18px; display: flex; gap: 14px; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 14px; }
.doc-body > .doc-section > h2::before { counter-increment: s; content: counter(s, decimal-leading-zero); font: 500 13px var(--mono); color: var(--blue); letter-spacing: 0; }
.doc-section .sec-head-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; order: -1; }
.doc-section > p, .doc-section li { color: var(--ink2); max-width: 70ch; }
.doc-section .footprint li, .doc-section .flow-steps li, .doc-section .leaves li { max-width: none; }
.doc-section h3 { font-size: 20px; margin: 40px 0 14px; }
.doc-section .ticks { margin-top: 18px; }
.stage-layer { font: 400 12px var(--mono); color: var(--ink3); }
.sec-tags { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: -4px 0 16px; }
.pull { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.45; font-weight: 500; color: var(--ink) !important; border-left: 2px solid var(--blue); padding: 2px 0 2px 22px; margin: 28px 0; }
.es { background: var(--sheet); border: 1px solid var(--ink); border-top-width: 2px; padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 40px) clamp(24px, 3vw, 40px); box-shadow: 7px 7px 0 -1px var(--paper), 7px 7px 0 0 var(--rule); margin-bottom: clamp(48px, 6vw, 72px); }
.es > h2 { border-top: 0; padding-top: 0; }
.reasons { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin: 18px 0 24px; }
.reasons li { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.reasons li:nth-child(2n) { padding-left: 18px; padding-right: 0; border-left: 1px solid var(--rule); }
.reasons li b { display: block; color: var(--ink); margin-bottom: 6px; font-size: 16px; }
.footprint:not(.reasons) { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.footprint:not(.reasons) li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.footprint svg { width: 22px; height: 22px; color: var(--ink); margin-top: 2px; }
table.events { width: 100%; border-collapse: collapse; margin: 22px 0 8px; font-size: 15px; }
table.events caption { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); padding-bottom: 8px; }
table.events th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--ink); border-top: 2px solid var(--ink); }
table.events td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink2); }
table.events td:first-child { color: var(--ink); }
.kind { display: inline-block; margin-top: 6px; padding: 1px 6px; border: 1.5px solid var(--ink3); border-radius: 3px; font: 700 10.5px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.kind.auth { border-color: var(--blue); color: var(--blue); }
.flow-steps { list-style: none; counter-reset: f; border-top: 1px solid var(--ink); }
.flow-steps li { counter-increment: f; display: grid; grid-template-columns: 34px 1fr; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.flow-steps li::before { content: counter(f, decimal-leading-zero); font: 400 12px/2 var(--mono); color: var(--ink3); }

/* privacy */
.stay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin: 18px 0 22px; }
.stay-grid > div { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--rule); }
.stay-grid > div:nth-child(2n) { padding-left: 18px; padding-right: 0; border-left: 1px solid var(--rule); }
.stay-grid b { display: block; margin-bottom: 4px; }
.stay-grid p { margin: 0; color: var(--ink2); font-size: 15.5px; }
.leaves { list-style: none; border-top: 2px solid var(--ink); margin: 18px 0 24px; counter-reset: l; }
.leaves li { counter-increment: l; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); max-width: none; }
.leaves li::before { content: counter(l, decimal-leading-zero); font: 400 12px/2 var(--mono); color: var(--ink3); grid-row: 1 / span 2; }
.leaves h3 { margin: 0; font-size: 17px; color: var(--ink); }
.leaves .stage { justify-self: end; }
.leaves dl { grid-column: 2 / -1; margin: 6px 0 0; display: grid; grid-template-columns: 76px 1fr; gap: 4px 14px; font-size: 15px; }
.leaves dt { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); padding-top: 3px; }
.leaves dd { margin: 0; color: var(--ink2); }
.note { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 16px 18px; border: 1px dashed var(--ink3); border-radius: 3px; }
.note svg { width: 20px; height: 20px; color: var(--ink2); margin-top: 2px; }
.note p { margin: 0; color: var(--ink2); }

/* 404 */
.nf { padding-bottom: clamp(64px, 8vw, 112px); }
.nf .page-hero .bo { width: clamp(150px, 18vw, 210px); height: auto; justify-self: center; }

/* ---------- Reveal ---------- */
.js .rv { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1080px) {
  .site-nav ul { gap: 18px; }
  .brand-sub { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 66px; z-index: 30; display: none; background: var(--paper); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 6px var(--gut) 12px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--rule); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding: 14px 0; border-bottom: 0; }
  .site-nav a[aria-current="page"] { color: var(--blue); }
  .mast { position: relative; }
  .cols, .layers-grid, .slip-wrap, .closing, .page-hero .wrap, .docs { grid-template-columns: minmax(0, 1fr); }
  .body { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 22px; }
  .chain-bar { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; }
  .e-no { flex-direction: row; align-items: baseline; gap: 12px; }
  .e-attack, .e-answer { grid-column: 1 / -1; }
  .e-out { grid-row: 1; grid-column: 2; }
  .e-bo { width: 76px; margin: 10px 0 0 auto; }
  .entry .e-label { display: block; margin: 0 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
  .e-answer { border-left: 2px solid var(--ink); padding-left: 16px; }
  .stages-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .stage-col { border-left: 0; padding: 0; }
  .toc { position: static; }
  .page-hero .art { max-width: 460px; }
  .closing-art { min-height: 240px; justify-content: flex-start; }
  .seal { right: auto; left: 190px; }
}
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 128px; gap: 12px; }
  .hero-copy { padding-bottom: 20px; }
  .hero h1 { margin-bottom: 18px; }
  .hero-mascot { grid-row: 1; grid-column: 2; align-self: start; margin: 0; }
  .hero-copy { grid-row: 1; grid-column: 1 / -1; }
  .hero h1, .status { max-width: calc(100% - 128px); }
  .sheet-lead { grid-template-columns: minmax(0, 1fr); }
  .stamp { justify-self: start; }
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: auto; }
  .ledger tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .ledger td { padding: 0; border: 0; }
  .ledger .who { white-space: normal; }
  .ledger .what { grid-column: 1 / -1; grid-row: 2; }
  .ledger .out { grid-column: 4; grid-row: 1; width: auto; }
  .reasons, .stay-grid { grid-template-columns: minmax(0, 1fr); }
  .reasons li:nth-child(2n), .stay-grid > div:nth-child(2n) { border-left: 0; padding-left: 0; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .leaves li { grid-template-columns: 30px minmax(0, 1fr); }
  .leaves .stage { grid-column: 2; justify-self: start; }
  .leaves dl { grid-template-columns: minmax(0, 1fr); }
  table.events thead { display: none; }
  table.events, table.events tbody, table.events tr, table.events td { display: block; }
  table.events tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  table.events td { border: 0; padding: 2px 0; }
  table.events td::before { content: attr(data-th); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-top: 6px; }
  .mast-line { font-size: 11px; }
  .mast-line > span { white-space: nowrap; }
  .mast-rest { display: none; }
  .tab { padding: 8px 10px; font-size: 13px; gap: 7px; white-space: nowrap; }
  .tabs { gap: 4px; }
  .status { font-size: 11.5px; }
}
@media (max-width: 420px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 104px; }
  .hero h1, .status { max-width: calc(100% - 100px); }
  .hero h1 { font-size: 40px; }
  .seal { left: 150px; width: 112px; }
  .closing-art .bo { width: 150px; }
}

/* ---------- Reduced motion: the finished page, still ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; transform: none; }
}
