/* The Double Entry: ledger paper, two inks.
   Second in the independence series after The Rogue Wave (orange, dark); sibling to The Abundance Gap (gold, dark),
   The Vanishing Point (teal, dusk) and The Broken Staircase (bone, rust). Same type system and the same reader.
   This one is the ledger: pale green account-book paper with a double red margin rule, and the two inks of
   bookkeeping. Blue ink = recovery (the credit side). Red ink = verification (the debit side). The two always balance.
   Status colours: green = proved, blue = confirmed, ochre = conjecture, slate = not claimed. */

:root {
  color-scheme: light;
  --paper: #eceee2;
  --paper-2: #e0e5d4;
  --card: #f8f9f1;
  --ink: #131d18;
  --ink-2: #3a463f;
  --ink-3: #626e66;
  --rule: #c2cab3;
  --rule-2: #d3dac6;
  --accent: #b0241c;            /* red ink: verify */
  --accent-ink: #fff6f3;
  --accent-soft: rgba(176,36,28,.1);
  --accent-text: #9d1f17;
  --blue: #1d4272;              /* blue ink: recover */
  --blue-text: #17375f;
  --blue-soft: rgba(29,66,114,.09);
  --proved: #2d6a42;
  --confirmed: #1d4272;
  --conj: #8d6a0c;
  --notc: #5d6878;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 30px -22px rgba(20,45,30,.5);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --measure: 38rem;
  --wide: 72rem;
  --led-0: #0a1511;
  --led-1: #11221b;
  --led-2: #1a3126;
  --on-dark: #e9eee2;
  --dim-on-dark: #9fb0a4;
  /* names the shared reader expects */
  --gold: var(--accent);
  --signal: var(--blue);
  --lost: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.62;
  text-rendering: optimizeLegibility; font-optical-sizing: auto;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(176,36,28,.2); color: var(--ink); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(var(--wide), calc(100% - 2.4rem)); margin-inline: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: -.015em; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--mono); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }
