/* A Brief History of AI — styles
   Tokens: cool paper + navy ink; origin colours from the Okabe–Ito palette (colour-blind safe). */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #13203b;
  --muted: #536079;
  --rule: #d3d9e2;
  --band: rgba(19, 32, 59, 0.045);
  --ls: #0072b2;
  --today: #e69f00;
  --agent: #cc79a7;
  --callout: #e9edf3;
  --focus: #0072b2;
  --scrim: rgba(19, 32, 59, 0.38);
  --right: #1e7b4a;
  --wrong: #b3261e;

  --font-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-condensed: "Bahnschrift Condensed", "Bahnschrift", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --font-text: "Sitka Text", "Charter", "Iowan Old Style", "Georgia", serif;

  --year-col: 7.5rem;
  --mark-col: 2.25rem;
  --measure: 46rem;
  --gutter: clamp(1rem, 4vw, 4rem);
  --tour-scale: 1;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1729;
  --surface: #16213a;
  --ink: #e7ecf4;
  --muted: #9ba7bc;
  --rule: #2b3856;
  --band: rgba(231, 236, 244, 0.045);
  --ls: #56b4e9;
  --callout: #1b2845;
  --focus: #56b4e9;
  --scrim: rgba(4, 8, 16, 0.6);
  --right: #5cc98f;
  --wrong: #f2857c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(16px, 0.55vw + 12px, 22px);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.6;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 0.5rem 1rem;
  font-family: var(--font-display);
}
.skip:focus { top: 1rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.5rem; padding: 0.4rem 1.1rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 500 0.9rem/1.2 var(--font-display);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--band); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink); opacity: 0.9; }
.btn-quiet { border-color: transparent; padding-inline: 0.7rem; }
.btn-quiet:hover { border-color: var(--rule); }
.btn:disabled { opacity: 0.35; cursor: default; }

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

.hero { padding: 1rem var(--gutter) 0; }

.hero-bar { display: flex; justify-content: flex-end; }

.hero h1 {
  margin: clamp(1rem, 6vh, 4rem) 0 0;
  font-family: var(--font-condensed);
  font-stretch: 75%;
  font-weight: 700;
  font-size: clamp(3.2rem, 10.5vw, 10rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  max-width: 12ch;
}

.lede {
  max-width: 36rem;
  margin: 1.4rem 0 0;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }

/* ---------- skyline ---------- */

.skyline { position: relative; margin: clamp(2rem, 6vh, 4rem) 0 0; }
.skyline-plot { width: 100%; }
.skyline svg { display: block; width: 100%; height: auto; overflow: visible; }

.skyline .band { fill: var(--band); }
.skyline .axis { stroke: var(--ink); stroke-width: 1.5; }
.skyline .tick { stroke: var(--muted); stroke-width: 1; }
.skyline .tick-label {
  fill: var(--muted); font-family: var(--font-display); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.skyline a { cursor: pointer; }
.skyline .dot { transition: opacity 0.25s; }
.skyline .dot.dim { opacity: 0.12; }
.skyline .dot:hover circle, .skyline .dot:hover path { stroke: var(--ink); stroke-width: 2; }

@media (prefers-reduced-motion: no-preference) {
  .skyline.animate .dot {
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i) * 18ms);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

.legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  margin-top: 1rem; padding-bottom: 1.5rem;
  font-family: var(--font-display); font-size: 0.85rem; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  max-width: 18rem; padding: 0.45rem 0.7rem;
  background: var(--ink); color: var(--bg);
  font: 0.8rem/1.35 var(--font-display);
  transform: translate(-50%, calc(-100% - 12px));
}
.tip strong { display: block; font-size: 1rem; font-family: var(--font-condensed); font-stretch: 75%; }

/* ---------- origin marks and badges ---------- */

.mark {
  display: inline-block; flex: none;
  width: 0.8rem; height: 0.8rem; border-radius: 50%;
  background: var(--mark);
}
.o-ls { --mark: var(--ls); }
.o-today { --mark: var(--today); }
.o-agent { --mark: var(--agent); }

.badges {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1rem;
  margin: 0.5rem 0 0; padding: 0; list-style: none;
  font: 0.8rem/1.4 var(--font-display); color: var(--muted);
}
.badges li { display: inline-flex; align-items: center; gap: 0.4rem; }
.badge-status { font-style: italic; }
.badge-status::before { content: ""; width: 0.8rem; height: 0.8rem; border: 1.5px dashed var(--muted); border-radius: 50%; }

/* ---------- controls ---------- */

.controls {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.controls-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem;
  padding: 0.6rem var(--gutter);
}

.origin-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 2.25rem; padding: 0.25rem 0.85rem 0.25rem 0.6rem;
  border: 1.5px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 500 0.85rem/1.2 var(--font-display); cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--ink); }
