:root {
  --paper: #f8f9f5;
  --white: #fff;
  --ink: #172019;
  --muted: #59655c;
  --line: #d8ded4;
  --green: #55b04f;
  --forest: #194d2d;
  --wash: #e8f4e6;
  --danger: #8b3e2e;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --s1: .375rem;
  --s2: .625rem;
  --s3: .875rem;
  --s4: 1.25rem;
  --s5: 1.75rem;
  --s6: 2.5rem;
  --s7: 4rem;
  --r1: 5px;
  --r2: 10px;
  --r3: 18px;
  --shadow: 0 16px 44px rgba(20,45,25,.05);
  --fast: 140ms ease-out;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
button, input, select { font: inherit; color: inherit; }
button, select, input { min-height: 44px; }
button { cursor: pointer; }
a { color: var(--forest); text-underline-offset: 4px; }
.shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: var(--s3); background: var(--white); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.topbar a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.parent-brand { font-weight: 750; letter-spacing: -.025em; gap: var(--s2); }
.parent-brand span, .parent-brand strong { color: var(--muted); font-weight: 450; }
.topbar > div { display: flex; gap: var(--s5); }
.topbar a:hover, footer a:hover { text-decoration: underline; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); padding-block: var(--s7) var(--s6); border-bottom: 1px solid var(--ink); }
.eyebrow { margin: 0 0 var(--s3); color: var(--forest); font-size: .7rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(4.5rem, 11.5vw, 10rem); line-height: .84; letter-spacing: -.085em; }
.hero h1 span { color: var(--green); }
.lede { max-width: 670px; margin: var(--s5) 0 0; font: clamp(1.15rem, 2vw, 1.5rem)/1.3 var(--serif); color: var(--muted); }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--s5); margin-top: var(--s5); color: var(--muted); font-size: .77rem; }
.hero-facts strong { font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-mark { width: clamp(120px, 17vw, 220px); flex: none; }
.hero-mark img { display: block; width: 100%; height: auto; }
.lab, .results, .method, .evidence { padding-block: var(--s6); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
h2 { margin: 0; font: 500 clamp(2.2rem, 4vw, 3.6rem)/1.03 var(--serif); letter-spacing: -.04em; }
.section-head > p { margin: 0 0 3px; color: var(--muted); font-size: .83rem; font-variant-numeric: tabular-nums; }
.controls { display: grid; grid-template-columns: 1fr 1fr 2fr 1.25fr; gap: var(--s3); align-items: end; padding: var(--s4); background: var(--white); border: 1px solid var(--line); border-radius: var(--r2); }
.controls label:not(.check) { display: grid; gap: var(--s1); font-size: .65rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.controls input, .controls select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--r1); background: var(--white); padding: 0 var(--s3); font-size: .9rem; letter-spacing: 0; text-transform: none; font-weight: 500; }
.control-options { grid-column: 1/-1; display: flex; align-items: center; flex-wrap: wrap; gap: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s2); }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 44px; white-space: nowrap; font-size: .8rem; cursor: pointer; }
.check input { min-height: auto; width: 17px; height: 17px; padding: 0; accent-color: var(--forest); }
#reset { margin-left: auto; border: 0; padding: 0 var(--s3); background: transparent; color: var(--forest); text-decoration: underline; text-underline-offset: 4px; font-size: .8rem; }
.families { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s4) 0; }
.family-pill { min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: 99px; background: transparent; white-space: nowrap; font-size: .8rem; transition: background var(--fast), border-color var(--fast); }
.family-pill .count { display: inline-block; margin-left: 8px; color: var(--muted); font-size: .72rem; }
.family-pill:hover { border-color: var(--forest); }
.family-pill[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--white); }
.family-pill[aria-pressed="true"] .count { color: #d6ead3; }
.plot-frame { position: relative; margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow); overflow: hidden; }
.plot-frame svg { display: block; width: 100%; height: auto; }
.plot-frame figcaption { display: flex; flex-wrap: wrap; gap: var(--s4); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.plot-frame figcaption span:before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--forest); }
.plot-frame figcaption span:nth-child(2):before { border-radius: 1px; background: var(--green); }
.plot-frame figcaption .frontier-key:before { width: 16px; height: 2px; border-radius: 0; vertical-align: middle; background: var(--green); }
.plot-note, .table-note { font-size: .78rem; color: var(--muted); margin: var(--s3) 0 0; }
.table-note { margin: 0 0 var(--s4); }
.axis { stroke: #bbc4bb; stroke-width: 1; }
.grid { stroke: #e8ece7; stroke-width: 1; }
.axis-label, .tick { fill: var(--muted); font: 12px var(--sans); }
.point { cursor: pointer; }
.point .marker { transition: stroke-width var(--fast); }
.point:hover .marker, .point:focus .marker { stroke: var(--ink); stroke-width: 3; }
.point:focus { outline: none; }
.point:focus-visible .hit-area { stroke: var(--forest); stroke-width: 2; stroke-dasharray: 3 2; }
.chain { fill: none; stroke: #b6cab4; stroke-width: 1.5; stroke-dasharray: 4 5; }
.frontier { fill: none; stroke: var(--green); stroke-width: 3; }
.point-label { pointer-events: none; fill: var(--ink); font: 600 11px var(--sans); paint-order: stroke; stroke: var(--white); stroke-width: 4; stroke-linejoin: round; }
.plot-tooltip { position: absolute; z-index: 4; pointer-events: none; max-width: 270px; padding: var(--s3); border-radius: var(--r2); background: var(--ink); color: var(--white); font-size: .75rem; box-shadow: var(--shadow); }
.plot-tooltip strong, .plot-tooltip span { display: block; }
.plot-tooltip span { color: #d6ead3; margin-top: 3px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r2); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .83rem; font-variant-numeric: tabular-nums; }
th, td { padding: var(--s2) var(--s3); text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { text-align: left; }
thead { background: #eef1ec; }
th button { min-height: 44px; border: 0; background: none; padding: 0; font-size: .65rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
th[aria-sort] button::after { content: " ↓"; color: var(--forest); }
th[aria-sort="ascending"] button::after { content: " ↑"; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f4f8f1; }
.model-cell > span { display: block; color: var(--muted); font-size: .69rem; }
.model-link { display: flex; align-items: center; gap: var(--s2); padding: 0; border: 0; background: transparent; color: var(--forest); font-size: .85rem; font-weight: 750; }
.model-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag { display: inline-block; padding: 1px 5px; border: 1px solid var(--line); border-radius: var(--r1); color: var(--muted); font-size: .59rem; font-weight: 500; text-transform: uppercase; }
.compare-label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.table-check { width: 18px; height: 18px; min-height: auto; accent-color: var(--forest); }
.downloads { display: flex; gap: var(--s2); }
.downloads button, .compare-tray button, .detail-compare { min-height: 44px; border: 1px solid var(--forest); border-radius: var(--r1); padding: 0 var(--s4); background: var(--forest); color: var(--white); font-size: .8rem; font-weight: 700; }
.downloads button { background: transparent; color: var(--forest); }
.downloads button:hover { background: var(--wash); }
.method { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--s7); border-top: 1px solid var(--ink); }
.method-copy { font: 1.13rem/1.65 var(--serif); }
.method-copy p:first-child { margin-top: 0; }
.method-copy p:last-child { margin-bottom: 0; }
.method-scope { color: var(--muted); font-size: 1rem; }
.evidence { border-top: 1px solid var(--line); }
.evidence-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--r2); background: var(--white); }
.evidence-grid > div { padding: var(--s4); border-right: 1px solid var(--line); overflow: hidden; }
.evidence-grid > div:last-child { border: 0; }
.evidence-grid span, .evidence-grid strong, .evidence-grid code { display: block; }
.evidence-grid span { color: var(--muted); margin-bottom: var(--s2); font-size: .67rem; text-transform: uppercase; letter-spacing: .07em; }
.evidence-grid code { word-break: break-all; font-size: .75rem; }
.evidence-links { display: flex; flex-wrap: wrap; gap: var(--s4); margin: var(--s4) 0; font-size: .83rem; }
.evidence-links a { min-height: 44px; }
details { border-top: 1px solid var(--line); padding-top: var(--s3); }
summary { cursor: pointer; font-size: .83rem; font-weight: 700; min-height: 44px; }
#manifest { padding-left: 1.2rem; color: var(--muted); font-size: .75rem; word-break: break-all; }
#manifest li { margin-bottom: var(--s3); }
#manifest strong, #manifest code { display: block; }
footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s4); padding-block: var(--s5); border-top: 1px solid var(--ink); font-size: .75rem; color: var(--muted); }
footer a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.compare-tray { position: fixed; z-index: 5; bottom: var(--s4); left: 50%; transform: translateX(-50%); width: min(650px, calc(100% - 32px)); padding: var(--s3); display: flex; align-items: center; gap: var(--s3); background: var(--ink); color: var(--white); border-radius: var(--r2); box-shadow: var(--shadow); font-size: .85rem; }
.compare-tray span { margin-right: auto; }
.compare-tray .quiet { background: transparent; border-color: #859087; }
dialog { width: min(940px, calc(100% - 24px)); max-height: 88vh; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow); color: var(--ink); }
dialog::backdrop { background: rgba(10,18,12,.72); }
dialog h2 { max-width: calc(100% - 32px); font-size: clamp(2rem, 4vw, 3rem); }
dialog h3 { margin: 0; font: 600 1.25rem/1.2 var(--sans); }
dialog p { overflow-wrap: anywhere; color: var(--muted); font-size: .85rem; }
.dialog-close { position: absolute; top: var(--s3); right: var(--s3); width: 44px; border: 0; background: transparent; font-size: 1.6rem; }
.detail-grid, .compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s5); }
.metric-box { padding: var(--s3); background: var(--paper); border-radius: var(--r2); }
.metric-box span, .metric-box strong { display: block; }
.metric-box span { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .03em; }
.metric-box strong { margin-top: 3px; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.compare-card { min-width: 0; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r2); }
.compare-card .metric-box { margin-top: var(--s2); }
.family-evidence { margin-top: var(--s5); }
.family-evidence ul { padding: 0; list-style: none; font-size: .8rem; }
.family-evidence li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.detail-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s5); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
@media (max-width: 1000px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .hero-mark { width: 170px; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .topbar { min-height: 66px; flex-wrap: wrap; gap: 0; padding-block: var(--s2); }
  .topbar > div { gap: var(--s4); font-size: .72rem; }
  .parent-brand { font-size: .75rem; }
  .source-link { display: none !important; }
  .hero { position: relative; padding-block: var(--s6); gap: 0; }
  .hero > div { width: 100%; }
  .hero .eyebrow { max-width: calc(100% - 70px); font-size: .6rem; }
  .hero h1 { font-size: clamp(3.6rem, 14.6vw, 6rem); letter-spacing: -.08em; }
  .hero-mark { position: absolute; width: 72px; top: 14px; right: 0; }
  .lede { margin-top: var(--s4); font-size: 1.2rem; }
  .hero-facts { gap: var(--s3); font-size: .68rem; margin-top: var(--s4); }
  .lab, .results, .method, .evidence { padding-block: var(--s5); }
  .section-head { align-items: start; flex-direction: column; gap: var(--s3); }
  .controls { grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s2); padding: var(--s3); }
  .controls label:not(.check) { font-size: .59rem; }
  .controls .search { grid-column: 1/-1; grid-row: 2; }
  .control-options { gap: var(--s2) var(--s3); }
  .check { font-size: .74rem; }
  #reset { margin-left: 0; }
  .families { flex-wrap: nowrap; overflow-x: auto; padding-block: var(--s3); scrollbar-width: thin; }
  .family-pill { flex: none; }
  .plot-frame figcaption { gap: var(--s2) var(--s3); font-size: .65rem; }
  .method { grid-template-columns: 1fr; gap: var(--s5); }
  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .evidence-links { flex-direction: column; gap: var(--s3); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-tray { flex-wrap: wrap; gap: var(--s2); }
  .compare-tray span { width: 100%; }
  .compare-tray button { flex: 1; padding: 0 var(--s2); }
  dialog { padding: var(--s5); }
  footer span { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
