/* Research project page — shared by both studies. */
:root {
  color-scheme: light;
  --page: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #e9eff6;
  --ink: #14243a;
  --ink-2: #3e526a;
  --muted: #52657d;
  --grid: #dbe4ee;
  --axis: #b4c3d4;
  --border: rgba(20, 36, 58, 0.15);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --neutral: #aabbd0;
  --seq-0: #e9eff6;
  --seq-1: #cde2fb;
  --seq-2: #86b6ef;
  --seq-3: #3987e5;
  --seq-4: #1c5cab;
  --seq-5: #0d366b;
  --callout: #eef4fc;
  --callout-edge: #86b6ef;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #6da7ec;
  --accent-ink: #86b6ef;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --neutral: #5d5c57;
  --seq-0: #232321;
  --seq-1: #104281;
  --seq-2: #1c5cab;
  --seq-3: #2a78d6;
  --seq-4: #5598e7;
  --seq-5: #9ec5f4;
  --callout: #16202c;
  --callout-edge: #256abf;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1120px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 48px; max-width: 1120px; }
.topbar .brand { font-weight: 650; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.topbar nav a { font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.theme-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 6px; font-size: 12px; padding: 4px 8px; cursor: pointer; white-space: nowrap;
}

/* hero */
header.hero { padding: 64px 16px 22px; }
.venue { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
h1.title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 6.5vw, 70px);
  line-height: 1.15; margin: 0 0 14px; max-width: 860px; letter-spacing: -0.01em;
}
.subtitle { font-family: var(--serif); font-size: clamp(18px, 2.4vw, 22px); color: var(--ink-2); margin: 0 0 22px; max-width: 760px; line-height: 1.4; }
.authors { font-size: 17px; margin: 0 0 4px; }
.affil { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px;
  border-radius: 999px; background: var(--ink); color: var(--page); text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--axis); }
.btn svg { width: 15px; height: 15px; }

/* sections */
section { padding: 28px 0; }
h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0 0 14px;
  letter-spacing: -0.005em; line-height: 1.25;
}
h3 { font-size: 19px; margin: 28px 0 8px; line-height: 1.35; }
p { margin: 0 0 14px; }
.lead { font-family: var(--serif); font-size: 19px; line-height: 1.6; }
.abstract { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; }
.abstract p { font-family: var(--serif); font-size: 18px; }
.abstract p:last-child { margin-bottom: 0; }

.evidence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); align-items: start; gap: 14px; margin: 20px 0; }
.evidence-grid .case { padding: 18px; }
.evidence-grid h3 { margin: 0 0 10px; }
.evidence-grid p { font-size: 16px; }
.evidence-grid .source-links { font-size: 14px; margin: 12px 0 0; }
.case-evidence { border-top: 1px solid var(--border); margin: 16px 0 0; padding-top: 10px; }
.case-evidence summary { font-weight: 650; }
.case-evidence[open] summary { margin-bottom: 10px; }

.opening-explorer { padding-top: 16px; }
.opening-explorer figure { margin-top: 14px; }
.opening-explorer .fig { border-top: 3px solid var(--s1); }
.chart-controls { padding: 0; margin: 0 0 10px; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chart-controls legend { padding: 0; margin-bottom: 5px; font-size: 14px; font-weight: 650; }
.chart-controls label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--axis); border-radius: 7px; padding: 5px 10px; cursor: pointer; font-size: 14px; }
.chart-controls label:has(:checked) { background: var(--callout); border-color: var(--accent); color: var(--ink); }
.chart-controls input { margin: 0; accent-color: var(--accent-ink); }
.chart-reading { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }


.tldr { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tldr li { position: relative; padding-left: 22px; }
.tldr li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat span { display: block; font-size: 13px; color: var(--ink-2); line-height: 1.35; margin-top: 4px; }

/* findings */
.finding { border-top: 1px solid var(--border); padding-top: 30px; margin-top: 30px; }
.finding:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.f-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.claim { font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.3; margin: 0 0 12px; }
.prior {
  background: var(--callout); border-left: 3px solid var(--callout-edge);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 16px 0; font-size: 15px; line-height: 1.55;
}
.prior .tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-right: 6px; }
.caveat { font-size: 14.5px; color: var(--ink-2); border-left: 2px solid var(--axis); padding-left: 12px; margin: 12px 0 0; }

/* figures */
figure { margin: 20px 0; }
.fig {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 16px 10px; overflow: hidden;
}
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.chart-sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px; }
figcaption { font-size: 14.5px; color: var(--ink-2); margin-top: 10px; line-height: 1.55; }
figcaption b { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 2px; border-radius: 1px; width: 14px; vertical-align: 3px; }

.chart text { font-family: var(--sans); fill: var(--ink-2); font-size: 11.5px; }
.chart .axis path, .chart .axis line { stroke: var(--axis); }
.chart .grid line { stroke: var(--grid); }
.chart .grid path { stroke: none; }
.chart .label-strong { fill: var(--ink); font-weight: 600; }
.chart .annot { fill: var(--ink-2); font-size: 11px; }

.tooltip {
  position: fixed; pointer-events: none; z-index: 50; opacity: 0;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,.12); border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; line-height: 1.45; max-width: 260px; transition: opacity .08s;
}
.tooltip b { font-weight: 600; }
.tooltip .muted { color: var(--ink-2); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; cursor: pointer; user-select: none; background: var(--surface-2); position: sticky; top: 0; }
th[aria-sort="ascending"]::after { content: " ↑"; }
th[aria-sort="descending"]::after { content: " ↓"; }
tr:last-child td { border-bottom: 0; }
details { margin: 10px 0; }
summary { cursor: pointer; font-size: 14px; color: var(--accent-ink); }