.chip[aria-pressed="false"] { color: var(--muted); background: transparent; }
.chip[aria-pressed="false"] .mark { background: transparent; box-shadow: inset 0 0 0 1.5px var(--mark); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }

.search { flex: 1 1 14rem; max-width: 22rem; }
.search input {
  width: 100%; min-height: 2.25rem; padding: 0.3rem 0.9rem;
  border: 1.5px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 0.9rem var(--font-display);
}
.search input:focus { border-color: var(--ink); }

.count { margin: 0 0 0 auto; font: 0.85rem var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- timeline ---------- */

main { padding: 0 var(--gutter) 3rem; outline: none; }

.era { padding-top: clamp(2.5rem, 7vh, 4.5rem); }

.era-head {
  display: grid; grid-template-columns: var(--year-col) minmax(0, 1fr);
  column-gap: calc(var(--mark-col) + 2rem);
  align-items: baseline; margin-bottom: 1.2rem;
}
.era-head h2 {
  grid-column: 2; margin: 0;
  font-family: var(--font-condensed); font-stretch: 75%; font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1;
}
.era-meta { grid-column: 2; margin: 0.35rem 0 0; font: 0.9rem var(--font-display); color: var(--muted); }

.rows { position: relative; margin: 0; padding: 0; list-style: none; }
.rows::before {
  content: ""; position: absolute; top: 0.5rem; bottom: 0;
  left: calc(var(--year-col) + 1rem + var(--mark-col) / 2 - 1px);
  width: 2px; background: var(--rule);
}

.row {
  display: grid;
  grid-template-columns: var(--year-col) var(--mark-col) minmax(0, var(--measure));
  column-gap: 1rem;
  padding: 0.9rem 0;
}
.row[hidden] { display: none; }

.row-year {
  margin: 0; text-align: right;
  font-family: var(--font-condensed); font-stretch: 75%; font-weight: 600;
  font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.row-year.span { font-size: 1.15rem; padding-top: 0.25rem; }
.row-year.repeat { color: var(--muted); opacity: 0.55; }

.row-mark { display: flex; justify-content: center; padding-top: 0.55rem; }
.row-mark .mark { width: 1rem; height: 1rem; box-shadow: 0 0 0 5px var(--bg); position: relative; }

.row-link { display: block; text-decoration: none; padding: 0.1rem 0 0.2rem; }
.row-link h3 {
  margin: 0; font: 600 1.25rem/1.25 var(--font-display);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em;
}
.row-link:hover h3 { text-decoration-color: currentColor; }
.row-link p { margin: 0.3rem 0 0; color: var(--muted); }
.row.current .row-link h3 { text-decoration-color: currentColor; }

.empty { padding: 3rem 0; text-align: center; font-family: var(--font-display); }

.topics { padding-top: clamp(3rem, 8vh, 5rem); }
.topics .row-mark .mark { border-radius: 2px; transform: rotate(45deg) scale(0.85); }
.topics[hidden] { display: none; }

.site-foot {
  padding: 2rem var(--gutter) 3rem;
  border-top: 1.5px solid var(--ink);
  font: 0.85rem/1.6 var(--font-display); color: var(--muted);
}
.site-foot p { margin: 0 0 0.4rem; }
.site-foot p:last-child { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; }

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

.scrim { position: fixed; inset: 0; z-index: 65; background: var(--scrim); }

.panel {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0;
  width: min(48rem, 100%);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1.5px solid var(--ink);
}
.panel[hidden], .scrim[hidden], .tour[hidden], .panel.peek [data-panel-prev], .panel.peek [data-panel-next], .popover[hidden], .tip[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]) { animation: slide-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); }
  @keyframes slide-in { from { transform: translateX(2.5rem); opacity: 0; } }
}

