/* AI Progress — a transit diagram of AI since ChatGPT.
 *
 * Each line takes its timeline's color (TIMELINES[].color in data.js):
 * indigo for the model, red for the harness, teal for the research, blue for the compute. Checked
 * as a set with the dataviz skill's palette checker on the card surface
 * (#fbfaf6): the teal–red pair is 6.9 ΔE for deuteranopes, legal only with a
 * second cue, which the separate blocks and every lane's name supply. Open
 * releases fill their square green for weights and amber for code, a pair
 * that passes every check; amber and teal sit under 3:1 against the card, so
 * each carries a text label in the legend, and every station is in the
 * table. Text never wears a line color.
 */
:root {
  --open-weights: #008300;
  --open-source: #eda100;
  --paper: #f7f5ef;
  --card: #fbfaf6;
  --ink: #1b1a17;
  --ink-2: #4f4c45;
  --ink-3: #8a867c;
  --rule: #dcd8cd;
  --rule-soft: #e9e6dc;
  --accent: #b5601e;
  --wash: rgba(27, 26, 23, 0.045);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem 2.4rem;
  flex-wrap: wrap;
  padding: 1.6rem 1.8rem 1.1rem;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3.4rem;
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.wordmark em { font-style: italic; color: var(--accent); }
.notes-link { margin-top: 0.55rem; font-size: 0.92rem; color: var(--ink-2); }
.notes-link a { font-weight: 600; }

.tagline {
  margin-top: 0.7rem;
  max-width: 64ch;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.labs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.labs-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 0.3rem;
}

.labs button {
  font-family: var(--cond);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.labs button:hover { border-color: var(--ink-3); }
.labs button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.labs button:focus-visible, .tour-step:focus-visible, .chip:focus-visible, .bt-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- tour ---------- */

.tour {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.8rem;
}

/* The tour's bar stays under the site nav while the two timelines scroll
 * past, so stepping through breakthroughs never means scrolling back up. It
 * is sticky inside .stage, which holds the tour, the legend and the map. */
.tour-sticky {
  position: sticky;
  top: var(--appnav-h, 0px);
  z-index: 20;
  background: var(--paper);
}
.tour-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0.75rem 1.8rem 0.55rem;
  border-top: 1px solid var(--ink);
}
.tour-sticky.stuck { box-shadow: 0 6px 14px -10px rgba(27, 26, 23, 0.35); }

.tour-step {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--card);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tour-step:hover { border-color: var(--ink); }
.tour-step:disabled { opacity: 0.35; cursor: default; border-color: var(--rule); }

.tour-now {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  flex-wrap: wrap;
}

.tour-now .roundel {
  align-self: center;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
}

.tour-now .when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tour-now .title {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.1;
}

.tour-now .idle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-2);
}

.tour-now .clear {
  font-family: var(--cond);
  font-size: 0.82rem;
  color: var(--ink-3);
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  margin-left: auto;
}
.tour-now .clear:hover { color: var(--ink); border-color: var(--ink); }

.tour-story {
  max-width: 88ch;
  min-height: 3em;
  padding-bottom: 0.7rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.tour-story b { color: var(--ink); font-weight: 600; }

/* ---------- legend ---------- */

.legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.4rem;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 0.45rem 1.8rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-2);
}

