/* C3Marley: the Marley ledger. Shared by landing, dashboard and 404. */
@font-face { font-family: "IM Fell English"; src: url(/fonts/im-fell-english-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url(/fonts/im-fell-english-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --charcoal: #1a1a1a;
  --parchment: #f5f1e8;
  --parchment-2: #ece5d4;
  --ink: #1a1a1a;
  --ink-soft: #564d40;          /* 7.4:1 on parchment */
  --ink-on-dark: #f5f1e8;
  --ink-on-dark-soft: #c4baa6;  /* 9:1 on charcoal */
  --red: #8b0000;               /* ledger red: scored, manual check, ruling */
  --gold: #c9a86e;              /* chain gold: chain links, primary action */
  --gold-deep: #6e5320;         /* chain drawn on parchment */
  --teal: #4a7c7e;              /* ghost teal: franchise-exempt, not scored */
  --teal-deep: #2f5a5c;         /* teal text on parchment, 7:1 */
  --teal-light: #8fbfc0;        /* teal text on charcoal */
  --rule: color-mix(in oklab, var(--teal) 32%, transparent);          /* ledger ruling hairline */
  --rule-red: color-mix(in oklab, var(--red) 82%, transparent);       /* margin and money rules */
  --desk: clamp(0.4rem, 1.3vw, 1.25rem);                               /* charcoal desk showing round each page */
  --rule-ink: color-mix(in oklab, var(--ink) 30%, transparent);
  --rule-dark: color-mix(in oklab, var(--parchment) 16%, transparent);

  --f-display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --f-text: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --t-xs: clamp(0.78rem, 0.75rem + 0.12vw, 0.84rem);
  --t-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.94rem);
  --t-base: clamp(1rem, 0.97rem + 0.18vw, 1.1rem);
  --t-lg: clamp(1.15rem, 1.08rem + 0.4vw, 1.38rem);
  --t-xl: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --t-2xl: clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem);
  --t-3xl: clamp(2.7rem, 1.6rem + 4.8vw, 5.8rem);

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --gutter: clamp(1rem, 4.5vw, 4.5rem);
  --margin-x: clamp(1.4rem, 6vw, 6rem);       /* where the red margin rule sits */
  --maxw: 80rem;
  --section: clamp(4rem, 9vw, 8.5rem);
  --mast-h: 3.6rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--mast-h) + 1.5rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--charcoal); color: var(--ink-on-dark);
  font-family: var(--f-text); font-size: var(--t-base); line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
::selection { background: var(--red); color: var(--parchment); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 1px; }
.on-paper :focus-visible, .paper :focus-visible, .mast :focus-visible { outline-color: var(--ink); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums slashed-zero; }
p .num, li .num, span .num, dd .num, caption .num, summary .num, label .num, button .num, small .num, .lede .mono, p .mono { font-size: 0.9em; letter-spacing: -0.01em; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: var(--s-4); top: -4rem; z-index: 60; background: var(--gold); color: var(--charcoal); padding: var(--s-2) var(--s-4); font-weight: 700; text-decoration: none; }
.skip:focus { top: var(--s-4); }
html { scrollbar-color: #8f8576 var(--parchment); }

/* ---------- atoms ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; min-height: 2.9rem; padding: 0.7em 1.25em;
  font: 600 var(--t-sm)/1 var(--f-text); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  border: 1px solid currentColor; border-radius: 2px; background: transparent; color: inherit;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); border-color: var(--gold-deep); color: var(--charcoal); }
.btn--gold:hover { background: #d9bd88; }
.btn--line:hover { background: color-mix(in oklab, currentColor 9%, transparent); }

.tag {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2em 0.55em; border-radius: 2px;
  font: 700 var(--t-xs)/1.3 var(--f-mono); letter-spacing: 0.01em; white-space: nowrap; border: 1px solid currentColor;
}
.tag--red { color: var(--red); }
.tag--teal { color: var(--teal-deep); }
.tag--ink { color: var(--ink-soft); }

/* section label: sentence case in the display italic. Never an uppercase eyebrow. */
.label { font: italic 400 var(--t-lg)/1.2 var(--f-display); color: var(--ink); margin: 0 0 var(--s-2); }

/* the chain: oval links hung one under another, joined by a small gold link. Vertical, so a link never dangles. */
.chain { display: flex; flex-direction: column; align-items: flex-start; list-style: none; margin: 0; padding: 0; }
.chain > li { position: relative; }
.chain > li + li { margin-top: 0.9rem; }
.chain > li + li::before { content: ""; position: absolute; left: 1.4rem; top: -1.05rem; width: 0.6rem; height: 1.2rem; border: 2px solid var(--gold-deep); border-radius: 999px; }
.link {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.2em 0.55em; padding: 0.38em 1em; border-radius: 1.25rem;
  border: 2px solid var(--gold-deep); background: var(--parchment);
  font: 400 var(--t-sm)/1.25 var(--f-text); color: var(--ink); position: relative; z-index: 1;
}
.link b { font: 700 var(--t-sm)/1 var(--f-mono); color: var(--red); }
.link small { font: 400 var(--t-xs)/1.3 var(--f-mono); color: var(--ink-soft); }
.link--zero { border-color: var(--teal); border-style: dashed; }
.link--zero b { color: var(--teal-deep); }

/* ledger page: parchment with a red double margin rule. The ruling lives in the tables, where the entries are. */
.paper {
  background-color: var(--parchment); color: var(--ink);
  background-image: linear-gradient(90deg,
    transparent calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 4px),
    transparent calc(var(--margin-x) - 4px), transparent calc(var(--margin-x) - 1px), var(--rule-red) calc(var(--margin-x) - 1px),
    var(--rule-red) var(--margin-x), transparent var(--margin-x));
}
.paper .wrap { padding-left: max(0px, calc(var(--margin-x) + var(--s-5) - var(--gutter))); }
/* each ledger page is a sheet on the charcoal desk, with stacked page edges at its sides */
.sec--paper, .hero.paper {
  margin-inline: var(--desk);
  box-shadow: -1px 0 0 0 #d9ceb5, 1px 0 0 0 #d9ceb5, -4px 0 0 -1px #ebe3d0, 4px 0 0 -1px #ebe3d0, -5px 0 0 -1px #cdbf9f, 5px 0 0 -1px #cdbf9f, 0 24px 48px -24px rgb(0 0 0 / 0.7);
}
.hero.paper { background-image:
    linear-gradient(90deg,
      transparent calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 4px),
      transparent calc(var(--margin-x) - 4px), transparent calc(var(--margin-x) - 1px), var(--rule-red) calc(var(--margin-x) - 1px),
      var(--rule-red) var(--margin-x), transparent var(--margin-x)),
    repeating-linear-gradient(180deg, transparent 0 calc(2.4rem - 1px), color-mix(in oklab, var(--teal) 16%, transparent) calc(2.4rem - 1px) 2.4rem); }