.panel-bar {
  display: flex; gap: 0.25rem; padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.panel-close { margin-left: auto; }

.entry { overflow-y: auto; padding: 1.5rem clamp(1.1rem, 4vw, 3rem) 4rem; overscroll-behavior: contain; }

.entry-year {
  margin: 0; font-family: var(--font-condensed); font-stretch: 75%; font-weight: 700;
  font-size: clamp(3rem, 7vw, 5rem); line-height: 0.95; font-variant-numeric: tabular-nums;
}
.entry h2 { margin: 0.4rem 0 0; font: 600 clamp(1.5rem, 2.6vw, 2rem)/1.2 var(--font-display); }
.entry-date { margin: 0.6rem 0 0; font: 0.9rem var(--font-display); color: var(--muted); }
.entry-summary { margin: 1.2rem 0 0; font-size: 1.15rem; line-height: 1.55; }

.entry section, .slide section { margin-top: 2rem; }
.entry h3, .slide h3 {
  margin: 0 0 0.4rem; font: 700 1.05rem/1.3 var(--font-display);
}
.entry section p, .entry section li { max-width: 40rem; }
.prose p { margin: 0 0 0.8rem; }
.prose ul, .prose ol { margin: 0 0 0.8rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.35rem; }
.prose table { border-collapse: collapse; font: 0.85rem/1.4 var(--font-display); margin: 0.5rem 0 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.prose code { font-family: var(--font-display); background: var(--callout); padding: 0 0.25rem; }
.prose blockquote { margin: 0 0 0.8rem; padding-left: 1rem; border-left: 3px solid var(--rule); }

a.ref {
  display: inline-block; margin: 0 0.1rem; padding: 0 0.3rem;
  border: 1px solid var(--rule); border-radius: 0.3rem;
  font: 600 0.72em/1.5 var(--font-display); vertical-align: 0.15em;
  text-decoration: none; color: var(--muted);
}
a.ref:hover, a.ref[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
a.xref { text-decoration-style: dotted; }

.corrections { background: var(--callout); padding: 1.1rem 1.3rem 0.4rem; border-left: 4px solid var(--muted); }

.source-list { margin: 0; padding: 0; list-style: none; }
.source-list li {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0 0.6rem;
  padding: 0.75rem 0; border-top: 1px solid var(--rule);
  font-size: 0.92rem; line-height: 1.5;
}
.source-list li.flash { background: var(--callout); }
.sid { font: 700 0.9rem/1.6 var(--font-display); }
.src-type { display: block; font: 0.78rem var(--font-display); color: var(--muted); }
.src-links { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; margin-top: 0.3rem; font: 0.85rem var(--font-display); }
.src-note { color: var(--muted); font-style: italic; }

/* ---------- source popover ---------- */

.popover {
  position: absolute; z-index: 80; width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 0.88rem; line-height: 1.45;
}
.popover p { margin: 0 0 0.4rem; }

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

.tour {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg);
  font-size: calc(1rem * var(--tour-scale));
}

.tour-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.tour-progress { flex: 1; display: flex; align-items: center; gap: 2px; height: 1.6rem; }
.tour-progress span {
  flex: 1; height: 6px; background: var(--rule); cursor: pointer;
}
.tour-progress span.seen { background: var(--muted); }
.tour-progress span.now { height: 18px; background: var(--ink); }
.tour-tools { display: flex; gap: 0.2rem; flex: none; }

.slide {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1.2em; min-height: 0;
  padding: 1.2em var(--gutter) 0.8em;
}

.slide-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1em 1.4em; align-items: end; }
.slide-year {
  grid-row: span 2; margin: 0;
  font-family: var(--font-condensed); font-stretch: 75%; font-weight: 700;
  font-size: clamp(4em, 11vw, 10em); line-height: 0.82; font-variant-numeric: tabular-nums;
}
.slide-year.span { font-size: clamp(3em, 6vw, 5.5em); }
.slide h2 { margin: 0; font: 600 clamp(1.4em, 2.6vw, 2.4em)/1.15 var(--font-display); }
.slide-summary { margin: 0.3em 0 0; font-size: 1.15em; line-height: 1.45; max-width: 60em; }

.slide-cols {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0 2.2em; min-height: 0;
  border-top: 1.5px solid var(--ink);
}
.slide-col { overflow-y: auto; padding: 1em 0.4em 1em 0; min-height: 0; overscroll-behavior: contain; }
.slide-col section { margin-top: 0; margin-bottom: 1.2em; }
.slide h3 { font-size: 1em; }
.slide .prose { font-size: 0.95em; }
.slide-col.so-what { border-left: 1.5px solid var(--rule); padding-left: 1.4em; }
@media (min-width: 901px) {
  .slide-col.more { -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
}

.slide-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 1.4em;
  font: 0.85em var(--font-display); color: var(--muted);
}
.slide-foot .badges { margin: 0; font-size: 1em; }
.slide-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2em; }
.slide-foot .open-entry { margin-left: auto; color: var(--ink); }