.lede { font-size: 1.42rem; line-height: 1.5; color: var(--ink-2); }
.small { font-size: .95rem; color: var(--ink-3); }
.mono { font-family: var(--mono); }
.rec { color: var(--blue-text); } .ver { color: var(--accent-text); }
em.rec, em.ver { font-style: italic; }
.dbl { display: inline-block; padding-bottom: .04em; border-bottom: 3px double currentColor; } /* the accountant's double underline: a total */

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
.brand svg { width: 2rem; height: 1.6rem; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand-tag { display: block; font-size: .58rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-family: var(--mono); }
@media (max-width: 700px) { .brand-tag { display: none; } }
.nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a.link { color: var(--ink-2); text-decoration: none; font-size: 1rem; }
.nav a.link:hover, .nav a.link[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.menu-btn { display: none; background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 6px; padding: .35rem .7rem; font: inherit; font-size: 1rem; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  .nav ul { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: flex-start; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 1rem 1.2rem; gap: .9rem; }
  .nav ul.open { display: flex; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-size: 1.05rem; padding: .75rem 1.4rem; border-radius: 3px; border: 1px solid currentColor; text-decoration: none; cursor: pointer; color: var(--ink); background: transparent; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); text-decoration: none; background: rgba(19,29,24,.05); }
.btn.gold { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.gold:hover { background: #8f1b14; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.on-dark .btn { color: var(--on-dark); }
.on-dark .btn:hover { background: rgba(255,255,255,.08); }
.on-dark .btn.gold { color: var(--accent-ink); background: #c4372c; border-color: #c4372c; }
.on-dark .btn.gold:hover { background: #d8483b; }

/* ---------- hero: a ledger page ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 2.1rem, rgba(70,110,90,.16) 2.1rem, rgba(70,110,90,.16) calc(2.1rem + 1px));
}
.hero::before { /* the double red margin rule of an account book */
  content: ""; position: absolute; top: 0; bottom: 0; left: max(.9rem, calc((100% - var(--wide)) / 2 - 1.6rem)); width: 5px; border-inline: 1px solid rgba(176,36,28,.55); z-index: -1;
}
@media (max-width: 760px) { .hero::before { left: .35rem; } }
.hero-in { padding: clamp(3rem, 7vw, 5.4rem) 0 clamp(3rem, 7vw, 5rem); }
.hero .kick { font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--ink-3); margin: 0 0 .1em; }
.hero h1 { font-size: clamp(3rem, 9.4vw, 7.2rem); font-weight: 700; line-height: .94; letter-spacing: -.035em; margin: 0 0 .24em; }
.hero h1 .l2 { display: block; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero h1 .dbl { border-bottom-width: 6px; }
.hero .sub { font-family: var(--mono); font-size: clamp(.72rem, 1.5vw, .9rem); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1.5rem; }
.hero .lede { max-width: 38rem; }
.hero .wrap { position: relative; }
.hero-bal { margin-top: clamp(1.8rem, 4vw, 3rem); padding-bottom: 2.4rem; }

/* ---------- the balance: the signature instrument ---------- */
.balance { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); position: relative; }
.balance::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--blue) 50%, var(--accent) 50%); border-radius: 4px 4px 0 0; }
.bal-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; padding: 1.3rem 1.4rem .8rem; }
.bal-ctl { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; align-items: end; }
.fld { display: grid; gap: .25rem; }
.fld > label, .fld > .lab { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.fld input[type=range] { width: min(21rem, 70vw); accent-color: var(--ink); }
.fld .readout { font-family: var(--display); font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.fld .readout small { font-family: var(--serif); font-size: .85rem; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-left: .3rem; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg button { font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; padding: .42rem .95rem; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ledger { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); position: relative; }
.ledger::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 5px; margin-left: -2px; border-inline: 1px solid rgba(176,36,28,.5); pointer-events: none; }
@media (max-width: 760px) { .ledger { grid-template-columns: 1fr; } .ledger::after { display: none; } }
.side { padding: 1.1rem 1.4rem 1.2rem; }
.side + .side { border-left: 0; }
@media (max-width: 760px) { .side + .side { border-top: 1px solid var(--rule); } }
.side h3 { font-size: 1.1rem; display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .15rem; }
.side h3 i { font-family: var(--mono); font-style: normal; font-weight: 500; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; padding: .1rem .5rem; border: 1px solid; border-radius: 999px; }
.side.rec h3 { color: var(--blue-text); } .side.ver h3 { color: var(--accent-text); }
.side p.q { font-size: .98rem; color: var(--ink-3); margin: 0 0 .7rem; line-height: 1.4; }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 4.5vw, 3.2rem); letter-spacing: -.03em; line-height: 1; }
.side.rec .big { color: var(--blue); } .side.ver .big { color: var(--accent); }
.big small { font-family: var(--mono); font-size: .72rem; font-weight: 400; letter-spacing: .06em; color: var(--ink-3); margin-left: .5rem; }
.cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin: .9rem 0 .3rem; }
.cells i { aspect-ratio: 1; border-radius: 2px; background: var(--blue); opacity: .85; transition: background .2s, opacity .2s; }
.cells i.x { background: transparent; border: 1.5px dashed var(--blue); opacity: .9; }
.cells.v i { background: var(--rule); opacity: 1; }
.cells.v i.hit { background: var(--accent); }
.cells.v i.bad { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(176,36,28,.16); }
.cells.v i.bad.hit { background: var(--accent); }
.legend-row { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.legend-row b { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -1px; margin-right: .35rem; }
.total { border-top: 1px solid var(--rule); padding: 1rem 1.4rem 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: .7rem 2rem; align-items: center; background: linear-gradient(180deg, rgba(70,110,90,.06), transparent); border-radius: 0 0 4px 4px; }
@media (max-width: 760px) { .total { grid-template-columns: 1fr; } }
.total .eq { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2.1rem); letter-spacing: -.02em; white-space: nowrap; }
.total .eq .num { border-bottom: 3px double var(--ink); padding-bottom: .02em; }
.gband { position: relative; height: 2.4rem; margin-top: .3rem; }
.gband .track { position: absolute; left: 0; right: 0; top: 1.05rem; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--blue-soft), var(--accent-soft)); border: 1px solid var(--rule); }
.gband .pin { position: absolute; top: .55rem; width: 3px; height: 1.6rem; background: var(--ink); border-radius: 2px; transform: translateX(-1px); transition: left .15s; }
.gband .ends { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); letter-spacing: .03em; }
.gnote { grid-column: 1 / -1; font-size: .95rem; color: var(--ink-3); line-height: 1.45; margin: 0; }
.gnote b { color: var(--ink); font-weight: 600; }