/* red double head rule across the top of every ledger page */
.headrule { border: 0; height: 4px; margin: 0; border-top: 1px solid var(--rule-red); border-bottom: 1px solid var(--rule-red); }

/* ledger table: one ink, entries sit on the hairline rule, money fenced by red verticals */
.ledger { width: 100%; border-collapse: collapse; font-size: var(--t-sm); color: var(--ink); }
.ledger caption { caption-side: bottom; text-align: left; font-size: var(--t-xs); color: var(--ink-soft); padding-top: var(--s-3); }
.ledger th, .ledger td { padding: 0.95rem 0.6rem 0.3rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: bottom; }
.ledger thead th { font: 600 var(--t-xs)/1.2 var(--f-text); color: var(--ink-soft); padding-top: 0.4rem; border-bottom: 1px solid var(--rule-ink); }
.ledger td.num, .ledger th.num { text-align: right; white-space: nowrap; font-family: var(--f-mono); font-variant-numeric: tabular-nums; border-left: 1px solid var(--rule-red); padding-left: 0.6rem; padding-right: 0.5rem; }
.ledger thead th.num { font-family: var(--f-text); }
.ledger tbody th { font-weight: 600; }
.ledger tfoot th, .ledger tfoot td { border-top: 3px double var(--ink); border-bottom: 0; font-weight: 700; }
.ledger .pts { font: 700 var(--t-sm)/1.2 var(--f-mono); color: var(--red); }
.ledger .zero .pts, .ledger .pts.zero { color: var(--teal-deep); }
.ledger .grp th { font: italic 400 var(--t-lg)/1.2 var(--f-display); font-weight: 400; padding-top: 1.6rem; border-bottom: 1px solid var(--rule-ink); }

/* ---------- landing: mast, the running head of the book ---------- */
.mast {
  position: fixed; inset: 0 0 auto 0; z-index: 40; background: var(--parchment); color: var(--ink);
  padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--rule-red);
  box-shadow: 0 3px 0 -2px var(--parchment), 0 4px 0 -2px var(--rule-red), 0 6px 12px -8px rgb(26 20 10 / 0.35);
}
.mast__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: var(--mast-h); }
.mark { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: inherit; flex: none; }
.mark svg { width: 1.75rem; height: 1.75rem; }
.mark span { font: 400 1.35rem/1 var(--f-display); }
.mast__right { display: flex; align-items: center; gap: var(--s-5); min-width: 0; }
.mast nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mast nav::-webkit-scrollbar { display: none; }
.mast .app-link { font-size: var(--t-sm); white-space: nowrap; text-decoration: none; padding: 0.4rem 0.7rem; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); font-weight: 600; flex: none; }
.mast .app-link:hover { background: var(--parchment-2); }
.mast nav ul { display: flex; gap: var(--s-1) var(--s-5); list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); white-space: nowrap; }
.mast nav a { text-decoration: none; color: var(--ink-soft); padding-block: 0.75rem; display: inline-block; }
.mast nav a:hover, .mast nav a[aria-current] { color: var(--ink); text-decoration: underline; }
.mast nav .app-link { color: var(--ink); font-weight: 600; }
@media (max-width: 46rem) { .mast nav { -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); } .mast nav ul { gap: var(--s-4); font-size: var(--t-xs); padding-right: 1.5rem; } .mark span { font-size: 1.15rem; } .mast__right { gap: var(--s-3); } .mast .app-link { font-size: var(--t-xs); padding: 0.35rem 0.5rem; } }