.legend-item { display: flex; align-items: center; gap: 0.45rem; }
.legend-item svg { height: 14px; width: auto; overflow: visible; }
.lg-line { stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.lg-achievements { stroke: #e87ba4; }
.lg-model { stroke: #4a3aa7; }
.lg-harness { stroke: #e34948; }
.lg-research { stroke: #1baf7a; }
.lg-compute { stroke: #2a78d6; }
.lg-open { fill: var(--card); stroke: var(--ink-2); stroke-width: 2.2; }
.lg-open.weights { fill: var(--open-weights); }
.lg-open.source { fill: var(--open-source); }
.lg-org { fill: var(--card); stroke: var(--ink-2); stroke-width: 2.2; stroke-linejoin: round; }
.lg-dotted { stroke-width: 2.4; stroke-dasharray: 0.1 5.5; }
.lg-station { fill: var(--card); stroke: var(--ink-2); stroke-width: 2.2; }
.lg-interchange { fill: var(--card); stroke: var(--ink); stroke-width: 2.6; }
.lg-link { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }

/* ---------- map ---------- */

.chart-wrap {
  position: relative;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 0.3rem 1.2rem 0;
}

#map {
  display: block;
  width: 100%;
  height: auto;
  background-color: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

#map text { font-family: var(--cond); }

.grid-month { stroke: var(--rule); stroke-width: 0.6; opacity: 0.55; }
.grid-year { stroke: var(--ink-3); stroke-width: 0.8; opacity: 0.5; }
.axis-year { font-family: var(--mono) !important; font-size: 12px; font-weight: 500; fill: var(--ink); }
.axis-month { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); letter-spacing: 0.04em; }
.axis-break { stroke: var(--ink-3); stroke-width: 1; fill: none; }
.pre-label { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); letter-spacing: 0.1em; text-anchor: middle; }

.origin-rule { stroke: var(--ink); stroke-width: 1.3; }
.origin-label { font-size: 10.5px; font-weight: 600; fill: var(--ink); }
.origin-sub { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); }
.today-rule { stroke: var(--accent); stroke-width: 1.2; }
.today-label { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--accent); letter-spacing: 0.06em; }

/* the two timelines: a faint wash each, and a header naming it */
.tl-wash { fill: var(--c); fill-opacity: 0.035; }
.tl-key { stroke-width: 5; stroke-linecap: round; }
.tl-name { font-family: var(--serif) !important; font-size: 21px; fill: var(--ink); }
.tl-dek { font-size: 10px; fill: var(--ink-3); }
.rail-label { font-family: var(--mono) !important; font-size: 9.5px; font-weight: 500; letter-spacing: 0.16em; fill: var(--ink-2); }
.axis-year, .axis-month, .origin-label, .origin-sub, .today-label, .pre-label {
  paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round;
}
.lane-name { font-size: 13.5px; font-weight: 600; fill: var(--ink); text-anchor: end; }
.lane-blurb { font-size: 9.5px; fill: var(--ink-3); text-anchor: end; }
.lane-hit { fill: transparent; }
.lane { cursor: pointer; }
.lane:hover .lane-name, .lane.lit .lane-name { fill: var(--accent); }

.line-solid { fill: none; stroke-width: 4.5; stroke-linecap: round; transition: opacity 0.25s; }
.line-dotted { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.1 6; transition: opacity 0.25s; }
.line-end { stroke-width: 5; stroke-linecap: round; }

.st { cursor: pointer; outline: none; }
.st .hit { fill: transparent; }
.st .dot { fill: var(--card); stroke-width: 2.5; transition: opacity 0.25s, stroke-width 0.15s; }
.st .dot.open-weights { fill: var(--open-weights); }
.st .dot.open-source { fill: var(--open-source); }
.st .dot.org { stroke-linejoin: round; }
.st.pre .dot { stroke-width: 2; }
.st.junction .dot { stroke: var(--ink) !important; stroke-width: 2.6; }
.st:hover .dot, .st:focus-visible .dot { stroke-width: 3.4; }
.st.pinned .dot { fill: var(--c); stroke: var(--ink) !important; stroke-width: 2.4; }
.st .halo { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity 0.2s; }
.st:focus-visible .halo, .st.lit .halo { opacity: 1; }

.st-label { font-size: 11px; font-weight: 500; fill: var(--ink); transition: opacity 0.25s; pointer-events: none; }
.st-label.major { font-weight: 600; font-size: 11.5px; }
.st-label.pre { font-size: 10px; font-weight: 400; fill: var(--ink-2); }
.st-leader { stroke: var(--ink-3); stroke-width: 0.8; transition: opacity 0.25s; pointer-events: none; }

.link { fill: none; stroke-width: 1.7; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.link.on { opacity: 0.9; stroke-dasharray: 5 4; animation: flow 1.1s linear infinite; }
.link.measure.on { opacity: 0.7; stroke-width: 1.3; stroke-dasharray: 1 4; stroke-linecap: round; }
@keyframes flow { to { stroke-dashoffset: -18; } }

.bt-band { fill: var(--ink); opacity: 0.04; transition: opacity 0.2s; pointer-events: none; }
.bt-drop { stroke: var(--ink); stroke-width: 0.8; opacity: 0.22; transition: opacity 0.2s; pointer-events: none; }
.bt { cursor: pointer; outline: none; }
.bt .roundel { fill: var(--ink); stroke: var(--card); stroke-width: 2; transition: fill 0.15s; }
.bt .num { font-family: var(--mono) !important; font-size: 10px; font-weight: 500; fill: var(--paper); text-anchor: middle; pointer-events: none; }
.bt:hover .roundel, .bt:focus-visible .roundel, .bt.on .roundel { fill: var(--accent); }
.bt-band.on { opacity: 0.09; }
.bt-drop.on { opacity: 0.75; }

.rail { opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.rail.on { opacity: 1; }
.rail-bg { fill: var(--card); opacity: 0.94; }
.rail-edge { stroke: var(--rule); stroke-width: 1; }
.rail-key { stroke-width: 5; stroke-linecap: round; }
.rail-name { font-size: 12px; font-weight: 600; fill: var(--ink); text-anchor: end; }

.dim { opacity: 0.16; }
.line-solid.dim, .line-dotted.dim { opacity: 0.22; }

/* horizon panel */
.hz-title { font-size: 12px; font-weight: 600; fill: var(--ink); }
.hz-sub { font-size: 9.5px; fill: var(--ink-3); }
.hz-grid { stroke: var(--rule); stroke-width: 0.8; }
.hz-tick { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); text-anchor: end; }
.hz-path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hz-dot { fill: var(--ink); stroke: var(--card); stroke-width: 2; cursor: pointer; }
.hz-dot.off-frontier { fill: var(--card); stroke: var(--ink-3); stroke-width: 1.4; }
.hz-hit { fill: transparent; cursor: pointer; }
.hz-label { font-size: 10px; fill: var(--ink-2); }
.hz-arrow { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* intelligence panel: two step lines, the scale on the right */
.ix-base { stroke: var(--ink-3); stroke-width: 0.9; }
.ix-tick { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); }
.ix-axis { font-family: var(--mono) !important; font-size: 8.5px; fill: var(--ink-3); letter-spacing: 0.1em; }
.ix-path { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ix-dot { fill: var(--c); stroke: var(--card); stroke-width: 1.6; }
.ix-dot.est { fill: var(--card); stroke: var(--c); stroke-width: 1.6; }
.ix-pt { transition: opacity 0.25s; }
.ix-pt:focus { outline: none; }
.ix-pt:focus .ix-dot { stroke-width: 2.6; }
.ix-flag-val { font-family: var(--mono) !important; font-size: 9px; font-weight: 500; fill: var(--ink); }
.ix-legend { font-size: 10.5px; font-weight: 600; fill: var(--ink); }
.ix-legend.est { font-weight: 400; fill: var(--ink-3); }
.ix-legend-now { font-size: 9px; fill: var(--ink-3); }
.ix-name { font-size: 11px; font-weight: 600; fill: var(--ink); }
.ix-label { font-size: 10px; fill: var(--ink-2); }
.ix-name, .ix-label { paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.ix-hit { fill: transparent; cursor: crosshair; }
.ix-cross-line { stroke: var(--ink-3); stroke-width: 0.8; stroke-dasharray: 2 3; }
.ix-cross-gap { stroke: var(--ink); stroke-width: 2; }
.ix-ring { fill: none; stroke: var(--c); stroke-width: 2; }

.tooltip {
  position: absolute;
  z-index: 10;
  /* its own width, not what is left of the map's visible width: when the map
     is scrolled sideways, that is nothing, and the tip would squeeze to a word */
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 0.55rem 0.75rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 0.84rem;
  line-height: 1.42;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(27, 26, 23, 0.22);
}
.tooltip .tip-ref {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cfcabd;
  margin-bottom: 0.15rem;
}
.tooltip .tip-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.tooltip .tip-title { display: block; font-family: var(--cond); font-weight: 600; font-size: 0.98rem; }
.tooltip .tip-where { display: block; font-family: var(--mono); font-size: 0.7rem; color: #cfcabd; margin-bottom: 0.2rem; }
.tooltip .tip-num { display: block; margin-top: 0.2rem; font-family: var(--mono); font-size: 0.72rem; color: #e8e4d8; }
.tooltip .tip-row { display: flex; align-items: baseline; gap: 0.45rem; font-family: var(--cond); }
.tooltip .tip-row .tip-key { align-self: center; }
.tooltip .tip-series { font-weight: 600; flex: none; }
.tooltip .tip-model { color: #e8e4d8; min-width: 0; }
.tooltip .tip-val { margin-left: auto; padding-left: 0.6rem; font-family: var(--mono); font-size: 0.8rem; font-weight: 500; }
.tooltip .tip-note { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: #e8e4d8; }

.scroll-hint { display: none; }

/* ---------- detail ---------- */

.detail {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.8rem 2rem;
  scroll-margin-top: calc(var(--appnav-h, 0px) + 12px);
}

.detail-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}

.key { display: inline-block; width: 18px; height: 5px; border-radius: 3px; background: var(--c, var(--ink)); flex: none; }

.detail-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.3rem;
  line-height: 1.05;
  margin-bottom: 0.3rem;
}
.detail-title .alt { font-style: italic; color: var(--ink-3); font-size: 0.6em; }

.detail-sub { color: var(--ink-2); margin-bottom: 1rem; }

.detail p.body { font-size: 1.04rem; line-height: 1.62; max-width: 70ch; margin-bottom: 0.7rem; }
.detail p.body b { font-weight: 600; }

.fact {
  display: inline-block;
  margin: 0.2rem 0 0.9rem;
  padding: 0.35rem 0.7rem;
  border-left: 3px solid var(--c, var(--ink));
  background: var(--card);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
}

.cite { font-size: 0.9rem; color: var(--ink-2); margin: 0.4rem 0 1.1rem; }
.cite a { font-weight: 500; }

.rel { margin-top: 1rem; }
.rel h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.45rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem 0.28rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--cond);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.chip:hover { border-color: var(--ink-3); background: #fff; }
.chip .when { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); }
.chip .key { width: 12px; height: 4px; }

.walk {
  list-style: none;
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
}
.walk > li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.3rem 1.2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.walk .side {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.2rem;
}
.walk p { font-size: 1.02rem; line-height: 1.6; margin-bottom: 0.5rem; max-width: 68ch; }

.bt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.bt-card {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bt-card:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27, 26, 23, 0.07); }
.bt-card .head { display: flex; align-items: center; gap: 0.55rem; }
.bt-card .roundel {
  display: inline-grid; place-items: center; flex: none;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
}
.bt-card .when { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.bt-card .title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.12; }
.bt-card .dek { font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }
.bt-card .lines { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; margin-top: 0.15rem; font-family: var(--cond); font-size: 0.8rem; color: var(--ink-2); }
.bt-card .lines span { display: inline-flex; align-items: center; gap: 0.3rem; }
.bt-card .lines .key { width: 10px; height: 4px; }

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.section-dek { color: var(--ink-2); max-width: 72ch; margin-bottom: 0.9rem; }

.index-title { margin-top: 2rem; }
.index-title .alt { font-style: italic; color: var(--ink-3); font-size: 0.6em; }
.line-index { list-style: none; margin-top: 0.6rem; border-top: 1px solid var(--rule); }
.line-index li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.2rem 1.2rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.line-index button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1rem;
}
.line-index button:hover { color: var(--accent); }
.line-index button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.line-index .fam { display: block; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-left: calc(18px + 0.5rem); }
.line-index p { font-size: 0.96rem; color: var(--ink-2); line-height: 1.55; }

/* ---------- is it AGI yet? ---------- */

/* the band on the map: hatched in the accent, behind every lane */
.agi-hatch-line { stroke: var(--accent); stroke-width: 1.4; stroke-opacity: 0.2; }
.agi-band { pointer-events: none; }
.agi-edge { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.65; pointer-events: none; }
.agi-label text { font-family: var(--mono) !important; font-size: 8.5px; font-weight: 500; letter-spacing: 0.1em; fill: var(--accent); cursor: pointer;
  paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.agi-label:hover text, .agi-label:focus-visible text { text-decoration: underline; }
.agi-label:focus { outline: none; }
.lg-agi { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 2; }
.lg-agi-hatch { stroke: var(--accent); stroke-width: 1; stroke-opacity: 0.45; fill: none; }

.agi {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.8rem 2.2rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--appnav-h, 0px) + 12px);
}
.agi h2 { font-family: var(--serif); font-weight: 400; font-size: 2.3rem; line-height: 1.05; margin-bottom: 0.5rem; }
.agi h2 em { color: var(--accent); }
.agi-lede { max-width: 70ch; font-size: 1.04rem; line-height: 1.6; color: var(--ink-2); margin-bottom: 1.4rem; }
.agi-h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 2rem 0 0.5rem; color: var(--ink); }
.agi-note { max-width: 70ch; color: var(--ink-2); margin-bottom: 0.8rem; }
.agi p.body { font-size: 1.02rem; line-height: 1.6; max-width: 70ch; margin-bottom: 0.7rem; }
.agi p.body b { font-weight: 600; color: var(--ink); }

/* verdicts are shapes, always named: filled met, half partially, open not met */
.vg { display: inline-block; width: 0.72em; height: 0.72em; border-radius: 50%; border: 1.5px solid var(--ink); vertical-align: -0.06em; margin-right: 0.35em; flex: none; }
.vg.met { background: var(--ink); }
.vg.partial { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.vg.dashed { border-style: dashed; border-color: var(--ink-3); }
.verdict { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }

.agi-mine { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 6px; padding: 1.1rem 1.3rem 1.2rem; scroll-margin-top: calc(var(--appnav-h, 0px) + 12px); }
.agi-mine-kicker { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.agi-mine-def { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; color: var(--ink); margin: 0.2rem 0 0.5rem; }
.agi-mine .verdict { margin-bottom: 0.8rem; }
.agi-mine-ev { list-style: none; margin: 0.4rem 0 0.8rem; display: grid; gap: 0.45rem; }
.agi-mine-ev li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; color: var(--ink-2); font-size: 0.95rem; }

.agi-score { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.6rem; padding: 1.2rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .agi-score { grid-template-columns: auto 1fr; align-items: center; gap: 2.2rem; } }
.agi-tally { display: flex; gap: 1.6rem; }
.agi-count b { display: block; font-family: var(--serif); font-size: 2.8rem; font-weight: 400; line-height: 1; color: var(--ink); }
.agi-count span { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.agi-pips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.agi-pip { width: 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font: 500 0.76rem var(--mono); display: grid; place-items: center; cursor: pointer; padding: 0; }
.agi-pip.met { background: var(--ink); color: var(--paper); }
.agi-pip.partial { background: linear-gradient(90deg, var(--rule) 50%, var(--card) 50%); }
.agi-pip:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.agi-score-note { margin-top: 0.6rem; color: var(--ink-2); font-size: 0.98rem; font-style: italic; }

.agi-evidence { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 640px) { .agi-evidence { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .agi-evidence { grid-template-columns: repeat(4, 1fr); } }
.agi-ev { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 0.95rem 1rem 1rem; display: flex; flex-direction: column; }
.agi-ev .agi-ev-name { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.agi-ev .agi-ev-num { font-family: var(--serif); font-size: 2.2rem; line-height: 1.05; color: var(--ink); margin: 0.3rem 0 0.2rem; }
.agi-ev .agi-ev-num small { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); }
.agi-ev p { font-size: 0.93rem; color: var(--ink-2); line-height: 1.45; }
.agi-ev .agi-ev-src { margin-top: auto; padding-top: 0.7rem; font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }
.agi-bars { margin: 0.4rem 0 0.3rem; }
.agi-bar-row { display: grid; grid-template-columns: 2.4rem 1fr 3.2rem; gap: 0.4rem; align-items: center; font: 0.7rem var(--mono); color: var(--ink-2); margin: 0.2rem 0; }
.agi-bar { height: 0.5rem; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.agi-bar i { display: block; height: 100%; background: var(--ink-2); }

.agi-map-wrap { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
.agi-map-wrap svg { display: block; width: 100%; min-width: 760px; height: auto; }
.agi-map-wrap text { font-family: var(--mono); }
.agi-reach { fill: var(--accent); fill-opacity: 0.08; }
.agi-reach-label { font-size: 12px; fill: var(--accent); }
.agi-lane { stroke: var(--rule); }
.agi-lane-label, .agi-axis-label { font-size: 12px; fill: var(--ink-2); }
.agi-axis { stroke: var(--ink); }
.agi-dot { cursor: pointer; outline: none; }
.agi-dot-c { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.agi-dot.met .agi-dot-c { fill: var(--ink); }
.agi-dot-half { fill: var(--ink); }
.agi-dot.extra .agi-dot-c { stroke: var(--ink-3); stroke-dasharray: 3 2; }
.agi-dot.mine .agi-dot-c { fill: var(--accent); stroke: var(--card); }
.agi-mine-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.agi-dot-label { font-size: 13px; fill: var(--ink); }
.agi-dot.mine .agi-dot-label { font-weight: 500; fill: var(--accent); }
.agi-dot:hover .agi-dot-c, .agi-dot:focus-visible .agi-dot-c { stroke-width: 3; }
.agi-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.7rem 0 0; font: 0.76rem var(--mono); color: var(--ink-2); }
.agi-legend > span { display: inline-flex; align-items: center; }
.lg-reach { display: inline-block; width: 0.9rem; height: 0.7rem; background: rgba(181, 96, 30, 0.14); border: 1px solid rgba(181, 96, 30, 0.4); margin-right: 0.4rem; }

.agi-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem; }
.agi-filters .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.agi-ledger { display: grid; gap: 0.7rem; }
.agi-entry { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 0.95rem 1.1rem 1rem; scroll-margin-top: calc(var(--appnav-h, 0px) + 16px); transition: box-shadow 0.3s; }
.agi-entry.flash { box-shadow: 0 0 0 3px var(--accent); }
.agi-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; }
.agi-entry-num { font: 500 0.76rem var(--mono); color: var(--ink-3); }
.agi-entry h3 { font-family: var(--cond); font-weight: 600; font-size: 1.12rem; color: var(--ink); flex: 1 1 14rem; }
.agi-entry-def { margin: 0.5rem 0 0.35rem; font-size: 1.05rem; color: var(--ink); max-width: 70ch; }
.agi-entry-def .lead { font: 0.7rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.agi-entry-sub { font-style: italic; color: var(--ink-2); margin-bottom: 0.4rem; }
.agi-entry-flip { font-size: 0.95rem; color: var(--ink-2); max-width: 70ch; }
.agi-entry-flip b { font: 500 0.7rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-right: 0.3rem; }
.agi-src { margin-top: 0.5rem; font: 0.7rem var(--mono); color: var(--ink-3); }
.agi-src a, .agi-ev-src a { color: var(--ink-2); }

/* ---------- table ---------- */

.table-view {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto 1.4rem;
  padding: 0 1.8rem;
}
.table-view summary {
  font-family: var(--cond);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0.5rem 0;
}
.table-view summary:hover { color: var(--accent); }
.table-scroll { overflow-x: auto; }

#station-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}
#station-table th {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 0.4rem 0.8rem 0.4rem 0;
  border-bottom: 1px solid var(--ink);
}
#station-table td {
  padding: 0.42rem 0.8rem 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
#station-table tr { cursor: pointer; }
#station-table tbody tr:hover { background: var(--card); }
#station-table td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
#station-table td:nth-child(2) { white-space: nowrap; font-family: var(--cond); }
#station-table td:nth-child(2) .key { margin-right: 0.4rem; vertical-align: middle; width: 12px; height: 4px; }
#station-table td:nth-child(4) { color: var(--ink-2); white-space: nowrap; }
#station-table td.open-cell { color: var(--ink-2); white-space: nowrap; font-size: 0.84rem; }
#station-table td:nth-child(6) a { font-size: 0.84rem; }
.open-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -0.05rem; border: 1px solid var(--ink-3); }
.open-key.weights { background: var(--open-weights); }
.open-key.source { background: var(--open-source); }

.table-note { color: var(--ink-2); max-width: 78ch; font-size: 0.9rem; margin: 0.2rem 0 0.4rem; }
#index-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.9rem; margin-top: 0.4rem; }
#index-table th {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 0.4rem 0.8rem 0.4rem 0;
  border-bottom: 1px solid var(--ink);
}
#index-table td { padding: 0.42rem 0.8rem 0.42rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
#index-table td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
#index-table td:nth-child(2) { white-space: nowrap; font-family: var(--cond); }
#index-table td:nth-child(2) .key { margin-right: 0.4rem; vertical-align: middle; width: 12px; height: 4px; }
#index-table td:nth-child(4) { color: var(--ink-2); white-space: nowrap; }
#index-table th:last-child, #index-table td:last-child { text-align: right; padding-right: 0; white-space: nowrap; font-family: var(--mono); font-size: 0.82rem; }

/* ---------- sources ---------- */

.sources {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem 1.8rem 2rem;
  border-top: 1px solid var(--rule);
}
.sources h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  margin-bottom: 0.3rem;
}
.sources-note { color: var(--ink-2); max-width: 78ch; font-size: 0.95rem; margin-bottom: 1rem; }
.src-group { margin-bottom: 1.1rem; break-inside: avoid; }
.src-group h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}
.src-group ol { list-style: none; }
.src-group li { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); padding: 0.14rem 0; }
.src-group li .d { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); margin-right: 0.4rem; }
.src-group li a { color: var(--ink); text-decoration-color: var(--rule); }
.src-group li a:hover { color: var(--accent); text-decoration-color: var(--accent); }
#source-list { columns: 2 440px; column-gap: 2.4rem; }

