/* Shared style for research project pages. Matches the home page tokens. */
:root {
  --bg: #EDF1F4;
  --surface: #F8FAFB;
  --paper: #FFFFFF;
  --ink: #17232E;
  --muted: #4C5B68;
  --line: #C9D3DB;
  --contour: #0E7C93;
  --mask: #B4336F;
  --mask-soft: rgba(180, 51, 111, 0.10);
  --contour-soft: rgba(14, 124, 147, 0.10);
}
:root[data-theme="dark"] {
  --bg: #0F171E; --surface: #16212A; --paper: #F4F6F8; --ink: #E3EAF0; --muted: #9AAAB7;
  --line: #2A3946; --contour: #4CC3DA; --mask: #E57AAE;
  --mask-soft: rgba(229, 122, 174, 0.14); --contour-soft: rgba(76, 195, 218, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 17.5px; line-height: 1.65;
}
a { color: var(--contour); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--contour); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }

.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar .in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar a { text-decoration: none; color: var(--ink); font-weight: 700; font-family: "Bricolage Grotesque", sans-serif; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { font-family: inherit; font-weight: 400; color: var(--muted); font-size: 15px; }
.topbar nav a:hover { color: var(--ink); }

/* Theme switch */
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--contour); color: var(--contour); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .i-sun { display: none; }
.theme-toggle.is-dark .i-sun { display: block; }
.theme-toggle.is-dark .i-moon { display: none; }
.bar-right { display: flex; align-items: center; gap: 22px; }

.col { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.wide { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.head { padding: 56px 0 28px; }
.venue { display: inline-block; background: var(--mask-soft); color: var(--mask); font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 6px; }
.head h1 {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: clamp(48px, 8vw, 96px); line-height: .92; letter-spacing: -0.035em; margin: 16px 0 14px;
}
.head .full { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; margin: 0 0 22px; max-width: 32ch; font-family: "Bricolage Grotesque", sans-serif; font-weight: 500; }
.authors { margin: 0 0 4px; }
.authors b { font-weight: 700; }
.affil { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink);
}
.btn.primary { background: var(--ink); color: var(--bg); }
.btn:hover { background: var(--contour); border-color: var(--contour); color: #fff; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }

/* Hero figure */
.hero-fig { margin: 8px auto 0; }
.hero-fig img { border-radius: 14px; border: 1px solid var(--line); background: #fff; width: 100%; }

.tldr { font-size: 21px; line-height: 1.5; margin: 40px 0 0; padding-left: 18px; border-left: 4px solid var(--contour); }

/* Sections */
section { padding: 56px 0 8px; }
section h2 { font-family: "Bricolage Grotesque", sans-serif; font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.1; }
section h3 { font-family: "Bricolage Grotesque", sans-serif; font-size: 23px; margin: 36px 0 8px; letter-spacing: -0.01em; }
section p { margin: 0 0 14px; }
section ul { padding-left: 20px; margin: 0 0 14px; }
section li { margin-bottom: 6px; }
.step { display: inline-block; min-width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; background: var(--contour); color: #fff; font-size: 15px; font-weight: 700; margin-right: 10px; vertical-align: 2px; }

figure { margin: 28px 0; }
figure img { background: var(--paper); border-radius: 12px; border: 1px solid var(--line); padding: 14px; width: 100%; }
figcaption { color: var(--muted); font-size: 15px; margin-top: 10px; line-height: 1.5; }
figcaption b { color: var(--ink); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pair figure { margin: 0; }

/* Results */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 22px 0 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 32px; line-height: 1; letter-spacing: -0.02em; }
.stat span { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.35; }
.tablewrap { overflow-x: auto; margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 700; color: var(--muted); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tr.ours td { font-weight: 700; background: var(--contour-soft); }
.note { color: var(--muted); font-size: 14.5px; }

/* Code + citation */
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.55; margin: 12px 0 18px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cite { position: relative; }
.copy { position: absolute; top: 10px; right: 10px; font: inherit; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.copy:hover { border-color: var(--contour); color: var(--contour); }

footer { margin-top: 72px; padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
footer .wide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .pair { grid-template-columns: 1fr; gap: 0; }
  .pair figure { margin: 20px 0; }
  .topbar nav { display: none; }
  .head { padding-top: 36px; }
  .tldr { font-size: 19px; }
  figure img { padding: 8px; }
}
@media (max-width: 520px) { .col, .wide, .topbar .in { padding-left: 16px; padding-right: 16px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Single accent */
section h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; margin-top: 10px; background: var(--contour); }
section h3 { color: var(--contour); }
section li::marker { color: var(--contour); }