/* ---------- landing: hero, page one of the ledger ---------- */
.hero { position: relative; }
.hero [data-sc-stage] { min-height: 100svh; display: grid; align-content: center; }
.hero.paper .wrap { padding-left: max(0px, calc(var(--margin-x) + var(--s-6) - var(--gutter))); }
.hero__page { padding-block: calc(var(--mast-h) + clamp(1.5rem, 5vh, 3.5rem)) clamp(2.5rem, 6vh, 3.5rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: end; }
.hero h1 { font: 400 var(--t-3xl)/0.96 var(--f-display); letter-spacing: -0.01em; margin: 0 0 var(--s-5); text-wrap: balance; max-width: 11ch; color: var(--ink); }
.hero h1 em { font-style: italic; }
.hero__lede { max-width: 44ch; margin: 0 0 var(--s-6); color: var(--ink-soft); font-size: var(--t-lg); line-height: 1.5; }
.hero__lede strong { color: var(--ink); font-weight: 600; }
.ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__meta { margin: var(--s-6) 0 0; font: 400 var(--t-xs)/1.5 var(--f-mono); color: var(--ink-soft); }
.hero__folio { position: absolute; right: var(--gutter); bottom: clamp(0.8rem, 2.5vh, 1.6rem); font: italic 400 var(--t-sm)/1 var(--f-display); color: var(--ink-soft); }

/* the entries */
.entries { margin: 0; }
.entries__title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 0.35rem; }
.entries__title p { margin: 0; font: italic 400 var(--t-xl)/1.1 var(--f-display); color: var(--ink); }
.entries__title span { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--ink-soft); white-space: nowrap; }
.entries .headrule { margin-bottom: 0.2rem; }
.entries .ledger th[scope="row"] { font: 700 var(--t-xs)/1.2 var(--f-mono); letter-spacing: 0.01em; white-space: nowrap; }
.entries .ledger tbody tr { position: relative; }
.entries .ledger tbody td, .entries .ledger tbody th { padding-top: 1.2rem; }
.entries .pts small { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--red); }
.strike { position: absolute; left: -0.2rem; right: 0; bottom: 0.78rem; height: 0; pointer-events: none; }
.strike svg { position: absolute; left: 0; bottom: -0.4rem; width: 100%; height: 0.8rem; overflow: visible; }
.strike path { fill: none; stroke: var(--red); stroke-width: 1.25; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--k, 1)); opacity: min(1, calc(var(--k, 1) * 40)); }
.stamp {
  display: inline-block; vertical-align: 0.1em; margin-left: 0.5rem; rotate: -4deg;
  font: 700 0.75rem/1 var(--f-mono); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--teal-deep); border: 1.5px solid var(--teal); padding: 0.25rem 0.4rem; border-radius: 2px;
  opacity: var(--k, 1); scale: calc(1.3 - var(--k, 1) * 0.3);
}
.stamp--m { display: none; }
.totals { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
.totals li { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 1rem; padding: 0.85rem 0 0.25rem; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.totals li:first-child { border-top: 3px double var(--ink); }
.totals b { font: 700 var(--t-base)/1 var(--f-mono); white-space: nowrap; }
.totals .s b { color: var(--red); }
.totals .x, .totals .x b { color: var(--teal-deep); }
.entries__src { margin: var(--s-3) 0 0; font-size: var(--t-xs); color: var(--ink-soft); max-width: 68ch; }
/* the chain hangs in the margin, left of the red rule: links fasten as each line is struck */
.margin-chain { position: absolute; left: calc(var(--margin-x) - 2.15rem); top: calc(var(--mast-h) + 1.2rem); bottom: 1.5rem; width: 1.3rem; pointer-events: none; }
.margin-chain svg { width: 100%; height: 100%; }
.margin-chain .lk { fill: none; stroke: var(--gold-deep); stroke-width: 2.4; opacity: var(--k, 1); }
@media (max-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  /* too tall to pin on small screens: the act scrolls and the strike follows the entries */
  .hero.sc-act--pinned { height: auto !important; }
  .hero [data-sc-stage], .hero .sc-stage { position: relative; height: auto; min-height: 0; overflow: visible; }
  .hero__page { padding-bottom: var(--s-8); }
}
@media (max-width: 46rem) {
  :root { --margin-x: 0.85rem; }
  .margin-chain { display: none; }
  .entries .ledger th[scope="row"] { font-size: 0.75rem; white-space: normal; }
  .entries .ledger .num { font-size: 0.76rem; padding-left: 0.35rem; padding-right: 0.25rem; }
  .entries .ledger thead th { font-size: 0.75rem; }
  .entries .pts small { display: block; margin-top: 0.15rem; }
  .stamp--d { display: none; }
  .stamp--m { display: block; width: max-content; margin: 0.4rem 0 0; font-size: 0.75rem; }
  .hero.paper .wrap { padding-left: max(0px, calc(var(--margin-x) + 0.6rem - var(--gutter))); }
  .strike { bottom: 0.72rem; }
  .totals li { font-size: var(--t-xs); }
}

/* ---------- landing: sections ---------- */
.sec { padding-block: var(--section); position: relative; }
.sec--paper { color: var(--ink); }
.sec--dark { background: var(--charcoal); color: var(--ink-on-dark); }
.sec h2 { font: 400 var(--t-2xl)/1.04 var(--f-display); letter-spacing: -0.01em; margin: 0 0 var(--s-5); text-wrap: balance; max-width: 22ch; }
.sec h2 .num { font-size: 0.84em; letter-spacing: -0.03em; }
.sec h3 { font: 600 var(--t-lg)/1.25 var(--f-text); margin: 0 0 var(--s-3); }
.sec p { max-width: 66ch; margin: 0 0 var(--s-4); }
.sec .lede { font-size: var(--t-lg); line-height: 1.5; max-width: 58ch; }
.sec--paper .lede, .sec--paper .soft { color: var(--ink-soft); }
.sec--dark .lede, .sec--dark .soft { color: var(--ink-on-dark-soft); }
.sec--paper > .headrule { position: absolute; left: 0; right: 0; top: clamp(1.25rem, 3vw, 2.25rem); }
.folio-no { position: absolute; bottom: clamp(1rem, 3vw, 2rem); right: var(--gutter); font: italic 400 var(--t-sm)/1 var(--f-display); color: var(--ink-soft); }

/* score */
.score-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; margin-top: var(--s-6); }
@media (max-width: 56rem) { .score-grid { grid-template-columns: minmax(0, 1fr); } }
.worked { border-top: 3px double var(--ink); padding-top: var(--s-4); }
.worked h3 { font: italic 400 var(--t-xl)/1.1 var(--f-display); margin: 0 0 var(--s-1); }
.worked .addr { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--ink-soft); margin: 0 0 var(--s-5); }
.worked dl { display: grid; grid-template-columns: 1fr auto; margin: var(--s-5) 0 0; font-size: var(--t-sm); }
.worked dt, .worked dd { padding: 0.85rem 0 0.25rem; border-bottom: 1px solid var(--rule); margin: 0; }
.worked dt { color: var(--ink-soft); }
.worked dd { text-align: right; font-family: var(--f-mono); }
.worked .total { font: 700 var(--t-xl)/1 var(--f-mono); color: var(--red); }
.note { font-size: var(--t-sm); margin-top: var(--s-4); }
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s-3) var(--s-6); margin: var(--s-7) 0 0; }
.glossary div { border-top: 1px solid var(--rule-ink); padding-top: var(--s-3); }
.glossary dt { font: 700 var(--t-xs)/1.3 var(--f-mono); }
.glossary dd { margin: 0.3rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }

