/* Promise Tracker: editorial, ruled, quiet.
   Type scale (rem): 0.8125 / 0.9375 / 1.0625 / 1.3125 / 1.75 / 2.5
   Fonts: Newsreader (headings, 400-500, upright) and Public Sans (body 400, UI 500/600). Both OFL. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.3125rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.5rem;

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Light: warm paper, near-black ink. All status inks >= 4.5:1 on --paper (checked in tests). */
  --paper: #f6f2e8;
  --paper-2: #ede7d9;
  --ink: #1c1a16;
  --ink-2: #4f4a40;
  --rule: #cfc6b3;
  --rule-strong: #1c1a16;
  --link: #1c1a16;
  --focus: #1d4ed8;
  --kept: #2b6430;
  --in_progress: #85540a;
  --stalled: #475a73;
  --broken: #a3302a;
  --not_started: #615c52;

  color-scheme: light;
}

/* Dark: deep warm charcoal, off-white ink. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1b18;
    --paper-2: #27241f;
    --ink: #ede7da;
    --ink-2: #b8b0a0;
    --rule: #4a443a;
    --rule-strong: #ede7da;
    --link: #ede7da;
    --focus: #93b4ff;
    --kept: #82c48c;
    --in_progress: #e2b45e;
    --stalled: #a3b6cf;
    --broken: #f28b80;
    --not_started: #aca596;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1d1b18;
  --paper-2: #27241f;
  --ink: #ede7da;
  --ink-2: #b8b0a0;
  --rule: #4a443a;
  --rule-strong: #ede7da;
  --link: #ede7da;
  --focus: #93b4ff;
  --kept: #82c48c;
  --in_progress: #e2b45e;
  --stalled: #a3b6cf;
  --broken: #f28b80;
  --not_started: #aca596;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: break-word;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: normal;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--fs-2xl); line-height: 1.05; letter-spacing: -0.02em; font-weight: 500; }
p { margin: 0 0 var(--s3); }

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

.visually-hidden {
  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-link {
  position: absolute; left: var(--s4); top: -10rem; z-index: 10;
  padding: var(--s3) var(--s4); background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: var(--fs-sm);
}
.skip-link:focus { top: var(--s2); }

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 var(--s4); }
.wrap.narrow { max-width: 46rem; }
.tabular, time, .tally td, .count { font-variant-numeric: tabular-nums lining-nums; }
.sep { color: var(--ink-2); }
.meta { font-size: var(--fs-xs); color: var(--ink-2); letter-spacing: 0.005em; margin-bottom: var(--s2); }
.muted { color: var(--ink-2); }

/* ---------- site header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4);
  min-height: 3.5rem;
}
.site-name { margin: 0; margin-right: auto; font-family: var(--serif); font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; }
.site-name a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-nav { display: flex; gap: var(--s4); font-size: var(--fs-sm); font-weight: 500; }
.site-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
.theme-toggle {
  font: 500 var(--fs-xs) / 1 var(--sans); color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 2px;
  min-height: 2.75rem; min-width: 2.75rem; padding: 0 var(--s3); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }

/* ---------- masthead ---------- */
.masthead { padding: var(--s6) 0 var(--s5); border-bottom: 3px double var(--rule-strong); margin-bottom: var(--s5); }
.kicker {
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: 0.06em; color: var(--ink-2);
  margin: 0 0 var(--s2);
}
.masthead h1 { max-width: 20ch; }
.office { font-family: var(--serif); font-size: var(--fs-lg); margin: var(--s2) 0 var(--s3); line-height: 1.3; }
.dateline { font-size: var(--fs-xs); color: var(--ink-2); margin: 0; border-top: 1px solid var(--rule); padding-top: var(--s2); display: inline-block; }
.dateline a { color: inherit; }
.standfirst { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.4; max-width: 34em; margin: var(--s3) 0 0; }

/* ---------- section headings ---------- */
.section-h { font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -0.01em; margin: var(--s6) 0 var(--s3); }
.section-h .kicker { display: block; margin-bottom: var(--s1); }
.section-count { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-2); letter-spacing: 0; white-space: nowrap; }
.tracker-section:first-of-type .section-h { margin-top: var(--s4); }

/* ---------- tracker layout ---------- */
.tracker-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-bottom: var(--s7); }
.rail-block { border-top: 1px solid var(--rule-strong); padding-top: var(--s3); margin-bottom: var(--s5); }
.rail-h {
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em;
  font-variant-caps: all-small-caps; color: var(--ink); margin: 0 0 var(--s3);
}
.rail-note { font-size: var(--fs-xs); color: var(--ink-2); margin-top: var(--s2); }

/* tally: a plain ruled table */
.tally { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tally th, .tally td { padding: var(--s2) var(--s1); border-bottom: 1px solid var(--rule); text-align: right; font-weight: 400; }
.tally thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); border-bottom-color: var(--rule-strong); vertical-align: bottom; }
.tally tbody th, .tally tfoot th { text-align: left; white-space: nowrap; }
.tally tfoot th, .tally tfoot td { font-weight: 600; border-bottom: 3px double var(--rule-strong); }
.tally th:first-child { padding-left: 0; }
.tally td:last-child, .tally th:last-child { padding-right: 0; }
.tally .mark { margin-right: var(--s2); }

