/* Forecasting the Future: project page.
   Layout: one reading column that widens for charts; every colour is a token so the page
   follows the reader's light or dark setting without redrawing anything. */

:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #121820;
  --muted: #5a6573;
  --rule: #dde2e8;
  --faint: #eef1f5;
  --blend: #2a6fc9;
  --model: #4a3aa7;
  --chain: #cf5a24;
  --average: #8a8f98;
  --happened: rgba(18, 24, 32, 0.07);
  --uninformative: rgba(18, 24, 32, 0.045);
  --bad: #c03a33;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --panel: #141a22;
    --ink: #e6ebf1;
    --muted: #97a3b1;
    --rule: #26303b;
    --faint: #1a212b;
    --blend: #5d9ff0;
    --model: #a397e6;
    --chain: #f08a55;
    --average: #8d96a3;
    --happened: rgba(230, 235, 241, 0.08);
    --uninformative: rgba(230, 235, 241, 0.04);
    --bad: #ef7a72;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blend); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blend); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 24px; }
.prose { max-width: 68ch; }

/* ------------------------------------------------------------------ navigation */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: 20px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
.top .github { display: inline-flex; color: var(--ink); }
.top .github svg { width: 20px; height: 20px; fill: currentColor; }

/* ------------------------------------------------------------------------ hero */