/* demo search */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; margin-top: var(--s-6); }
@media (max-width: 56rem) { .demo { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: var(--s-2); }
.field label { font: 600 var(--t-sm)/1.2 var(--f-text); }
.field .hint { font-size: var(--t-xs); color: var(--ink-soft); }
.input {
  width: 100%; min-height: 3rem; padding: 0.65rem 0.85rem; font: 400 var(--t-base)/1.2 var(--f-mono); color: var(--ink);
  background: var(--parchment); border: 1.5px solid var(--ink); border-radius: 2px; caret-color: var(--red);
}
.input::placeholder { color: #6d6355; }
.input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.results { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-top: 1px solid var(--rule-ink); max-height: 23rem; overflow: auto; }
.results li { border-bottom: 1px solid var(--rule); }
.results button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 1rem; text-align: left; cursor: pointer; padding: 0.8rem 0.4rem 0.3rem; background: transparent; border: 0; color: var(--ink); font: inherit; }
.results button:hover, .results button[aria-current="true"] { background: var(--parchment-2); }
.results .o { font-weight: 600; font-size: var(--t-sm); }
.results .m { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--ink-soft); }
.results .v { font: 700 var(--t-sm)/1.4 var(--f-mono); text-align: right; }
.empty { padding: var(--s-4) 0; color: var(--ink-soft); font-size: var(--t-sm); }

