/* The slide title, source and output share one left margin across the deck. */
:root {
  color-scheme: dark;
  --paper: #14171c;
  --ink: #f3f4f7;
  --muted: #b2bbc6;
  --line: #48505b;
  --surface: #20252c;
  --focus: #ea5520;
  --mono: Menlo, Consolas, "Liberation Mono", monospace;
  --heading: clamp(30px, 3.8vw, 72px);
  --body: clamp(21px, 2.15vw, 39px);
  --source: clamp(19px, 2.10vw, 38px);
  --space: clamp(18px, 3svh, 38px);
  font-family: "Helvetica Neue", Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body, h1, h2, p, pre, figure { margin:0; }
main {
  min-height:100svh;
  max-width:1800px;
  margin:auto;
  padding:clamp(32px,min(5vw,9svh),96px) 5vw clamp(12px,2svh,24px);
  display:flex;
  flex-direction:column;
}
code, pre, samp, kbd, textarea { font-family:var(--mono); }
code { font-size:.96em; }
.projection {
  flex:1; min-width:0;
  display:grid; grid-template-columns:minmax(0,1fr) clamp(235px,23vw,400px);
  align-items:start; gap:4vw;
}
.screen { min-width:0; align-self:start; }
.slide { display:flex; flex-direction:column; align-items:flex-start; gap:var(--space); min-width:0; }
h1 { font-size:var(--heading); line-height:1.24; letter-spacing:-.03em; font-weight:700; overflow-wrap:anywhere; text-wrap:balance; }
.slide h1 { margin-bottom:clamp(4px,1.6svh,20px); }
.remark, .assembly p { max-width:32em; font-size:var(--body); color:#dae0e7; line-height:1.55; line-break:strict; overflow-wrap:anywhere; }
.slide p.remark:not(figure *, table *) {
  line-break:strict;
  word-break:normal;
  overflow-wrap:normal;
  text-wrap:wrap;
}
.title-slide { container-type:inline-size; }
.title-slide h1 {
  margin:0;
  font-size:min(11.3cqi,16svh);
  line-height:1.07;
  letter-spacing:-.04em;
  white-space:nowrap;
}
.title-slide h1 span { color:var(--focus); }
.title-slide > p { font-size:clamp(23px,4.9cqi,72px); line-height:1.35; }
.title-slide .author {
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:.2em .8em;
  margin-block-start:.35em;
  font-size:clamp(20px,4cqi,56px);
  font-weight:600;
}
.title-slide .author span { color:var(--muted); font-size:.86em; font-weight:500; white-space:nowrap; }
.title-links { font-size:clamp(16px,min(3.6cqi,3.4svh),46px); line-height:1.35; }
.slide[data-scene="origin"] h1, .slide[data-scene="why"] h1 { font-size:clamp(36px,5.1vw,90px); }
.slide:has(.computer-diagram) { align-items:stretch; gap:clamp(10px,1.5svh,20px); }
.slide:has(.computer-diagram) .remark { max-width:none; font-size:clamp(20px,1.75vw,32px); }

/* Keep consecutive listings in the same place; the selected Perl line changes. */
.slide pre {
  max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; tab-size:4;
  font:400 var(--source)/1.42 var(--mono);
}
pre code { font:inherit; }
.source-line { display:block; }
.source-line.focus, .slide mark { font-weight:700; color:var(--focus); background:none; }
pre[data-source]:has(.focus) .source-line:not(.focus) { color:var(--muted); }
.slide pre[data-source], .module-excerpt pre, #running-source { width:100%; }
#running-source { font-size:clamp(17px,1.8vw,32px); }
.slide:has(pre[data-source]) h1 { font-size:clamp(26px,2.9vw,52px); }
.slide[data-scene="hello"] pre, .slide[data-scene="optree"] pre { font-size:clamp(24px,3.7vw,68px); }
.slide:has(pre[data-source="greet"]) pre[data-source] { font-size:clamp(22px,2.45vw,43px); }
.demo-editor {
  display:grid; width:100%; gap:.3em; color:var(--muted);
  font-size:clamp(14px,1.15vw,20px); font-weight:500;
}
.demo-editor textarea {
  display:block; width:100%; min-width:0; height:auto; max-height:46svh; margin:0;
  padding:.15em .3em; border:1px solid var(--line); border-radius:4px; background:var(--paper);
  color:var(--ink); caret-color:var(--focus); font:400 var(--source)/1.42 var(--mono);
  field-sizing:content; resize:none; tab-size:4;
}
.demo-editor textarea:hover { border-color:var(--muted); }
.demo-editor textarea:focus { outline:2px solid var(--focus); outline-offset:1px; }
.slide[data-scene="hello"] .demo-editor textarea { font-size:clamp(24px,3.7vw,68px); }
.slide[data-scene="greet"] .demo-editor textarea { font-size:clamp(22px,2.45vw,43px); }
.demo-result { display:flex; align-items:baseline; gap:1em; flex-wrap:wrap; width:100%; }
.guest-output {
  display:block; min-width:0; max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere;
  color:var(--focus); font:650 clamp(28px,3.4vw,60px)/1.2 var(--mono);
}
.slide[data-scene="hello"] .guest-output { font-size:clamp(32px,5.7vw,104px); }
.guest-output:empty { display:none; }
.guest-output.pending { color:var(--muted); }
.demo-run { font-size:clamp(14px,1.05vw,19px); }
.sample:has(> .demo-run) { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:.6em; }
.module-excerpt { width:100%; }
.module-excerpt figcaption { margin-bottom:.55em; font:500 clamp(16px,1.45vw,25px) var(--mono); color:var(--muted); }
.build-path { display:flex; flex-wrap:wrap; align-items:baseline; gap:.45em; font-size:clamp(20px,2.5vw,44px); }
.build-path strong { font-weight:700; color:var(--focus); }
.computer-diagram { width:min(100%,120svh); }
.computer-diagram svg { display:block; width:100%; height:auto; }
#op-tree, #op-order { font:600 clamp(23px,2.35vw,42px)/1.45 var(--mono); }
#op-tree code { display: block; white-space: pre-wrap; }
.assembly {
  width:100%; display:grid;
  grid-template-columns:max-content minmax(0,.85fr) minmax(0,1.25fr);
  align-items:baseline; row-gap:.5em; column-gap:.6em;
}
.assembly { border-top:1px solid var(--line); padding-top:clamp(12px,1.7svh,26px); }
.assembly strong { color:var(--focus); font:700 clamp(20px,1.9vw,34px) var(--mono); }
.op-follow { font:500 clamp(17px,1.45vw,26px) var(--mono); color:var(--muted); }
.assembly pre { grid-row:2; grid-column:1/3; font-size:clamp(17px,1.65vw,30px); }
.assembly p { grid-column:3; grid-row:1/3; padding-left:.65em; font-size:clamp(19px,1.8vw,32px); }
#deck-output { font-weight:bold; }

.machine { min-width:0; align-self:center; border-left:1px solid var(--line); padding-left:clamp(12px,1.6vw,26px); }
.machine section + section { margin-top:1.2em; padding-top:1.2em; border-top:1px solid var(--line); }
.machine h2 { font-size:clamp(16px,1.35vw,25px); font-weight:600; }
.machine code { font:650 clamp(22px,2.1vw,38px) var(--mono); }
#monitor-program { display:block; margin:.15em 0 .4em; font:500 .84em var(--mono); }
#cpu-registers { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:10px 0; font-family:var(--mono); }
#cpu-registers dt { font-size:clamp(11px,.85vw,17px); color:var(--muted); }
#cpu-registers dd { margin:0; font-size:clamp(16px,1.35vw,25px); font-variant-numeric:tabular-nums; }

button, a { font:inherit; color:inherit; }
button { padding:.32em .65em; border:1px solid var(--line); border-radius:2px; background:var(--paper); cursor:pointer; }
button:hover { background:var(--surface); }
button:disabled { opacity:.38; cursor:default; }
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
footer, footer nav, .controls { display:flex; align-items:center; gap:.65em; }
footer { min-height:38px; margin-top:auto; padding-top:1.4svh; justify-content:space-between; color:var(--muted); }
footer nav button, .tools summary { padding:.2em .35em; border:0; background:transparent; font-size:20px; }
.next-control { position:relative; display:inline-flex; }
#page-turn-hint {
  position:absolute; bottom:calc(100% + 7px); right:0; width:max-content;
  padding:7px 12px; border-radius:6px; background:var(--ink); color:var(--paper);
  font-size:14px; font-weight:600; line-height:1.4; pointer-events:none;
}
#page-turn-hint::after {
  content:""; position:absolute; right:12px; top:100%;
  border:5px solid transparent; border-top-color:var(--ink);
}
.presenting #page-turn-hint { display:none; }
#page-number { font:400 clamp(12px,.95vw,17px) var(--mono); }
#page-number { color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:3px; padding:.3em; cursor:pointer; }
#page-number:disabled { opacity:.6; cursor:default; }
footer:has(.talk-clock) { position:sticky; bottom:0; z-index:1; background:var(--paper); }
.clock-pair { display:inline-flex; gap:.65em; align-items:center; flex-wrap:wrap; }
footer .clock-pair { margin-right:auto; }
.page-budget { font:600 clamp(14px,1.4vw,24px)/1.2 var(--mono); font-variant-numeric:tabular-nums; white-space:nowrap; }
.page-budget.overdue { color:#ff7575; }
.talk-clock { padding:.25em .5em; font:600 clamp(15px,1.4vw,24px)/1.2 var(--mono); white-space:nowrap; }
.clock-example { font-size:clamp(18px,1.75vw,30px); }
#inline-talk-time { color:var(--focus); white-space:nowrap; }
main:has(#inline-talk-time) .talk-clock { outline:2px solid var(--focus); border-radius:4px; color:var(--ink); }
.slide[data-scene="source"]:has(.clock-example) { gap:clamp(10px,1.8svh,20px); }
.slide.projection-io { --heading:clamp(27px,3.05vw,53px); --body:clamp(19px,1.85vw,32px); gap:clamp(10px,1.9svh,22px); }
.projection-io .remark { max-width:none; line-height:1.45; }
.projection-io pre { font-size:clamp(16px,1.85vw,32px); }
.clock-listing figcaption { margin-bottom:.2em; color:var(--muted); font-size:clamp(15px,1.4vw,24px); }
.dialog-clock { display:flex; width:max-content; margin-left:auto; background:var(--paper); color:var(--ink); }
#live-demo .dialog-clock { position:fixed; top:.5em; left:50%; transform:translateX(-50%); }
#clock-arrow { position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:2; }
#clock-arrow-line, #clock-arrow-tip path { fill:none; stroke:var(--focus); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#monitor-size { display:flex; width:max-content; align-items:center; gap:2px; margin:0 0 4px; color:var(--muted); font-size:clamp(10px,.78vw,13px); line-height:1.3; }
#monitor-size button { min-height:18px; padding:1px .25em 2px; border:0; border-radius:0; background:transparent; }
#monitor-size button:hover { background:var(--surface); }
#monitor-size button[aria-pressed="true"] { color:var(--ink); box-shadow:inset 0 -1px var(--focus); }
.tools { position:relative; }
.tools summary { list-style:none; cursor:pointer; }
.tools summary::-webkit-details-marker { display:none; }
.tools .controls { position:absolute; bottom:100%; left:0; z-index:1; width:max-content; max-width:85vw; }
.controls { gap:.7em; flex-wrap:wrap; }
.tools .controls, dialog, textarea { padding:14px; border:1px solid var(--line); color:var(--ink); background:var(--surface); }
dialog { width:min(720px,94vw); padding:24px; color:var(--ink); }
dialog::backdrop { background:#15181aa6; }
dialog p { margin:10px 0; }
textarea { width:100%; height:32vh; font-size:20px; line-height:1.4; margin:6px 0 14px; }
#live-demo { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:0; border:0; }
#problem { white-space:pre-wrap; overflow-wrap:anywhere; padding:.75em 0; color:#ffad9c; }
@media(max-width:820px) {
  .projection { grid-template-columns:minmax(0,1fr); gap:18px; }
  .machine { border:0; }
  .assembly { display:block; }
  .assembly pre, .assembly p { margin-top:.5em; padding:0; }
  .assembly .op-follow { margin-left:.3em; }
}
@media(max-width:540px) {
  main { padding:24px 5vw 12px; }
  .slide pre { font-size:clamp(16px,3.8vw,20px); }
}

.live-deck { --monitor-scale:.6; grid-template-columns:minmax(0,1fr) calc(clamp(300px,28vw,460px) * var(--monitor-scale)); gap:clamp(16px,2.4vw,42px); }
.live-deck[data-monitor-size="small"] { --monitor-scale:.3; }
.live-deck[data-monitor-size="large"] { --monitor-scale:1.15; }
@media(min-width:821px) {
  .live-deck[data-monitor-size="large"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .live-deck[data-monitor-size="large"] .screen { zoom:.7; }
  .live-deck[data-monitor-size="large"] #monitor-tree { max-height:19svh; }
}
.monitor-pane { min-width:0; align-self:start; border-left:1px solid var(--line); padding-left:calc(clamp(14px,1.6vw,28px) * var(--monitor-scale)); }
.live-deck .machine { zoom:var(--monitor-scale); border:0; padding:0; }
.live-deck .machine section { min-width:0; }
.live-deck .machine section + section { margin-top:1.1em; padding-top:1.1em; }
.live-deck .machine h2 { display:flex; flex-wrap:wrap; gap:.45em; align-items:baseline; color:var(--ink); font-size:clamp(22px,1.8vw,29px); font-weight:720; }
.live-deck .vm h2 span { font-size:.72em; font-weight:580; }
.tree-caption, #cpu-program { color:var(--muted); font-size:clamp(14px,1.2vw,20px); }
.tree-caption { display:flex; justify-content:space-between; align-items:baseline; gap:6px; margin:.35em 0 .55em; }
.tree-caption #monitor-program, #cpu-program { margin:0; font:500 1em var(--mono); overflow-wrap:anywhere; }
.live-deck #cpu-program { font-size:clamp(14px,1.16vw,20px); }
#monitor-tree { position:relative; overflow:auto; overscroll-behavior:contain; max-height:clamp(7rem,29svh,18rem); border-block:1px solid var(--line); background:var(--paper); }
#monitor-tree:empty { border:0; }
.tree-op { --indent:clamp(9px,.85vw,16px); position:relative; display:flex; align-items:baseline; flex-wrap:wrap; column-gap:.55em; width:100%; min-height:1.8em; margin:0; padding:.24em .35em .24em calc(.48em + min(var(--depth),8) * var(--indent)); border:0; border-radius:0; background:transparent; text-align:left; font:600 clamp(20px,1.7vw,29px)/1.25 var(--mono); }
.tree-op strong { font-weight:650; }
.tree-op.branch::before { content:""; position:absolute; top:0; height:.89em; left:calc(.32em + (min(var(--depth),8) - 1) * var(--indent)); width:.46em; border:solid #667280; border-width:0 0 1px 1px; }
.tree-op .operand { min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.83em; color:var(--muted); font-weight:500; }
.tree-op.tracked { box-shadow:inset 3px 0 var(--focus); color:var(--focus); background:#33231e; }
.tree-op:hover, .tree-op:focus-visible, .tree-op[aria-expanded="true"] { background:var(--surface); }
.tree-op:focus-visible { outline:2px solid var(--focus); outline-offset:-2px; }
#monitor-detail { margin-top:.5em; font-size:clamp(15px,1.1vw,20px); line-height:1.5; }
.live-deck #cpu-registers, #cpu-shadow {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.35em .5em;
  margin:.45em 0 0; font-family:var(--mono);
}
#cpu-shadow { border-top:1px solid var(--line); padding-top:.35em; }
.live-deck #cpu-registers dt, #cpu-shadow dt { color:var(--muted); font-size:clamp(15px,1.1vw,19px); }
.live-deck #cpu-registers dd, #cpu-shadow dd { margin:0; font-size:clamp(20px,1.55vw,26px); font-variant-numeric:tabular-nums; }
.cpu-flags { display:flex; gap:.6em; align-items:center; margin:.5em 0; font:600 clamp(15px,1.1vw,19px) var(--mono); }
#cpu-flags { display:grid; flex:1; grid-template-columns:repeat(8,1fr); text-align:center; }
#cpu-flags span { padding:.16em 0; color:var(--muted); }
#cpu-flags .on { background:#263a32; color:#c4efd3; box-shadow:inset 0 -2px #7dc89d; }
.cpu-bus { padding:.55em .75em; background:var(--surface); color:var(--ink); }
.bus-caption { display:flex; align-items:baseline; justify-content:space-between; gap:.5em; font-size:clamp(16px,1.16vw,20px); }
.bus-caption span { font:600 clamp(19px,1.4vw,24px) var(--mono); }
.bus-bits { display:flex; gap:.55em; margin-top:.12em; font:600 clamp(18px,1.52vw,25px)/1.25 var(--mono); }
.bus-bits span { display:flex; gap:.08em; }
.bus-bits i { font-style:normal; color:#b3c4b9; }
.bus-bits .on { color:#e1ffa9; }
.bus-bits + .bus-caption { margin-top:.4em; }
#cpu-pins { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.25em; margin-top:.5em; font:600 clamp(15px,1.1vw,19px) var(--mono); }
#cpu-pins span { display:flex; align-items:center; gap:.35em; white-space:nowrap; }
#cpu-pins span::before { content:""; width:.6em; height:.6em; border:1px solid #789181; border-radius:50%; }
#cpu-pins .on::before { background:#9edead; border-color:#9edead; }
#cpu-history { margin-top:.65em; font:500 clamp(15px,1.05vw,19px) var(--mono); color:var(--muted); }
#cpu-history summary { cursor:pointer; }
#cpu-count { font-variant-numeric:tabular-nums; }
#cpu-history input { width:100%; accent-color:var(--focus); }
.live-deck .cpu dd.changed { color:var(--focus); }
@media(min-width:821px) {
  .live-deck[data-monitor-size="large"] .machine {
    max-height:calc((82svh - 26px) / var(--monitor-scale));
    overflow-y:auto;
  }
}
@media(min-width:1000px) {
  .live-deck[data-monitor-size="large"] .cpu {
    display:grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.06fr);
    gap:.45em .85em;
    align-items:start;
  }
  .live-deck[data-monitor-size="large"] .cpu h2,
  .live-deck[data-monitor-size="large"] #cpu-history { grid-column:1/-1; }
  .live-deck[data-monitor-size="large"] #cpu-registers { grid-area:2/1; }
  .live-deck[data-monitor-size="large"] #cpu-shadow { grid-area:3/1; }
  .live-deck[data-monitor-size="large"] .cpu-flags { grid-area:4/1; }
  .live-deck[data-monitor-size="large"] .cpu-bus { grid-area:2/2/4/3; }
  .live-deck[data-monitor-size="large"] .bus-bits { justify-content:space-between; gap:.15em; font-size:clamp(15px,1.4vw,23px); }
  .live-deck[data-monitor-size="large"] #cpu-pins { grid-area:4/2; grid-template-columns:repeat(4,1fr); font-size:clamp(12px,1vw,17px); }
  .live-deck[data-monitor-size="large"] #cpu-registers,
  .live-deck[data-monitor-size="large"] #cpu-shadow { gap:.3em; }
  .live-deck[data-monitor-size="large"] .cpu dd { font-size:clamp(15px,1.45vw,25px); }
}
@media(max-width:820px) {
  .live-deck { grid-template-columns:minmax(0,1fr); align-content:start; gap:clamp(16px,4svh,40px); }
  .monitor-pane { width:calc(90vw * var(--monitor-scale)); max-width:100%; justify-self:end; padding:8px 0 0; border:0; border-top:1px solid var(--line); }
  .live-deck .machine { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:clamp(14px,3vw,28px); align-items:start; }
  .live-deck .machine section + section { margin:0; padding:0; border:0; }
  #monitor-tree { max-height:clamp(7rem,22svh,12rem); }
  .live-deck[data-monitor-size="large"] { --monitor-scale:1; }
  .live-deck[data-monitor-size="large"] .machine { max-height:48svh; overflow-y:auto; }
}
@media(max-width:480px) {
  .monitor-pane { width:100%; }
  .live-deck[data-monitor-size="small"] .monitor-pane { width:50%; }
  .live-deck[data-monitor-size="large"] .machine { grid-template-columns:minmax(0,1fr); }
}

/* VM and compiler slides, with the same type scale as the approved projection. */
.slide.cpu-example { --body: clamp(17px,1.875vw,34px); gap: 7px; }
.slide.cpu-example .remark { max-width: none; line-height:1.38; }
.slide.cpu-example pre { font-size: clamp(18px,1.953vw,35px); }
.slide.cpu-example h1 { font-size: clamp(26px,2.891vw,52px); margin-bottom: 4px; }
.cpu-example .register-route { width:min(100%,100svh); }
.register-route svg { width: 100%; display: block; }
.emulator-patch { width: 100%; }
.emulator-patch figcaption { color: var(--muted); font-size: clamp(14px,1.484vw,27px); line-height: 1.25; }
.emulator-patch table { border-collapse: collapse; font-size: clamp(15px,1.641vw,30px); line-height: 1.25; }
.emulator-patch th, .emulator-patch td { text-align: left; padding: 1px 14px 1px 0; }
.emulator-patch th { font-weight: 500; color: var(--muted); }
.register-route svg { fill: var(--ink); font-family: inherit; }
.register-route .reg-command { font: 600 27px var(--mono); }
.register-route .reg-label { font-size: 23px; font-weight: 600; }
.register-route .reg-small { fill: var(--muted); font-size: 19px; }
.register-route .reg-byte { font: 600 26px var(--mono); }
.register-route .reg-change { font: 600 26px var(--mono); }
.register-route .reg-divider { fill: none; stroke: var(--line); stroke-width: 1; }
.register-route .reg-slot, .register-route .reg-rule { fill: var(--surface); stroke: var(--muted); stroke-width: 1.4; }
.register-route .reg-focus, .register-route .reg-wire { fill: none; stroke: var(--focus); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.slide.hello-source { --heading: clamp(29px,3.203vw,58px); --body: clamp(17px,1.875vw,34px); gap: 10px; }
.slide.hello-source h1 { margin-bottom: 4px; }
.slide.hello-source .remark { max-width: none; line-height: 1.42; }
.slide[data-scene="hello-asm"] { gap: 7px; }
.hello-source .hello-key { color: var(--focus); font-weight: 700; text-decoration: underline; text-underline-offset: .15em; }
.slide.greeting-flow .greeting-intent { padding: 0; margin: 0; font-size: clamp(19px,2.109vw,38px); }
.hello-source.hello-record { --heading: clamp(26px,2.891vw,52px); gap: 8px; }
.hello-record .hello-labels { padding: 0; margin: 0; font: clamp(18px,1.953vw,35px)/1.15 var(--mono); }
.hello-links { width: 100%; }
.hello-step { display: grid; grid-template-columns: clamp(140px,15.625vw,281px) 1fr; gap: clamp(15px,1.719vw,31px); align-items: baseline; }
.hello-step strong { font-weight: 650; }
.hello-step > div:first-child { font-size: clamp(17px,1.875vw,34px); }
.hello-step small { display: block; color: var(--muted); }
.hello-excerpt { font: clamp(18px,1.953vw,35px) var(--mono); }
.hello-step p { margin-top: 3px; font-size: clamp(15px,1.719vw,31px); line-height: 1.4; }
.hello-arrow { padding-left: 3em; color: var(--muted); line-height: 1; font-size: clamp(17px,1.875vw,34px); }
.hello-output { width: 100%; }
.hello-output figcaption { color: var(--muted); font-size: clamp(14px,1.562vw,28px); margin-bottom: 5px; }
.hello-output > div { display: grid; grid-template-columns: max-content 1fr; gap: clamp(17px,1.875vw,34px); align-items: baseline; }
.slide .hello-output pre { font-size: clamp(16px,1.797vw,32px); line-height: 1.4; }
.hello-output p { font-size: clamp(15px,1.719vw,31px); line-height: 1.4; }
.slide.parser-example { --heading: clamp(29px,3.203vw,58px); --body: clamp(17px,1.875vw,34px); gap: 15px; }
.slide[data-scene="table-size"] { gap: 10px; }
.slide.parser-example h1 { margin-bottom: 2px; }
.parser-example .remark { max-width: none; line-height: 1.43; }
.parser-example table { width: 100%; border-collapse: collapse; font-size: clamp(15px,1.719vw,31px); }
.parser-example caption { color: var(--muted); text-align: left; margin-bottom: 6px; font-size: clamp(14px,1.562vw,28px); }
.parser-example :is(td, th, code) { color: var(--ink); -webkit-text-fill-color: currentColor; }
.parser-example :is(td, th) { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.parser-example tbody td:first-child { white-space: pre; }
.parser-example :is(td, th) { vertical-align: top; }
.parser-example strong { color: var(--focus); text-decoration: underline; -webkit-text-fill-color: currentColor; }
.slide.parser-example .source-comma { padding: 0; margin: 0; font: clamp(20px,2.188vw,39px)/1.35 var(--mono); }
.actual-tree { margin: 0; }
.actual-tree figcaption { font-size: clamp(15px,1.641vw,30px); margin-bottom: 4px; color: var(--muted); }
.slide .actual-tree pre { padding: 0; font: clamp(18px,2.031vw,37px)/1.3 var(--mono); }
.slide.parser-memory { gap: 10px; }
.slide.parser-memory h1 { margin-bottom: 0; }
.parser-memory figure, .parser-memory svg { width: 100%; display: block; margin: 0; }
.parser-memory svg { font-family: inherit; }
.parser-memory svg text { fill: var(--ink); }
.parser-memory svg .legend { font-size: 22px; font-weight: 600; }
.parser-memory svg .node { font-size: 21px; font-weight: 500; }
.parser-memory svg .small { font-size: 21px; fill: var(--muted); }
.parser-memory svg .box { fill: var(--surface); stroke: var(--muted); stroke-width: 1.4; }
.parser-memory svg .frame-line, .parser-memory svg .wire, .parser-memory svg .focus-wire { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.parser-memory svg .focus-wire { stroke: var(--focus); stroke-width: 2.8; }
.parser-memory svg .focus-box { fill: var(--surface); stroke: var(--focus); stroke-width: 2.3; }
.slide.parser-example.compact-sharing { gap: 11px; }
.table-sizes { border-top: 1px solid var(--line); padding-top: 10px; }
.table-sizes figcaption { color: var(--muted); font-size: clamp(14px,1.562vw,28px); margin-bottom: 4px; }
.table-sizes div { display:flex; gap: clamp(14px,1.562vw,28px); align-items: baseline; font-size: clamp(17px,1.875vw,34px); }
.table-sizes b { font-size: clamp(22px,2.422vw,44px); color: var(--ink); white-space:nowrap; }
.slide[data-scene="table-storage"].parser-memory h1 { font-size: clamp(27px,2.969vw,53px); }
.parser-memory strong { color: var(--ink); text-decoration: none; }
.slide.chapter-title-page h1 { font-size: clamp(47px,5.234vw,94px); line-height: 1.2; margin: 0; }
.slide.read-table { gap: 6px; }
.slide.read-table .remark { line-height: 1.36; }

.read-table .token-heading { white-space: nowrap; }
.parser-memory .diagram-code { font-family: var(--mono); }
@media(max-width: 700px) {
  .hello-step, .hello-output > div { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .hello-step small { display: inline; margin-inline-start: .5em; }
  .parser-example :is(td,th), .read-table .token-heading { white-space: normal; overflow-wrap: anywhere; }
  .parser-example table { table-layout: fixed; }
  .table-sizes div { flex-wrap: wrap; }
}

/* The text and code share the projection column with the live machine monitor. */
.hello-print-bytes .hello-first-byte samp { font: clamp(32px, 3.75vw, 68px)/1.3 var(--mono); }
.hello-print-bytes .hello-output > div { display: block; }
.slide.hello-print-bytes .hello-output pre { font-size: clamp(23px, 2.5vw, 45px); margin: .25em 0 .4em; }
.hello-print-bytes .hello-output p { font-size: clamp(18px, 1.875vw, 34px); }

.slide.talk-content {
  --heading: clamp(28px, 3.05vw, 55px);
  --body: clamp(18px, 1.875vw, 34px);
  --source: clamp(18px, 1.95vw, 35px);
  gap: clamp(10px, 1.25vw, 22px);
}
.slide.talk-content h1 { font-size: var(--heading); line-height: 1.22; margin: 0 0 .12em; text-wrap: pretty; }
.slide.talk-content .remark { font-size: var(--body); line-height: 1.47; max-width: none; margin: 0; }
.verbatim p.remark { white-space: pre-wrap; }
.slide .project-link {
  max-width: 100%;
  margin-block-start: 1em;
  font-size: calc(1.16 * var(--prose-size, clamp(22px, 3.6vw, 27px)));
  font-weight: 650;
  line-height: 1.2;
}
.project-link a, .title-links a {
  color: var(--ink);
  text-decoration-color: var(--focus);
  text-underline-offset: .15em;
  overflow-wrap: anywhere;
}
.talk-content .sample { width: 100%; }
.sample figcaption { color: var(--muted); font-size: clamp(14px, 1.41vw, 25px); line-height: 1.4; margin-bottom: .25em; }
.slide.talk-content .listing { font: 500 var(--source)/1.26 var(--mono); margin: 0; }
.talk-content .guest-output { font-size: clamp(27px, 3.125vw, 56px); line-height: 1.14; }
.slide.talk-content[data-scene="hello"] .guest-output { font-size: clamp(32px, 4.22vw, 76px); }
.talk-content .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em; margin: 0; width: 100%; }
.talk-content .choices > div { border-top: 2px solid var(--line); padding-top: .4em; }
.talk-content .choices dt, .talk-content .choices dd { font-size: clamp(17px, 1.72vw, 31px); line-height: 1.4; }
.talk-content .choices dt { font-weight: 700; margin-bottom: .25em; }
.talk-content .choices dd { color: var(--muted); margin: 0; }
.talk-content .final-title { font-size: clamp(24px, 2.81vw, 50px); font-weight: 700; }
.talk-content .op-trace { margin-inline-start: .8em; color: var(--ink); font-family: var(--mono); }
.slide.talk-content:is([data-scene="call"], [data-scene="lexical"], [data-scene="return"], [data-scene="speaker"]) {
  --source: clamp(17px, 1.8vw, 32px);
  gap: clamp(7px, .78vw, 14px);
}
.slide.talk-content:is([data-scene="call"], [data-scene="lexical"], [data-scene="return"]) {
  --body: clamp(17px, 1.72vw, 31px);
}
.slide.talk-content pre.listing[data-source="greet"] { font-size: var(--source); }
.slide.talk-content[data-scene="greet"] .demo-editor textarea { font-size: clamp(21px, 2.12vw, 38px); }
.talk-content .demo-editor textarea { line-height: 1.26; }
.talk-content .clock-example samp { font-weight: 700; }
.cpan-distribution .distribution { border-inline-start:3px solid var(--focus); padding-inline-start:1.5vw; }
.cpan-distribution .distribution h2 { font:650 clamp(22px,2.42vw,43px)/1.25 var(--mono); color:var(--ink); text-transform:none; letter-spacing:normal; margin:0 0 .3em; }
.cpan-distribution .distribution small { color:var(--muted); font-size:.74em; }
.slide:is(.module-nest,.module-disk) { --heading:clamp(27px,2.89vw,52px); --body:clamp(17px,1.8vw,32px); }
.disk-route { width:100%; margin:0; }
.disk-route svg { display:block; width:100%; height:auto; }
.disk-route .wire path { fill:none; stroke:var(--muted); stroke-width:1.8; }
.disk-route .mono { fill:var(--ink); font:500 24px var(--mono); }
.disk-route .highlight { fill:var(--focus); font-weight:650; }
.disk-route .node-label { fill:var(--ink); font-size:24px; font-weight:650; }
.disk-route .open-strip { fill:var(--surface); stroke:var(--muted); stroke-width:1.4; }
.disk-route .note { fill:var(--muted); font-size:17px; font-weight:550; }
.call-memory .mono { font-size:20px; }
.call-memory .note { font-size:18px; }
.call-details .asm-row { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); gap:1.8vw; align-items:center; width:100%; }
.slide.call-details .asm-row .listing { font-size:clamp(16px,1.72vw,31px); }
.slide.call-details .asm-row .remark { font-size:clamp(16px,1.64vw,30px); }
#closing-demo { width:100%; }
.slide.talk-content[data-scene="closing"] {
  --heading: clamp(42px,6.40625vw,115px);
  --body: clamp(24px,3.36vw,60px);
  gap: clamp(16px,2.344vw,42px);
}
.slide[data-scene="closing"] .demo-editor { min-width:0; font-size:clamp(14px,1.563vw,28px); }
.slide[data-scene="closing"] .demo-editor textarea { font-size:clamp(24px,4.063vw,73px); }
.slide[data-scene="closing"] .closing-controls button { font-size:clamp(16px,2.188vw,39px); }
.ai-reflection { word-break:auto-phrase; text-wrap:pretty; }
.ai-reflection .keep-phrase { display:inline-block; }
.pad-save { border-collapse:collapse; width:100%; color:var(--ink); font-size:clamp(15px,1.641vw,30px); line-height:1.35; }
.pad-save th, .pad-save td { padding:.24em .48em .24em 0; text-align:left; border-bottom:1px solid var(--line); }
.pad-save tbody th { font-weight:500; }
.pad-save thead th { color:var(--muted); }
.closing-controls { display:flex; gap:1em; align-items:end; }
.closing-controls button { white-space:nowrap; }
#closing-output { display:block; max-height:15svh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--focus); font:600 clamp(16px,1.6vw,28px)/1.35 var(--mono); }
#closing-output:not(:empty) { margin-top:.5em; }

.slide.input-detail {
  --heading: clamp(27px, 2.89vw, 52px);
  --body: clamp(17px, 1.64vw, 30px);
  gap: clamp(12px, 1.48vw, 27px);
}
.input-detail .remark { line-height: 1.4; }
.stdin-route {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.38fr);
  align-items: center; width: 100%; gap: .5em;
  font-size: clamp(18px, 1.95vw, 35px); line-height: 1.32;
}
.stdin-route strong, .stdin-route span { display: block; }
.stdin-worker { border: 1px solid var(--line); padding: .35em .5em; }
.stdin-screen span, .stdin-tick, .stdin-device { margin-top: .2em; }
.stdin-route .right-arrow, .stdin-device b { color: var(--focus); }
.stdin-device { border-left: 3px solid var(--focus); padding-left: .4em; }
.slide .io-asm pre { font: 500 clamp(16px, 1.72vw, 31px)/1.45 var(--mono); white-space: normal; }
.io-asm .io-line { display: grid; grid-template-columns: 26ch 1fr; gap: .4em; align-items: baseline; }
.io-asm .io-inst, .byte-line { white-space: pre; }
.io-asm .io-note { font-size: .9em; color: var(--muted); }
.byte-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em; width: 100%; }
.byte-pair figcaption { color: var(--ink); font-weight: 650; font-size: clamp(16px, 1.72vw, 31px); }
.slide .byte-pair pre { font: 500 clamp(15px, 1.56vw, 28px)/1.45 var(--mono); }
.byte-line { display: block; }
.byte-note { color: var(--muted); }
.slide[data-scene="stdin-poll"] { --body: clamp(17px, 1.8vw, 32px); }
.stdin-poll-chart, .stdin-poll-chart svg { display: block; width: 100%; }
.stdin-poll-chart rect { stroke: var(--line); stroke-width: 2; fill: var(--surface); }
.stdin-poll-chart .poll-edge { fill: none; stroke: var(--focus); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.stdin-poll-chart text { fill: var(--ink); font: 500 21px sans-serif; }
.stdin-poll-chart .poll-code { font: 650 22px var(--mono); }
.stdin-poll-chart .poll-small { font-size: 17px; }
.poll-measure { padding-left: .55em; border-left: 3px solid var(--focus); }
@media (max-width: 700px) {
  .byte-pair, .io-asm .io-line, .talk-content .choices { grid-template-columns: 1fr; }
  .byte-line, .io-asm .io-inst { white-space: pre-wrap; }
}

.screen .slide[data-scene] { row-gap:clamp(7px,1.2svh,15px); }
.screen .slide.title-slide { row-gap:clamp(8px,1.5svh,18px); }
.screen .slide > .remark + .remark { margin-block-start:.55em; }
.screen .talk-content > :is(.sample, .disk-route, .choices) + .remark,
.screen .talk-content > .remark + :is(.sample, .disk-route, .choices),
.screen .talk-content > .sample + .sample { margin-block-start:.4em; }
.screen .slide > h1:first-child { margin:0; }
@media (min-width:821px) {
  /* Chapter titles sit in the middle of the projection. All content titles share the top margin. */
  main:has(.chapter-title-page:not([hidden])) { padding-top:clamp(24px,7svh,80px); }
  .screen:has(> .chapter-title-page:not([hidden])),
  .screen:has(> .chapter-title-page:not([hidden])) + .monitor-pane { align-self:center; }

  .screen .slide:where(:not(.chapter-title-page, .title-slide)) > h1:first-child {
    min-height:clamp(46px,4.5vw,82px);
    font-size:clamp(30px,3.125vw,56px);
    line-height:1.2;
  }
  .screen .slide:has(> h1 + .remark + .remark:last-child) > .remark + .remark,
  .screen .slide > .remark + .remark:has(+ .project-link),
  .screen .slide > :is(.build-path, .greeting-intent, .stdin-route) + .remark,
  .screen .slide > .remark + .clock-example { margin-block-start:.8em; }
  #closing-demo { margin-block-start:clamp(18px,3svh,32px); }
  .screen .slide[data-scene="closing"] > h1:first-child { font-size:var(--heading); line-height:1.08; }
}

/* Sizes below are CSS pixels on a 1280 × 720 projector. Scale with the limiting
   dimension, allowing a larger body on taller screens with room for more lines. */
@media (min-width:821px) {
  .screen {
    --type-unit: min(.078125vw, .138889svh, 1.40625px);
    --extra-height: clamp(0px, 2svh - 1.125vw, 3px);
  }
  .screen .slide {
    --body-at-720p: 32;
    --prose-size: min(calc(35 * var(--type-unit)), calc(var(--body-at-720p) * var(--type-unit) + var(--extra-height)));
    --code-size: min(calc(31 * var(--type-unit)), calc(var(--prose-size) - 3 * var(--type-unit)));
    --detail-size: min(calc(28 * var(--type-unit)), calc(var(--prose-size) - 4 * var(--type-unit)));
    --caption-size: min(calc(24 * var(--type-unit)), calc(var(--prose-size) - 6 * var(--type-unit)));
  }

  /* Keep the same scale on successive slides with comparable amounts of prose,
     code and diagrams. Title slides, the closing demo and the monitor have their own type. */
  .screen .slide:is(
    [data-scene="machine"], [data-scene="wiring"], [data-scene="call"],
    [data-scene="return"], [data-scene="module-load"], [data-scene="cpu-fix"],
    [data-scene="lookup-address"], [data-scene="talk-timer"], [data-scene="stdin-poll"],
    [data-scene="lexical"], [data-scene="zpfs-overview"], [data-scene="module-disk"],
    [data-scene="why"], [data-scene="design"]
  ) { --body-at-720p: 26; }
  .screen .slide:is(
    [data-scene="bus"], [data-scene="hello-record"], [data-scene="table-storage"],
    [data-scene="stdin-count"], [data-scene="experience"]
  ) { --body-at-720p: 28; }
  .screen .slide:is(
    [data-scene="worker"], [data-scene="parser-table"], [data-scene="table-position"],
    [data-scene="key-input"], [data-scene="hello"], [data-scene="greet"], [data-scene="fundamentals"]
  ) { --body-at-720p: 30; }
  .screen .slide:is(
    [data-scene="compiler"], [data-scene="table-size"], [data-scene="speaker"], [data-scene="finish"]
  ) { --body-at-720p: 34; }
  .screen .slide:is(
    [data-scene="origin"], [data-scene="runtime"], [data-scene="vm"], [data-scene="source"],
    [data-scene="stdin-route"], [data-scene="optree"], [data-scene="runops"], [data-scene="accessor"],
    [data-scene="hobby"], [data-scene="curiosity"], [data-scene="compilers"]
  ) { --body-at-720p: 35; }

  .screen .slide:not([data-scene="closing"]) > p.remark {
    font-size: var(--prose-size);
    line-height: 1.43;
    max-width: none;
  }
  .screen .slide :is(.sample figcaption, .actual-tree figcaption, .table-sizes figcaption,
    .hello-output figcaption, .emulator-patch figcaption, table caption) { font-size: var(--caption-size); }
  .screen .slide :is(.sample pre.listing, .actual-tree pre, .greeting-intent, .hello-excerpt, .hello-labels) {
    font-size: max(min(var(--source), calc(24 * var(--type-unit))), var(--code-size));
  }
  .screen .slide pre.source-comma { font-size: max(calc(28 * var(--type-unit)), var(--code-size)); }
  .screen .slide :is(table, .choices dt, .choices dd, .hello-step p, .hello-output p, .asm-row p.remark) {
    font-size: var(--detail-size);
  }
  .screen .slide:has(> .computer-diagram) { row-gap: clamp(5px, .9svh, 10px); }
  .screen .slide > .computer-diagram { width: min(100%, 116svh); }
  .screen .slide > :is(.disk-route, .sharing-drawing, .comma-drawing, .memory-drawing) { max-width: 128svh; }
  .screen .slide.call-details { row-gap: clamp(5px, .85svh, 10px); }
  .screen .slide.call-details > :is(.sample, .remark, .call-memory) { margin-block-start: 0; }
  .screen .slide:is(.module-nest, .cpu-example, :has(> .computer-diagram)) > p.remark { line-height: 1.36; }
  .screen .slide.module-nest { row-gap: clamp(6px, .9svh, 10px); }
  .screen .slide.module-nest > .remark + .disk-route,
  .screen .slide.module-nest > .disk-route + .remark { margin-block-start: 0; }
  .screen .module-nest > .disk-route { max-width: min(100%, 120svh); }
  .screen .cpu-example .register-route { width: min(100%, 96svh); }
  .screen .slide.parser-example :is(th,td) { padding-block: min(5px, .6svh); }
  .live-deck[data-monitor-size="large"] .byte-line { white-space: pre-wrap; }
}
@media (min-width:821px) and (max-height:700px), (min-width:821px) and (min-aspect-ratio:9/5) {
  .screen { --type-unit: min(.075vw, .13svh); }
  .screen .slide[data-scene] { row-gap: clamp(5px, .95svh, 8px); }
  .screen .slide[data-scene="speaker"] { --body-at-720p: 32; }
}
@media (max-width:820px) {
  .screen .slide:not([data-scene="closing"]) > p.remark {
    font-size: clamp(22px, 3.6vw, 27px);
    line-height: 1.48;
    max-width: none;
  }
}

.presenter-only { display:none; }
body.presenting {
  height:100dvh;
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) auto;
  gap:18px 22px;
  padding:clamp(12px,1.6vw,24px);
  background:#0c0e12;
}
.presenting #current-panel, .presenting #upcoming figure {
  min-height:0; min-width:0; display:flex; flex-direction:column; gap:8px;
}
.presenting #current-panel > h2, #upcoming figcaption {
  display:block; font-size:16px; font-weight:600; line-height:1.3;
}
.presenting #current-panel > h2::before {
  content:''; display:inline-block; width:8px; height:8px; margin-right:.55em;
  border-radius:50%; background:var(--focus); vertical-align:.07em;
}
.presenting #current-frame, .thumbnail {
  flex:1; min-height:0; overflow:hidden; position:relative; isolation:isolate;
  border:1px solid var(--line); border-radius:5px; background:#101216;
}
.presenting #current-surface, .thumbnail iframe {
  position:absolute; top:50%; left:50%; transform-origin:center; background:var(--paper);
}
.presenting #current-surface { width:100vw; }
.presenting #current-surface footer { position:relative; bottom:auto; }
.presenting #upcoming {
  grid-area:1 / 2 / 3 / 3; display:grid; grid-template-rows:1fr 1fr; min-height:0; gap:18px;
}
#upcoming figcaption span { color:var(--muted); font:500 .95em var(--mono); padding-left:.5em; }
.thumbnail iframe { width:1280px; height:720px; border:0; pointer-events:none; }
.thumbnail[data-message]:not([data-message=""])::after {
  content:attr(data-message); position:absolute; inset:0; display:grid; place-items:center;
  color:var(--muted); background:var(--paper); font-size:14px;
}
.preview-sheet main:has(.chapter-title-page) { justify-content:center; }
.presenting #presenter-controls { display:grid; gap:14px; grid-column:1; min-width:0; }
.presenter-timing, .presenter-toolbar, .presenter-toolbar nav, #presenter-monitor {
  display:flex; flex-wrap:wrap; align-items:center; gap:6px;
}
.presenter-timing { gap:18px; color:var(--muted); }
.presenter-timing .talk-clock { padding:0 .3em; font-size:clamp(20px,2.3vw,34px); color:var(--ink); }
.presenter-timing .page-budget { font-size:clamp(16px,1.55vw,24px); }
.presenter-toolbar { gap:10px 20px; font-size:14px; }
.presenter-toolbar button, .presenter-toolbar select {
  padding:6px 10px; border:1px solid var(--line); border-radius:4px; background:var(--surface);
  color:var(--ink); font:inherit; cursor:pointer;
}
.presenter-toolbar button[aria-pressed="true"] { border-color:var(--focus); }
.presenter-toolbar #stop-presenter { margin-left:auto; }
#presenter-error { position:fixed; z-index:5; bottom:60px; left:5vw; max-width:min(32em,85vw); padding:12px; background:var(--surface); }
.audience :is(footer .tools,footer nav,#monitor-size) { visibility:hidden; }
