/* A quiet presentation canvas: the diagrams carry the story. */
:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --ink: #202621;
  --muted: #62695f;
  --olive: #626f51;
  --rust: #b24e32;
  --line: #d1d3c8;
  --faint: #e9e9df;
  --white: #fbfaf5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 5px; }
::selection { background: #dbe2cf; color: var(--ink); }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 10; left: 20px; top: 14px; padding: 15px 20px; background: var(--ink); color: var(--paper); }
.masthead, #main, .timeline, .controls, .sources { width: min(1440px, calc(100% - 104px)); margin-inline: auto; }
.masthead { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 650; letter-spacing: -.025em; text-decoration: none; }
.brand-icon { width: 27px; height: 27px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font: 21px/1 Georgia, serif; }
.brand-icon > span { color: var(--rust); }
.brand-sub { display: block; font: 8px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; color: var(--muted); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions button, .text-button { padding: 10px 13px; min-height: 44px; border: 1px solid transparent; background: transparent; font-size: 11px; }
.header-actions button:hover, .text-button:not(:disabled):hover { border-color: var(--line); }
#presentButton { border-color: var(--line); }

/* The same canvas dimensions keep every historical station steady. */
.slide, .visual-graphic { display: flex; flex-direction: column; align-items: center; gap: 10px; height: calc(100svh - 228px); min-height: 440px; padding: 20px 0 12px; }
.visual-heading { flex: 0 0 auto; text-align: center; max-width: 100%; }
.eyebrow { margin: 0 0 7px; color: var(--rust); font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .15em; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.04em; text-wrap: balance; }
.visual-heading h1, .visual-heading h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; }
h1 em, h2 em { color: var(--olive); font-weight: 400; }
.exhibit { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; width: min(820px, 100%); margin: 0; padding: 0; }
.demo { flex: 1 1 0; height: auto; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 0; }
.demo > svg, .chart-svg { display: block; flex: 1 1 0; min-height: 0; width: 100%; height: 100%; overflow: visible; }
.demo svg text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.demo svg .svg-small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.demo svg .svg-serif { font-family: Georgia, serif; }
.graphic-note { flex: 0 0 auto; margin: 6px 0 0; text-align: center; color: var(--muted); font: 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
mark { background: #dce2d2; color: var(--ink); padding: 2px 5px; }

/* Text here is part of the diagrams, rather than explanatory body copy. */
.proof { width: min(670px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; }
.proof-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.proof-label, .eliza .chat-line > span, .rule-line > span, .context > span, .mini-label, .generation-result > span { display: block; font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--muted); }
.proof-row strong { display: block; margin-top: 9px; font: 35px/1.3 Georgia, serif; letter-spacing: -.025em; }
.proof-arrow { grid-column: 1 / -1; text-align: center; padding: 6px 0; color: var(--rust); font-size: 32px; line-height: 1; }
.proof-result { grid-column: 1 / -1; text-align: center; border: 0; padding-block: 20px; }
.proof-result .proof-label { color: var(--rust); }
.proof-result strong { font-size: 42px; color: var(--olive); }
.eliza { width: min(670px, 100%); padding: 0 14px; }
.eliza .chat-line { padding: 6px 0; }
.eliza .chat-line p { font: 36px/1.3 Georgia, serif; letter-spacing: -.03em; margin: 8px 0 12px; }
.rule-line { padding: 13px 18px; margin: 10px 0 17px; border-left: 2px solid var(--rust); }
.rule-line code { display: block; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 7px; }
.eliza .reply > span { color: var(--rust); }
.attention { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 45px; align-items: center; padding: 15px 0; }
.context { padding: 12px 15px; }
.context + .context { border-left: 1px solid var(--line); padding-left: 35px; }
.context p { margin: 14px 0 18px; font: 37px/1.4 Georgia, serif; letter-spacing: -.035em; }
.context strong { font-weight: 400; border-bottom: 1px solid var(--olive); }
.context-link { display: flex; gap: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.context-link > span { color: var(--rust); }
.generation { width: min(570px, 100%); padding: 0 14px; }
.mini-label { text-align: center; margin: 0; }
.token-sentence { font: 39px/1.35 Georgia, serif; letter-spacing: -.03em; text-align: center; margin: 12px 0 20px; }
.token-slot { color: var(--rust); border-bottom: 1px solid var(--rust); padding: 0 10px; }
.token-bars { margin: 15px auto; width: min(100%, 420px); }
.bar-row { display: grid; grid-template-columns: 70px 1fr 48px; gap: 14px; align-items: center; margin: 12px 0; font-size: 15px; }
.bar-row b { display: block; height: 11px; background: var(--faint); font-weight: 400; }
.bar-row b i { height: 100%; display: block; background: var(--olive); }
.bar-row em { font: normal 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.generation-result { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; text-align: center; }
.generation-result p { font: 30px/1.35 Georgia, serif; letter-spacing: -.025em; margin: 8px 0; }
.generation-result .muted { color: var(--muted); }
.loop-caption { font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); text-align: center; margin: 13px 0 0; }

/* The navigation stays secondary to the visual. */
.timeline { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); padding-top: 8px; border-top: 1px solid var(--ink); }
.timeline-item { position: relative; min-width: 0; min-height: 48px; padding: 10px 5px 10px 0; text-align: left; border: 0; background: transparent; }
.timeline-item .tick { position: absolute; top: -12px; left: 0; width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; background: var(--paper); }
.timeline-item .year { display: block; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.timeline-item .timeline-name { display: none; }
.timeline-item[aria-current="step"] .year { color: var(--rust); }
.timeline-item[aria-current="step"] .tick { border-color: var(--rust); background: var(--rust); width: 9px; height: 9px; top: -13px; }
.timeline-item:hover .year { color: var(--rust); }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; border-top: 1px solid var(--line); }
.progress-label { color: var(--muted); font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .025em; }
.kbd-hint { margin-left: 15px; font-size: 9px; }
.nav-buttons { display: flex; align-items: center; gap: 12px; }
.next-button { min-width: 125px; min-height: 44px; padding: 11px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 30px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 12px; }
.next-button:not(:disabled):hover { background: var(--olive); border-color: var(--olive); }
.sources { padding: 8px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.sources summary { width: fit-content; cursor: pointer; min-height: 26px; }
.sources .links { padding-left: 20px; max-width: 850px; }
.source-intro { max-width: 850px; }
.sources .links li { padding: 6px 0; }
.sources a:hover { color: var(--ink); }
.source-link { white-space: nowrap; }

/* The spoken explanation remains available separately. */
dialog { width: min(650px, calc(100% - 36px)); max-height: calc(100svh - 48px); overflow: auto; border: 1px solid var(--ink); padding: 28px 32px 32px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgb(24 30 25 / 48%); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 26px; padding-bottom: 16px; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
#closeNotes { flex-shrink: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); background: transparent; font: 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#closeNotes:hover { border-color: var(--ink); }
.dialog-header .eyebrow { margin: 0; }
.note-hint { font-size: 11px; line-height: 1.65; color: var(--muted); }
#notesTitle { font-size: 36px; }
#notesText { font-size: 16px; line-height: 1.8; white-space: pre-line; }
.download-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; font-size: 13px; }
.presenting .slide { height: calc(100svh - 182px); }
.presenting .sources { display: none; }

@media (min-width: 1550px) {
  .exhibit { width: min(960px, 100%); }
  .visual-heading h1, .visual-heading h2 { font-size: 44px; }
}
@media (max-width: 1100px) {
  .masthead, #main, .timeline, .controls, .sources { width: calc(100% - 64px); }
  .kbd-hint { display: none; }
}
@media (max-width: 700px) {
  .masthead, #main, .timeline, .controls, .sources { width: calc(100% - 36px); }
  .masthead { gap: 10px; }
  .brand { font-size: 12px; gap: 8px; }
  .brand-icon { width: 24px; height: 24px; }
  .brand-sub { display: none; }
  .header-actions { gap: 3px; }
  .header-actions button { font-size: 10px; padding-inline: 9px; }
  .slide, .visual-graphic { height: calc(100svh - 228px); min-height: 390px; padding-top: 23px; }
  .visual-heading h1, .visual-heading h2 { font-size: 29px; }
  .demo { padding: 5px 0; }
  .graphic-note { font-size: 8px; }
  .timeline { display: flex; overflow-x: auto; scrollbar-width: thin; gap: 0; }
  .timeline-item { min-width: 58px; flex: 1 0 58px; }
  .timeline-item .tick { top: -7px; }
  .timeline-item[aria-current="step"] .tick { top: -8px; }
  .timeline-item .year { font-size: 11px; }
  .proof { gap: 8px 20px; padding-inline: 10px; }
  .proof-row strong { font-size: 25px; }
  .proof-label { font-size: 8px; }
  .proof-result strong { font-size: 34px; }
  .eliza { padding-inline: 7px; }
  .eliza .chat-line p { font-size: 29px; }
  .rule-line { padding-inline: 12px; }
  .rule-line code { font-size: 11px; }
  .attention { grid-template-columns: 1fr; gap: 15px; padding: 0 10px; }
  .context { padding: 10px 0; }
  .context + .context { padding: 16px 0 5px; border-left: 0; border-top: 1px solid var(--line); }
  .context p { font-size: 28px; margin: 7px 0 8px; }
  .context-link { font-size: 12px; }
  .generation { padding: 0 5px; }
  .token-sentence { font-size: 29px; margin-block: 10px 15px; }
  .bar-row { grid-template-columns: 60px 1fr 40px; font-size: 13px; }
  .generation-result p { font-size: 26px; }
  .loop-caption { font-size: 9px; }
  .controls { gap: 8px; }
  .progress-label { font-size: 9px; }
  .nav-buttons { gap: 2px; }
  .text-button { font-size: 11px; padding-inline: 10px; }
  .next-button { min-width: 100px; padding-inline: 13px; font-size: 12px; gap: 15px; }
  dialog { padding: 20px 23px 25px; }
  #notesTitle { font-size: 31px; }
  #notesText { font-size: 15px; }
}
@media (max-width: 380px) {
  .brand { font-size: 11px; }
  .header-actions button > span { display: none; }
  .header-actions button { padding-inline: 7px; }
}
@media (max-height: 680px) and (min-width: 701px) {
  .slide, .visual-graphic { min-height: 370px; padding-top: 13px; gap: 6px; }
  .visual-heading h1, .visual-heading h2 { font-size: 31px; }
  .generation { transform: scale(.86); transform-origin: center; }
  .eliza { transform: scale(.9); transform-origin: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; }
  .masthead, #main { width: 100%; }
  .header-actions, .timeline, .controls, dialog { display: none; }
  .slide { height: 700px; min-height: 0; }
  .sources { width: 100%; }
}