/* owner / parcel slip: a sheet laid on the page */
.drawer { background: var(--parchment); border: 1px solid var(--ink); box-shadow: 4px 4px 0 -1px var(--parchment), 4px 4px 0 0 var(--rule-ink); padding: var(--s-5); position: relative; }
.drawer__close { position: absolute; top: 0.5rem; right: 0.5rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--ink); border-radius: 2px; }
.drawer__close:hover { background: var(--parchment-2); }
.drawer__close svg { width: 1.1rem; height: 1.1rem; }
.drawer h3 { font: italic 400 var(--t-xl)/1.1 var(--f-display); margin: 0 2.5rem var(--s-1) 0; }
.caveat { font-size: var(--t-xs); color: var(--ink-soft); margin: 0 0 var(--s-3); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-4); border-block: 1px solid var(--rule-ink); padding-block: var(--s-3); }
.figs div { display: grid; gap: 0.2rem; }
.figs dt { font-size: var(--t-xs); color: var(--ink-soft); }
.figs dd { margin: 0; font: 700 var(--t-sm)/1.2 var(--f-mono); overflow-wrap: anywhere; }
.figs .big { font-size: var(--t-xl); color: var(--red); }
@media (max-width: 30rem) { .figs { grid-template-columns: 1fr 1fr; } }
.drawer h4 { font: italic 400 var(--t-lg)/1.2 var(--f-display); margin: var(--s-5) 0 var(--s-2); color: var(--ink); }
.signals { list-style: none; margin: 0; padding: 0; font: 400 var(--t-xs)/1.5 var(--f-mono); }
.signals li { padding: 0.65rem 0 0.25rem 1.4rem; position: relative; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.signals li::before { content: ""; position: absolute; left: 0.05rem; top: 0.95rem; width: 0.75rem; height: 0.42rem; border: 1.5px solid var(--gold-deep); border-radius: 999px; }
.signals li.weak::before { border-color: var(--ink-soft); border-style: dashed; }
.parcels { width: 100%; border-collapse: collapse; font-size: var(--t-xs); }
.parcels th, .parcels td { padding: 0.6rem 0.5rem 0.2rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: bottom; }
.parcels td { font-family: var(--f-mono); }
.parcels td.num { text-align: right; white-space: nowrap; border-left: 1px solid var(--rule-red); padding-left: 0.5rem; }
.parcels-wrap { max-height: 16rem; overflow: auto; }
.hcad { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-4); font-size: var(--t-sm); }
.copy { font: 600 var(--t-xs)/1 var(--f-text); padding: 0.45rem 0.6rem; min-height: 2.25rem; border: 1px solid var(--ink); background: transparent; cursor: pointer; border-radius: 2px; color: var(--ink); }
.copy:hover { background: var(--parchment-2); }

/* second signal */
.sig-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin: var(--s-6) 0 var(--s-4); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: 2px; }
.seg button { font: 600 var(--t-sm)/1 var(--f-text); padding: 0.7rem 1rem; min-height: 2.75rem; border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--parchment); }
.seg .num { font-weight: 700; }
.tally { width: min(100%, 40rem); margin-top: var(--s-5); table-layout: fixed; }
.tally td.num { width: 5rem; }
.ruled .totals { margin-top: var(--P); }
.tally tr.r .num { color: var(--red); }
.tally tr.t .num { color: var(--teal-deep); }
.table-wrap { overflow: auto; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); max-height: 36rem; }
.sig { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 50rem; }
.sig th, .sig td { padding: 0.9rem 0.75rem 0.3rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: bottom; }
.sig thead th.num { text-align: right; }
.sig thead th { position: sticky; top: 0; background: var(--parchment); font: 600 var(--t-xs)/1.2 var(--f-text); color: var(--ink-soft); border-bottom: 1px solid var(--rule-ink); z-index: 1; padding-top: 0.6rem; }
.sig td.num { text-align: right; white-space: nowrap; font-family: var(--f-mono); border-left: 1px solid var(--rule-red); padding-left: 0.6rem; }
.sig td.notes { font: 400 var(--t-xs)/1.5 var(--f-mono); color: var(--ink-soft); max-width: 46ch; }
.sig tbody th { font-weight: 600; }
.sig tr.nosig th, .sig tr.nosig td { color: var(--ink-soft); }
.totalbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); padding: 0.9rem 0 0.3rem; border-bottom: 3px double var(--ink); font-size: var(--t-sm); font-weight: 600; }
.totalbar .num { font-weight: 700; }

