/* lexplicit scoreboard: a compiler report for law. No script; tables first. */

:root {
  --paper: #e9edf0;
  --sheet: #f6f8f9;
  --ink: #17222c;
  --muted: #4f5d6a;
  --rule: #b4bfc8;
  --rule-soft: #d3dae0;
  --link: #24439a;
  --proved: #1f6446;
  --proved-wash: #dcebe2;
  --caution: #7d5200;
  --caution-wash: #f2e6c9;
  --fault: #8c2335;
  --fault-wash: #f3dade;
  --track: #d5dce2;
  --series-0: #24439a;
  --series-1: #8c2335;
  --series-2: #1f6446;
  --series-3: #7d5200;
  --grid: rgba(23, 34, 44, 0.045);
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", sans-serif;
  --text: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --code: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10161d;
    --sheet: #161e27;
    --ink: #dbe3ea;
    --muted: #9aa8b5;
    --rule: #3a4754;
    --rule-soft: #26313c;
    --link: #a3b8f4;
    --proved: #78c9a0;
    --proved-wash: #173126;
    --caution: #e2b65a;
    --caution-wash: #33290f;
    --fault: #f08a99;
    --fault-wash: #3a1a20;
    --track: #26313c;
    --series-0: #a3b8f4;
    --series-1: #f08a99;
    --series-2: #78c9a0;
    --series-3: #e2b65a;
    --grid: rgba(219, 227, 234, 0.035);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  font-optical-sizing: auto;
}

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

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); padding: 0.5rem 0.75rem; z-index: 2; }

code, pre { font-family: var(--code); font-size: 0.86em; }

/* Fixture banner */
.fixture {
  margin: 0;
  padding: 0.55rem clamp(1rem, 4vw, 3rem);
  background: repeating-linear-gradient(-45deg, var(--caution-wash) 0 12px, var(--sheet) 12px 24px);
  border-bottom: 1px solid var(--caution);
  color: var(--ink);
  font: 500 0.92rem/1.4 var(--display);
}

/* Masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2.5rem;
  padding: 1.75rem clamp(1rem, 4vw, 3rem) 1.25rem;
  border-bottom: 3px double var(--rule);
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-stretch: 68%;
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.wordmark-sub {
  display: block;
  margin-top: 0.35rem;
  font-stretch: 100%;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.cycle {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0.25rem 1.75rem;
  margin: 0;
  font-family: var(--display);
}
.cycle dt { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.cycle dd { margin: 0; font-size: 0.98rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Frame */
.frame {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0 clamp(1.5rem, 3vw, 3rem);
  max-width: 84rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.toc {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 1.75rem 0;
  font-family: var(--display);
  font-size: 0.93rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li a {
  display: block;
  padding: 0.22rem 0 0.22rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: -1px;
  border-left: 2px solid transparent;
}
.toc li a:hover { color: var(--ink); border-left-color: var(--ink); }
.toc-tiers { color: var(--muted); margin-top: 1.25rem; line-height: 1.5; }

main { min-width: 0; padding: 1.75rem 0 3rem; }

.lede {
  max-width: 34ch;
  margin: 0 0 2rem;
  font-family: var(--display);
  font-stretch: 82%;
  font-weight: 650;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
}

section { margin: 0 0 3rem; scroll-margin-top: 1rem; }
section > p, section > ul, section > dl { max-width: 72ch; }

h2 {
  margin: 0 0 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
  font-family: var(--display);
  font-stretch: 88%;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.2;
}

h3 {
  margin: 1.5rem 0 0.4rem;
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.08rem;
  line-height: 1.3;
}

.frac {
  display: block;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
h3 .frac, p .frac { display: inline; }

/* Tables */
.scroll { overflow-x: auto; margin: 0 0 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}
caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 0.4rem;
  font-weight: 650;
  font-size: 0.98rem;
}
th, td { padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
thead th { font-weight: 600; color: var(--muted); font-size: 0.82rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
tbody th { font-weight: 600; }
.num { text-align: right; white-space: nowrap; }
.pct { font-weight: 600; }
table.scores + table.scores { margin-top: 1.5rem; }
tr.headline td, tr.headline th { border-top: 1px solid var(--rule); }

/* Target gauge: the one bold element */
table.target td, table.target th { vertical-align: middle; }
.gauge-wrap { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.gauge { flex: 0 0 auto; width: 13rem; height: 1.1rem; overflow: visible; }
.reading { white-space: nowrap; }
.reading .pct { display: inline-block; min-width: 3.6rem; }
tr.tier-row th { padding-top: 0.75rem; border-bottom: 1px solid var(--rule); background: var(--paper); font-size: 0.98rem; }
table.target tbody th[scope="row"] { font-weight: 500; }
.gauge-track { fill: var(--track); }
.gauge-fill { fill: var(--muted); }
.gauge-target { stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
tr.met .gauge-fill { fill: var(--proved); }
tr.short .gauge-fill { fill: var(--caution); }
.verdict { font-weight: 600; }
tr.short .verdict { color: var(--caution); }
tr.met .verdict { color: var(--proved); }

/* Raw proposer curve */
.curve { margin: 0 0 1rem; padding: 1rem 1rem 0.75rem; background: var(--sheet); border: 1px solid var(--rule); max-width: 46rem; }
.curve svg { width: 100%; height: auto; display: block; }
.series { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.series-0 { stroke: var(--series-0); }
.series-1 { stroke: var(--series-1); }
.series-2 { stroke: var(--series-2); }
.series-3 { stroke: var(--series-3); }
.curve figcaption { font-family: var(--display); font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.key { margin-left: 1rem; color: var(--ink); white-space: nowrap; }
.key::before { content: ""; display: inline-block; width: 1.2rem; height: 2px; margin-right: 0.35rem; vertical-align: middle; background: currentColor; }
.key-0::before { background: var(--series-0); }
.key-1::before { background: var(--series-1); }
.key-2::before { background: var(--series-2); }
.key-3::before { background: var(--series-3); }

/* Audit and status marks */
.audit, .pstate {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.audit-bounded, .pstate-promoted { color: var(--proved); background: var(--proved-wash); }
.audit-degraded, .pstate-failed { color: var(--fault); background: var(--fault-wash); }
.audit-unaudited, .audit-unaudited-corpus, .pstate-unknown, .pstate-pending { color: var(--caution); background: var(--caution-wash); }
.pstate-excluded { color: var(--muted); }

.legend { display: grid; gap: 0.5rem; margin: 1rem 0; }
.legend div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; align-items: baseline; }
.legend dd { margin: 0; }

.facts { display: grid; gap: 0.4rem; margin: 0 0 1rem; font-family: var(--display); }
.facts div { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.facts dt { color: var(--muted); min-width: 9rem; }
.facts dd { margin: 0; min-width: 0; }
.hash { word-break: break-all; }

/* Samples: source beside rule */
.sample {
  margin: 0 0 1.75rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--ink);
  padding: 0.25rem 1.25rem 1rem;
}
.sample h3 a { color: var(--ink); text-decoration: none; font-family: var(--code); font-weight: 500; font-size: 0.92rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.pair figure { margin: 0; min-width: 0; }
.pair figcaption { font-family: var(--display); font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 0.4rem; }
.source blockquote {
  margin: 0;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 2px solid var(--rule);
  font-size: 1.02rem;
  line-height: 1.7;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.rule pre {
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  overflow-x: auto;
  line-height: 1.5;
}
.comment { margin: 0.5rem 0 0; font-style: italic; color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }

.trust-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.6rem 1.25rem;
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--display);
  font-size: 0.9rem;
}
.trust-line dt { color: var(--muted); font-size: 0.78rem; }
.trust-line dd { margin: 0; }
.edition em { font-style: normal; font-weight: 600; }
.edition-unofficial em { color: var(--caution); }
.edition-official em { color: var(--proved); }

/* Findings */
.finding, .disagreement { max-width: 72ch; margin: 0 0 1rem; padding: 0.1rem 0 0.1rem 1rem; border-left: 3px solid var(--rule); }
.finding h3, .disagreement h3 { margin-top: 0.5rem; }
.finding-confirmed { border-left-color: var(--fault); }
.finding-confirmed h3 { color: var(--fault); }
.finding-candidate { border-left-style: dashed; border-left-color: var(--caution); }
.disagreement ul { padding-left: 1.1rem; margin: 0.3rem 0 0.5rem; }

.changes { padding-left: 1.1rem; }
.changes .notable { font-weight: 600; }
.items-delta { font-size: 0.95rem; }

/* Stages: a real sequence */
.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border: 1px solid var(--rule); background: var(--sheet); }
.stage { padding: 0.9rem 1rem; border-right: 1px solid var(--rule-soft); }
.stage:last-child { border-right: 0; }
.stage strong { font-family: var(--display); font-stretch: 75%; font-size: 1.6rem; font-weight: 750; }
.stage .state { font-family: var(--display); font-size: 0.85rem; color: var(--muted); margin-left: 0.4rem; }
.stage-in-progress { box-shadow: inset 0 3px 0 var(--link); }
.stage-shipped { box-shadow: inset 0 3px 0 var(--proved); }
.stage p { margin: 0.35rem 0 0; font-size: 0.95rem; }

.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; margin-top: 2rem; }
.report-cols section { margin-bottom: 1.5rem; }
#proved h2 { border-top-color: var(--proved); }
#evidence h2 { border-top-color: var(--caution); }

/* Colophon */
.colophon {
  border-top: 3px double var(--rule);
  padding: 1.25rem clamp(1rem, 4vw, 3rem) 2.5rem;
  font-family: var(--display);
  font-size: 0.88rem;
  color: var(--muted);
}
.colophon p { max-width: 80ch; margin: 0 0 0.5rem; }
.notice { color: var(--ink); }

@media (max-width: 60rem) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 1.25rem 0 0; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; border-left: 0; }
  .toc li a { padding: 0.15rem 0; border-left: 0; }
  .cycle { grid-template-columns: repeat(2, auto); }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .pair, .report-cols { grid-template-columns: minmax(0, 1fr); }
  .legend div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .gauge-wrap { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .gauge { width: 100%; min-width: 6rem; }
  th, td { padding: 0.45rem 0.4rem; }
  table.target { font-size: 0.84rem; }
  table.target .reading { white-space: normal; }
  .sample { padding: 0.25rem 0.9rem 0.9rem; }
}

@media print {
  body { background: none; }
  .toc, .skip { display: none; }
  .frame { grid-template-columns: 1fr; }
}
