:root {
  --canvas: #f3f0e9;
  --surface: #fbf9f4;
  --raised: #eae5da;
  --rule: #ded7c9;
  --ink: #221e16;
  --mute: #635c4e;
  --faint: #91887a;
  --attested: #036849;
  --failing: #bf1d1d;
  --queued: #855405;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.bar .inner {
  max-width: 60rem; margin: 0 auto; padding: 0.85rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 800; text-decoration: none;
}
.brand svg { width: 1.4rem; height: 1.4rem; display: block; }
.bar nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.bar nav a { color: var(--mute); text-decoration: none; }
.bar nav a:hover { color: var(--ink); }
.bar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { max-width: 60rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 {
  font-size: 1.45rem; letter-spacing: -0.01em;
  margin: 3.25rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }
p { margin: 0.9rem 0; }
.lede { font-size: 1.2rem; color: var(--mute); margin-top: 1.25rem; max-width: 46rem; }
.crumb { font-size: 0.85rem; color: var(--faint); margin-bottom: 1rem; }
.crumb a { color: var(--faint); }

ul, ol { margin: 0.9rem 0; padding-left: 1.25rem; }
li { margin: 0.35rem 0; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 0.6rem; padding: 1.15rem 1.25rem; margin: 0.85rem 0;
}
.grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid .card { margin: 0; }
.card h3 { margin-top: 0; }
.card p { margin: 0.4rem 0 0; color: var(--mute); font-size: 0.95rem; }

.rule { border-top: 1px solid var(--rule); padding: 1.35rem 0; }
.rule:last-child { border-bottom: 1px solid var(--rule); }
.rule .id { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--faint); }
.rule .id a { text-decoration: none; }
.rule .name { font-weight: 700; margin: 0.15rem 0 0.35rem; }
.rule .statement { margin: 0; }
.rule .note {
  margin: 0.7rem 0 0; padding-left: 0.9rem;
  border-left: 2px solid var(--rule); color: var(--mute); font-size: 0.95rem;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem;
  margin-top: 0.75rem; font-size: 0.78rem;
}
.tag {
  border: 1px solid var(--rule); background: var(--raised);
  border-radius: 0.35rem; padding: 0.1rem 0.45rem; color: var(--mute);
}
.tag.force { font-weight: 700; color: var(--ink); }
.tag.auto { border-color: var(--attested); color: var(--attested); background: transparent; }
.tag.manual { border-color: var(--rule); color: var(--faint); background: transparent; }

table { border-collapse: collapse; width: 100%; margin: 1.1rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.scroll { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.past { color: var(--failing); font-weight: 600; }
.soon { color: var(--queued); font-weight: 600; }
.later { color: var(--mute); }

.controls { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.controls label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.8rem; color: var(--faint);
}
.controls select, .controls input {
  font: inherit; font-size: 0.95rem; padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule); border-radius: 0.4rem;
  background: var(--surface); color: var(--ink);
}
.count { color: var(--mute); font-size: 0.95rem; }

dl.terms { margin: 1.25rem 0; }
dl.terms > div { border-top: 1px solid var(--rule); padding: 1rem 0; }
dl.terms dt { font-weight: 700; }
dl.terms dd { margin: 0.3rem 0 0; color: var(--mute); }
dl.terms .alts { font-size: 0.85rem; color: var(--faint); margin-top: 0.35rem; }

.cta {
  margin-top: 3.5rem; padding: 1.6rem; border-radius: 0.6rem;
  background: var(--raised); border: 1px solid var(--rule);
}
.cta h2 { margin: 0 0 0.4rem; border: 0; padding: 0; font-size: 1.2rem; }
.cta p { margin: 0; color: var(--mute); }
.cta a { font-weight: 700; }

footer.site {
  border-top: 1px solid var(--rule); margin-top: 4rem;
  padding: 2rem 1.5rem 3rem; font-size: 0.88rem; color: var(--faint);
}
footer.site .inner { max-width: 60rem; margin: 0 auto; }
footer.site p { margin: 0.35rem 0; }
