:root {
  --paper: #f4f6f8;
  --surface: #ffffff;
  --ink: #16202a;
  --muted: #56616d;
  --rule: #d6dce2;
  --link: #1d4b78;
  --company: #6a4c9c;
  --school: #2b7a68;
  --government: #2c5c8f;
  --religious: #8a5a1f;
  --grave: #9a2b2b;
  --resolved: #2e6a40;
  --focus: #c47a00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12181f;
    --surface: #18212a;
    --ink: #e4e9ee;
    --muted: #9aa6b2;
    --rule: #2c3743;
    --link: #8db8e4;
    --company: #a48ad6;
    --school: #5cbfa6;
    --government: #79a7d9;
    --religious: #d6a464;
    --grave: #e48a8a;
    --resolved: #84c79a;
    --focus: #f0b54a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 "Public Sans", system-ui, sans-serif;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem .75rem; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-head, .site-foot, main { max-width: 64rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.site-head {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.brand { font-weight: 800; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-head nav { display: flex; gap: 1.25rem; font-size: .95rem; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }

/* Intro */
.intro { padding: 2.5rem 0 1.5rem; }
.intro h1 {
  font-weight: 800; font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.04;
  letter-spacing: -0.03em; margin: 0 0 1rem; max-width: 16ch;
}
.intro.narrow h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 24ch; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin: 0 0 1.75rem; }
.crumb { margin: 0 0 .5rem; font-size: .95rem; }

.filters { display: grid; gap: .9rem; }
.search input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: .8rem 1rem;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font: inherit; font-size: .95rem; padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
}
.chip span { color: var(--muted); margin-left: .25rem; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.status-filter { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .95rem; }
.status-filter select {
  font: inherit; padding: .35rem .6rem; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink);
}
.count { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; min-height: 1.4em; }

/* Ledger */
.month h2 {
  position: sticky; top: 0; z-index: 1; margin: 0; padding: .75rem 0 .5rem;
  background: var(--paper); font-size: 1rem; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid var(--ink);
}
.entries { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.entry {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--rule);
}
.entry time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; padding-top: .2rem; }
.entry .body { border-left: 3px solid var(--rule); padding-left: 1rem; }
.cat-company .body { border-left-color: var(--company); }
.cat-school .body { border-left-color: var(--school); }
.cat-government .body { border-left-color: var(--government); }
.cat-religious .body { border-left-color: var(--religious); }
.entry h3 { margin: 0 0 .35rem; font-size: 1.12rem; line-height: 1.35; font-weight: 700; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { color: var(--link); text-decoration: underline; }
.summary { margin: 0 0 .55rem; max-width: 68ch; }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .88rem; color: var(--muted); align-items: baseline; }
.status { font-weight: 700; color: var(--ink); }
.s-conviction, .s-verdict, .s-charges { color: var(--grave); }
.s-settlement, .s-legislation, .s-policy { color: var(--resolved); }
.inst { font-weight: 500; }
.empty { color: var(--muted); padding: 2rem 0; }

/* Institutions directory */
.dirs { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); padding-bottom: 3rem; }
.dir h2 { font-size: 1rem; margin: 0 0 .5rem; padding-bottom: .4rem; border-bottom: 3px solid var(--rule); }
.dir.cat-company h2 { border-color: var(--company); }
.dir.cat-school h2 { border-color: var(--school); }
.dir.cat-government h2 { border-color: var(--government); }
.dir.cat-religious h2 { border-color: var(--religious); }
.dir ul { list-style: none; margin: 0; padding: 0; }
.dir li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.dir li span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* About */
.prose { max-width: 40rem; padding-bottom: 3rem; }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; letter-spacing: -0.01em; }
.prose li { margin-bottom: .4rem; }

.site-foot {
  border-top: 1px solid var(--rule); padding-top: 1.5rem; padding-bottom: 2.5rem;
  color: var(--muted); font-size: .9rem;
}
.site-foot p { max-width: 62ch; margin: 0 0 .6rem; }

@media (max-width: 40rem) {
  .entry { grid-template-columns: 1fr; gap: .35rem; }
  .entry .body { padding-left: .85rem; }
}