.tour-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem var(--gutter) max(0.7rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}
.tour-pos { margin: 0; font: 0.9rem var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }

.slide-end { align-content: center; justify-items: start; }
.slide-end h2 { font-size: clamp(2em, 5vw, 4em); font-family: var(--font-condensed); font-stretch: 75%; font-weight: 700; }
.slide-end p { max-width: 36em; }

/* ---------- quiz ---------- */

.quiz { grid-template-rows: auto minmax(0, 1fr); }

.quiz-progress { flex: 1; display: flex; align-items: center; gap: 4px; height: 1.6rem; }
.quiz-progress span { flex: 1; height: 6px; background: var(--rule); }
.quiz-progress span.right { background: var(--right); }
.quiz-progress span.wrong { background: var(--wrong); }
.quiz-progress span.now { height: 18px; background: var(--ink); }

.quiz-body { overflow-y: auto; overscroll-behavior: contain; padding: 1.6em var(--gutter) 3em; }
.quiz-card { max-width: 50em; }

.quiz-meta { margin: 0; font: 0.9em var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.quiz-question { margin: 0.4em 0 1.1em; font: 600 clamp(1.4em, 2.8vw, 2.2em)/1.22 var(--font-display); }

.quiz-options { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6em; }
.option {
  display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; align-items: baseline; gap: 0 0.6em;
  width: 100%; min-height: 3.2em; padding: 0.75em 1em;
  border: 1.5px solid var(--rule); border-radius: 0.5em;
  background: var(--surface); color: var(--ink);
  font: 1.05em/1.4 var(--font-text); text-align: left; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--ink); }
.option:disabled { cursor: default; }
.option-letter { font: 700 1em var(--font-display); color: var(--muted); }
.option-tag { font: 600 0.78em var(--font-display); white-space: nowrap; }
.answered .option { opacity: 0.55; }
.answered .option.correct, .answered .option.wrong { opacity: 1; }
.option.correct { border-color: var(--right); box-shadow: inset 5px 0 0 var(--right); }
.option.correct .option-tag { color: var(--right); }
.option.wrong { border-color: var(--wrong); box-shadow: inset 5px 0 0 var(--wrong); }
.option.wrong .option-tag { color: var(--wrong); }

.feedback { margin-top: 1.6em; padding-top: 1.2em; border-top: 1.5px solid var(--ink); }
.feedback[hidden] { display: none; }
.feedback h3 { margin: 0 0 0.4em; font: 700 1.3em var(--font-display); }
.feedback h3.is-right { color: var(--right); }
.feedback h3.is-wrong { color: var(--wrong); }
.feedback p { margin: 0 0 0.7em; max-width: 42em; }
.feedback .actions, .quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem; margin-top: 1.2em; }
a.peek { font-family: var(--font-display); }