.hero { padding-block: 72px 56px; border-bottom: 1px solid var(--rule); }
.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -0.015em; max-width: 16ch; }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink); max-width: 62ch; margin: 22px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--rule); color: var(--ink); background: var(--panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.button:hover { border-color: var(--muted); transform: translateY(-1px); }
.button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .button, .button:hover { transition: none; transform: none; } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 48px; border-top: 1px solid var(--rule); }
.stat { padding: 18px 20px 4px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--rule); }
.stat .value { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .value small { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .label { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.value.blend { color: var(--blend); }
.value.model { color: var(--model); }

/* -------------------------------------------------------------------- sections */

section.block { padding-block: 64px; border-bottom: 1px solid var(--rule); }
section.block:last-of-type { border-bottom: 0; }
h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 14px; }
h3 { font-size: 20px; margin-bottom: 8px; }
.kicker { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }

.findings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin-top: 32px; }
.finding h3 { font-size: 18px; margin-bottom: 6px; }
.finding p { font-size: 15.5px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------------- charts */

.figure { min-width: 0; margin-top: 28px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 18px 14px; }
.figure .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 10px; font-size: 14px; }
.figure .toolbar label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); }
.figure .toolbar label:has(select) { min-width: 0; max-width: 100%; }
.figure .toolbar select { max-width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; padding: 5px 8px; }
.figure .toolbar input[type="range"] { width: min(260px, 100%); accent-color: var(--blend); }
.readout { display: flex; flex-wrap: wrap; gap: 6px 20px; min-height: 26px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.readout strong { color: var(--ink); font-weight: 500; }
.readout .when { font-family: var(--sans); font-weight: 600; color: var(--ink); }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.key.blend { background: var(--blend); } .key.model { background: var(--model); }
.key.chain { background: var(--chain); } .key.average { background: var(--average); }
.caption { font-size: 14.5px; color: var(--muted); margin-top: 12px; max-width: 80ch; }
.chart { overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; min-width: 560px; font-family: var(--sans); }
.split .chart svg { min-width: 400px; }

svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .zero { stroke: var(--muted); stroke-width: 1.2; }
svg .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
svg .axis-label { fill: var(--muted); font-size: 12px; }
svg .shade { fill: var(--uninformative); }
svg .happened { fill: var(--happened); }
svg .band { stroke: none; }
svg .band.blend { fill: var(--blend); opacity: 0.14; }
svg .band.chain { fill: var(--chain); opacity: 0.12; }
svg .band.model { fill: var(--model); opacity: 0.12; }
svg .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
svg .line.blend { stroke: var(--blend); stroke-width: 2.4; }
svg .line.model { stroke: var(--model); }
svg .line.chain { stroke: var(--chain); }
svg .line.average { stroke: var(--average); stroke-width: 1.4; }
svg .marker { stroke-width: 1.2; stroke-dasharray: 3 3; }
svg .marker.blend { stroke: var(--blend); } svg .marker.model { stroke: var(--model); }
svg .marker-label { font-size: 12px; font-weight: 600; }
svg .marker-label.blend { fill: var(--blend); } svg .marker-label.model { fill: var(--model); }
svg .cursor { stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1; }
svg .dot { stroke: var(--panel); stroke-width: 1.5; }
svg .dot.blend { fill: var(--blend); } svg .dot.model { fill: var(--model); } svg .dot.chain { fill: var(--chain); }
svg .tickmark { fill: var(--bad); }
svg .row-rule { stroke: var(--rule); stroke-width: 1; }
svg .row-label { fill: var(--ink); font-size: 12.5px; }
svg .note { fill: var(--muted); font-size: 11.5px; }
svg .draw { stroke-dasharray: var(--length); stroke-dashoffset: var(--length); animation: draw 1.1s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { svg .draw { animation: none; stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ two columns */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.split .figure { margin-top: 0; }

/* ----------------------------------------------------------------- the forecasts */

.table-wrap { overflow-x: auto; margin-top: 24px; border-top: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
td.num { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.bar { position: relative; height: 6px; background: var(--faint); border-radius: 3px; width: 96px; display: inline-block; margin-left: 10px; vertical-align: middle; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--blend); }
.bar.average span { background: var(--average); }
td .long { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; max-width: 58ch; }
td .short { font-weight: 600; }
td .halves { display: block; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* ------------------------------------------------------------------------ method */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 30px; border-top: 1px solid var(--rule); }
.step { padding: 18px 20px 0 0; }
.step + .step { padding-left: 20px; border-left: 1px solid var(--rule); }
.step .n { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.step h3 { font-size: 17px; margin: 6px 0 6px; }
.step p { font-size: 15px; color: var(--muted); margin: 0; }
.image-figure { margin: 32px 0 0; }
.image-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fcfcfb; }

.ledger { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.ledger li { display: grid; grid-template-columns: 90px minmax(0, 1fr) 150px; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.ledger .date { font-family: var(--mono); font-size: 13.5px; color: var(--muted); padding-top: 2px; }
.ledger .skill { font-family: var(--mono); font-size: 14px; text-align: right; }
.ledger .skill span { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ paper, links */

.paper > div { min-width: 0; }
.paper { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 28px; }
.cover { display: block; aspect-ratio: 8.5 / 11; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); padding: 22px 18px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.18); transition: transform 0.2s ease; }
.cover:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .cover, .cover:hover { transition: none; transform: none; } }
.cover .t { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.25; }
.cover .s { font-family: var(--serif); font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.cover .a { font-size: 11px; margin-top: 14px; }
.cover .lines { margin-top: 16px; display: grid; gap: 6px; }
.cover .lines i { display: block; height: 4px; background: var(--faint); border-radius: 2px; }
.cover .lines i:nth-child(3n) { width: 78%; }
pre.cite { position: relative; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; margin: 18px 0 0; color: var(--ink); }
.copy { position: absolute; top: 10px; right: 10px; font: 500 12.5px var(--sans); color: var(--muted); background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--ink); }

.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.link-card { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); text-decoration: none; color: var(--ink); transition: border-color 0.15s ease; }
.link-card:hover { border-color: var(--muted); }
.link-card strong { display: block; font-size: 15.5px; font-weight: 600; }
.link-card span { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.sources { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
.sources a { font-family: var(--mono); font-size: 13px; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--panel); }
.sources a:hover { border-color: var(--muted); }

footer { padding-block: 36px 56px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ------------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .findings, .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .top nav { display: none; }
  .hero { padding-block: 48px 40px; }
  .lede { font-size: 18px; }
  .findings, .links, .steps { grid-template-columns: 1fr; }
  .step + .step { padding-left: 0; border-left: 0; }
  .stat .value { font-size: 32px; }
  .paper { grid-template-columns: minmax(0, 1fr); }
  .cover { max-width: 220px; }
  .ledger li { grid-template-columns: 1fr; gap: 4px; }
  td .long { display: none; }
  table { min-width: 520px; }
  .ledger .skill { text-align: left; }
  section.block { padding-block: 48px; }
}
