/* ---------- fonts ---------- */
@font-face { font-family: "Newsreader"; src: url(../vendor/fonts/newsreader-latin-opsz-normal.woff2) format("woff2"); font-weight: 200 800; font-style: normal; font-display: block; }
@font-face { font-family: "Newsreader"; src: url(../vendor/fonts/newsreader-latin-opsz-italic.woff2) format("woff2"); font-weight: 200 800; font-style: italic; font-display: block; }
@font-face { font-family: "Inter"; src: url(../vendor/fonts/inter-latin-opsz-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url(../vendor/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url(../vendor/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: block; }

/* ---------- tokens ---------- */
:root {
  --paper: #f2ede2;
  --paper-2: #ebe4d5;
  --card: #f7f3ea;
  --ink: #1b2130;
  --ink-2: #4a5162;
  --ink-3: #8b8f99;
  --rule: #cfc6b3;
  --problem: #23407a;
  --problem-soft: rgba(35, 64, 122, .09);
  --patch: #b6422a;
  --patch-soft: rgba(182, 66, 42, .09);
  --gold: #9c7630;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}
@property --r { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* ---------- page ---------- */
html, body { margin: 0; height: 100%; background: var(--paper); overflow: hidden; }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; }

/* Reveal only carries navigation, fragments and notes: hide its slides. */
.reveal { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.reveal .slides { visibility: hidden; }
.reveal .controls, .reveal .progress { display: none !important; }

/* stage = fixed 1920x1080 design surface, scaled to fit */
#stage { position: fixed; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 50% 50%; z-index: 1; overflow: hidden; background: var(--paper); }
#viewport { position: absolute; inset: 0; overflow: hidden; }
#world { position: absolute; left: 0; top: 0; width: 42000px; height: 2400px; transform-origin: 0 0; }
#grain { position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.40  0 0 0 0 0.32  0 0 0 .10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* chrome: running header / footer like a printed publication */
#chrome { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#chrome .run { position: absolute; left: 96px; right: 96px; font: 500 15px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
#chrome .run.top { top: 44px; }
#chrome .run.bot { bottom: 40px; }
#chrome .rule { position: absolute; left: 96px; right: 96px; height: 1px; background: var(--rule); }
#chrome .rule.top { top: 72px; }
#chrome .rule.bot { bottom: 68px; }
#chrome #part { color: var(--ink-2); transition: opacity .5s; }
#chrome #folio { font-family: var(--mono); letter-spacing: .06em; }
#chrome .progress { position: absolute; left: 96px; bottom: 68px; height: 1px; background: var(--ink); transition: width .9s var(--ease); }

/* ---------- frames ---------- */
.frame { position: absolute; top: 0; width: 1920px; height: 1080px; }
.pad { position: absolute; left: 160px; right: 160px; top: 132px; bottom: 132px; }

/* ---------- presence: state is a function of the step index ---------- */
[data-in] { opacity: 0; transition: opacity .7s var(--ease), transform .9s var(--ease-out), filter .7s; }
[data-in].on { opacity: 1; }
.rise[data-in] { transform: translateY(18px); }
.rise[data-in].on { transform: none; }
.pop[data-in] { transform: scale(.94); }
.pop[data-in].on { transform: none; transition: opacity .5s, transform .6s cubic-bezier(.34, 1.56, .64, 1); }

/* plates: printed onto the page, inked in with a radial mask */
.plate { position: absolute; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 calc(var(--r) - 14%), transparent var(--r));
          mask-image: radial-gradient(circle at 50% 55%, #000 calc(var(--r) - 14%), transparent var(--r));
  transition: --r 2.2s var(--ease-out), opacity .8s; opacity: 1; }
.plate[data-in] { opacity: 1; }
.plate.on { --r: 150%; }
.plate img { width: 100%; height: 100%; object-fit: contain; display: block; }
.plate.dim { opacity: .35; }
.plate.gone { opacity: 0; transition: opacity .6s; }

/* pen: svg paths draw on */
.pen path, .pen line, .pen polyline, .pen rect, .pen circle { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease); }
.pen.on path, .pen.on line, .pen.on polyline, .pen.on rect, .pen.on circle { stroke-dashoffset: 0; }
.pen[data-in] { opacity: 1; }
.pen:not(.on) { opacity: 1; }

/* ---------- type ---------- */
.kicker { font: 600 16px/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.display { font-family: var(--serif); font-optical-sizing: auto; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.h1 { font-size: 96px; line-height: 1.02; }
.h2 { font-size: 64px; line-height: 1.08; }
.h3 { font-size: 44px; line-height: 1.15; }
.lede { font: 400 30px/1.4 var(--sans); color: var(--ink-2); }
.label { font: 500 22px/1.35 var(--sans); color: var(--ink-2); }
.small { font: 400 20px/1.4 var(--sans); color: var(--ink-3); }
.source { font: 400 17px/1.3 var(--mono); color: var(--ink-3); letter-spacing: .01em; }
.em-problem { color: var(--problem); }
.em-patch { color: var(--patch); }
.italic { font-style: italic; }

/* typewriter: letters settle in */
.type .ch { display: inline-block; opacity: 0; transform: translateY(6px); }
.type.on .ch { opacity: 1; transform: none; transition: opacity .35s, transform .45s var(--ease-out); transition-delay: calc(var(--i) * 18ms); }
.type .sp { display: inline; }

/* ---------- specimen card ---------- */
.specimen { position: absolute; width: 780px; height: 420px; }
.specimen .half { position: absolute; top: 0; height: 100%; width: 50%; background: var(--card); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -24px rgba(27,33,48,.35);
  transition: transform 1.1s var(--ease), opacity .9s, background .9s, box-shadow .9s; }
.specimen .half.l { left: 0; border: 1.5px solid var(--ink); border-right: none; }
.specimen .half.r { right: 0; border: 1.5px solid var(--ink); border-left: none; }
.specimen .frameline { position: absolute; inset: 10px; border: 1px solid var(--rule); pointer-events: none; }
.specimen .half.l .frameline { right: -1px; border-right: none; }
.specimen .half.r .frameline { left: -1px; border-left: none; }
.specimen .name { position: absolute; left: 0; right: 0; top: 118px; text-align: center; font-family: var(--serif); font-size: 104px; font-weight: 420; letter-spacing: -.01em; transition: opacity .6s, transform 1.1s var(--ease); z-index: 3; pointer-events: none; }
.specimen .catno { position: absolute; left: 34px; top: 30px; font: 500 14px/1 var(--mono); letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; z-index: 3; transition: opacity .6s; }
.specimen .taxon { position: absolute; left: 0; right: 0; bottom: 40px; text-align: center; font: italic 400 24px/1 var(--serif); color: var(--ink-2); z-index: 3; transition: opacity .6s; }
.specimen .crack { position: absolute; left: 50%; top: -8px; width: 24px; height: calc(100% + 16px); margin-left: -12px; z-index: 4; overflow: visible; }
.specimen .crack path { stroke: var(--ink); stroke-width: 2; fill: none; }
.specimen .inside { position: absolute; inset: 0; padding: 48px 40px 36px; opacity: 0; transition: opacity .7s .35s; display: flex; flex-direction: column; justify-content: flex-end; }
.specimen .tag { font: 700 15px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 18px; }
.specimen .half.l .tag { color: var(--problem); }
.specimen .half.r .tag { color: var(--patch); }
.specimen .body { font: 400 27px/1.32 var(--serif); color: var(--ink); }
.specimen .sub { margin-top: 14px; font: 400 19px/1.4 var(--sans); color: var(--ink-2); }
/* split state */
.specimen.split .name, .specimen.split .catno, .specimen.split .taxon { opacity: 0; }
.specimen.split .inside { opacity: 1; }
.specimen.split .half.l { transform: none; background: var(--card); border-color: var(--problem); box-shadow: inset 6px 0 0 var(--problem), 0 18px 40px -24px rgba(27,33,48,.35); }
.specimen.split .half.r { transform: translateX(56px) rotate(2.2deg) translateY(10px); border-color: var(--patch);
  background: repeating-linear-gradient(135deg, rgba(182,66,42,.075) 0 2px, transparent 2px 11px), var(--card); }
.specimen.split .crack { opacity: 0; transition: opacity .3s .2s; }
.specimen.expire .half.r { transform: translateX(80px) rotate(6deg) translateY(120px); opacity: 0; }
.specimen.expire .half.l { transform: translateX(170px); }

/* margin note (handwritten-feel italic serif with a rule) */
.note { position: absolute; font: italic 400 30px/1.35 var(--serif); color: var(--ink); padding-left: 26px; border-left: 2px solid var(--ink); }

/* story beats */
.beats { position: absolute; display: flex; flex-direction: column; gap: 26px; }
.beat { display: grid; grid-template-columns: 56px 1fr; align-items: baseline; }
.beat .n { font: 500 18px/1 var(--mono); color: var(--ink-3); }
.beat .t { font: 400 29px/1.35 var(--sans); color: var(--ink); }

/* ---------- ladder ---------- */
.ladder svg { overflow: visible; }
.ladder .rail { stroke: var(--ink); stroke-width: 3; fill: none; }
.ladder .rung { stroke: var(--ink); stroke-width: 3; fill: none; }
.ladder .hatch { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.rungtext { position: absolute; width: 640px; }
.rungtext .lvl { font: 600 16px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; transition: color .8s; }
.rungtext .q { font: 400 34px/1.25 var(--serif); color: var(--ink); transition: color .8s; }
.rungtext.ai .lvl, .rungtext.ai .q { color: var(--patch); }
.bracket { position: absolute; }
.bracket svg path { stroke: var(--ink-2); stroke-width: 2; fill: none; }
.bracket .bl { font: 600 17px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- split-flap board ---------- */
.board { position: absolute; background: transparent; color: var(--ink); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 22px 0 22px; }
.board .bhead { display: flex; justify-content: space-between; font: 600 16px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.board .row { display: grid; grid-template-columns: 220px repeat(3, 1fr); gap: 0; align-items: center; }
.board .cell { position: relative; height: 120px; perspective: 700px; }
.board .flap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding-left: 28px; border-left: 1px solid var(--rule); font: 400 50px/1 var(--serif); letter-spacing: -.01em; color: var(--patch); backface-visibility: hidden; transform-origin: 50% 50%; transition: transform .75s var(--ease), opacity .5s; }

.board .flap.year { font: 500 44px/1 var(--mono); color: var(--ink); border-left: none; padding-left: 0; }
.board .flap.stay { color: var(--problem); }
.board .flap.gone { transform: rotateX(-100deg); opacity: 0; }
.board .flap.come { transform: rotateX(100deg); opacity: 0; }
.board .flap.cur { transform: rotateX(0deg); }
.board .foot { margin-top: 16px; font: 400 17px/1.4 var(--mono); color: var(--ink-3); }

.counter { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- bars ---------- */
.bars svg text { font-family: var(--mono); }
.bar-rect { transition: height 1.2s var(--ease), y 1.2s var(--ease); }

/* ---------- generic cards / columns ---------- */
.col { position: absolute; }
.rulelist { list-style: none; padding: 0; margin: 0; }
.rulelist li { border-top: 1px solid var(--rule); padding: 20px 0 22px; font: 400 28px/1.35 var(--sans); color: var(--ink); display: grid; grid-template-columns: 52px 1fr; }
.rulelist li .n { font: 500 17px/1.9 var(--mono); color: var(--ink-3); }
.course { position: absolute; width: 360px; }
.course .pl { position: relative; height: 250px; }
.course .cname { margin-top: 18px; font: 600 16px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.course .intu { margin-top: 12px; font: 400 32px/1.2 var(--serif); color: var(--problem); }
.course .case { margin-top: 14px; font: 400 22px/1.4 var(--sans); color: var(--ink-2); padding-top: 14px; border-top: 1px solid var(--rule); }

/* table */
.answers { position: absolute; border-collapse: collapse; }
.answers th { font: 600 16px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 28px 20px; }
.answers td { border-top: 1.5px solid var(--ink); padding: 26px 28px 30px; vertical-align: top; font: 400 30px/1.3 var(--serif); width: 560px; }
.answers td.rowh { width: 220px; font: 600 16px/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); padding-top: 34px; }

/* strike */
.strike { position: relative; display: inline; }
.strike::after { content: ""; position: absolute; left: -6px; right: -6px; top: 54%; height: 3px; background: var(--patch); transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease); }
.strike.struck::after { transform: scaleX(1); }

/* overlay headline used during the pull-back (lives on the stage, not in the world) */
#overlay { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#overlay .ov { position: absolute; opacity: 0; transition: opacity .8s var(--ease); }
#overlay .ov.on { opacity: 1; }
.veil { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, rgba(242,237,226,0) 0%, rgba(242,237,226,.94) 35%, rgba(242,237,226,.97) 100%); }

/* part numerals floating in the sheet, seen during flights */
.numeral { position: absolute; font-family: var(--serif); font-weight: 300; font-size: 520px; line-height: 1; color: rgba(27,33,48,.05); font-style: italic; pointer-events: none; }

@media print { #grain { display: none; } }


/* reversed specimen: left half is the one that expires (used for the degree) */
.specimen.rev.split .half.l { transform: translateX(-34px) rotate(-2.2deg) translateY(10px); border-color: var(--patch); box-shadow: 0 18px 40px -24px rgba(27,33,48,.35);
  background: repeating-linear-gradient(45deg, rgba(182,66,42,.075) 0 2px, transparent 2px 11px), var(--card); opacity: .92; }
.specimen.rev.split .half.r { transform: translateX(26px); border-color: var(--problem); background: var(--card); box-shadow: inset 6px 0 0 var(--problem), 0 18px 40px -24px rgba(27,33,48,.35); }
.specimen.rev.split .half.l .tag { color: var(--patch); }
.specimen.rev.split .half.r .tag { color: var(--problem); }
.missing { outline: 2px dashed #d33; color: #d33 !important; }

/* pen-drawn diagrams: labels and dots arrive after the strokes */
.pen text, .pen circle { opacity: 0; transition: opacity .6s .9s; }
.pen.on text, .pen.on circle { opacity: 1; }
.pen circle { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }

/* the crack draws on the split beat, then the halves part */
.specimen .crack path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s var(--ease); }
.specimen.split .crack path { stroke-dashoffset: 0; }
.specimen.split .crack { opacity: 0; transition: opacity .4s 1.1s; }
.specimen.split .half { transition-delay: .45s; }
.specimen.split .inside { transition-delay: .9s; }


/* cover: the geode halves start closed and slowly part (the talk's motif, before it is named) */
.geode img { transition: transform 3.2s var(--ease-out) .6s; }
.geode .gl { transform: translateX(34px) rotate(1.5deg); }
.geode .gr { transform: translateX(-34px) rotate(-1.5deg); }
.geode.on .gl { transform: translateX(-26px) rotate(-3deg); }
.geode.on .gr { transform: translateX(30px) rotate(3.5deg); }

/* S09: four specimens, patches attached, then dropped */
.mrow { position: absolute; left: 160px; top: 250px; width: 1600px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.mspec { position: relative; height: 520px; }
.mspec .mhead { height: 150px; border: 1.5px solid var(--ink); border-bottom: none; background: var(--card); display: flex; align-items: center; gap: 18px; padding: 0 22px; }
.mspec .mhead img { height: 112px; width: 112px; object-fit: contain; }
.mspec .mname { font: 420 46px/1 var(--serif); letter-spacing: -.01em; }
.mspec .mprob { height: 200px; background: var(--card); border: 1.5px solid var(--problem); box-shadow: inset 6px 0 0 var(--problem); padding: 24px 22px 20px 32px; }
.mspec .tag { font: 700 14px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; }
.mspec .mprob .tag { color: var(--problem); }
.mspec .mprob .body { font: 400 27px/1.28 var(--serif); }
.mspec .mpatch { height: 150px; border: 1.5px solid var(--patch); border-top: none; padding: 22px 22px 18px 24px;
  background: repeating-linear-gradient(135deg, rgba(182,66,42,.08) 0 2px, transparent 2px 11px), var(--card);
  transition: transform 1.2s cubic-bezier(.55,0,.85,.35), opacity 1s ease-in; transition-delay: var(--d); }
.mspec .mpatch .tag { color: var(--patch); }
.mspec .mpatch .ptxt { font: italic 400 24px/1.25 var(--serif); color: var(--ink-2); }
.mspec .gone-name { margin-top: 12px; font: 500 22px/1 var(--mono); letter-spacing: .04em; color: var(--patch); }
.mspec.drop .mpatch { transform: translateY(260px) rotate(7deg); opacity: 0; }
.mspec:nth-child(even).drop .mpatch { transform: translateY(260px) rotate(-6deg); }

/* S18: large serif list */
.rulelist.big li { font: 400 40px/1.22 var(--serif); padding: 34px 0 38px; grid-template-columns: 64px 1fr; }
.rulelist.big li .n { font: 500 20px/2.1 var(--mono); }

/* one voice for closing lines */
.closer { font-size: 38px !important; line-height: 1.25; color: var(--ink); }
.display, .closer { text-wrap: balance; }
.big-tag .tag { font-size: 20px !important; }
.big-tag .body { font-size: 30px !important; }
/* S14: the choice is pulled toward two corners */
.pen .pull { opacity: 0; transition: opacity .8s 2.6s; }
.pen.on .pull { opacity: 1; }
.pen .choice { transform-box: fill-box; transform-origin: center; transition: opacity .6s 1.6s, transform 1.4s var(--ease) 2.2s !important; }
.pen.on .choice { transform: translate(80px, -60px); }
.ladder.mini .rail { stroke-width: 2.5; }
/* S09: tighter cards, bigger plates */
.mspec { height: auto; }
.mspec .mhead { height: 190px; }
.mspec .mhead img { height: 160px; width: 160px; }
.mspec .mprob { height: 170px; }
.mrow { top: 280px; }

/* ===================== v5 components ===================== */
/* RAG pipeline */
.docs { position: absolute; width: 190px; height: 150px; }
.docs i { position: absolute; width: 120px; height: 150px; background: var(--card); border: 1.5px solid var(--ink); }
.docs i:nth-child(1) { left: 0; top: 0; } .docs i:nth-child(2) { left: 16px; top: 10px; } .docs i:nth-child(3) { left: 32px; top: 20px; }
.docs span { position: absolute; left: 0; top: 190px; font: 600 16px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.pipeline { position: absolute; display: flex; gap: 22px; }
.pstage { flex: 1; height: 130px; border: 1.5px solid var(--ink); background: var(--card); display: flex; flex-direction: column; justify-content: center; padding: 0 18px; font: 400 28px/1.15 var(--serif); position: relative; }
.pstage::after { content: "→"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); font: 300 24px var(--serif); color: var(--ink-3); }
.pstage:last-child::after { content: ""; }
.pstage .pn { font: 500 15px/1 var(--mono); color: var(--ink-3); margin-bottom: 10px; }
.window { position: absolute; width: 240px; height: 190px; border: 2px solid var(--patch); }
.window .wfill { position: absolute; inset: 8px; background: repeating-linear-gradient(135deg, rgba(182,66,42,.12) 0 2px, transparent 2px 10px); }
.window span { position: absolute; left: 0; top: 206px; font: 600 16px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--patch); width: 280px; }

/* quote card */
.quote { position: absolute; border-left: 3px solid var(--ink); padding: 6px 0 6px 40px; }
.quote .qtext { font: 400 42px/1.28 var(--serif); color: var(--ink); text-wrap: balance; }
.quote .qtext::before { content: "“"; } .quote .qtext::after { content: "”"; }
.quote .qsrc { margin-top: 22px; font: 400 18px/1.3 var(--mono); color: var(--ink-3); }

/* timelines */
.timeline { position: absolute; height: 120px; border-top: 1.5px solid var(--ink); }
.timeline .tick { position: absolute; top: -9px; width: 360px; }
.timeline .tick::before { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); }
.timeline .tick.last::before { background: var(--patch); border-color: var(--patch); }
.timeline .tick.old::before { border-color: var(--ink-3); }
.timeline .ty { margin-top: 14px; font: 500 22px/1 var(--mono); color: var(--ink); }
.timeline .tn { margin-top: 10px; font: 400 25px/1.25 var(--serif); color: var(--ink-2); width: 380px; }

/* abstraction stack */
.stack { position: absolute; display: flex; flex-direction: column; gap: 8px; }
.slab { height: 50px; border: 1.5px solid var(--patch); display: flex; align-items: center; padding-left: 22px; font: 500 21px/1 var(--mono); color: var(--patch);
  background: repeating-linear-gradient(135deg, rgba(182,66,42,.06) 0 2px, transparent 2px 11px), var(--card); }
.slab:nth-child(odd) { margin-left: 18px; } .slab:nth-child(3n) { margin-left: 36px; }

/* evidence rows */
.erows { position: absolute; display: flex; flex-direction: column; }
.erow { border-top: 1px solid var(--rule); padding: 22px 0 24px; display: grid; grid-template-columns: 270px 1fr; gap: 20px; }
.erow .elabel { font: 500 18px/1.35 var(--mono); color: var(--ink-3); }
.erow .etext { font: 400 30px/1.3 var(--serif); color: var(--ink); }

/* course pages */
.cells { position: absolute; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 36px; }
.cell { border-top: 1.5px solid var(--ink); padding-top: 16px; }
.cell.key { grid-column: 1 / -1; border-top-color: var(--problem); }
.cell .clabel { font: 600 15px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.cell.key .clabel { color: var(--problem); }
.cell .ctext { font: 400 28px/1.3 var(--serif); color: var(--ink); }
.cell.key .ctext { font-size: 38px; color: var(--problem); }

/* memorize columns */
.mitem { margin-top: 30px; font: 400 38px/1.25 var(--serif); color: var(--ink); min-height: 96px; }
.mitem .strike::after { height: 3px; }
.mitem.keep { color: var(--problem); }

/* three columns */
.tri { position: absolute; display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px; }
.tcol { border-top: 1.5px solid var(--ink); padding-top: 22px; }
.tcol .ttext { margin-top: 16px; font: 400 36px/1.28 var(--serif); color: var(--ink); }

/* judgments */
.jcase { position: absolute; }
.plate.inline { position: relative; width: 100%; height: 270px; }
.plate.inline img { object-position: left center; }
.jtag { margin-top: 22px; font: 700 15px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.jtag.yes { color: var(--problem); } .jtag.no { color: var(--patch); }
.jtext { margin-top: 12px; font: 400 32px/1.3 var(--serif); color: var(--ink); }
.scale { position: absolute; height: 110px; }
.scale .sbar { position: absolute; left: 0; right: 0; top: 40px; height: 2px; background: linear-gradient(90deg, var(--problem), var(--ink-3) 50%, var(--patch)); }
.scale .send { position: absolute; top: 0; font: 600 16px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.scale .send.r { right: 0; }
.scale .smark { position: absolute; top: 32px; width: 2px; height: 18px; background: var(--ink); }
.scale .smark span { position: absolute; top: 28px; left: -140px; width: 280px; text-align: center; font: 400 24px/1.2 var(--serif); color: var(--ink); }
.scale .smark.far span { left: -260px; text-align: right; }
.levers { position: absolute; display: flex; flex-direction: column; gap: 22px; }
.lever { border-top: 1px solid var(--rule); padding-top: 14px; font: 400 30px/1.3 var(--serif); }
.lever .kicker { margin-bottom: 8px; }

/* traceback */
.trace { position: absolute; margin: 0; padding: 30px 34px; background: var(--card); border: 1.5px solid var(--ink); font: 400 22px/1.55 var(--mono); color: var(--ink-2); white-space: pre-wrap; }
.trace .hl { transition: background .6s, color .6s; }
.trace .hl.lit { background: rgba(182,66,42,.14); color: var(--patch); font-weight: 500; }

/* roles */
.roles { position: absolute; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.role { border: 1.5px solid var(--ink); padding: 30px 30px 34px; background: var(--card); transition: opacity .8s, border-color .8s, box-shadow .8s; }
.role .rname { font: 420 52px/1 var(--serif); }
.role .rdesc { margin-top: 14px; font: 400 24px/1.35 var(--sans); color: var(--ink-2); }
.role.dim { opacity: .38; }
.role.boss.lit { border-color: var(--problem); box-shadow: inset 6px 0 0 var(--problem); }
.role.boss.lit .rname { color: var(--problem); }
.duties { position: absolute; display: flex; flex-direction: column; }
.duty { border-top: 1px solid var(--rule); padding: 22px 0 24px; display: grid; grid-template-columns: 64px 1fr; font: 400 36px/1.25 var(--serif); }
.duty .n { font: 500 20px/2 var(--mono); color: var(--ink-3); }

/* touch: no double-tap zoom (pinch zoom stays); taps and swipes navigate (js/engine.js) */
html, body { touch-action: manipulation; }

/* ---------- navigator (js/engine.js): M or the grid button ---------- */
body.nav-open .frame, body.nav-leaving .frame { transition: left 1.1s var(--ease), top 1.1s var(--ease), opacity .5s; }
body.nav-snap .frame { transition: none !important; }
body.nav-open .frame { cursor: pointer; }
body.nav-open .frame::after { content: ""; position: absolute; inset: -34px; border: 0 solid var(--problem); border-radius: 18px; transition: border-width .25s; pointer-events: none; }
body.nav-open .frame.nav-sel::after { border-width: 26px; }
body.nav-leaving .frame:not(.nav-focus) { opacity: 0; }
body.nav-leaving .frame.nav-focus::after { border-width: 0; }
.navlabel { display: none; position: absolute; left: 0; top: 1140px; width: 1920px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 104px/1.1 var(--serif); color: var(--ink-2); pointer-events: none; }
.navlabel b { font-weight: 500; color: var(--problem); margin-right: 28px; font-family: var(--mono); font-size: 92px; }
body.nav-open .navlabel { display: block; }
body.nav-leaving .navlabel { opacity: 0; transition: opacity .3s; }
body.nav-open #chrome { opacity: 0; transition: opacity .4s; }
#navhud { position: absolute; left: 50%; bottom: 34px; transform: translate(-50%, 16px); z-index: 20; opacity: 0; pointer-events: none;
  display: flex; align-items: baseline; gap: 22px; max-width: 1640px; padding: 16px 30px; background: var(--card); border: 1px solid var(--rule);
  box-shadow: 0 16px 40px -20px rgba(0,0,0,.35); transition: opacity .35s, transform .35s var(--ease-out); }
body.nav-open:not(.nav-leaving) #navhud { opacity: 1; transform: translate(-50%, 0); }
#navhud b { font: 500 30px/1 var(--mono); color: var(--problem); }
#navhud b.typing { color: var(--ink); min-width: 2.4ch; }
#navhud b i { font-style: normal; color: var(--problem); animation: navcaret 1s steps(1) infinite; }
@keyframes navcaret { 50% { opacity: 0; } }
#navhud span { font: 400 30px/1.2 var(--serif); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#navhud em { font: 500 15px/1 var(--sans); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
#navbtn { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--card); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; opacity: .35; transition: opacity .2s, transform .2s; }
#navbtn:hover, body.nav-open #navbtn { opacity: 1; }
#navbtn:active { transform: scale(.94); }
@media (hover: none) { #navbtn { opacity: .7; } }
/* the PDF exporter prints with screen media, so hide by its class as well as for print */
@media print { #navbtn, #navhud { display: none !important; } }
html.pdf-export #navbtn, html.pdf-export #navhud { display: none !important; }

/* ---------- jump chips: a real <button data-goto="slide.step"> inside a frame; R returns ---------- */
.jump { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; cursor: pointer; pointer-events: auto;
  font: 600 18px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--ink); border-radius: 0; }
.jump:hover { background: var(--ink); color: var(--card); }
/* a chip that has not appeared yet must not catch a stray click (opacity alone leaves it clickable) */
[data-in]:not(.on) [data-goto], [data-goto][data-in]:not(.on) { pointer-events: none; }
html.pdf-export .jump { display: none; }

/* =================== KSUG deck components =================== */
.blue { color: var(--problem); } .verm { color: var(--patch); }
.numeral { font-size: 360px; color: rgba(27,33,48,.06); }
code { font-family: var(--mono); font-size: .9em; color: var(--ink); background: rgba(27,33,48,.05); padding: 0 .25em; }

/* history */
.hstop .hyear { font: 500 44px/1 var(--mono); color: var(--ink); margin-bottom: 14px; }
.hstop .hname { font: 600 34px/1.15 var(--serif); color: var(--ink); margin-bottom: 10px; }
.hstop .hline { font: 400 26px/1.35 var(--sans); color: var(--ink-2); }

/* column heads */
.colhead { font: 700 18px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.colhead.blue { color: var(--problem); } .colhead.verm { color: var(--patch); }

/* soup and markdown */
pre.soup, pre.mdcard { margin: 0; padding: 28px 30px; height: 520px; box-sizing: border-box; font: 400 25px/1.55 var(--mono); white-space: pre-wrap; }
pre.soup { color: var(--patch); border: 1.5px solid var(--patch); background: var(--patch-soft); letter-spacing: .04em; }
pre.mdcard { color: var(--problem); border: 1.5px solid var(--problem); background: var(--card); box-shadow: inset 6px 0 0 var(--problem); white-space: pre; font-size: 22px; }
pre.mdcard.small-md { height: 300px; font-size: 21px; padding: 22px 22px 22px 30px; }

/* page -> tokens -> markdown */
.minipage { width: 260px; height: 300px; border: 1.5px solid var(--ink); background: var(--card); padding: 26px 24px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.minipage .mp-t { height: 20px; width: 60%; background: var(--ink); }
.minipage .mp-r { height: 8px; background: var(--ink-3); } .minipage .mp-r.s { width: 55%; }
.minipage .mp-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.minipage .mp-g i { height: 22px; border: 1px solid var(--ink-2); }
.tokrow { display: flex; flex-wrap: wrap; gap: 10px; }
.tok { font: 500 26px/1 var(--mono); color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); padding: 12px 12px; white-space: pre; }

/* demo commands */
.authline { font: 400 22px/1.3 var(--mono); color: var(--ink-3); }
.authline b { font-weight: 500; color: var(--ink-2); }
.cmd { box-sizing: border-box; min-height: 132px; padding: 26px 30px 24px 92px; background: var(--card); border: 1.5px solid var(--ink); box-shadow: inset 6px 0 0 var(--ink); display: flex; flex-direction: column; justify-content: center; gap: 10px; position: absolute; }
.cmd .cn { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); font: 500 22px/1 var(--mono); color: var(--ink-3); }
.cmd .cl { font: 400 27px/1.25 var(--mono); color: var(--ink); white-space: pre; }
.cmd .cl.hl { color: var(--problem); font-weight: 500; }
.cmd.final { min-height: 120px; padding-left: 36px; }
.res { box-sizing: border-box; height: 132px; padding: 22px 24px; border: 1.5px solid; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.res .rt { font: 700 16px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.res .rv { font: 500 27px/1.2 var(--serif); color: var(--ink); }
.res.ok { border-color: var(--problem); background: var(--problem-soft); } .res.ok .rt { color: var(--problem); }
.res.bad { border-color: var(--patch); background: var(--patch-soft); } .res.bad .rt { color: var(--patch); }

/* flips */
.fhead { display: grid; grid-template-columns: 340px 560px 1fr; font: 700 18px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.frow { display: grid; grid-template-columns: 340px 560px 1fr; align-items: baseline; border-top: 1.5px solid var(--ink); padding-top: 30px; height: 140px; box-sizing: border-box; }
.frow .fl { font: 600 20px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.frow .fo { font: 400 34px/1.25 var(--serif); color: var(--ink-2); padding-right: 40px; }
.frow .fn { font: 500 34px/1.25 var(--serif); color: var(--problem); }
.strike.struck { color: var(--ink-3); transition: color .8s; }

/* schools */
.receipt { display: flex; align-items: baseline; gap: 36px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 22px 0; }
.receipt .rk { font: 600 17px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); width: 320px; flex: none; }
.receipt .rq { font: italic 400 40px/1.15 var(--serif); color: var(--ink); }
.school { box-sizing: border-box; height: 410px; padding: 30px 34px; border: 1.5px solid var(--ink); background: var(--card); }
.school.gen { border-color: var(--problem); box-shadow: inset 6px 0 0 var(--problem); }
.school .sh { font: 600 40px/1.1 var(--serif); margin-bottom: 26px; }
.school.gen .sh { color: var(--problem); }
.steps3 { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.steps3 div { border: 1.5px solid var(--ink-2); padding: 14px 16px; font: 500 24px/1.15 var(--sans); background: var(--paper); }
.steps3 div small { display: block; font: 400 19px/1.3 var(--sans); color: var(--ink-3); margin-top: 4px; }
.steps3 div.wide { flex: 1; border-color: var(--problem); color: var(--problem); }
.steps3 span { font: 300 28px var(--serif); color: var(--ink-3); }
.school .sx { font: italic 400 26px/1.3 var(--serif); color: var(--ink-2); margin-bottom: 16px; }
.school .sc { font: 400 26px/1.35 var(--sans); color: var(--ink); position: absolute; left: 34px; right: 34px; bottom: 30px; }
.school { position: absolute; }
.names { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.names span { font: 500 22px/1 var(--mono); padding: 10px 12px; border: 1px solid var(--rule); color: var(--ink-2); transition: all .6s; }
.names span.us.mark { background: var(--problem); color: var(--card); border-color: var(--problem); }

/* reader */
.bigurl { font: 400 46px/1.2 var(--mono); color: var(--ink); white-space: nowrap; }
.bigurl.hdr { font-size: 36px; color: var(--ink-2); } .bigurl.hdr b { color: var(--problem); font-weight: 500; }

/* cost */
.legend { font: 500 22px/1 var(--sans); color: var(--ink-2); display: flex; align-items: center; gap: 12px; }
.legend i { display: inline-block; width: 26px; height: 18px; border: 1.5px solid; }
.legend .lg-i { border-color: var(--ink-2); background: repeating-linear-gradient(45deg, var(--ink-3) 0 2px, transparent 2px 7px); }
.legend .lg-b { border-color: var(--problem); background: repeating-linear-gradient(45deg, var(--problem) 0 3px, transparent 3px 7px); margin-left: 24px; }
.formula { font: 500 38px/1.35 var(--mono); color: var(--ink); border-left: 3px solid var(--ink); padding-left: 26px; }
.band { background: var(--ink); color: var(--paper); box-sizing: border-box; padding: 30px 160px; display: flex; align-items: baseline; gap: 40px; }
.band .btag { font: 700 17px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(242,237,226,.6); flex: none; }
.band .bt { font: 500 46px/1.2 var(--serif); }

/* tricks */
.trick-h { font: 600 40px/1.1 var(--serif); color: var(--ink); display: flex; align-items: baseline; gap: 18px; }
.trick-h .pn { font: 500 24px/1 var(--mono); color: var(--ink-3); }
.trick-h small { font: 500 20px/1 var(--mono); color: var(--ink-3); }
.bignum { display: grid; grid-template-columns: 210px 1fr; align-items: center; border-top: 1.5px solid var(--ink); padding-top: 22px; }
.bignum b { font: 500 84px/1 var(--mono); color: var(--problem); }
.bignum span { font: 400 26px/1.35 var(--sans); color: var(--ink); }
.vrule { width: 1px; height: 600px; background: var(--rule); }

/* frontier */
.lad-title { font: 600 36px/1.1 var(--serif); color: var(--ink); }
.rung2 { display: grid; grid-template-columns: 50px 170px 1fr; align-items: baseline; }
.rung2 i { width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); display: block; transform: translateY(2px); }
.rung2 .sc { font: 500 40px/1 var(--mono); color: var(--ink-2); }
.rung2 .nm { font: 500 34px/1.1 var(--serif); color: var(--ink); }
.rung2 .nt { grid-column: 3; font: 400 22px/1.3 var(--sans); color: var(--ink-3); margin-top: 6px; }
.rung2.us i { background: var(--problem); width: 24px; height: 24px; margin-left: -3px; }
.rung2.us .sc, .rung2.us .nm { color: var(--problem); }
.rung2.other .sc { font: italic 400 32px/1 var(--serif); color: var(--ink-2); }
.rung2.base i { background: transparent; border: 2px solid var(--ink-3); }

/* limits */
.rulelist.limits li .n { color: var(--patch); }

/* close */
.jtag { font: 700 16px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--problem); border-bottom: 2px solid var(--problem); padding-bottom: 10px; }
.pstage.blue-st { border-color: var(--problem); box-shadow: inset 6px 0 0 var(--problem); color: var(--problem); }
.pstage.dashed { border-style: dashed; color: var(--ink-2); background: transparent; }
.exits { display: flex; gap: 60px; font: 400 30px/1.3 var(--sans); color: var(--ink-2); }
.exits b { color: var(--ink); font-weight: 600; }
.pull { display: flex; align-items: baseline; gap: 40px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 26px 0; }
.pull .btag { font: 700 17px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); flex: none; }
.pull .bt { font: 500 46px/1.2 var(--serif); color: var(--ink); }
.pstage::after { font-size: 34px !important; color: var(--ink) !important; right: -24px !important; }
.exits { font-size: 26px !important; color: var(--ink-3) !important; } .exits b { font-weight: 500 !important; color: var(--ink-2) !important; }
.source { font-size: 18px; color: var(--ink-2); }