/* officials */
.officials { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
@media (max-width: 56rem) { .officials { grid-template-columns: minmax(0, 1fr); } }
.oath { font: italic 400 var(--t-xl)/1.3 var(--f-display); color: var(--parchment); margin: 0 0 var(--s-5); max-width: 30ch; }
.dos { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.dos li { display: grid; grid-template-columns: 1.5rem 1fr; gap: var(--s-3); align-items: start; color: var(--ink-on-dark-soft); }
.dos svg { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--gold); }
.dos .n svg { color: var(--ink-on-dark-soft); }
.dos .num { color: var(--parchment); }
.sec--dark a:not(.btn) { color: var(--parchment); }

/* methodology: the pipeline travels sideways */
.arch { background: var(--charcoal); color: var(--ink-on-dark); }
.arch [data-sc-stage] { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; min-height: 100svh; overflow: hidden; }
.arch__head { padding-top: calc(var(--mast-h) + 2rem); }
.arch__head h2 { font: 400 var(--t-2xl)/1.04 var(--f-display); letter-spacing: -0.01em; margin: 0 0 var(--s-4); max-width: 22ch; color: var(--parchment); }
.arch__head .soft { max-width: 62ch; color: var(--ink-on-dark-soft); margin: 0; }
.rail { list-style: none; margin: 0; display: flex; gap: clamp(1.25rem, 2.5vw, 2rem); padding: var(--s-6) var(--gutter) clamp(3rem, 8vh, 5rem); width: max-content; align-items: stretch; }
.stage-card { width: clamp(15rem, 22vw, 19rem); flex: none; border-top: 3px double var(--ink-on-dark-soft); padding: var(--s-4) 0 0; display: grid; align-content: start; gap: var(--s-3); position: relative; }
.stage-card h3 { font: italic 400 var(--t-xl)/1.1 var(--f-display); color: var(--parchment); margin: 0; display: flex; gap: 0.6rem; align-items: baseline; }
.stage-card h3 .num { font-size: var(--t-sm); color: var(--gold); font-style: normal; }
.stage-card p { font-size: var(--t-sm); color: var(--ink-on-dark-soft); margin: 0; }
.stage-card .cad { font: 400 var(--t-xs)/1.3 var(--f-mono); color: var(--teal-light); }
.stage-card--out { border-top-color: var(--parchment); }
.stage-card--wide { width: clamp(22rem, 40vw, 36rem); }
.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-5); list-style: none; margin: 0; padding: 0; }
.sources li { border-left: 1px solid var(--rule-dark); padding-left: var(--s-3); display: grid; gap: 0.2rem; }
.sources b { font: italic 400 var(--t-lg)/1.1 var(--f-display); color: var(--parchment); font-weight: 400; }
.sources span { font-size: var(--t-xs); color: var(--ink-on-dark-soft); }
@media (max-width: 46rem) { .rail { width: auto; flex-direction: column; } .stage-card, .stage-card--wide { width: auto; } .sources { grid-template-columns: minmax(0, 1fr); } }

/* coverage */
.counties { list-style: none; margin: var(--s-6) 0 0; padding: 0; border-top: 3px double var(--ink); }
.counties li { display: grid; grid-template-columns: minmax(10rem, 1.1fr) 5.5rem minmax(0, 2fr); gap: var(--s-4); padding: 1.1rem 0 0.35rem; border-bottom: 1px solid var(--rule); align-items: end; }
.counties .c { font: italic 400 var(--t-xl)/1.1 var(--f-display); }
.counties .d { font-size: var(--t-sm); color: var(--ink-soft); margin: 0; }
@media (max-width: 40rem) { .counties li { grid-template-columns: 1fr auto; } .counties .d { grid-column: 1 / -1; } }

/* api */
.api { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 56rem) { .api { grid-template-columns: minmax(0, 1fr); } }
pre.code { white-space: pre-wrap; overflow-wrap: break-word; margin: 0; background: #11100f; color: #e6dfcf; border: 1px solid var(--rule-dark); padding: var(--s-5); overflow-x: auto; font: 400 var(--t-xs)/1.65 var(--f-mono); }
pre.code .k { color: var(--gold); } pre.code .s { color: var(--teal-light); } pre.code .c { color: #a89f8d; }

/* close + footer */
.close { border-top: 1px solid var(--rule-dark); }
.close h2 { font-size: var(--t-3xl); max-width: 14ch; }
.foot { background: #121110; color: var(--ink-on-dark-soft); padding-block: var(--s-7) calc(var(--s-7) + env(safe-area-inset-bottom, 0px)); font-size: var(--t-sm); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); }
@media (max-width: 46rem) { .foot__grid { grid-template-columns: minmax(0, 1fr); } }
.foot h2 { font: italic 400 var(--t-lg)/1.2 var(--f-display); color: var(--parchment); margin: 0 0 var(--s-3); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.foot a { color: var(--ink-on-dark-soft); }
.foot a:hover { color: var(--parchment); }
.foot p { margin: 0 0 var(--s-3); max-width: 60ch; }
.nf { font: 400 var(--t-3xl)/1 var(--f-display); margin: 0 0 var(--s-5); max-width: 14ch; color: var(--parchment); }

/* no JS: reveal targets stay visible */
html:not(.sc-ready) [data-sc-in], html:not(.sc-ready) [data-sc-stagger] > * { opacity: 1; transform: none; }

.nf-note { margin-top: var(--s-5); color: var(--ink-on-dark-soft); }

/* =====================================================================
   Round 4: one pitch per sheet (rule.js aligns every entry to it)
   ===================================================================== */
:root { --P: 2rem; }
.sec--paper.ruled, .hero [data-sc-stage].ruled {
  background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--P) - 1px), var(--rule) calc(var(--P) - 1px) var(--P));
  background-position: 0 var(--rule-off, 0px);
}
.sec--paper.ruled {
  background-image:
    linear-gradient(90deg,
      transparent calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 4px),
      transparent calc(var(--margin-x) - 4px), transparent calc(var(--margin-x) - 1px), var(--rule-red) calc(var(--margin-x) - 1px),
      var(--rule-red) var(--margin-x), transparent var(--margin-x)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--P) - 1px), var(--rule) calc(var(--P) - 1px) var(--P));
  background-position: 0 0, 0 var(--rule-off, 0px);
}
.hero.paper { background-image: linear-gradient(90deg,
    transparent calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 5px), var(--rule-red) calc(var(--margin-x) - 4px),
    transparent calc(var(--margin-x) - 4px), transparent calc(var(--margin-x) - 1px), var(--rule-red) calc(var(--margin-x) - 1px),
    var(--rule-red) var(--margin-x), transparent var(--margin-x)); }
