/* ==========================================================================
   Lecture deck engine: shared base styles
   Every deck defines its own tokens on :root (colors, fonts, radii, shadows)
   and adds deck-specific styles. This file only uses tokens.
   Canvas: 1920 x 1080, scaled to the viewport by deck.js.
   ========================================================================== */

:root {
  /* palette (each deck overrides these) */
  --bg: #f1f2f3;
  --surface: #ffffff;
  --surface-2: #e6e8ea;
  --ink: #101214;
  --ink-2: #4c535b;
  --ink-3: #8b939c;
  --accent: #0b7ea3;
  --accent-ink: #ffffff;
  --good: #16865a;
  --bad: #cf3a3a;
  --warn: #c77700;
  --letterbox: #000000;

  /* type */
  --f-display: system-ui, sans-serif;
  --f-body: system-ui, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* shape: decks pick sharp (0) or Apple-like continuous corners */
  --card-r: 0px;
  --pill-r: 999px;
  --tag-r: 0px;
  --shadow-1: 0 1px 1px rgba(16, 18, 20, .03), 0 2px 6px rgba(16, 18, 20, .04), 0 14px 32px -12px rgba(16, 18, 20, .12);
  --shadow-2: 0 1px 1px rgba(16, 18, 20, .04), 0 8px 18px rgba(16, 18, 20, .06), 0 40px 80px -32px rgba(16, 18, 20, .28);
  --hairline: inset 0 0 0 1px rgba(16, 18, 20, .06);

  /* chrome (top rail, counters) follows the slide tone */
  --chrome-fg: var(--ink);
  --chrome-dim: var(--ink-3);
  --chrome-accent: var(--accent);

  /* code */
  --code-bg: #0e1116;
  --code-fg: #e6e8eb;
  --code-dim: #6d7682;
  --tok-keyword: #ff8fb1;
  --tok-string: #a8e6a1;
  --tok-fn: #8cb8ff;
  --tok-tag: #7fd8d0;
  --tok-attr: #f7c86a;
  --tok-num: #f59f6d;
  --tok-punct: #96a0ab;
  --tok-class: #f7c86a;
  --tok-hl: rgba(255, 255, 255, .08);
  --tok-add: rgba(61, 220, 151, .14);
  --tok-del: rgba(255, 93, 115, .14);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--letterbox);
  color: var(--ink);
  font-family: var(--f-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .5s ease;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- stage ---------- */
.deck { position: fixed; inset: 0; overflow: hidden; }
.stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center center;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.slide {
  position: absolute; inset: 0;
  padding: 136px 144px 118px;
  display: flex; flex-direction: column;
  background: var(--slide-bg, var(--bg));
  color: var(--ink);
  opacity: 0; visibility: hidden;
  transform: translate3d(0, 18px, 0);
  transition: opacity .5s ease, transform .7s var(--ease-out), visibility 0s linear .5s;
}
.slide.is-active {
  opacity: 1; visibility: visible; transform: none; z-index: 2;
  transition: opacity .5s ease, transform .7s var(--ease-out), visibility 0s;
}
.slide.is-before { transform: translate3d(0, -18px, 0); }
.slide .notes { display: none; }
.slide[data-tone="dark"] { color: var(--ink-on-dark, #f4f5f6); }

/* fragments: hidden until their step */
[data-step] { transition: opacity .45s ease, transform .6s var(--ease-out), filter .45s ease; }
[data-step]:not(.is-shown) { opacity: 0; transform: translate3d(0, 14px, 0); pointer-events: none; }
[data-step].is-shown { opacity: 1; transform: none; }
[data-step][data-fx="dim"]:not(.is-shown) { opacity: .18; transform: none; pointer-events: none; }
[data-step][data-fx="blur"]:not(.is-shown) { opacity: .25; filter: blur(14px); transform: none; }
.deck.show-all [data-step] { opacity: 1 !important; transform: none !important; filter: none !important; }

/* ---------- chrome ---------- */
.chrome { position: absolute; inset: 0; pointer-events: none; z-index: 20; color: var(--chrome-fg); }
.stage[data-tone="dark"] { --chrome-fg: #f3f4f5; --chrome-dim: rgba(243, 244, 245, .5); --chrome-accent: var(--accent-on-dark, var(--accent)); }
.chrome > * { pointer-events: auto; }
.chrome__top {
  position: absolute; left: 144px; right: 64px; top: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.chrome__brand { display: flex; align-items: center; gap: 28px; min-width: 0; }
.chrome__code {
  font: 600 15px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--chrome-fg); white-space: nowrap;
}
.rail { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rail li {
  font: 500 14px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--chrome-dim); padding: 9px 10px; white-space: nowrap;
  transition: color .3s ease;
}
.rail li.is-past { color: color-mix(in srgb, var(--chrome-fg) 62%, transparent); }
.rail li.is-current { color: var(--chrome-accent); }
.rail li.is-current::before { content: "["; margin-right: 6px; }
.rail li.is-current::after { content: "]"; margin-left: 6px; }
/* right group and nav sit on a frosted pill so they stay readable over photos */
.chrome__right, .chrome__nav {
  display: flex; align-items: center; gap: 6px; padding: 5px;
  border-radius: var(--pill-r);
  background: var(--chrome-glass, color-mix(in srgb, var(--bg) 72%, transparent));
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.stage[data-tone="dark"] { --chrome-glass: rgba(12, 14, 18, .42); }
.chrome__clock { font: 500 15px/1 var(--f-mono); letter-spacing: .1em; color: var(--chrome-fg); opacity: .62; font-variant-numeric: tabular-nums; padding: 0 12px 0 14px; }
.break-btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 20px 0 16px;
  border: 0; border-radius: var(--pill-r);
  background: color-mix(in srgb, var(--chrome-fg) 9%, transparent);
  color: var(--chrome-fg);
  font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  transition: background-color .25s ease, transform .25s var(--ease);
}
.break-btn:hover { background: color-mix(in srgb, var(--chrome-fg) 15%, transparent); }
.break-btn:active { transform: scale(.97); }
.break-btn svg { width: 22px; height: 22px; }
.break-btn.is-running { background: var(--chrome-accent); color: var(--accent-ink); }
.break-btn .break-btn__time { font-variant-numeric: tabular-nums; }

.chrome__bottom {
  position: absolute; left: 144px; right: 64px; bottom: 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.chrome__title { font: 500 14px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--chrome-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chrome__nav button {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: var(--pill-r); background: transparent; color: var(--chrome-dim);
  transition: color .2s ease, background-color .2s ease;
}
.chrome__nav button:hover { color: var(--chrome-fg); background: color-mix(in srgb, var(--chrome-fg) 8%, transparent); }
.chrome__nav svg { width: 20px; height: 20px; }
.chrome__count { font: 500 15px/1 var(--f-mono); letter-spacing: .08em; color: var(--chrome-fg); min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; padding: 0 14px 0 4px; }
.chrome__count span { color: var(--chrome-dim); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--chrome-fg) 8%, transparent); }
.progress span { display: block; height: 100%; width: 0; background: var(--chrome-accent); transition: width .6s var(--ease-out); }
.credit {
  position: absolute; z-index: 3; right: 64px; bottom: 82px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--chrome-dim); opacity: .8;
}
.stage[data-tone="dark"] .credit { color: rgba(255, 255, 255, .55); }
.deck.no-chrome .chrome { opacity: 0; pointer-events: none; }

/* ---------- typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font: 600 18px/1.2 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2); margin: 0;
}
.eyebrow b { color: var(--accent); font-weight: 600; }
[data-tone="dark"] .eyebrow { color: rgba(255, 255, 255, .62); }
.display { font-family: var(--f-display); font-size: 156px; line-height: .9; letter-spacing: -.035em; font-weight: 700; margin: 0; text-wrap: balance; }
.h1 { font-family: var(--f-display); font-size: 96px; line-height: .98; letter-spacing: -.03em; font-weight: 700; margin: 0; text-wrap: balance; }
.h2 { font-family: var(--f-display); font-size: 68px; line-height: 1.04; letter-spacing: -.025em; font-weight: 700; margin: 0; text-wrap: balance; }
.h3 { font-family: var(--f-display); font-size: 44px; line-height: 1.12; letter-spacing: -.015em; font-weight: 650; margin: 0; text-wrap: balance; }
.h4 { font-family: var(--f-body); font-size: 32px; line-height: 1.2; letter-spacing: -.01em; font-weight: 650; margin: 0; }
.lead { font-size: 36px; line-height: 1.36; color: var(--ink-2); margin: 0; max-width: 1180px; text-wrap: pretty; }
.p { font-size: 28px; line-height: 1.48; margin: 0; text-wrap: pretty; }
.small { font-size: 22px; line-height: 1.45; margin: 0; }
.tiny { font-size: 18px; line-height: 1.4; margin: 0; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: var(--accent); }
[data-tone="dark"] .lead, [data-tone="dark"] .muted { color: rgba(255, 255, 255, .72); }
[data-tone="dark"] .faint { color: rgba(255, 255, 255, .5); }
.upper { text-transform: uppercase; letter-spacing: .12em; }
.nums { font-variant-numeric: tabular-nums; }
code, .code-inline {
  font-family: var(--f-mono); font-size: .86em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: .08em .32em; border-radius: 6px;
}
[data-tone="dark"] code { background: rgba(255, 255, 255, .1); }
pre code, .code code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
:not(pre) > code { white-space: nowrap; }

/* ---------- layout ---------- */
.stack { display: flex; flex-direction: column; gap: var(--gap, 24px); }
.row { display: flex; align-items: center; gap: var(--gap, 24px); flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grid { display: grid; gap: var(--gap, 32px); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 96px; align-items: start; }
.split-7-5 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 88px; align-items: start; }
.split-5-7 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 88px; align-items: start; }
.split-4-8 { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 80px; align-items: start; }
.items-center { align-items: center; }
.items-end { align-items: end; }
.fill { flex: 1 1 auto; min-height: 0; }
.mt-auto { margin-top: auto; }
.mt-s { margin-top: 16px; } .mt-m { margin-top: 32px; } .mt-l { margin-top: 56px; } .mt-xl { margin-top: 88px; }
.w-60 { max-width: 60%; } .w-70 { max-width: 70%; } .w-50 { max-width: 50%; }
.center-all { justify-content: center; align-items: center; text-align: center; }
.slide.v-center { justify-content: center; }
.slide.v-end { justify-content: flex-end; }
.rel { position: relative; }
.min0 { min-width: 0; }

/* ---------- surfaces ---------- */
.card {
  position: relative;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  border-radius: var(--card-r);
  padding: 36px 38px;
  min-width: 0;
}
.card.is-raised { box-shadow: var(--shadow-2); }
.card.is-flat { box-shadow: none; background: var(--surface-2); }
.card.is-ghost { box-shadow: none; background: transparent; padding: 0; }
.squircle { border-radius: var(--r-apple, 28px); }
@supports (corner-shape: squircle) {
  .squircle { corner-shape: squircle; border-radius: calc(var(--r-apple, 28px) * 1.9); }
}
.card__icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent); margin-bottom: 22px; }
.card__icon svg { width: 34px; height: 34px; stroke-width: 1.6; }
.card__k { font: 600 15px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.card h3, .card .h4 { margin: 0 0 12px; }
.card p { margin: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 17px/1 var(--f-mono); letter-spacing: .02em;
  padding: 9px 12px; border-radius: var(--tag-r);
  background: var(--tag-bg, color-mix(in srgb, var(--ink) 7%, transparent));
  color: var(--tag-fg, var(--ink-2));
  white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip.is-accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em;
  font: 600 .7em/1 var(--f-mono); padding: .3em .45em; border-radius: 8px;
  background: var(--surface); box-shadow: 0 1px 0 rgba(0, 0, 0, .18), var(--hairline); color: var(--ink);
}

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; }
.ico-l svg, svg.ico-l { width: 40px; height: 40px; }

