/* Evidence room. Dark by default, light when the system asks, paper when printed. */
:root {
  color-scheme: dark;
  --bg: #101410;
  --header-bg: rgba(16, 20, 16, 0.97);
  --surface: #1a211b;
  --ink: #f4f0e4;
  --muted: #c5ceb8;
  --line: #3e4c3c;
  --brass: #f0d48a;
  --brass-ink: #1a160c;
  --chip: #243528;
  --focus: #f0d48a;
  --selection-bg: #d8c797;
  --selection-ink: #171c18;
  --caret: #f0d48a;
  --scrollbar: #5f6b4f;
  --shell: 46rem;
  --serif: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Consolas, "Courier New", monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f0e6;
    --header-bg: rgba(244, 240, 230, 0.97);
    --surface: #fbf8f2;
    --ink: #1c2618;
    --muted: #3d4e36;
    --line: #d2cbb8;
    --brass: #6a4e16;
    --brass-ink: #fbf8f2;
    --chip: #e7efe4;
    --focus: #6a4e16;
    --selection-bg: #cfd8b9;
    --selection-ink: #283625;
    --caret: #405a33;
    --scrollbar: #8a9a72;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; scrollbar-color: var(--scrollbar) var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  caret-color: var(--caret);
}
::selection { background: var(--selection-bg); color: var(--selection-ink); }
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--brass); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--brass);
  color: var(--brass-ink);
  padding: 0.55rem 0.8rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  z-index: 40;
}
.skip:focus { transform: none; }
.wrap { width: min(var(--shell), calc(100% - 2rem)); margin: 0 auto; }

/* Canonical site header. Same structure, text and metrics on every surface. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  width: min(var(--shell), calc(100% - 2rem));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
}
.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.site-monogram { font: italic 400 30px/1 var(--serif); letter-spacing: -0.04em; color: var(--brass); }
.site-name { display: flex; flex-direction: column; font: 400 15px/1.2 var(--sans); letter-spacing: 0.02em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--brass); }
.site-nav a[aria-current="page"] { text-decoration: underline 1px var(--brass); text-underline-offset: 6px; }

/* Evidence section nav: the five evidence pages and the instruments index. */
.section-nav { border-bottom: 1px solid var(--line); }
.section-nav .wrap { display: flex; flex-wrap: wrap; gap: 0 20px; }
.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.02em;
}
.section-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline 1px var(--brass); text-underline-offset: 6px; }
.section-nav a:last-child { margin-left: auto; }

main { padding: 2.5rem 0 3.5rem; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-weight: 500; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0.2rem 0 0.9rem; }
h2 { font-weight: 500; font-size: 1.3rem; letter-spacing: -0.02em; margin: 2.1rem 0 0.45rem; }
h3 { font-weight: 500; font-size: 1.05rem; margin: 0 0 0.35rem; }
p { max-width: 68ch; text-wrap: pretty; }
.lede { font-size: 1.2rem; line-height: 1.55; margin-top: 0; max-width: 62ch; }
.counts, .note, .group-count { color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.counts, .note { font-size: 1rem; }
.claim-id, .group-count, time, .limit-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums lining-nums;
}
.claim-id, .group-count { color: var(--muted); }
.rules { margin: 1.5rem 0; display: grid; gap: 0.9rem; }
.rules div { display: grid; gap: 0.2rem; }
.rules dt { margin: 0; }
.rules dd { margin: 0; color: var(--muted); max-width: 68ch; }
.tools { display: grid; gap: 0.65rem; margin: 1.5rem 0 0.5rem; }
.tools label { font-size: 1rem; color: var(--muted); }
input[type="search"] {
  width: 100%;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0.75rem;
  font: 1rem/1.4 var(--serif);
}
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters button, button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  background: var(--chip);
  color: var(--ink);
  border: 1px solid var(--line);
}
.chip-owner, .chip-artifact { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.claim, .entry, .role {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.entry h2 { margin: 0.2rem 0 0.35rem; }
.claim-meta { margin: 0 0 0.35rem; display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.claim-text { margin: 0.25rem 0; }
.claim-limit { margin: 0.35rem 0 0; color: var(--muted); font-size: 1rem; }
.limit-label { text-transform: uppercase; }
.claim-links { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0.45rem 0 0; }
.claim-links a, .claim-links span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.group-count { margin-top: 0; }
.labs { padding-left: 1.1rem; }
.labs li { margin: 0.35rem 0; }
.labs a, .resume a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.boundary { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); }
.claim[hidden] { display: none; }

/* Canonical site footer. 12px mono, every link a 44px target. */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem max(1rem, calc((100% - var(--shell)) / 2)) 2.5rem;
  color: var(--muted);
  font: 400 12px/1.6 var(--mono);
}
.site-footer p { margin: 0; max-width: 68ch; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-footer-stamp { margin-bottom: 0.25rem; }
.site-footer-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }

@media (max-width: 680px) {
  .site-header-inner { flex-direction: column; align-items: stretch; padding: 8px 0 4px; }
  .site-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
  .site-nav a { justify-content: flex-start; }
  .section-nav a:last-child { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .filters button { transition: transform 160ms ease; }
  .filters button:hover { transform: translateY(-1px); }
}
@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --ink: #111;
    --muted: #222;
    --line: #bbb;
    --brass: #111;
    --brass-ink: #fff;
    --chip: #fff;
    --focus: #111;
  }
  @page { margin: 16mm; }
  body { font-size: 11pt; }
  .site-header, nav, .tools, .skip, .site-footer { display: none !important; }
  .wrap { width: auto; margin: 0; }
  a { text-decoration: none; }
  .resume a, .labs a { min-height: 0; min-width: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .claim, .entry, .role, .labs li { break-inside: avoid; }
  .resume h1 { font-size: 22pt; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