/* the hero is anchored to the top so late fonts never move it */
.hero [data-sc-stage] { align-content: start; }
.hero__page { padding-top: calc(var(--mast-h) + 3 * var(--P)); }
.hero__grid { align-items: start; }
/* line heights are whole or half pitches */
.ruled h1 { font-size: clamp(3rem, 1.6rem + 4.2vw, 5rem); line-height: calc(var(--P) * 3); margin-bottom: var(--P); }
.ruled h2 { line-height: calc(var(--P) * 2); margin-bottom: var(--P); }
.ruled h3 { line-height: var(--P); }
.ruled .worked .addr { margin-bottom: var(--P); }
.ruled .note { line-height: var(--P); }
.ruled .note .tag { line-height: 1.2; }
.sig td.notes { font: 400 var(--t-xs)/1.45 var(--f-text); }
.ruled p, .ruled li, .ruled dd, .ruled dt, .ruled .lede, .ruled .hero__lede, .ruled .entries__title p, .ruled .field label { line-height: var(--P); }
.ruled .hint, .ruled caption, .ruled .entries__src, .ruled .addr, .ruled .hero__meta, .ruled .glossary dd { line-height: var(--P); }
.ruled .hero__lede { margin-bottom: var(--P); }
.ruled .ledger th, .ruled .ledger td { border-bottom-color: transparent; padding-top: 0.2rem; padding-bottom: 0.32rem; line-height: 1.35; }
.ruled .ledger thead th { border-bottom-color: transparent; }
.ruled .totals li { border-bottom: 0; padding: 0; min-height: var(--P); align-items: last baseline; }
.ruled .totals li:first-child { border-top: 0; box-shadow: inset 0 3px 0 -1px var(--parchment), inset 0 4px 0 -1px var(--ink), inset 0 1px 0 0 var(--ink); }
.ruled .worked dt, .ruled .worked dd { border-bottom: 0; padding: 0; }
.ruled .counties li { border-bottom: 0; padding: 0; }
.ruled .glossary div { border-top: 0; padding-top: 0; }
@media (max-width: 46rem) {
  .ruled h1 { font-size: 2.9rem; line-height: calc(var(--P) * 2); }
  .ruled h2 { font-size: 2.2rem; line-height: calc(var(--P) * 1.5); }
  .hero__page { padding-top: calc(var(--mast-h) + 2 * var(--P)); }
}

/* the strike passes behind the figures: a knockout keeps every figure legible */
.entries .ledger td > *:not(.strike), .entries .ledger th > *:not(.stamp) { position: relative; z-index: 1; }
.entries .ledger tbody td, .entries .ledger tbody th { text-shadow: 0 0 2px var(--parchment), 0 0 3px var(--parchment), 0 0 4px var(--parchment); }
.strike { z-index: 0; }

/* no gradient fades over text: on phones the running head keeps only the dashboard link */
@media (max-width: 46rem) {
  .mast nav { display: none; }
  .mast nav { -webkit-mask-image: none; mask-image: none; }
}