/* ---------- three numbers ---------- */
.numbers { background: var(--led-1); color: var(--on-dark); position: relative; }
.numbers .wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.num { padding: 2.3rem 1.6rem 2.5rem 0; }
.num + .num { padding-left: 1.6rem; border-left: 1px solid rgba(255,255,255,.12); }
.num b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 5.4vw, 3.9rem); line-height: 1; letter-spacing: -.03em; color: #fff; white-space: nowrap; }
.num b i { font-style: normal; color: #ec7467; padding: 0 .2em; font-size: .55em; vertical-align: .22em; letter-spacing: 0; }
.num span { display: block; margin-top: .6rem; font-size: 1.02rem; line-height: 1.42; color: var(--dim-on-dark); max-width: 20rem; }
@media (max-width: 760px) { .numbers .wrap { grid-template-columns: 1fr; } .num, .num + .num { padding: 1.4rem 0; border-left: 0; } .num + .num { border-top: 1px solid rgba(255,255,255,.12); } }

/* ---------- sections ---------- */
section { padding: clamp(3.4rem, 8vw, 6rem) 0; }
section.alt { background: var(--paper-2); border-block: 1px solid var(--rule); }
.section-head { margin-bottom: 2.2rem; max-width: 46rem; }
.section-head .lede { margin-top: .6rem; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: 1fr; gap: 1.2rem; } }
.dropcap::first-letter { font-family: var(--display); float: left; font-size: 4.6em; line-height: .8; padding: .06em .1em 0 0; color: var(--accent); font-weight: 700; }
.prose { max-width: 42rem; font-size: 1.15rem; color: var(--ink-2); line-height: 1.6; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- the day book: a timeline set as a ledger ---------- */
.daybook { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; }
.dbh, .dbr { display: grid; grid-template-columns: 5.2rem 1fr 1fr 1fr; align-items: start; }
.dbh { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); border-bottom: 2px solid var(--ink); padding: .7rem 1.2rem; background: var(--paper-2); }
.dbh span:nth-child(3) { color: var(--blue-text); } .dbh span:nth-child(4) { color: var(--accent-text); }
.dbr { padding: .95rem 1.2rem; border-bottom: 1px solid var(--rule-2); font-size: 1rem; line-height: 1.4; gap: 0 1rem; }
.dbr:last-child { border-bottom: 0; }
.dbr .yr { font-family: var(--mono); font-size: .92rem; color: var(--ink-2); padding-top: .12rem; }
.dbr .who { font-family: var(--display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.dbr .who small { display: block; font-family: var(--serif); font-weight: 400; font-size: .9rem; color: var(--ink-3); margin-top: .15rem; line-height: 1.35; }
.dbr .c { color: var(--ink-2); }
.dbr .c.both { grid-column: 3 / 5; }
.dbr .c:empty::before { content: "\2014"; color: var(--rule); }
.dbr.final { background: linear-gradient(90deg, var(--blue-soft), var(--accent-soft)); border-top: 2px solid var(--ink); }
.dbr.final .who { font-size: 1.25rem; }
@media (max-width: 860px) {
  .dbh { display: none; }
  .dbr { grid-template-columns: 4.2rem 1fr; gap: .2rem .8rem; }
  .dbr .c { grid-column: 2; } .dbr .c.both { grid-column: 2; }
  .dbr .c:empty { display: none; }
  .dbr .c:nth-of-type(3)::before { content: "recovers \2014 "; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--blue-text); text-transform: uppercase; }
  .dbr .c:nth-of-type(4)::before { content: "verifies \2014 "; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--accent-text); text-transform: uppercase; }
  .dbr .c.both::before { content: "both \2014 "; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
}

/* ---------- the law ---------- */
.law { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 900px) { .law { grid-template-columns: 1fr; gap: 1.8rem; } }
.law-card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.8rem 1.8rem 1.5rem; box-shadow: var(--shadow); position: relative; }
.law-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--blue) 50%, var(--accent) 50%); border-radius: 4px 4px 0 0; }
.law-card .f { font-family: var(--display); font-weight: 600; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; margin: .2rem 0 .3rem; line-height: 1.1; }
.law-card .f .rec { color: var(--blue); } .law-card .f .ver { color: var(--accent); }
.law-card .g { font-family: var(--display); font-size: 1.25rem; color: var(--ink-2); margin: .2rem 0 1rem; }
.law-card ul { margin: 0; padding: 0; list-style: none; font-size: 1.02rem; color: var(--ink-2); }
.law-card li { padding: .6rem 0; border-top: 1px solid var(--rule); }
.law-card li b { font-family: var(--mono); font-weight: 500; font-size: .78rem; letter-spacing: .04em; color: var(--ink-3); display: block; }
.proof { counter-reset: p; list-style: none; padding: 0; margin: 0 0 1.4rem; }
.proof li { counter-increment: p; position: relative; padding: .8rem 0 .8rem 2.8rem; border-top: 1px solid var(--rule); font-size: 1.08rem; line-height: 1.5; color: var(--ink-2); }
.proof li:last-child { border-bottom: 1px solid var(--rule); }
.proof li::before { content: counter(p); position: absolute; left: 0; top: .72rem; font-family: var(--display); font-weight: 600; font-size: 1.35rem; color: var(--accent); width: 2rem; text-align: center; }
.proof code, .law-card code, .kbd { font-family: var(--mono); font-size: .86em; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px; padding: .02em .35em; color: var(--ink); }