.quiz-score {
  margin: 0.1em 0 0; font-family: var(--font-condensed); font-stretch: 75%; font-weight: 700;
  font-size: clamp(5em, 14vw, 10em); line-height: 0.9; font-variant-numeric: tabular-nums;
}
.quiz-score small { font-size: 0.35em; font-weight: 600; color: var(--muted); }
.quiz-review { margin: 1.5em 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.quiz-review li {
  display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 0 0.8em;
  padding: 0.7em 0; border-bottom: 1px solid var(--rule);
}
.review-mark { font: 700 0.85em/1.6 var(--font-display); }
.review-mark.right { color: var(--right); }
.review-mark.wrong { color: var(--wrong); }
.quiz-review p { margin: 0; }
.quiz-review a { font: 0.85em var(--font-display); }

/* ---------- guided story ---------- */

.guide-bar {
  position: fixed; z-index: 75; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1.5px solid var(--ink);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.guide-bar[hidden] { display: none; }
.guide-progress { height: 4px; background: var(--rule); }
.guide-progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s linear; }
.guide-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem;
  padding: 0.7rem var(--gutter) 0.2rem;
}
.guide-info { flex: 1 1 24rem; min-width: 0; }
.guide-meta { margin: 0; font: 0.8rem var(--font-display); color: var(--muted); }
.guide-caption { margin: 0.15rem 0 0; font-size: 1.1rem; line-height: 1.4; min-height: 2.8em; }
.guide-controls { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.guide-note { margin: 0; padding: 0 var(--gutter) 0.55rem; font: 0.75rem var(--font-display); color: var(--muted); }

body.guiding { padding-bottom: var(--guide-h, 9rem); }
:root:has(body.guiding) { scroll-padding-bottom: var(--guide-h, 9rem); }
.panel.guide { width: min(44rem, 46vw); bottom: var(--guide-h, 9rem); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08); }
.panel.guide .panel-bar { display: none; }
.row.speaking .row-link h3 { text-decoration-color: currentColor; }
.row.speaking .row-mark .mark { box-shadow: 0 0 0 5px var(--bg), 0 0 0 7.5px var(--ink); }
.skyline .dot.now circle, .skyline .dot.now path { stroke: var(--ink); stroke-width: 3; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .slide { display: block; overflow-y: auto; }
  .slide > * + * { margin-top: 1.2em; }
  .slide-cols { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .slide-col { overflow: visible; padding-right: 0; }
  .slide-col.so-what { border-left: 0; padding-left: 0; }
  .slide-head { grid-template-columns: minmax(0, 1fr); }
  .slide-year { grid-row: auto; }
  .tour-tools [data-scale], .tour-tools [data-fullscreen] { display: none; }
  .option { grid-template-columns: 1.6em minmax(0, 1fr); }
  .option-tag { grid-column: 2; }
}

@media (max-width: 640px) {
  :root { --year-col: 3.4rem; --mark-col: 1.2rem; }
  .row { column-gap: 0.6rem; }
  .rows::before { left: calc(var(--year-col) + 0.6rem + var(--mark-col) / 2 - 1px); }
  .row-year { font-size: 1.25rem; }
  .row-year.span { font-size: 0.85rem; }
  .row-mark .mark { width: 0.8rem; height: 0.8rem; box-shadow: 0 0 0 4px var(--bg); }
  .row-link h3 { font-size: 1.1rem; }
  .era-head { column-gap: calc(var(--mark-col) + 1.2rem); }
  .era-head { grid-template-columns: minmax(0, 1fr); }
  .era-head h2, .era-meta { grid-column: 1; }
  .controls { position: static; backdrop-filter: none; }
  .count { margin-left: 0; width: 100%; }
  .search { max-width: none; }
  .panel-bar .btn { padding-inline: 0.5rem; }
  .panel.guide { width: 100%; }
  .guide-caption { font-size: 1rem; min-height: 0; }
  .guide-controls { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
