:root {
  --bg: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #3d3d3d;
  --muted: #6a6a6a;
  --faint: #8f8f8f;
  --rule: #e6e6e6;
  --rule-strong: #d2d2d2;
  --accent: #2f5c8f;
  --accent-dark: #234869;
  --wash: #f6f6f4;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --col: 720px;
  --col-wide: 1000px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.running-title {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.running-title span { color: var(--faint); font-weight: 500; }
.topnav { display: flex; gap: 26px; }
.topnav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s;
}
.topnav a:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 5px 12px;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- Shared column ---------- */
.masthead,
.section {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 32px;
}
.section { margin-top: 68px; }
.section:last-of-type { margin-bottom: 60px; }

/* ---------- Masthead ---------- */
.masthead { padding-top: 84px; }
.kicker {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}
h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}
.dek {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 26px;
  font-weight: 400;
}
.authors {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-2);
  font-weight: 500;
  margin: 0 0 4px;
}
.term {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: #8f8f8f;
  font-weight: 400;
  margin: 0 0 40px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}
.term .dot { margin: 0 8px; color: var(--rule-strong); }

.abstract { margin: 0 0 40px; }
.abstract-label {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}
.abstract p {
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.62;
}

/* Facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 0;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.facts > div { padding: 0 18px; border-left: 1px solid var(--rule); }
.facts > div:first-child { padding-left: 0; border-left: none; }
.facts dt {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.facts dd {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
}

/* ---------- Headings ---------- */
h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 20px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.secnum {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transform: translateY(-1px);
}
h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.3;
  margin: 34px 0 12px;
  color: var(--ink);
}

p { margin: 0 0 20px; }
em { font-style: italic; }
b { font-weight: 600; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(47, 92, 143, 0.35); }
a:hover { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  color: var(--ink-2);
  background: var(--wash);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Pipeline table ---------- */
.pipeline-table { margin: 26px 0 16px; }
.pipeline-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.pipeline-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--rule-strong);
}
.pipeline-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: top;
}
.pipeline-table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.tools {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Figures ---------- */
figure {
  margin: 40px 0;
  /* break out wider than the reading column */
  width: 100vw;
  max-width: var(--col-wide);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 32px;
}
.chart-frame {
  position: relative;
  height: 320px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px 20px 14px;
  background: var(--bg);
}
.chart-frame-tall { height: 420px; }
figcaption {
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 14px;
  max-width: var(--col);
}
figcaption b { color: var(--ink-2); font-weight: 600; }

.figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.figure-pair figcaption { grid-column: 1 / -1; }

/* ---------- Questions ---------- */
.questions-list {
  margin-top: 26px;
  border-top: 1px solid var(--rule-strong);
}
.question {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.question-id {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.question-body p { margin: 0; font-size: 1rem; line-height: 1.5; }
.question-note {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px !important;
}
.status {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid;
}
.status.ready { color: #2f6b46; border-color: #bfe0cb; background: #f1f8f3; }
.status.partial { color: #8a6a1c; border-color: #e6d6ab; background: #faf5e8; }

/* ---------- Two column lists ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}
.two-col h3 { margin-top: 0; }
.two-col ul, .resource-list { margin: 0; padding: 0; list-style: none; }
.two-col li {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-2);
  padding: 11px 0 11px 20px;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.two-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 6px;
  height: 1px;
  background: var(--faint);
}

/* ---------- Resources ---------- */
.resource-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.98rem;
}
.resource-list li:first-child { border-top: 1px solid var(--rule-strong); }
.resource-list a { font-weight: 600; }
.resource-list span { color: var(--muted); }

.muted { color: var(--faint) !important; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 22px 32px 60px;
  border-top: 1px solid var(--rule);
}
.footer p {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--faint);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .figure-pair { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 18px; }
  .topnav { display: none; }
  .nav-toggle { display: inline-block; }
  .topnav.open {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 18px 32px;
  }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .facts > div { padding: 0 16px; }
  .facts > div:nth-child(odd) { border-left: none; padding-left: 0; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  figure { padding: 0 20px; }
  .masthead, .section { padding: 0 20px; }
  .question { grid-template-columns: 1fr; gap: 8px; }
  .status { justify-self: start; }
}
