:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --surface: #fff;
  --ink: #161816;
  --muted: #656963;
  --line: #d9ddd6;
  --accent: #164c38;
  --measure: 76rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-underline-offset: 0.2em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.masthead {
  min-height: 3.25rem;
  padding: 0.75rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
}

.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.source-nav { display: flex; gap: 1rem; color: var(--muted); }
.source-nav a { text-decoration-thickness: 1px; }

main, footer { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }

.hero { padding: clamp(3.5rem, 9vw, 8rem) 0 clamp(3rem, 7vw, 6rem); }
.eyebrow, .section-index {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 17ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 6vw, 5.75rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h2 { margin-bottom: 1rem; font-size: clamp(1.65rem, 3vw, 2.75rem); line-height: 1.08; letter-spacing: -0.025em; }
h3 { margin: 0.3rem 0 0.65rem; font-size: 1.05rem; line-height: 1.25; }
.lede { max-width: 46rem; color: #3e423d; font-size: clamp(1.1rem, 2vw, 1.35rem); }

.notice {
  max-width: 46rem;
  margin-top: 2rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.notice strong { display: block; margin-bottom: 0.25rem; }

.section {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(3rem, 0.3fr) minmax(0, 1.7fr);
  gap: clamp(1rem, 4vw, 4rem);
}

.section > * { min-width: 0; }
.section > div { max-width: 47rem; }
.section > .wide { max-width: 64rem; }
.prose p { max-width: 47rem; }
.standfirst { color: #3e423d; font-size: 1.125rem; }

.principle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  margin: 2rem 0;
  padding: 1rem;
  border-block: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
}

.boundary {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.boundary p:last-child { margin-bottom: 0; }

.table-wrap {
  width: 100%;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; min-width: 48rem; font-size: 0.9rem; }
th, td { padding: 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #edf1ec; color: var(--accent); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

.pending-evidence { margin-top: 1.5rem; }
.case-list { margin-top: 2rem; border-top: 1px solid var(--line); }
.case { padding: clamp(2rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--line); }
.case.partial-valid { border-left: 3px solid #a76d16; padding-left: 1rem; }
.case-heading { max-width: 48rem; }
.case-heading p:last-child { margin-bottom: 1.5rem; }
.case-media { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: 1rem; align-items: start; }
figure { margin: 0; min-width: 0; }
figure a { display: block; background: #e8ebe6; }
figure img { display: block; width: 100%; height: auto; object-fit: contain; object-position: top; }
figcaption { margin-top: 0.55rem; color: var(--muted); font-size: 0.8rem; }
.capture-note { max-width: 48rem; margin: 2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.reference-list, .decision-list { margin: 1.75rem 0; border-top: 1px solid var(--line); }
.reference-list article { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.reference-list article p:last-child { margin-bottom: 0; }
.decision-list article { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.decision-list h3 { margin-top: 0; }
.decision-list p:last-child { margin-bottom: 0; }
.decision-number { color: var(--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; }
.subhead { margin-top: 3rem; font-size: 1.25rem; }
.source-docs { margin-top: 1.5rem; }

.source-section > div { max-width: none; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1.5rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.source-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.source-grid article { padding: 1.15rem; background: var(--surface); }
.source-grid article p:last-child { margin-bottom: 0; color: #464b45; }
.source-type {
  margin: 0;
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.ledger-links { margin: 1.25rem 0 0; font-size: 0.9rem; }

footer {
  margin-top: 3rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (max-width: 42rem) {
  .masthead { align-items: flex-start; flex-direction: column; }
  .source-nav { width: 100%; overflow-x: auto; padding-bottom: 0.25rem; }
  .source-nav a { white-space: nowrap; }
  .section { grid-template-columns: 1fr; gap: 0; }
  .section-index { margin-bottom: 0.75rem; }
  .source-grid, .source-grid.two-up { grid-template-columns: 1fr; }
  .case-media { grid-template-columns: 1fr; }
  figure img { width: min(100%, 390px); height: auto; margin-inline: auto; }
  .principle-row { align-items: flex-start; flex-direction: column; }
  .principle-row span[aria-hidden="true"] { transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