/* engine: four stages in one row, joined by chain links */
.arch { padding-block: var(--section); }
.arch__head { padding-top: 0; }
.rail { width: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); padding: var(--s-6) 0 0; gap: clamp(1.25rem, 2.5vw, 2rem); }
.stage-card { width: auto; }
.stage-card + .stage-card::before { content: ""; position: absolute; left: calc(-1 * clamp(1.25rem, 2.5vw, 2rem) - 0.1rem); top: 1.55rem; width: calc(clamp(1.25rem, 2.5vw, 2rem) + 0.2rem); height: 0.55rem; border: 2px solid var(--gold); border-radius: 999px; }
.stage-card .cad, .sources .cad { color: var(--ink-on-dark-soft); }
.stage-card .cad::before { content: "Runs: "; }
@media (max-width: 56rem) {
  .rail { grid-template-columns: minmax(0, 1fr); }
  .stage-card + .stage-card::before { left: 1.2rem; top: calc(-1 * clamp(1.25rem, 2.5vw, 2rem) - 0.1rem); width: 0.55rem; height: calc(clamp(1.25rem, 2.5vw, 2rem) + 0.2rem); }
}
pre.code .k, pre.code .s { color: #e6dfcf; }
pre.code .s { color: var(--ink-on-dark-soft); }
pre.code { background: var(--charcoal); }

/* slips: one ink border, no offset frame */
.drawer { box-shadow: none; }

/* officials: no dead band */
.officials { align-items: center; }

abbr[title] { text-decoration: none; cursor: help; }
.tally { width: calc(100% - 8px); max-width: 40rem; }
.ledger caption, .entries__src { overflow-wrap: anywhere; }

.ruled .entries .ledger tbody td, .ruled .entries .ledger tbody th { padding-top: 0.2rem; }
.ruled .entries__src { margin-top: var(--P); }

/* round 4 craft: coverage entries on the rule, never colliding */
.ruled .counties li { padding: calc(var(--P) / 2) 0; }
.ruled .counties .c { font-size: var(--t-lg); line-height: var(--P); }
.ruled .counties .d { line-height: var(--P); }
.sig th, .sig td { vertical-align: baseline; }
.drawer .tag { white-space: normal; }
.results button { padding-top: 0.5rem; padding-bottom: 0.2rem; }
.hero__meta { max-width: 40ch; }

.signals { font: 400 var(--t-xs)/1.5 var(--f-text); }
.signals .mono, .sig td.notes .mono { font-size: 0.95em; }
.rec-check { padding: 0 0.3em; font-size: 0.75rem; }
.tally tr.t .num { color: var(--ink); }

.officials + .arch, #officials + #method { padding-top: calc(var(--section) * 0.35); }

/* round 5: drawer text at reading spacing, not ledger pitch */
.ruled .drawer li, .ruled .drawer p, .ruled .drawer dd, .ruled .drawer dt, .ruled .results li { line-height: 1.5; }
.ruled .drawer h3 { line-height: 1.15; }
.stage-card .cad--out::before { content: none; }
.menu-btn { display: none; font: 600 var(--t-xs)/1 var(--f-text); padding: 0.45rem 0.6rem; border: 1px solid var(--rule-ink); border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer; min-height: 2.25rem; }
@media (max-width: 46rem) {
  .menu-btn { display: inline-block; }
  .mast nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--parchment); border-bottom: 1px solid var(--rule-red); padding: var(--s-2) var(--gutter) var(--s-3); }
  .mast nav.is-open ul { flex-direction: column; gap: 0; font-size: var(--t-sm); }
  .mast nav.is-open a { display: block; padding-block: 0.6rem; }
  .entries .pts .sos { display: none; }
  .entries .pts small { display: inline; margin-left: 0.2rem; }
  /* second signal as stacked entries on phones */
  .table-wrap { max-height: none; overflow: visible; }
  .sig { min-width: 0; }
  .sig thead { display: none; }
  .sig, .sig tbody, .sig tr, .sig td, .sig th { display: block; width: 100%; }
  .sig tr { padding: 0.6rem 0 0.4rem; border-bottom: 1px solid var(--rule-ink); }
  .sig th, .sig td { border: 0; padding: 0.1rem 0; text-align: left; }
  .sig td.num { text-align: left; border-left: 0; padding-left: 0; }
  .sig td[data-label]::before { content: attr(data-label) ": "; font: 400 var(--t-xs)/1.4 var(--f-text); color: var(--ink-soft); }
  .sig td.notes { max-width: none; }
}

/* round 5 craft: the worked entry and the look-up list on the pitch */
.ruled .worked .total { font-size: var(--t-lg); line-height: var(--P); }
.ruled .worked dd, .ruled .worked dt { line-height: var(--P); }
.ruled .results button { padding: 0 0.4rem; row-gap: 0; }
.ruled .results .o, .ruled .results .v, .ruled .results .m { line-height: var(--P); }
.ruled .results li { line-height: var(--P); border-bottom: 0; }
.ruled .results { border-top: 0; max-height: calc(var(--P) * 12); }
.sec--dark { padding-block: calc(var(--section) * 0.75); }
@media (min-width: 56.01rem) { .api { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); align-items: center; } }

.note-line { display: block; }
.ruled .entries__src, .ruled caption, .ruled .hint { line-height: 1.5; }

@media (max-width: 56rem) { pre.code { white-space: pre; overflow-x: auto; } }
#officials { padding-bottom: calc(var(--section) * 0.55); }
.rail { align-items: start; }

/* round 7 */
.totals li b { margin-left: auto; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 0.8rem; height: 0.8rem; cursor: pointer;
  background: linear-gradient(45deg, transparent 45%, var(--ink) 45% 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--ink) 45% 55%, transparent 55%); }

/* round 7 craft: code keeps its indentation; desk sections close up */
pre.code { white-space: pre !important; overflow-x: auto; overflow-wrap: normal; }
#officials { padding-block: calc(var(--section) * 0.6) calc(var(--section) * 0.45); }
#method { padding-bottom: calc(var(--section) * 0.5); }
#api { padding-block: calc(var(--section) * 0.55); }
@media (min-width: 56.01rem) { .api { align-items: start; } }

.ruled .totals li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: last baseline; }
.figs .big--ink { color: var(--ink); }
@media (max-width: 46rem) { .seg { display: flex; } .seg button { flex: 1 1 0; padding-inline: 0.5rem; } }
