:root {
  --ink: #14212e;
  --paper: #eef1f4;
  --sheet: #ffffff;
  --rule: #c3ced8;
  --rule-soft: #dee5ea;
  --muted: #54677a;
  --amber: #94570a;
  --amber-wash: #f6ecdc;
  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  line-height: 1.62;
  font-optical-sizing: auto;
}

.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--amber); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.wordmark {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.wordmark span { color: var(--amber); }

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- disclosure ---------- */

.disclosure {
  background: var(--amber-wash);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4a3618;
}

.disclosure .wrap { padding-block: 0.65rem; max-width: 74rem; }

/* ---------- hero: the ledger is the hero ---------- */

.lede { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.75rem; }

h1 {
  font-size: clamp(2rem, 1.3rem + 3.1vw, 3.4rem);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 20ch;
}

.standfirst {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.1em;
  max-width: var(--measure);
}

.stamp {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  border-left: 3px solid var(--amber);
  padding-left: 0.85rem;
  margin: 0;
}

.stamp b { color: var(--ink); font-weight: 500; }

/* ---------- the ledger ---------- */

.ledger-frame {
  background: var(--sheet);
  border: 1px solid var(--rule);
  margin-block: 2rem 1rem;
  overflow-x: auto;
}

table.ledger {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

table.ledger caption {
  text-align: left;
  padding: 1rem 1.1rem 0.75rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.05rem;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-soft);
}

table.ledger th {
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

table.ledger td {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}

table.ledger .num { text-align: right; }
table.ledger .app { font-family: "Newsreader", Georgia, serif; font-size: 1.02rem; }
table.ledger tbody tr:last-child td { border-bottom: 1px solid var(--rule); }

table.ledger tfoot td {
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  border-bottom: none;
}

.fill { color: var(--amber); }

.tag {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.go { text-decoration: none; border-bottom: 1px solid var(--amber); color: var(--amber); white-space: nowrap; }
.go:hover { background: var(--amber-wash); }

/* ---------- sections ---------- */

section { padding-block: clamp(2.25rem, 5vw, 3.5rem); border-top: 1px solid var(--rule); }
section:first-of-type { border-top: none; }

h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.95rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 0.9rem;
  max-width: 26ch;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.4rem;
}

h3 + .meta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

p { margin: 0 0 1rem; }

.entry { max-width: var(--measure); padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule-soft); }
.entry:last-of-type { border-bottom: none; }

.method { max-width: var(--measure); }
.method li { margin-bottom: 0.5rem; }

details {
  border-bottom: 1px solid var(--rule-soft);
  max-width: var(--measure);
  padding: 0.9rem 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "+";
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  flex: none;
}

details[open] summary::before { content: "\2212"; }
details p { margin: 0.7rem 0 0; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--rule);
  background: var(--sheet);
  font-size: 0.9rem;
  color: var(--muted);
}

footer .wrap { padding-block: 2rem 3rem; }
footer p { max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