/* ---------- colophon & changelog ---------- */

.colophon {
  margin-top: auto;
  padding: 0.7rem 1.8rem;
  border-top: 1px solid var(--ink);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.colophon a { color: var(--accent); }

.changelog {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.8rem 2rem;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.changelog h2 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.changelog ul { list-style: none; }
.changelog li + li { margin-top: 0.3rem; }
.changelog time { font-family: var(--mono); color: var(--accent); margin-right: 0.6rem; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .link.on { stroke-dasharray: none; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .masthead { padding: 1.1rem 1rem 0.9rem; }
  .wordmark { font-size: 2.6rem; }
  .tagline { font-size: 0.95rem; }
  .labs { width: 100%; }
  .labs-label { width: 100%; }
  .tour { padding: 0 1rem; }
  .tour-bar { padding-left: 1rem; padding-right: 1rem; }
  .tour-now .title { font-size: 1.3rem; }
  .tour-story { font-size: 0.92rem; }
  .legend-bar { padding: 0.45rem 1rem; font-size: 0.76rem; gap: 0.3rem 1rem; }

  .chart-wrap {
    padding: 0.2rem 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #map { min-width: 1250px; border-radius: 0; border-left: 0; border-right: 0; }

  .scroll-hint {
    display: block;
    padding: 0.35rem 1rem 0;
    font-size: 0.76rem;
    font-style: italic;
    color: var(--ink-3);
    text-align: center;
  }

  .detail { padding: 1.2rem 1rem 1.6rem; }
  .detail-title { font-size: 1.9rem; }
  .walk > li, .line-index li { grid-template-columns: 1fr; }
  .table-view, .sources, .changelog { padding-left: 1rem; padding-right: 1rem; }
  .colophon { padding: 0.7rem 1rem; }
}