/* comparison & cases */
.compare { width: 100%; }
.compare td, .compare th { text-align: left; white-space: normal; vertical-align: top; }
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.case { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.case h4 { margin: 0 0 6px; font-size: 15.5px; line-height: 1.35; }
.case p { font-size: 14.5px; margin: 0; color: var(--ink-2); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-bottom: 6px; }

ol.refs { padding-left: 22px; font-size: 14.5px; }
ol.refs li { margin-bottom: 6px; }
pre.bibtex {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5; position: relative;
}
.copy-btn { position: absolute; top: 8px; right: 8px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.setup-grid .case p { color: var(--ink); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 48px; font-size: 13.5px; color: var(--ink-2); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  header.hero { padding-top: 36px; }
  .topbar .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; height: auto; padding-block: 8px; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; padding-top: 5px; }
  .topbar .theme-btn { grid-column: 2; grid-row: 1; }
  html { scroll-padding-top: 100px; }
  .abstract { padding: 16px; }
  .abstract p { text-align: left; }
  .claim { font-size: 20px; }
  .fig { padding: 12px 10px 8px; }
  .stat b { font-size: 24px; }
}
@media print {
  .topbar, .theme-btn, .buttons { display: none; }
}

/* ---------- scientific additions ---------- */
.rq { counter-reset: rq; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rq li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 12px 54px; position: relative; }
.rq li::before { counter-increment: rq; content: "RQ" counter(rq); position: absolute; left: 14px; top: 13px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.rq li b { display: block; }
.rq li span { font-size: 14.5px; color: var(--ink-2); }
.methods dt { font-weight: 600; margin-top: 12px; }
.methods dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15.5px; }
.tests td:nth-child(1) { font-weight: 700; white-space: nowrap; }
.tests td { white-space: normal; vertical-align: top; font-size: 14px; }
.tests td:nth-child(2) { min-width: 200px; }
.tests td:nth-child(4) { min-width: 220px; }
.verdict { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border); }
.verdict.yes { background: color-mix(in srgb, var(--s3) 18%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--s3) 55%, transparent); }
.verdict.no { background: color-mix(in srgb, var(--s2) 16%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--s2) 55%, transparent); }
.verdict.est { background: var(--surface-2); color: var(--ink-2); }
.verdict.weak { background: color-mix(in srgb, var(--s4) 18%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--s4) 55%, transparent); }
.stat-line { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; color: var(--ink-2); overflow-x: auto; }
.audit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.audit-item { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--neutral); border-radius: 10px; padding: 12px 14px; }
.audit-item.sev-high { border-left-color: var(--s2); }
.audit-item.sev-mid { border-left-color: var(--s4); }
.audit-item.sev-ok { border-left-color: var(--s3); }
.audit-item h4 { margin: 0 0 4px; font-size: 15px; }
.audit-item p { margin: 0; font-size: 14px; color: var(--ink-2); }
.audit-item .sev { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.convos { display: grid; gap: 18px; margin: 18px 0; }
.convo { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.convo header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.convo h4 { margin: 0; font-size: 16px; }
.convo .meta { font-size: 12.5px; color: var(--muted); }
.convo .why { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.convo .crit { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.turn { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.turn .who { font-size: 13px; font-weight: 600; color: var(--ink); }
.turn .who span { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.turn q { font-family: var(--serif); font-size: 16px; line-height: 1.5; quotes: "“" "”"; }
.turn.gap { color: var(--muted); font-size: 12px; text-align: center; grid-template-columns: 1fr; border-top-style: dotted; }
.feedback { background: var(--callout); border-left: 3px solid var(--callout-edge); border-radius: 6px; padding: 8px 12px; font-size: 14.5px; margin: 0 0 8px; }
.multiples { display: grid; gap: 14px 18px; }
.mult { min-width: 0; }
.mult-title { font-size: 13px; font-weight: 600; margin: 0; }
.mult-title span { font-weight: 400; color: var(--muted); margin-left: 4px; }
.mult-terms { font-size: 11.5px; color: var(--muted); margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc { columns: 2; column-gap: 28px; font-size: 15px; padding-left: 18px; }
@media (max-width: 640px) {
  .toc { columns: 1; }
  .turn { grid-template-columns: 1fr; gap: 2px; }
}

/* Retained drafts and reconstructed audio */
.evidence-grid audio { display: block; margin-top: 12px; width: 100%; }
.artifact-score { background: var(--surface-2); padding: 10px; overflow-x: auto; }
.artifact-score code { padding: 0; }
.artifact-table { margin-top: 10px; }
.artifact-exchange dt { font-weight: 650; margin-top: 8px; }
.artifact-exchange dd { margin-left: 0; color: var(--ink-2); }
.artifact-excerpt { margin: 12px 0 0; padding: 12px; border-left: 3px solid var(--s1); background: var(--surface-2); font-family: var(--serif); }
.artifact-excerpt p + p { margin-top: 6px; }
.appendix-techniques[open] > summary { margin-bottom: 8px; }

/* Controls and notes for the flow charts */
.explorable-title { margin: 0 0 10px; font-size: 1.1rem; }
.flow-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 14px; }
.flow-controls label { font-size: .9rem; font-weight: 650; }
.flow-controls select { max-width: 100%; min-width: 0; font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 6px 28px 6px 9px; }
.flow-columns { display: flex; justify-content: space-between; font-size: .83rem; font-weight: 650; color: var(--ink); }
.trace-steps { margin: 6px 0 14px; padding-left: 25px; font-size: .95rem; }
.trace-steps li { margin-top: 9px; padding-left: 4px; }
.trace-steps li::marker { font-weight: 650; color: var(--accent-ink); }
.trace-steps span { display: block; color: var(--ink-2); font-size: .85rem; }
.trace-steps p { margin: 2px 0 0; }