/* filters: a disclosure on phones, open in the rail on wide screens */
.filters summary {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  min-height: 2.75rem; margin: 0; list-style: none;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "+"; font-family: var(--sans); font-size: var(--fs-lg); font-weight: 400; line-height: 1; }
.filters[open] summary::after { content: "\2212"; }
.filter-form { display: grid; gap: var(--s3); padding: var(--s2) 0 var(--s3); }
.field { display: grid; gap: var(--s1); }
.field label { font-size: var(--fs-xs); font-weight: 600; }
input[type="search"], select {
  font: 400 1rem/1.3 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-2); border-radius: 2px;
  min-height: 2.75rem; padding: var(--s2) var(--s3); width: 100%;
}
select { cursor: pointer; }
.form-actions { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.button {
  font: 600 var(--fs-sm)/1 var(--sans); color: var(--paper); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 2px; min-height: 2.75rem; padding: 0 var(--s4); cursor: pointer;
}
.button:hover { background: var(--ink-2); border-color: var(--ink-2); }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--ink-2); }
.button-quiet:hover { background: var(--paper-2); color: var(--ink); }
.clear-link { font-size: var(--fs-sm); display: inline-flex; align-items: center; min-height: 2.75rem; }

.result-count { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); }

/* ---------- status mark ---------- */
.mark { display: inline-block; width: 0.625rem; height: 0.625rem; background: var(--not_started); flex: none; }
.status { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; }
[data-status="kept"] { --st: var(--kept); }
[data-status="in_progress"] { --st: var(--in_progress); }
[data-status="stalled"] { --st: var(--stalled); }
[data-status="broken"] { --st: var(--broken); }
[data-status="not_started"] { --st: var(--not_started); }
.status, .mark[data-status] { color: var(--st); }
.status .mark, .mark[data-status] { background: var(--st); }

/* ---------- item rows ---------- */
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.item { padding: var(--s4) 0 var(--s3); border-bottom: 1px solid var(--rule); scroll-margin-top: var(--s4); }
.item:target { background: var(--paper-2); box-shadow: -0.75rem 0 0 var(--paper-2), 0.75rem 0 0 var(--paper-2); }
.item-status { margin-bottom: var(--s2); }
.item-title { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -0.005em; margin-bottom: var(--s1); max-width: 34em; }
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.summary, .rationale, .relations { font-size: var(--fs-sm); max-width: 38em; }
.summary { margin-bottom: var(--s2); }
.label { font-weight: 600; }
.relations { margin-bottom: var(--s2); }
.sources {
  margin: var(--s2) 0 0; padding: var(--s2) 0 0 1.5rem; font-size: var(--fs-xs); color: var(--ink-2);
  border-top: 1px dotted var(--rule); max-width: 46em;
}
.sources li { margin-bottom: var(--s1); padding-left: var(--s1); }
.sources li::marker { font-variant-numeric: tabular-nums; }
.sources a { color: var(--ink); font-weight: 500; }
.empty { font-size: var(--fs-sm); color: var(--ink-2); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); margin: 0; }
.data-link { font-size: var(--fs-xs); margin-top: var(--s6); }

/* ---------- index roster ---------- */
.roster { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-strong); }
.roster-row { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.row-title { font-size: var(--fs-lg); line-height: 1.2; margin-bottom: var(--s1); }
.roster-office { margin-bottom: var(--s1); }
.aside-note { font-size: var(--fs-sm); margin: var(--s6) 0 var(--s7); }

/* ---------- prose (methodology) ---------- */
.prose p { max-width: 38em; }
.prose .section-h { font-size: var(--fs-lg); margin-top: var(--s6); }
.defs { margin: var(--s4) 0; border-top: 1px solid var(--rule-strong); }
.def { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.def dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s1); }
.def-status { font-size: var(--fs-sm); }
.def-alt { font-size: var(--fs-xs); color: var(--ink-2); }
.def dd { margin: 0; font-size: var(--fs-sm); max-width: 38em; }
.prose > p:last-child { margin-bottom: var(--s7); }

/* ---------- review ---------- */
.inline-form { margin: var(--s2) 0; }
.snippet summary { cursor: pointer; font-size: var(--fs-xs); font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.snippet pre { font-size: var(--fs-xs); background: var(--paper-2); padding: var(--s3); overflow-x: auto; margin: 0 0 var(--s2); }

/* ---------- footer ---------- */
.site-foot { border-top: 3px double var(--rule-strong); padding: var(--s4) 0 var(--s6); font-size: var(--fs-xs); color: var(--ink-2); }
.site-foot p { margin: 0 0 var(--s1); }

/* ---------- phones: one-line header, filters near the top ---------- */
@media (max-width: 59.99rem) {
  .rail { display: flex; flex-direction: column; }
  .rail .filters { order: -1; }
}
@media (max-width: 29.99rem) {
  .site-head-inner { flex-wrap: nowrap; gap: 0 var(--s3); }
  .site-name { font-size: var(--fs-md); white-space: nowrap; }
  .site-nav { gap: var(--s3); font-size: var(--fs-xs); }
  .theme-toggle { padding: 0 var(--s2); }
}

/* ---------- wide screens: rail + main column ---------- */
@media (min-width: 60rem) {
  h1 { font-size: 3rem; letter-spacing: -0.025em; }
  .masthead { padding-top: var(--s7); }
  .tracker-layout { grid-template-columns: 19rem minmax(0, 1fr); gap: var(--s7); align-items: start; }
  .rail { position: sticky; top: var(--s4); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 0 2px; }
  .item { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: var(--s5); }
  .item-status { margin: 0.3rem 0 0; align-items: baseline; }
  .item-status .mark { transform: translateY(0.05rem); }
}

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

@media print {
  .site-head, .rail .filters, .theme-toggle, .skip-link, .data-link { display: none !important; }
  .item[hidden] { display: block !important; }
}