/* ---------- audit + code identity ---------- */
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 860px) { .twin { grid-template-columns: 1fr; } }
.tw { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.3rem 1.5rem; box-shadow: var(--shadow); }
.tw.a { border-top: 4px solid var(--accent); } .tw.c { border-top: 4px solid var(--blue); }
.tw .who { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tw .fm { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -.015em; margin: .3rem 0 .6rem; }
.tw p { font-size: 1.02rem; color: var(--ink-2); line-height: 1.5; margin: 0; }
.equals { text-align: center; font-family: var(--display); font-size: 1.2rem; color: var(--ink-2); margin: 1.2rem 0 .2rem; }
.equals b { border-bottom: 3px double var(--ink); padding-bottom: .02em; font-weight: 600; }
.atable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .86rem; margin-top: 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.atable th { text-align: right; font-weight: 500; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: .55rem .8rem; border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.atable th:first-child, .atable td:first-child { text-align: left; }
.atable td { text-align: right; padding: .55rem .8rem; border-bottom: 1px solid var(--rule-2); }
.atable tr:last-child td { border-bottom: 0; }
.atable td.ok { color: var(--proved); }
.atable td.pub { color: var(--blue-text); }

/* ---------- charts ---------- */
.chart { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.2rem .9rem; box-shadow: var(--shadow); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1.2; }
.chart .tick { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }
.chart .lab { font-family: var(--mono); font-size: 11.5px; fill: var(--ink-2); letter-spacing: .03em; }
.chart figcaption { font-size: .92rem; color: var(--ink-3); margin: .6rem .3rem 0; line-height: 1.45; }
.chart .legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; color: var(--ink-2); margin-bottom: .6rem; }
.chart .legend[hidden] { display: none; }
.legend i { display: inline-block; width: 1.5rem; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: .4rem; }
.legend i.dash { border-top-style: dashed; }
.legend i.dot { width: .75rem; height: .75rem; border: 0; border-radius: 50%; }
.chart-ctl { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: 1rem; }
.chart-ctl .eyebrow { margin: 0; }
.pt { cursor: pointer; transition: r .12s; }
.pt:hover, .pt:focus { stroke: var(--ink); stroke-width: 2; outline: none; }
.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: .76rem; line-height: 1.5; padding: .5rem .7rem; border-radius: 4px; max-width: 18rem; opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip b { font-weight: 500; color: #ffd5cd; }

/* ---------- domains ---------- */
.domains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 980px) { .domains { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 620px) { .domains { grid-template-columns: 1fr; } }
.dom { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.3rem 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.dom .kind { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.dom h3 { margin: .3rem 0 .5rem; font-size: 1.35rem; }
.dom .big { font-size: clamp(1.9rem, 3.6vw, 2.5rem); color: var(--ink); }
.dom .big small { display: block; margin: .3rem 0 0; }
.dom .what { font-size: 1rem; line-height: 1.5; color: var(--ink-2); margin: .8rem 0; }
.dom .verdict { margin-top: auto; border-top: 1px solid var(--rule); padding-top: .7rem; font-size: .92rem; line-height: 1.45; color: var(--ink-3); }
.pill { display: inline-block; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; padding: .12rem .6rem; border-radius: 999px; border: 1px solid; margin-right: .5rem; white-space: nowrap; }
.pill.Proved { color: var(--proved); border-color: rgba(45,106,66,.5); background: rgba(45,106,66,.08); }
.pill.Confirmed { color: var(--confirmed); border-color: rgba(29,66,114,.5); background: var(--blue-soft); }
.pill.Conjecture { color: var(--conj); border-color: rgba(141,106,12,.5); background: rgba(141,106,12,.08); }
.pill.Notclaimed { color: var(--notc); border-color: rgba(93,104,120,.5); background: rgba(93,104,120,.08); }
.pill.Analogy { color: var(--conj); border-color: rgba(141,106,12,.5); background: rgba(141,106,12,.08); }

/* ---------- the k threshold ---------- */
.kchart svg .id { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-dasharray: 6 5; }
.kchart svg .mem { fill: none; stroke: var(--accent); stroke-width: 3; }
.kchart svg .band { fill: rgba(176,36,28,.07); }

/* ---------- the blind spot ---------- */
.blind { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
@media (max-width: 760px) { .blind { grid-template-columns: 1fr; } }
.bl { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow); border-left: 4px solid var(--ink); }
.bl .yr { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.bl h3 { margin: .2rem 0 .5rem; }
.bl p { font-size: 1.02rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 .5rem; }
.bl .missing { font-size: .95rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: .55rem; margin-top: .6rem; }
.bl .missing b { font-family: var(--mono); font-weight: 500; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); display: block; margin-bottom: .1rem; }
.zero { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 0 0 2rem; }
@media (max-width: 760px) { .zero { grid-template-columns: 1fr; } }
.zbox { border: 1px solid var(--rule); background: var(--card); border-radius: 4px; padding: 1.1rem 1.3rem; box-shadow: var(--shadow); }
.zbox .eq { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3.2vw, 2.3rem); letter-spacing: -.02em; line-height: 1.1; margin: .2rem 0 .4rem; }
.zbox.z .eq { color: var(--accent); }
.zbox p { margin: 0; font-size: 1rem; color: var(--ink-2); line-height: 1.5; }

/* ---------- scoreboard (the ledger of claims) ---------- */
.score-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.4rem; }
.tally { display: flex; gap: .5rem; flex-wrap: wrap; }
.fbtn { font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; padding: .42rem .95rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink-2); cursor: pointer; }
.fbtn b { font-weight: 500; margin-left: .3rem; color: var(--ink-3); }
.fbtn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fbtn[aria-pressed="true"] b { color: var(--dim-on-dark); }
.tbar { display: flex; gap: 3px; margin-bottom: 1.2rem; }
.tbar i { flex: 1; height: 8px; border-radius: 2px; background: var(--rule); }
.tbar i.Proved { background: var(--proved); } .tbar i.Confirmed { background: var(--confirmed); } .tbar i.Conjecture { background: var(--conj); } .tbar i.Notclaimed { background: var(--notc); }
.tests { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; }
.test { display: grid; grid-template-columns: 2.4rem 1.1fr 9.6rem 1.5fr; gap: .4rem 1.1rem; align-items: baseline; padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule-2); font-size: 1rem; line-height: 1.45; }
.test:last-child { border-bottom: 0; }
.test[hidden] { display: none; }
.test .n { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.test .claim { font-weight: 600; color: var(--ink); }
.test .result { color: var(--ink-2); }
.test .pill { margin: 0; }
@media (max-width: 860px) { .test { grid-template-columns: 2rem 1fr; } .test .pill { grid-column: 2; justify-self: start; } .test .result { grid-column: 2; } }
.statusnote { margin-top: 1.4rem; font-size: .98rem; color: var(--ink-3); max-width: 46rem; line-height: 1.5; }

/* ---------- chapters ---------- */
.parts { display: grid; gap: 2.4rem; }
.part { display: grid; grid-template-columns: 15rem 1fr; gap: 2rem; padding-top: 1.4rem; border-top: 2px solid var(--ink); }
@media (max-width: 860px) { .part { grid-template-columns: 1fr; gap: .8rem; } }
.part .range { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.part h3 { margin: .2rem 0 .3rem; font-size: 1.6rem; }
.part .pline { font-size: .98rem; line-height: 1.45; color: var(--ink-3); }
.part ol { list-style: none; margin: 0; padding: 0; }
.part li { border-bottom: 1px solid var(--rule); }
.part li:first-child { border-top: 0; }
.part details summary { display: flex; align-items: baseline; gap: 1rem; cursor: pointer; padding: .75rem 0; font-family: var(--display); font-weight: 500; font-size: 1.22rem; line-height: 1.25; list-style: none; }
.part details summary::-webkit-details-marker { display: none; }
.part details summary b { font-family: var(--mono); font-weight: 500; font-size: .82rem; color: var(--ink-3); min-width: 1.8rem; }
.part details summary::after { content: "+"; margin-left: auto; font-family: var(--mono); color: var(--ink-3); }
.part details[open] summary::after { content: "\2212"; }
.part details summary:hover { color: var(--accent-text); }
.part li.inter summary { font-style: italic; color: var(--ink-2); }
.chap-body { padding: 0 0 1.1rem 2.8rem; max-width: 40rem; }
.chap-body p { font-size: 1.04rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 .5rem; }
.chap-body a { font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; }
.chap-body .q { font-family: var(--display); font-style: italic; font-size: 1.1rem; color: var(--ink); }
.tag-s { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: .05rem .45rem; border-radius: 999px; border: 1px solid; margin-left: .3rem; white-space: nowrap; vertical-align: 1px; }
.tag-s.pr { color: var(--proved); border-color: rgba(45,106,66,.5); } .tag-s.cf { color: var(--confirmed); border-color: rgba(29,66,114,.5); } .tag-s.cj { color: var(--conj); border-color: rgba(141,106,12,.5); }

/* ---------- check it yourself ---------- */
.code-block { background: var(--led-1); color: var(--on-dark); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; background: rgba(255,255,255,.05); font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--dim-on-dark); }
.copy-btn { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; color: #ffd0c8; background: rgba(255,255,255,.08); border: none; border-radius: 3px; padding: .3rem .8rem; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.16); }
.code-block pre { margin: 0; padding: 1.2rem 1.4rem; overflow-x: auto; }
.code-block code { font-family: var(--mono); font-size: .88rem; line-height: 1.55; white-space: pre; }
.scripts { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem 2rem; font-size: .98rem; color: var(--ink-2); }
@media (max-width: 760px) { .scripts { grid-template-columns: 1fr; } }
.scripts code { display: block; font-family: var(--mono); font-size: .82rem; color: var(--ink); margin-bottom: .1rem; }

/* ---------- series ---------- */
.series { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 46rem; }
@media (max-width: 520px) { .series { grid-template-columns: 1fr; } }
.bk { border: 1px solid var(--rule); border-radius: 4px; padding: 1.1rem 1.2rem; background: var(--card); display: flex; flex-direction: column; }
.bk .no { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.bk h3 { font-size: 1.15rem; margin: .3rem 0 .4rem; }
.bk .eq { font-family: var(--display); font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 .5rem; }
.bk p { font-size: .94rem; line-height: 1.45; color: var(--ink-2); margin: 0 0 .5rem; }
.bk a { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; margin-top: auto; }
.bk.rw { border-top: 4px solid #e8844f; } .bk.ag { border-top: 4px solid #d1a145; } .bk.vp { border-top: 4px solid #5fc7c0; } .bk.bs { border-top: 4px solid #b4481f; }
.bk.de { border-top: 4px solid; border-image: linear-gradient(90deg, var(--blue) 50%, var(--accent) 50%) 1; background: linear-gradient(180deg, rgba(70,110,90,.08), var(--card)); }
.bk.de .eq { color: var(--accent-text); }

/* ---------- ways through ---------- */
.ways { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
@media (max-width: 960px) { .ways { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 560px) { .ways { grid-template-columns: 1fr; } }
.way { border-top: 3px double var(--ink); padding-top: 1rem; }
.way h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.way p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; margin: 0; }
.way .go { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; display: block; margin-top: .6rem; }

/* ---------- closing ---------- */
.closing { background: var(--led-1); color: var(--on-dark); text-align: center; position: relative; overflow: hidden; }
.closing h2 { color: #fff; }
.closing h2 .dbl { border-bottom-width: 5px; }
.closing p { color: var(--dim-on-dark); max-width: 36rem; margin-inline: auto; }
.closing .btn-row { justify-content: center; }
.closing .support { margin-top: 1.6rem; font-size: 1rem; }
.closing .support a { color: #ffb0a6; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .gband .pin, .cells i { transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 3rem 0 3.6rem; background: var(--paper-2); font-size: 1rem; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .8rem; font-weight: 500; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .15rem 0; }
.site-footer a { color: var(--ink-2); }
.fine { margin-top: 2rem; font-size: .9rem; color: var(--ink-3); }

/* ---------- the lab ---------- */
.lab-head { padding: clamp(2.6rem, 6vw, 4.2rem) 0 1.4rem; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 2.1rem, rgba(70,110,90,.14) 2.1rem, rgba(70,110,90,.14) calc(2.1rem + 1px)); border-bottom: 1px solid var(--rule); }
.lab-head h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin-bottom: .3em; }
.lab-section { padding: clamp(2.2rem, 5vw, 3.6rem) 0; border-bottom: 1px solid var(--rule); }
.lab-section:last-of-type { border-bottom: 0; }
.lab-section .num-tag { font-family: var(--mono); font-size: .76rem; letter-spacing: .16em; color: var(--accent-text); text-transform: uppercase; margin-bottom: .6rem; }
.lab-section h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.lab-grid { display: grid; grid-template-columns: 19rem 1fr; gap: 1.6rem; align-items: start; }
@media (max-width: 960px) { .lab-grid { grid-template-columns: 1fr; } }
.ctl { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.ctl .fld + .fld { margin-top: 1.1rem; }
.ctl input[type=range] { width: 100%; accent-color: var(--ink); }
.ctl select { width: 100%; font: inherit; font-size: 1rem; padding: .45rem .6rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink); }
.ctl .btn { width: 100%; justify-content: center; margin-top: .6rem; font-size: .95rem; padding: .6rem 1rem; }
.ctl .row { display: flex; gap: .6rem; }
.stage { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.3rem 1.1rem; box-shadow: var(--shadow); min-height: 16rem; }
.stage h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.stage .sub { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink-3); margin-bottom: .6rem; }
.stage .cells { grid-template-columns: repeat(25, 1fr); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
@media (max-width: 700px) { .statrow { grid-template-columns: repeat(2, 1fr); } }
.stat b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.stat span { display: block; font-size: .8rem; line-height: 1.3; color: var(--ink-3); margin-top: .25rem; }
.stat.r b { color: var(--accent); } .stat.b b { color: var(--blue); }
.lab-notes { margin-top: 1.2rem; display: grid; gap: .8rem; font-size: 1rem; color: var(--ink-2); max-width: 46rem; }
.lab-notes p { margin: 0; } .lab-notes b { color: var(--ink); }
.hist { display: flex; align-items: end; gap: 2px; height: 9rem; margin-top: .6rem; border-bottom: 2px solid var(--ink); position: relative; }
.hist i { flex: 1; background: var(--accent); opacity: .85; min-height: 1px; border-radius: 1px 1px 0 0; }
.hist i.past { background: var(--ink-3); opacity: .6; }
.hist-ax { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); margin-top: .25rem; }
.calc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
@media (max-width: 700px) { .calc { grid-template-columns: 1fr; } }
.calc .res { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: .9rem 1.1rem; }
.calc .res .who { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.calc .res b { display: block; font-family: var(--display); font-size: 2.1rem; letter-spacing: -.02em; line-height: 1.1; }
.calc .res.a b { color: var(--accent); } .calc .res.c b { color: var(--blue); }
.calc .res small { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); }

.stage .cells.v i { background: var(--paper); border: 1px solid var(--rule); }
.stage .cells.v i.hit { background: #9aa597; }
.stage .cells.v i.hit.bad { background: var(--accent); border-color: var(--accent); box-shadow: none; }
html, body { overflow-x: clip; }
@media (max-width: 760px) { .total .eq { white-space: normal; } .bal-ctl { gap: .8rem 1rem; } .fld input[type=range] { width: 100%; } .bal-top { padding-inline: 1rem; } }
@media (max-width: 700px) { .calc-in { grid-template-columns: 1fr !important; } }

/* ---------- short version ---------- */
.beat { min-height: 62vh; display: grid; align-items: center; padding: clamp(2.4rem, 7vw, 5rem) 0; border-top: 1px solid var(--rule); }
.beat:first-of-type { border-top: 0; }
.beat .bn { font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; color: var(--accent-text); margin-bottom: 1.2rem; }
.beat h2 { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.02; max-width: 17ch; letter-spacing: -.03em; }
.beat h2 em { color: var(--accent); font-style: italic; font-weight: 500; }
.beat p { max-width: 36rem; font-size: 1.3rem; line-height: 1.55; color: var(--ink-2); }
.beat .fig { margin-top: 1.6rem; max-width: 40rem; }
.beat .card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.beat.dark { background: var(--led-1); color: var(--on-dark); border-top: 0; }
.beat.dark h2 { color: #fff; } .beat.dark h2 em { color: #ec7467; } .beat.dark p { color: var(--dim-on-dark); } .beat.dark .bn { color: #ec7467; }
.progress { position: fixed; left: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--accent)); width: 0; z-index: 90; }
.bar2 { display: grid; grid-template-columns: 7.5rem 1fr 4rem; gap: .7rem; align-items: center; font-family: var(--mono); font-size: .82rem; margin: .4rem 0; }
.bar2 .trk { background: var(--paper-2); height: 1.5rem; border-radius: 2px; overflow: hidden; }
.bar2 .trk div { height: 100%; }

@media print { .site-header, .site-footer, .btn-row { display: none !important; } body { font-size: 11.5pt; } .numbers, .closing, .beat.dark { background: #fff !important; color: #000 !important; } }
