:root {
  color-scheme: dark;
  --bg: #101916;
  --panel: #15221d;
  --panel-accent: #1b2b22;
  --line: #365044;
  --text: #f2f4eb;
  --muted: #b3c5ba;
  --mint: #8fddba;
  --lime: #d2fb9f;
  --amber: #ffba89;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font: 17px/1.55 var(--sans); }
p, h1, h2, h3, figure, dl, dd { margin: 0; }
a { color: var(--mint); text-underline-offset: .22em; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
h1:focus, h2:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { width: min(1180px, calc(100% - 62px)); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--line); background: #101916ed; z-index: 5; }
.mast-inner, .mast-actions, .jump, .brand, .panel-head, .footer { display: flex; align-items: center; }
.mast-inner { justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { color: var(--text); gap: 5px; text-decoration: none; font-weight: 740; white-space: nowrap; letter-spacing: -.04em; }
.brand b { color: var(--lime); }
.mark { display: inline-flex; width: 29px; height: 29px; align-items: center; justify-content: center; gap: 2px; border-radius: 7px; color: #17241b; background: var(--lime); margin-right: 4px; }
.mark i { background: currentColor; border-radius: 3px; width: 2px; height: 6px; }
.mark i:nth-child(2), .mark i:nth-child(4) { height: 11px; }
.mark i:nth-child(3) { height: 17px; }
.jump { gap: clamp(12px, 2vw, 25px); }
.jump a { color: var(--muted); font-size: .87rem; text-decoration: none; }
.jump a:hover, .footer a:hover { color: var(--lime); }
.mast-actions { gap: 7px; }
.button { border: 1px solid transparent; border-radius: 7px; padding: .36rem .75rem; min-height: 37px; display: inline-flex; align-items: center; justify-content: center; font-size: .86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.quiet { border-color: var(--line); color: var(--text); background: #192722; }
.quiet:not(:disabled):hover { background: #283d31; }
.primary { background: var(--lime); color: #192219; }
.primary:not(:disabled):hover { background: #e6ffcd; }
.scene { padding: clamp(30px, 6vw, 70px) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.overview { padding-top: 0; }
.hero { position: relative; isolation: isolate; min-height: clamp(310px, 32vw, 440px); display: grid; align-items: center; padding: 22px 0 30px; overflow: hidden; }
.hero img { z-index: -2; position: absolute; right: 0; top: 0; height: 100%; width: 77%; object-fit: cover; object-position: center 51%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--bg) 12%, #101916eb 26%, #10191680 52%, #10191600 88%), linear-gradient(0deg, var(--bg), #10191600 27%, #10191600 80%, var(--bg)); }
.eyebrow { color: var(--mint); font: .76rem/1.4 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.hero h1, .scene h2 { font-size: clamp(2.6rem, 7.3vw, 6.55rem); letter-spacing: -.085em; line-height: .98; font-weight: 740; margin: .17em 0; }
.hero h1 span, .scene h2 span { color: var(--lime); }
.hero-note { color: var(--muted); font-size: clamp(1rem, 2.15vw, 1.45rem); max-width: 30ch; }
.hero-note strong { color: var(--text); }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric, .panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.metric { padding: 15px 18px; }
.metric.highlight { background: var(--panel-accent); border-color: #64865b; }
.metric strong { display: block; color: var(--lime); font-size: clamp(2.35rem, 6vw, 4.9rem); line-height: 1; letter-spacing: -.075em; margin: .09em 0 .13em; }
.metric strong small { font-size: .43em; letter-spacing: -.04em; }
.metric p:last-child, .scene-note, .muted, figcaption { color: var(--muted); }
.metric p:last-child { font-size: .91rem; }
.scene-note { font-size: .82rem; margin-top: 12px; }
.scene-heading { margin-bottom: clamp(17px, 3vw, 29px); max-width: 62rem; }
.scene h2 { font-size: clamp(2.35rem, 6.3vw, 5.4rem); }
.scene-heading > p:last-child:not(.eyebrow) { color: var(--muted); font-size: clamp(1rem, 1.9vw, 1.23rem); }
.performance, .state-grid, .proof-grid { display: grid; gap: 13px; }
.performance { grid-template-columns: 2.25fr 1fr; }
.panel { padding: 20px; }
.panel-head { justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.panel h3 { font-size: clamp(1.03rem, 2vw, 1.4rem); letter-spacing: -.025em; }
figcaption, .chart-key, .muted { font-size: .86rem; }
.chart-scroll { overflow-x: auto; }
.chart table { width: 100%; border-collapse: collapse; margin-top: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart th, .chart td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #314338; }
.chart tbody th { font-weight: 680; }
.chart thead th { font: .71rem var(--mono); color: var(--muted); }
.chart td:not(:nth-child(2)) { font: .84rem var(--mono); }
.chart th:nth-child(2) { width: 49%; }
.chosen { background: #223829; }
.chosen th, .chosen td:last-child { color: var(--lime); }
.track { min-width: 50px; display: block; height: 13px; position: relative; background: #0d1712; border-radius: 2px; }
.track::after { content: ""; position: absolute; width: 1px; background: #e9faef; height: calc(100% + 4px); top: -2px; left: 80%; }
.track i { width: var(--filled); display: block; height: 100%; border-radius: 2px; background: var(--mint); }
.track.late i { background: var(--amber); }
.late-text { color: var(--amber); }
.chart-key { color: var(--muted); margin: 10px 0 0; display: flex; align-items: center; gap: 6px; }
.chart-key i { width: 1px; height: .82rem; background: var(--text); }
.public-card h3 { margin: .24em 0 .5em; }
.public-card dl { display: grid; gap: 8px; margin-bottom: 6px; }
.public-card dl div { border-top: 1px solid var(--line); padding-top: 5px; }
.public-card dt { color: var(--muted); font-size: .87rem; }
.public-card dd { color: var(--lime); font-size: clamp(1.65rem, 4vw, 3.1rem); font-weight: 720; letter-spacing: -.065em; line-height: 1.14; }
.public-card dd small { font-size: .48em; letter-spacing: 0; }
.proof { background: #16241e; }
.sequence { display: grid; grid-template-columns: auto 1fr 1.7fr; align-items: center; gap: 8px; margin-top: 14px; }
.sequence > span { color: var(--muted); font-size: .8rem; padding-right: 6px; }
.sequence div { font-size: .9rem; font-weight: 700; padding: 8px 10px; border-radius: 5px; }
.prefix { color: #16251b; background: var(--mint); }
.original-tail { color: var(--text); background: #30473d; }
.changed-tail { color: #ffdbc6; background: #4a3026; }
.proof-outcome { color: var(--muted); margin-top: 14px; }
.proof-outcome strong { color: var(--lime); }
.proof-grid, .state-grid { grid-template-columns: 1fr 1fr; margin-top: 13px; }
.proof-card h3 { margin: 3px 0 4px; }
.proof-card p:last-child, .state-item p { color: var(--muted); font-size: .92rem; }
.warning .eyebrow { color: var(--amber); }
.keep { display: grid; gap: 10px; }
.state-item + .state-item { border-top: 1px solid var(--line); padding-top: 9px; }
.code-card pre { max-width: 100%; overflow: auto; font: clamp(.75rem, 1.55vw, .96rem)/1.65 var(--mono); margin: 10px 0; background: #0d1712; color: #d6f4df; padding: 12px; border-radius: 6px; }
.state-foot { display: flex; gap: 12px; align-items: baseline; color: var(--muted); margin-top: 12px; font-size: .9rem; }
.state-foot strong { color: var(--lime); white-space: nowrap; font-size: 1.48rem; letter-spacing: -.04em; }
.appendix { padding-top: 17px; }
.appendix details { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 10px 14px; }
.appendix summary { font-weight: 700; cursor: pointer; }
.appendix-content { margin-top: 9px; color: var(--muted); font-size: .9rem; }
.appendix-content code { font: .79rem var(--mono); overflow-wrap: anywhere; }
.appendix-content ul { display: flex; flex-wrap: wrap; gap: 7px 22px; list-style: none; padding: 0; margin: 7px 0 3px; }
.footer { justify-content: space-between; gap: 10px; color: var(--muted); font-size: .82rem; padding-block: 15px 24px; }
.deck-controls { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 6px; background: #111c17ed; border: 1px solid var(--line); border-radius: 9px; z-index: 10; box-shadow: 0 8px 22px #04070575; }
#slide-counter { min-width: 47px; text-align: center; color: var(--muted); font: .77rem var(--mono); }
.presenting .jump, .presenting #present, .presenting .appendix, .presenting .footer, .presenting .scene:not([data-active]) { display: none; }
.presenting .scene { border: 0; padding-bottom: 79px; }
.presenting .scene:not(.overview) { padding-top: clamp(20px, 5vh, 55px); }
@media (max-width: 795px) {
  .shell { width: calc(100% - 36px); }
  .jump { display: none; }
  .performance { grid-template-columns: 1.6fr 1fr; }
  .panel { padding: 14px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 26px); }
  .mast-inner { min-height: 58px; gap: 5px; }
  .mast-actions { gap: 4px; }
  .brand { font-size: .9rem; }
  .button { padding-inline: .44rem; font-size: .76rem; }
  .hero { min-height: 285px; }
  .hero img { width: 100%; opacity: .85; object-position: 60%; }
  .hero::after { background: linear-gradient(90deg, #101916fa 5%, #101916b5 53%, #1019162b), linear-gradient(0deg, var(--bg), #10191600 26%, #10191600 82%, var(--bg)); }
  .summary-grid { grid-template-columns: 1fr; gap: 8px; }
  .metric { padding: 10px 12px; }
  .metric strong { font-size: 2.35rem; }
  .performance, .state-grid, .proof-grid { grid-template-columns: 1fr; gap: 9px; }
  .public-card dl { grid-template-columns: 1fr 1fr; gap: 9px; }
  .chart td:not(:nth-child(2)) { font-size: .71rem; }
  .chart th, .chart td { padding: 7px 4px; }
  .chart th:nth-child(2) { width: 34%; }
  .code-card pre { font-size: .69rem; }
  .sequence { gap: 5px; }
  .sequence div, .sequence > span { font-size: .73rem; }
  .state-foot { flex-direction: column; gap: 0; }
}
@media (max-width: 355px) {
  .brand, .button { font-size: .78rem; }
  .mast-inner { gap: 6px; }
  .mast-actions { gap: 4px; }
  .mark { margin-right: 1px; width: 25px; height: 25px; }
  .chart table { table-layout: fixed; }
  .chart thead th { white-space: normal; }
  .chart td:not(:nth-child(2)) { font-size: .64rem; }
  .chart th:nth-child(1) { width: 22%; }
  .chart th:nth-child(2), .chart th:nth-child(3) { width: 25%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #17251c; --panel: #f7faf8; --panel-accent: #eaf5ed; --line: #b0c1b6; --muted: #31453a; --lime: #25492f; --mint: #24553e; --amber: #793416; }
  .mast, .appendix, .footer, .deck-controls, .hero img, .hero::after { display: none !important; }
  .shell { width: 100%; }
  .scene, .presenting .scene:not([data-active]) { display: block; padding-block: 18px; break-inside: avoid; break-after: page; }
  .hero { min-height: auto; }
  .panel, .track, .track i, .prefix, .tail { print-color-adjust: exact; }
  .chosen { background: #eaf5ed; }
  .prefix, .original-tail, .changed-tail { color: var(--text); background: #e4eee8; }
}
