:root {
  --bg: #fbfaf7;
  --band: #f1efe8;
  --surface: #ffffff;
  --text: #1d2420;
  --muted: #5b655f;
  --line: #d9d6cc;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --focus: #b45309;
  --both: #1b9e77;
  --height-only: #7570b3;
  --rgb-only: #d95f02;
  --neither: #e7298a;
  --box-rgb: #ffffff;
  --box-rel: #00d4f0;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --band: #181d1a; --surface: #1e2420; --text: #e6ebe7; --muted: #a3ada6;
    --line: #333b36; --accent: #6cc39a; --accent-ink: #0d1411; --focus: #f59e0b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible,
svg [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font-size: .92em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.band { background: var(--band); padding: 48px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.masthead { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.kicker { display: block; margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.brand { display: block; margin: 0; font-weight: 650; }
.brandlink { text-decoration: none; color: var(--text); }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--text); font-size: 15px; }
nav a:hover { color: var(--accent); }
.site-nav a { padding: 6px 2px; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 650; }
.subnav { border-bottom: 1px solid var(--line); background: var(--band); }
.subnav .wrap { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.subnav a { font-size: 14px; color: var(--muted); text-decoration: none; }
.subnav a:hover { color: var(--accent); }

h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 0 0 16px; max-width: 22ch; letter-spacing: -.01em; }
h2 { font-size: 26px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
.lead { font-size: 19px; max-width: 70ch; color: var(--text); }
.section-intro { max-width: 75ch; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.two-col > *, .result-grid > *, .explorer > * { min-width: 0; }
.parts dt { font-weight: 650; margin-top: 8px; }
.parts dd { margin: 0 0 6px; }
.result { margin-top: 4px; }
.statement { font-size: 18px; max-width: 80ch; }
.result-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.limits li { margin-bottom: 4px; }
.note { color: var(--muted); font-size: 14px; max-width: 80ch; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 10px 18px;
  border-radius: 8px; text-decoration: none; font-weight: 600; }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child, td.text, th.text { text-align: left; }
#split-table td:last-child, #split-table th:last-child, #model-table td:nth-child(2), #model-table th:nth-child(2) { text-align: left; }
thead th { color: var(--muted); font-weight: 600; }
td.worse { color: var(--rgb-only); }
td.better { color: var(--both); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.controlled { border-color: var(--accent); color: var(--accent); }

.outcome-bar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.outcome-bar span { display: block; height: 100%; }
.outcome-legend { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.outcome-legend li { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.dot { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.dot.dashed { background: transparent !important; border: 2px dashed var(--neither); }

.explorer { display: grid; grid-template-columns: 250px minmax(0, 1fr) 260px; gap: 18px; margin-top: 18px; align-items: start; }
.controls fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 12px; padding: 10px 12px; }
.controls legend { font-weight: 650; font-size: 14px; padding: 0 4px; }
.controls label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 5px 0; cursor: pointer; }
.controls select { width: 100%; padding: 6px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; }
.examples { list-style: none; margin: 0; padding: 0; }
.examples button { width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid var(--line); padding: 5px 8px; margin: 3px 0; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.examples button:hover, .examples button[aria-pressed="true"] { border-left-color: var(--accent); background: var(--band); }
.swatch { display: inline-block; width: 16px; height: 12px; border-radius: 2px; flex: none; }
.swatch.box-rgb { border: 2px dashed #9ca3af; }
.swatch.box-rel { border: 2px dashed var(--box-rel); }
.count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.patch-title { font-weight: 650; }
.zoom button { font: inherit; min-width: 36px; height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; cursor: pointer; }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 1 / 1; touch-action: none; }
#map { width: 100%; height: 100%; display: block; cursor: grab; }
#map.dragging { cursor: grabbing; }
#map .crown { fill: transparent; stroke-width: 1.6; vector-effect: non-scaling-stroke; cursor: pointer; }
#map .crown:hover, #map .crown.selected { fill: rgba(255, 255, 255, .22); stroke-width: 3.2; }
#map .crown.neither { stroke-dasharray: 5 3; }
#map .box { fill: transparent; stroke-width: 1.4; vector-effect: non-scaling-stroke; cursor: pointer; }
#map .box.fp { stroke-dasharray: 4 3; stroke-width: 2; }
#map .box.selected { stroke-width: 3.4; }
.patch-summary { font-size: 14px; margin: 8px 0 0; }

.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: sticky; top: 72px; }
.info h3 { margin-top: 0; }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 14px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.crown-table { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.crown-table summary { cursor: pointer; font-weight: 600; }
.crown-table tr { cursor: pointer; }
.crown-table tr:hover, .crown-table tr.selected { background: var(--band); }

figure.card { display: flex; flex-direction: column; }
#footprint-map svg { width: 100%; height: auto; display: block; }
figcaption { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.footer { padding: 28px 20px 48px; color: var(--muted); font-size: 13.5px; }
.noscript { padding: 16px 20px; background: #fff3cd; color: #3b2f00; }

/* ---- Introduction and crown-volume pages ---- */
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0; }
.three-col > * { min-width: 0; }
.component { display: flex; flex-direction: column; }
.component h2 { margin-bottom: 4px; }
.component .who { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.component .cta { margin-top: auto; padding-top: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fact b { display: block; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fact span { color: var(--muted); font-size: 13.5px; }
.flow { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; counter-reset: step; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: relative; font-size: 14.5px; }
.flow li::before { counter-increment: step; content: counter(step); display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; margin-bottom: 6px; }
.flow li b { display: block; }
.flow li.scope-det { border-top: 4px solid var(--rgb-only); }
.flow li.scope-vol { border-top: 4px solid var(--height-only); }
.legend-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.legend-inline span::before { content: ""; display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle; }
.legend-inline .l-det::before { background: var(--rgb-only); }
.legend-inline .l-vol::before { background: var(--height-only); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0; }
.steps figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.steps svg { width: 100%; height: auto; display: block; }
.steps figcaption { margin-top: 6px; color: var(--text); font-size: 14px; }
.steps figcaption b { display: block; }
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; margin-top: 18px; }
.cloud-frame { position: relative; background: #0f1512; border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4 / 3; touch-action: none; overflow: hidden; }
.cloud-frame canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.cloud-frame canvas.dragging { cursor: grabbing; }
.cloud-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.seg button, .cloud-tools button { font: inherit; font-size: 14px; padding: 5px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"], .cloud-tools button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-list button { width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid var(--line); padding: 6px 8px; margin: 2px 0; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.tree-list button:hover, .tree-list button[aria-pressed="true"] { border-left-color: var(--accent); background: var(--band); }
.colorbar { height: 10px; border-radius: 3px; background: linear-gradient(90deg, #5b8fd6, #3fb0c9, #3fc49a, #86d45a, #d2dc45, #fde725); }
.colorbar-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .bar { fill: var(--accent); }
.chart .median { stroke: var(--rgb-only); stroke-width: 2; }
.chart .title { fill: var(--text); font-size: 13px; font-weight: 600; }
.map-wrap { position: relative; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-wrap .cell:hover { stroke: var(--text); stroke-width: 1.5; }
.map-wrap .tp { fill: none; stroke: #c0392b; stroke-width: 2; }
.map-wrap .tp-label { fill: #c0392b; font-size: 12px; font-weight: 700; font-family: var(--font); }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.15); display: none; white-space: nowrap; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.scale .ramp { flex: 1; height: 10px; border-radius: 3px; }
@media (max-width: 1080px) {
  .explorer { grid-template-columns: 230px minmax(0, 1fr); }
  .info { grid-column: 1 / -1; position: static; }
}
@media (max-width: 980px) {
  .three-col { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .steps, .facts { grid-template-columns: repeat(2, 1fr); }
  .viewer { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .two-col, .result-grid, .explorer { grid-template-columns: 1fr; }
  .flow, .steps { grid-template-columns: 1fr; }
  .masthead nav { gap: 12px; }
  .section, .band { padding: 32px 0; }
  .wrap { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.section > dl.parts { max-width: 75ch; }

/* Optional scientific detail and compact information panels. */
summary { cursor: pointer; }
.info dd { overflow-wrap: anywhere; }
#method details { margin: 0 0 16px; }
#results details { margin-top: 16px; }

/* Study-setting maps precede the pixel-scale and aggregate views. */
.story-map-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; align-items:start; }
.story-map-grid figure { margin:0; }
.context-map { width:100%; height:490px; object-fit:contain; display:block; background:#fff; }
.story-map-grid figcaption { margin-top:.8rem; font-size:.9rem; line-height:1.5; }
.context-map-frame { position:relative; }
.north-marker { position:absolute; right:12px; top:12px; padding:.25rem .5rem; background:#fff; font-weight:700; }
@media (max-width:700px) { .story-map-grid {grid-template-columns:1fr;} .context-map {height:auto;max-height:620px;} }

/* Introduction: figures explain successive stages of the recorded study. */
.intro-story-nav { display:flex; flex-wrap:wrap; gap:8px 22px; margin-top:28px; padding-top:16px; border-top:1px solid var(--line); font-size:14px; }
.intro-story h2 { margin-top:0; }
.intro-story h3 { margin-top:32px; }
.intro-figure { margin:28px 0; min-width:0; }
.intro-figure img { display:block; width:100%; height:auto; border-radius:6px; background:#fff; }
.intro-figure a { display:block; }
.intro-figure figcaption { max-width:90ch; font-size:14px; line-height:1.6; margin-top:12px; }
.intro-figure figcaption strong { color:var(--text); }
.intro-point-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; align-items:start; }
.intro-point-pair img { height:390px; object-fit:contain; }
.intro-envelope { max-width:960px; }
.intro-height-triptych { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.intro-height-triptych .intro-figure { margin-bottom:8px; }
.intro-image-note { font-size:14px; color:var(--muted); max-width:90ch; }
@media (max-width:760px) {
 .intro-point-pair,.intro-height-triptych { grid-template-columns:1fr; gap:4px; }
 .intro-point-pair img { height:auto; max-height:420px; object-fit:contain; }
 .intro-height-triptych .intro-figure { max-width:512px; }
 .intro-story-nav { gap:10px 18px; }
}

.intro-story,.intro-study-area { scroll-margin-top:110px; }
@media (max-width:760px) { .intro-story,.intro-study-area { scroll-margin-top:150px; } }

/* Story entry: readable prose and real project views, with methods in topic pages. */
.story-hero { display:grid; grid-template-columns:1.05fr 1fr; gap:52px; align-items:center; padding:56px 20px; }
.story-hero h1 { margin-top:12px; max-width:17ch; font-size:clamp(34px,4.4vw,58px); }
.story-hero-copy > p { max-width:56ch; }
.story-hero-image { margin:0; }
.story-hero-image img { display:block; width:100%; height:auto; border-radius:12px; }
.story-hero-image figcaption { max-width:60ch; }
.story-start { display:inline-block; margin-top:12px; font-weight:650; text-decoration:none; border-bottom:1px solid var(--accent); }
.story-page .story-chapter.wrap { padding:56px 20px; }
.story-prose { max-width:76ch; }
.story-prose p { line-height:1.75; }
.story-chapter .kicker { margin-bottom:10px; }
.story-chapter h2 { max-width:30ch; line-height:1.25; font-size:clamp(26px,3vw,34px); }
.story-page .intro-figure { margin:28px 0; }
.story-page .intro-figure figcaption { max-width:90ch; }
.story-page .story-map-grid { margin-top:28px; }
.story-page .context-map { height:440px; }
.story-finding { max-width:76ch; margin:30px 0; padding:22px 26px; border-left:4px solid var(--accent); background:var(--band); }
.story-finding > p:nth-child(2) { font-size:22px; line-height:1.5; margin:6px 0 12px; }
.story-finding .note { margin-bottom:0; }
.story-chapter,.story-finding { scroll-margin-top:100px; }
.volume-shape-detail { margin-top:24px; }
.volume-shape-detail summary { font-weight:600; }
@media (max-width:760px) {
 .story-hero { grid-template-columns:1fr; gap:24px; padding:32px 16px; }
 .story-hero h1 { max-width:19ch; }
 .story-hero-image { max-width:512px; }
 .story-page .story-chapter.wrap { padding:36px 16px; }
 .story-page .context-map { height:auto; max-height:520px; }
 .story-finding { padding:18px; }
 .story-chapter,.story-finding { scroll-margin-top:140px; }
}