.callout {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 28px 32px; background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-radius: var(--card-r);
}
.callout > svg { width: 40px; height: 40px; color: var(--accent); }
.callout.is-warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.callout.is-warn > svg { color: var(--warn); }
.callout.is-bad { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.callout.is-bad > svg { color: var(--bad); }
.callout.is-good { background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.callout.is-good > svg { color: var(--good); }

/* lists */
/* lists use block layout so mixed text + inline code stays one paragraph */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap, 18px); }
.list li { position: relative; padding-left: 56px; font-size: 28px; line-height: 1.42; }
.list li > svg:first-child { position: absolute; left: 0; top: .16em; width: 30px; height: 30px; color: var(--accent); }
.list.is-tight li { font-size: 24px; }
.list-num { counter-reset: n; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap, 22px); }
.list-num > li { counter-increment: n; position: relative; padding-left: 72px; font-size: 28px; line-height: 1.42; }
.list-num > li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .42em; font: 600 20px/1 var(--f-mono); color: var(--accent); letter-spacing: .06em; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 24px; }
.table th { text-align: left; font: 600 15px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 0 20px 16px 0; }
.table td { padding: 18px 20px 18px 0; vertical-align: top; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent); }
.table td:first-child { font-weight: 600; }

/* full-bleed media */
.bleed { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.bleed img { width: 100%; height: 100%; object-fit: cover; }
.bleed.is-right { left: auto; width: 46%; }
.bleed.is-left { right: auto; width: 46%; }
.shade { position: absolute; inset: 0; pointer-events: none; }
.shade.to-right { background: linear-gradient(90deg, rgba(6, 8, 12, .9) 0%, rgba(6, 8, 12, .62) 42%, rgba(6, 8, 12, .08) 100%); }
.shade.to-top { background: linear-gradient(0deg, rgba(6, 8, 12, .92) 0%, rgba(6, 8, 12, .45) 46%, rgba(6, 8, 12, .1) 100%); }
.shade.full { background: rgba(6, 8, 12, .62); }
.shade.deep { background: linear-gradient(90deg, rgba(6, 8, 12, .94) 0%, rgba(6, 8, 12, .78) 50%, rgba(6, 8, 12, .5) 100%); }
.slide > :not(.bleed):not(.credit):not(.notes) { position: relative; z-index: 1; }
.grain::after {
  content: ""; position: absolute; inset: -50%; pointer-events: none; z-index: 1; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

/* marquee */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__track { display: inline-flex; gap: 48px; animation: marquee var(--marquee-speed, 38s) linear infinite; }
.marquee__track > * { flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* browser frame mock */
.frame { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; min-width: 0; }
.frame__bar { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 18px; background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.frame__dots { display: flex; gap: 8px; }
.frame__dots i { width: 13px; height: 13px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 16%, transparent); }
.frame__url { flex: 1; height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 9px; background: var(--surface); font: 500 17px/1 var(--f-mono); color: var(--ink-2); box-shadow: var(--hairline); min-width: 0; overflow: hidden; white-space: nowrap; }
.frame__url svg { width: 16px; height: 16px; flex: none; }
.frame__body { position: relative; }

/* terminal */
.term {
  background: var(--term-bg, #0d0f12); color: var(--term-fg, #e8eaed);
  font: 500 24px/1.6 var(--f-mono); padding: 26px 30px; border-radius: var(--term-r, 14px);
  box-shadow: var(--shadow-2); min-width: 0; overflow: hidden;
}
.term__bar { display: flex; gap: 8px; margin: -6px 0 18px; }
.term__bar i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.term__line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.term__prompt { color: var(--term-prompt, #7ee2b8); margin-right: 14px; }
.term__out { color: rgba(232, 234, 237, .58); }
.term__caret { display: inline-block; width: .6em; height: 1.05em; vertical-align: -.16em; background: currentColor; animation: caret 1s steps(1) infinite; margin-left: 2px; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- code blocks ---------- */
.code {
  position: relative; margin: 0; min-width: 0;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--code-r, 16px);
  box-shadow: var(--shadow-2);
  font: 500 var(--code-size, 25px)/1.55 var(--f-mono);
  font-variant-ligatures: none;
  padding: 30px 0 30px;
  overflow: hidden;
  tab-size: 2;
}
.code__file {
  display: flex; align-items: center; gap: 10px; margin: -6px 34px 18px;
  font: 500 16px/1 var(--f-mono); letter-spacing: .04em; color: var(--code-dim);
}
.code__file svg { width: 16px; height: 16px; }
.code code { display: block; font: inherit; white-space: pre; }
.code .line { display: block; padding: 0 34px; transition: opacity .35s ease, background-color .35s ease; }
.code[data-ln] code { counter-reset: ln; }
.code[data-ln] .line { padding-left: 88px; position: relative; }
.code[data-ln] .line::before { counter-increment: ln; content: counter(ln); position: absolute; left: 24px; width: 40px; text-align: right; color: var(--code-dim); opacity: .55; }
.code .line.is-hl { background: var(--tok-hl); box-shadow: inset 4px 0 0 var(--accent-code, var(--accent)); }
.code.is-walking .line:not(.is-hl) { opacity: .32; }
.code .line.is-add { background: var(--tok-add); }
.code .line.is-del { background: var(--tok-del); text-decoration: line-through; text-decoration-color: rgba(255, 93, 115, .6); }
.code.is-sm { --code-size: 21px; }
.code.is-xs { --code-size: 18px; }
.code.is-lg { --code-size: 30px; }
.code .token.comment, .code .token.prolog, .code .token.doctype { color: var(--code-dim); font-style: italic; }
.code .token.keyword, .code .token.important, .code .token.atrule, .code .token.module, .code .token.control-flow { color: var(--tok-keyword); }
.code .token.string, .code .token.template-string, .code .token.char, .code .token.attr-value { color: var(--tok-string); }
.code .token.function, .code .token.method { color: var(--tok-fn); }
.code .token.tag, .code .token.selector { color: var(--tok-tag); }
.code .token.tag .token.class-name { color: var(--tok-tag); }
.code .token.attr-name, .code .token.property { color: var(--tok-attr); }
.code .token.number, .code .token.boolean, .code .token.constant { color: var(--tok-num); }
.code .token.punctuation, .code .token.operator { color: var(--tok-punct); }
.code .token.class-name, .code .token.builtin { color: var(--tok-class); }
.code .token.parameter { color: var(--code-fg); }
.code .token.script, .code .token.plain-text { color: var(--code-fg); }
.code .token.tag .token.punctuation { color: var(--tok-punct); }

/* ---------- widgets ---------- */
/* quiz */
.quiz { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.quiz__q { font-size: 34px; line-height: 1.3; font-weight: 600; margin: 0 0 8px; }
.quiz__opts { display: grid; gap: 14px; }
.quiz__opts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quiz__opt {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 36px; align-items: center; gap: 18px;
  text-align: left; border: 0; padding: 20px 24px;
  background: var(--surface); color: var(--ink); border-radius: var(--card-r);
  box-shadow: var(--shadow-1); font-size: 26px; line-height: 1.35;
  transition: transform .25s var(--ease), background-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}
.quiz__opt:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.quiz__opt .quiz__key {
  width: 44px; height: 44px; display: grid; place-items: center;
  font: 600 18px/1 var(--f-mono); color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: calc(var(--card-r) * .5);
}
.quiz__opt .quiz__mark svg { width: 30px; height: 30px; opacity: 0; transition: opacity .3s ease; }
.quiz__opt code { font-size: .92em; white-space: pre-wrap; }
.quiz.is-answered .quiz__opt { pointer-events: none; }
.quiz.is-answered .quiz__opt:not(.is-correct):not(.is-picked) { opacity: .45; }
.quiz__opt.is-correct { background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.quiz__opt.is-correct .quiz__key { background: var(--good); color: #fff; }
.quiz__opt.is-correct .quiz__mark svg { opacity: 1; color: var(--good); }
.quiz__opt.is-wrong { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.quiz__opt.is-wrong .quiz__key { background: var(--bad); color: #fff; }
.quiz__opt.is-wrong .quiz__mark svg { opacity: 1; color: var(--bad); }
.quiz__explain { font-size: 24px; line-height: 1.45; color: var(--ink-2); padding: 4px 0 0; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .5s var(--ease-out); }
.quiz.is-answered .quiz__explain { opacity: 1; transform: none; }
.quiz__reset { align-self: flex-start; border: 0; background: none; padding: 6px 0; font: 500 15px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.quiz__reset:hover { color: var(--ink); }
[data-tone="dark"] .quiz__opt { background: rgba(255, 255, 255, .06); color: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
[data-tone="dark"] .quiz__opt .quiz__key { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }

/* order (drag to sort) */
.order { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.order__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.order__item {
  display: grid; grid-template-columns: 34px 54px minmax(0, 1fr) 34px; align-items: center; gap: 12px;
  padding: 14px 20px 14px 14px; background: var(--surface); border-radius: var(--card-r);
  box-shadow: var(--shadow-1); font: 500 24px/1.3 var(--f-mono); color: var(--ink);
  cursor: grab; user-select: none; touch-action: none;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.order__item:focus-visible { outline-offset: 2px; }
.order__item.is-dragging { cursor: grabbing; box-shadow: var(--shadow-2); z-index: 5; position: relative; transition: none; }
.order__grip svg { width: 22px; height: 22px; color: var(--ink-3); }
.order__n { font: 600 17px/1 var(--f-mono); color: var(--ink-3); letter-spacing: .06em; }
.order__item .order__mark svg { width: 26px; height: 26px; opacity: 0; }
.order__item.is-right { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.order__item.is-right .order__mark svg { opacity: 1; color: var(--good); }
.order__item.is-wrongpos { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.order__item.is-wrongpos .order__mark svg { opacity: 1; color: var(--bad); }
.order__item code { background: none; padding: 0; font-size: 1em; }
.order__item small { display: block; font: 400 17px/1.3 var(--f-body); color: var(--ink-2); margin-top: 4px; }
.order__bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.order.is-compact .order__list { gap: 8px; }
.order.is-compact .order__item { padding: 8px 18px 8px 12px; font-size: 21px; }
.order.is-compact .order__item small { font-size: 15px; margin-top: 2px; }

/* generic button used by widgets */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 22px; border: 0;
  border-radius: var(--btn-r, var(--card-r));
  background: var(--ink); color: var(--bg);
  font: 600 16px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  transition: transform .2s var(--ease), background-color .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.is-ghost { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.btn.is-accent { background: var(--accent); color: var(--accent-ink); }
.btn[disabled] { opacity: .4; pointer-events: none; }
[data-tone="dark"] .btn { background: #f4f5f6; color: #111; }
[data-tone="dark"] .btn.is-ghost { background: rgba(255, 255, 255, .1); color: #fff; }
[data-tone="dark"] .btn.is-accent { background: var(--accent-on-dark, var(--accent)); color: var(--accent-ink); }

/* hotspots over a screenshot */
.hotspots { position: relative; margin: 0; min-width: 0; line-height: 0; }
.hotspots > img { width: 100%; height: auto; }
.hs {
  position: absolute; border: 0; padding: 0; margin: 0; background: transparent;
  left: calc(var(--x) / var(--w) * 100%); top: calc(var(--y) / var(--h) * 100%);
  width: calc(var(--hw) / var(--w) * 100%); height: calc(var(--hh) / var(--h) * 100%);
  box-shadow: inset 0 0 0 2px var(--hs-line, rgba(66, 133, 244, .95));
  background: var(--hs-fill, rgba(111, 168, 220, .30));
  line-height: 1.2;
}
.hs__tip {
  position: absolute; left: -2px; bottom: calc(100% + 6px); z-index: 10;
  display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap;
  padding: 7px 11px; border-radius: 6px;
  background: var(--hs-tip-bg, #202124); color: #fff;
  font: 500 16px/1.2 var(--f-mono); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.hs__tip b { color: var(--hs-tag, #c58af9); font-weight: 600; }
.hs__tip span { color: rgba(255, 255, 255, .6); font-size: 14px; }
.hs.tip-below .hs__tip { bottom: auto; top: calc(100% + 6px); }
.hs.tip-inside .hs__tip { bottom: auto; top: 8px; left: 8px; }
.hs.tip-left .hs__tip { bottom: auto; top: -2px; left: auto; right: calc(100% + 10px); }
.hs.tip-right .hs__tip { bottom: auto; top: -2px; left: calc(100% + 10px); }
.hs.is-alt { --hs-line: rgba(52, 168, 83, .95); --hs-fill: rgba(147, 196, 125, .28); }
.hs.is-warm { --hs-line: rgba(232, 135, 30, .95); --hs-fill: rgba(246, 178, 107, .30); }

/* flip cards */
.flip { position: relative; perspective: 1600px; cursor: pointer; min-width: 0; min-height: var(--flip-h, 300px); }
.flip__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s var(--ease-out); }
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; gap: 16px; padding: 30px 32px;
  background: var(--surface); border-radius: var(--card-r); box-shadow: var(--shadow-1); overflow: hidden;
}
.flip__back { transform: rotateY(180deg); background: var(--flip-back, var(--ink)); color: var(--flip-back-ink, var(--bg)); }
.flip__k { font: 600 15px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; }
.flip__back .flip__k { color: color-mix(in srgb, var(--flip-back-ink, var(--bg)) 60%, transparent); }
.flip .code { box-shadow: none; --code-size: 21px; padding: 18px 0; border-radius: calc(var(--card-r) * .6); }
.flip .code .line { padding: 0 20px; }

/* timer chip */
.timer {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 10px 12px 10px 22px; border-radius: var(--pill-r);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font: 600 30px/1 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink);
}
.timer button { width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.timer button.is-ghost { background: transparent; color: var(--ink-2); }
.timer button svg { width: 22px; height: 22px; }
.timer.is-running { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.timer.is-done { background: var(--accent); color: var(--accent-ink); animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.04); } }
[data-tone="dark"] .timer { background: rgba(255, 255, 255, .1); color: #fff; }
[data-tone="dark"] .timer button { background: #fff; color: #111; }

/* tabs (generic switcher) */
.tabs__bar { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs__btn {
  border: 0; padding: 12px 18px; border-radius: var(--pill-r);
  background: transparent; color: var(--ink-2);
  font: 600 15px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease;
}
.tabs__btn:hover { color: var(--ink); }
.tabs__btn.is-on { background: var(--ink); color: var(--bg); }
.tabs__panel { display: none; }
.tabs__panel.is-on { display: block; animation: fadeUp .5s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* reveal button (answer under a cover) */
.reveal-box { position: relative; }
.reveal-box__cover {
  position: absolute; inset: 0; z-index: 2; border: 0; border-radius: inherit;
  display: grid; place-items: center; background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: blur(12px); color: var(--ink-2);
  font: 600 16px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  transition: opacity .4s ease;
}
.reveal-box.is-open .reveal-box__cover { opacity: 0; pointer-events: none; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: none; }
.overlay.is-open { display: block; }

/* overview */
.overview { background: color-mix(in srgb, var(--letterbox) 86%, transparent); backdrop-filter: blur(18px); overflow: auto; padding: 56px 64px; color: #fff; }
.overview__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.overview__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.overview__item {
  display: flex; flex-direction: column; gap: 10px; text-align: left; border: 0;
  padding: 16px 16px 18px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: #fff; min-height: 104px;
  transition: background-color .2s ease, transform .2s var(--ease);
}
.overview__item:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.overview__item.is-current { background: #fff; color: #111; }
.overview__item small { font: 600 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.overview__item span { font-size: 16px; line-height: 1.3; }

/* help */
.help { background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); }
.help__box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 92vw); padding: 32px 36px; border-radius: 18px; background: #fff; color: #111; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.help__box h2 { margin: 0 0 18px; font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #666; }
.help__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 16px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06); }
.help__row .kbd { font-size: 14px; }

/* notes drawer (inside stage) */
.notes-drawer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  max-height: 46%; overflow: auto; padding: 32px 144px 80px;
  background: rgba(14, 16, 20, .94); color: #e9ebee; backdrop-filter: blur(14px);
  font-size: 24px; line-height: 1.5; transform: translateY(100%); transition: transform .45s var(--ease-out);
}
.notes-drawer.is-open { transform: none; }
.notes-drawer h2 { margin: 0 0 12px; font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(233, 235, 238, .55); }
.notes-drawer p, .notes-drawer li { margin: 0 0 10px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 20px);
  padding: 14px 20px; border-radius: 12px; background: #15171b; color: #fff;
  font: 500 15px/1.3 var(--f-body); box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- break overlay ---------- */
.break { background: #07080a; color: #f5f2ec; overflow: hidden; }
.break__bg { position: absolute; inset: 0; }
.break__bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06); transition: opacity 1.6s ease, transform 14s linear;
}
.break__bg img.is-on { opacity: .62; transform: scale(1); }
.break__shade { position: absolute; inset: 0; background: radial-gradient(120% 90% at 20% 30%, rgba(7, 8, 10, .25) 0%, rgba(7, 8, 10, .82) 70%), linear-gradient(0deg, rgba(7, 8, 10, .85), rgba(7, 8, 10, 0) 55%); }
.break .grain::after { opacity: .09; }
.break__stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale, 1)); transform-origin: center;
  padding: 64px 96px 72px; display: flex; flex-direction: column;
}
.break__top { display: flex; align-items: center; justify-content: space-between; font: 600 16px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: rgba(245, 242, 236, .7); }
.break__top .break__label { display: flex; align-items: center; gap: 14px; }
.break__top .break__label svg { width: 24px; height: 24px; color: var(--break-accent, #f2b45c); }
.break__close { border: 0; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.break__close:hover { background: rgba(255, 255, 255, .18); }
.break__close svg { width: 18px; height: 18px; }
.break__main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.break__kicker { font: 500 30px/1.2 var(--f-body); color: rgba(245, 242, 236, .8); margin: 0; }
.break__time {
  font-family: var(--break-font, var(--f-display)); font-weight: 700;
  font-size: 380px; line-height: .86; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; margin: 0; color: #fff;
  transition: color .6s ease;
}
.break.is-last-minute .break__time { color: var(--break-accent, #f2b45c); }
.break__meta { display: flex; align-items: center; gap: 28px; font: 600 18px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(245, 242, 236, .7); }
.break__meta b { color: #fff; font-weight: 600; }
.break__adj { display: flex; gap: 8px; }
.break__adj button { border: 0; height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: 600 15px/1 var(--f-mono); letter-spacing: .08em; }
.break__adj button:hover { background: rgba(255, 255, 255, .2); }
.break__player {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 36px;
  padding: 26px 30px; border-radius: 26px;
  background: rgba(20, 20, 22, .55); backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .35);
}
@supports (corner-shape: squircle) { .break__player { corner-shape: squircle; border-radius: 52px; } }
.break__play { width: 84px; height: 84px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; transition: transform .2s var(--ease); }
.break__play:hover { transform: scale(1.05); }
.break__play svg { width: 34px; height: 34px; }
.break__now { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.break__genres { display: flex; gap: 6px; }
.break__genres button { border: 0; padding: 10px 16px; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .6); font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.break__genres button.is-on { background: rgba(255, 255, 255, .14); color: #fff; }
.break__stations { display: flex; gap: 8px; flex-wrap: wrap; }
.break__stations button {
  border: 0; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .82);
  font: 500 17px/1 var(--f-body);
}
.break__stations button:hover { background: rgba(255, 255, 255, .12); }
.break__stations button.is-on { background: #fff; color: #111; }
.break__stations button small { font: 600 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.break__status { font: 500 15px/1.3 var(--f-mono); letter-spacing: .06em; color: rgba(255, 255, 255, .6); display: flex; align-items: center; gap: 10px; }
.break__status .live { width: 9px; height: 9px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 0 rgba(255, 90, 79, .6); }
.break.is-playing .break__status .live { animation: live 1.6s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 79, .6); } 100% { box-shadow: 0 0 0 12px rgba(255, 90, 79, 0); } }
.break__vol { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .7); }
.break__vol svg { width: 22px; height: 22px; }
.break__vol input { width: 180px; accent-color: #fff; }
.break__eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.break__eq i { width: 3px; height: 30%; background: currentColor; border-radius: 2px; }
.break.is-playing .break__eq i { animation: eq .9s ease-in-out infinite; }
.break.is-playing .break__eq i:nth-child(2) { animation-delay: -.3s; }
.break.is-playing .break__eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.break__welcome { display: none; }
.break.is-over .break__welcome { display: flex; flex-direction: column; gap: 28px; }
.break.is-over .break__countdown { display: none; }
.break__welcome h2 { font-family: var(--break-font, var(--f-display)); font-size: 200px; line-height: .9; letter-spacing: -.04em; margin: 0; }
.break__welcome .btn { align-self: flex-start; background: #fff; color: #111; height: 64px; padding: 0 28px; border-radius: 999px; font-size: 18px; }

/* ---------- AI lab (masterclass) ---------- */
.prompt {
  position: relative; margin: 0; min-width: 0;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--code-r, 16px); box-shadow: var(--shadow-2);
  padding: 18px 28px 24px;
}
.prompt__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; font: 600 14px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--code-dim); }
.prompt__bar > span { display: inline-flex; align-items: center; gap: 10px; }
.prompt__bar svg { width: 18px; height: 18px; }
.prompt__text { font: 500 var(--prompt-size, 19px)/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.prompt__text b { display: inline-block; margin-top: 4px; font-weight: 700; letter-spacing: .1em; color: var(--accent-code, var(--accent)); }
.prompt.is-sm { --prompt-size: 17px; }
.copy-btn {
  border: 0; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--pill-r); background: var(--code-chip, rgba(255, 255, 255, .1)); color: var(--code-chip-ink, #fff);
  font: 600 13px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  transition: background-color .2s ease;
}
.copy-btn:hover { background: var(--code-chip-hover, rgba(255, 255, 255, .2)); }
.copy-btn.is-done { background: var(--good); color: #fff; }
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn.is-ghost { background: var(--code-ghost, rgba(255, 255, 255, .05)); color: var(--code-fg); }
.copy-btn.is-ghost:hover { background: var(--code-ghost-hover, rgba(255, 255, 255, .14)); }
.prompt__tools { display: inline-flex; gap: 8px; }
.prompt__count {
  font: 600 12px/1 var(--f-mono); font-style: normal; letter-spacing: .1em; padding: 6px 9px; margin-left: 6px;
  border-radius: var(--pill-r); color: var(--accent-code, var(--accent)); background: color-mix(in srgb, var(--accent-code, var(--accent)) 16%, transparent);
}

/* loaded terms inside prompts */
.pterm { cursor: help; text-decoration: underline dotted color-mix(in srgb, var(--code-fg) 45%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; border-radius: 5px; outline: none; }
.pterm:focus-visible { box-shadow: 0 0 0 2px var(--accent-code, var(--accent)); }
.pterm.is-new {
  text-decoration: none; color: var(--term-ink, #0b0d10); font-weight: 650;
  background: var(--term-fill, var(--accent-code, var(--accent))); padding: 1px 5px; margin: 0 -1px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.pterm.is-blank[data-step] { opacity: 1; transform: none; pointer-events: auto; filter: none; transition: color .35s ease, background-color .35s ease, box-shadow .35s ease; }
.pterm.is-blank:not(.is-shown):not(.is-open) {
  color: transparent; background: var(--code-blank, rgba(255, 255, 255, .07)); cursor: pointer;
  box-shadow: inset 0 -2px 0 var(--accent-code, var(--accent));
}
.prompt.is-revealed .pterm.is-blank, .deck.show-all .pterm.is-blank { color: var(--term-ink, #0b0d10) !important; background: var(--term-fill, var(--accent-code, var(--accent))) !important; box-shadow: none !important; }
.term-tip {
  position: absolute; z-index: 30; left: 0; top: 0; width: max-content; max-width: 460px; pointer-events: none;
  background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-2);
  padding: 16px 18px 18px; opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .25s var(--ease-out);
}
@supports (corner-shape: squircle) { .term-tip { corner-shape: squircle; border-radius: 26px; } }
.term-tip.is-on { opacity: 1; transform: none; }
.term-tip__top { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.term-tip__top b { font: 700 19px/1.2 var(--f-mono); color: var(--accent); }
.term-tip__top span { font: 600 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.term-tip p { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); }
.term-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font: 500 16px/1.3 var(--f-mono); color: var(--ink-2); }
.term-legend span { display: inline-flex; align-items: center; gap: 10px; }
.term-legend i { width: 30px; height: 16px; border-radius: 4px; background: var(--term-fill, var(--accent-code, var(--accent))); }
.term-legend i.is-known { background: none; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--ink) 40%, transparent); border-radius: 0; }
.term-legend i.is-blank { background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 640px; gap: 72px; align-items: center; flex: 1; min-height: 0; }
.lab-ticket { background: var(--surface); border-radius: var(--card-r); box-shadow: var(--shadow-2); padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lab-ticket__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 600 14px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lab-ticket__top .chip { font-size: 13px; padding: 7px 10px; }
.lab-ticket h3 { margin: 0; font: 650 32px/1.18 var(--f-body); letter-spacing: -.01em; color: var(--ink); }
.lab-ticket p { margin: 0; font-size: 21px; line-height: 1.45; color: var(--ink-2); }
.lab-ticket .k { font: 600 13px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { position: relative; padding-left: 34px; font-size: 20px; line-height: 1.4; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: .22em; width: 20px; height: 20px; border-radius: 5px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 28%, transparent); }
.checks.is-done li { font-size: 22px; color: var(--ink); }
.checks.is-done li::before { background: var(--good); box-shadow: none; }
.checks.is-done li::after { content: ""; position: absolute; left: 7px; top: calc(.22em + 3px); width: 5px; height: 10px; transform: rotate(45deg); box-shadow: 2.5px 2.5px 0 0 #fff; }
.anat-list { display: flex; flex-direction: column; gap: 14px; }
.anat-list > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: baseline; padding-bottom: 14px; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ink) 10%, transparent); }
.anat-list b { font: 700 15px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.anat-list span { font-size: 21px; line-height: 1.42; color: var(--ink-2); }
.problems { display: flex; flex-direction: column; gap: 10px; }
.problems > div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 14px 18px; background: var(--surface); border-radius: var(--card-r); box-shadow: var(--shadow-1); align-items: start; }
.problems .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bad); color: #fff; font: 700 15px/1 var(--f-mono); }
.problems b { display: block; font-size: 21px; line-height: 1.3; margin-bottom: 4px; color: var(--ink); }
.problems .t { font-size: 18px; line-height: 1.42; color: var(--ink-2); }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pipeline > div { background: var(--surface); border-radius: var(--card-r); box-shadow: var(--shadow-1); padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pipeline .n { font: 700 14px/1 var(--f-mono); letter-spacing: .1em; color: var(--accent); }
.pipeline h4 { margin: 0; font: 650 23px/1.2 var(--f-body); color: var(--ink); }
.pipeline p { margin: 0; font-size: 18px; line-height: 1.42; color: var(--ink-2); }
.lab-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }

/* ---------- more ways to reveal a step: data-fx="..." on any [data-step] ---------- */
/* slide in from a side, zoom, pop */
[data-step][data-fx="left"]:not(.is-shown) { transform: translate3d(-56px, 0, 0); }
[data-step][data-fx="right"]:not(.is-shown) { transform: translate3d(56px, 0, 0); }
[data-step][data-fx="down"]:not(.is-shown) { transform: translate3d(0, -40px, 0); }
[data-step][data-fx="zoom"]:not(.is-shown) { transform: scale(.86); }
[data-step][data-fx="pop"] { transition: opacity .3s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1); }
[data-step][data-fx="pop"]:not(.is-shown) { transform: scale(.35); }
/* wipe: painted in from left to right */
[data-step][data-fx="wipe"] { transition: clip-path 1s var(--ease-out), opacity .2s ease; clip-path: inset(0 0 0 0); }
[data-step][data-fx="wipe"]:not(.is-shown) { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); }
/* curtain: the content is already there, under a blind that rolls up. data-curtain="text" labels the blind */
[data-step][data-fx="curtain"] { position: relative; overflow: hidden; }
[data-step][data-fx="curtain"]:not(.is-shown) { opacity: 1; transform: none; }
[data-step][data-fx="curtain"]::after {
  content: attr(data-curtain); position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center; padding: 24px; text-align: center; white-space: pre-line;
  background: var(--curtain-bg, var(--ink)); color: var(--curtain-ink, var(--bg));
  font: 600 20px/1.35 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  transition: transform .95s var(--ease-out);
}
[data-step][data-fx="curtain"].is-shown::after { transform: translateY(-101%); }
/* stage: two theatre curtains part to the sides */
[data-step][data-fx="stage"] { position: relative; overflow: hidden; }
[data-step][data-fx="stage"]:not(.is-shown) { opacity: 1; transform: none; }
[data-step][data-fx="stage"]::before, [data-step][data-fx="stage"]::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 6;
  background: var(--stage-curtain, repeating-linear-gradient(90deg, #6e1a27 0 26px, #561320 26px 52px));
  transition: transform 1.15s var(--ease-out);
}
[data-step][data-fx="stage"]::before { left: 0; box-shadow: inset -18px 0 30px rgba(0, 0, 0, .35); }
[data-step][data-fx="stage"]::after { right: 0; box-shadow: inset 18px 0 30px rgba(0, 0, 0, .35); }
[data-step][data-fx="stage"].is-shown::before { transform: translateX(-101%); }
[data-step][data-fx="stage"].is-shown::after { transform: translateX(101%); }
/* draw: an SVG line draws itself. Give the path pathLength="1" */
[data-step][data-fx="draw"] { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s var(--ease-out), opacity .2s ease; }
[data-step][data-fx="draw"]:not(.is-shown) { opacity: 1; transform: none; stroke-dashoffset: 1; }
.deck.show-all [data-fx="curtain"]::after, .deck.show-all [data-fx="stage"]::before, .deck.show-all [data-fx="stage"]::after { display: none; }
.deck.show-all [data-fx="draw"] { stroke-dashoffset: 0 !important; }
.deck.show-all [data-fx="wipe"] { clip-path: none !important; }

/* code that grows step by step (data-build) */
.code .line { max-height: 1.6em; transition: opacity .4s ease, background-color .4s ease, max-height .45s var(--ease-out); }
.code .line.is-future { max-height: 0; opacity: 0; overflow: hidden; }
.code.build-ghost .line.is-future { max-height: 1.6em; opacity: .13; overflow: visible; }
.code .line.is-new { background: var(--tok-add); box-shadow: inset 4px 0 0 var(--good-code, #6fdc9a); }
.deck.show-all .code .line.is-future { max-height: 1.6em; opacity: 1; }
/* the lecturer's Copy button on code blocks (data-copy) */
.code__copy { position: absolute; top: 14px; right: 16px; z-index: 2; opacity: .55; transition: opacity .2s ease, background-color .2s ease; }
.code:hover .code__copy, .code__copy:focus-visible, .code__copy.is-done { opacity: 1; }

/* data-peek: blurred until clicked */
[data-peek] { position: relative; cursor: pointer; }
[data-peek] > * { transition: filter .5s ease, opacity .5s ease; }
[data-peek]:not(.is-peeked) > * { filter: blur(11px); opacity: .55; user-select: none; }
[data-peek]:not(.is-peeked)::after {
  content: attr(data-peek); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  padding: 10px 16px; border-radius: var(--pill-r); background: var(--ink); color: var(--bg);
  font: 600 15px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; pointer-events: none;
}
.deck.show-all [data-peek] > * { filter: none; opacity: 1; }
.deck.show-all [data-peek]::after { display: none; }

/* helpers for data-on: a marker highlight and a strike-through that animate in */
.mark { background: linear-gradient(transparent 58%, var(--mark, rgba(255, 205, 86, .55)) 0) no-repeat 0 0 / 0% 100%; transition: background-size .8s var(--ease-out); }
.mark.is-on { background-size: 100% 100%; }
.strike { position: relative; transition: opacity .4s ease; }
.strike::after { content: ""; position: absolute; left: -6px; right: -6px; top: 52%; height: 4px; border-radius: 2px; background: var(--bad); transform: scaleX(0); transform-origin: left center; transition: transform .55s var(--ease-out); }
.strike.is-on { opacity: .55; }
.strike.is-on::after { transform: scaleX(1); }

/* speaker notes: Say / Do / Ask labels */
.notes-drawer b { color: #7ee2b8; }
.notes-drawer code { background: rgba(255, 255, 255, .1); }

@media (prefers-reduced-motion: reduce) {
  [data-step][data-fx="curtain"]::after, [data-step][data-fx="stage"]::before, [data-step][data-fx="stage"]::after { transition: opacity .3s ease; }
  .slide, .slide.is-active { transition: opacity .2s ease, visibility 0s; transform: none !important; }
  [data-step] { transition: opacity .2s ease; transform: none !important; }
  .marquee__track, .grain::after, .break__bg img { animation: none !important; transition: opacity .3s ease !important; }
  .flip__inner { transition: none; }
}
