/* CT·GenAI slide deck — light-first, premium, RTL/LTR aware (logical properties only) */
:root {
  --bg: #F7F7F4;
  --bg-2: #EFEEE8;
  --surface: #FFFFFF;
  --surface-2: #FBFBF9;
  --ink: #0F1318;
  --ink-2: #485060;
  --ink-3: #8790A0;
  --line: rgba(15, 19, 24, .09);
  --line-2: rgba(15, 19, 24, .16);
  --accent: #4338CA;
  --accent-2: #0E9F9A;
  --accent-soft: rgba(67, 56, 202, .08);
  --accent-2-soft: rgba(14, 159, 154, .10);
  --good: #0B8F63;
  --good-soft: rgba(11, 143, 99, .10);
  --bad: #D2405A;
  --bad-soft: rgba(210, 64, 90, .09);
  --warn: #A8680E;
  --shadow-sm: 0 1px 2px rgba(15, 19, 24, .05);
  --shadow: 0 1px 2px rgba(15, 19, 24, .04), 0 18px 40px -18px rgba(15, 19, 24, .16);
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0E14;
  --bg-2: #10141C;
  --surface: #131925;
  --surface-2: #171E2C;
  --ink: #EEF1F6;
  --ink-2: #A9B2C3;
  --ink-3: #6E7890;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --accent: #8B84FF;
  --accent-2: #3CD2C8;
  --accent-soft: rgba(139, 132, 255, .12);
  --accent-2-soft: rgba(60, 210, 200, .12);
  --good: #3DD6A0;
  --good-soft: rgba(61, 214, 160, .12);
  --bad: #FF7A92;
  --bad-soft: rgba(255, 122, 146, .12);
  --warn: #F0B35A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: 'cv11', 'ss01';
}
html[lang="he"] body { font-family: 'Heebo', 'Inter', system-ui, sans-serif; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 85% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(700px 480px at -5% 105%, var(--accent-2-soft), transparent 70%);
}
button { font: inherit; color: inherit; cursor: pointer; }
em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
b, strong { font-weight: 650; }
code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .9em; background: var(--bg-2); padding: .12em .4em; border-radius: 6px; }

/* ── chrome ─────────────────────────────────────────── */
.progress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 3px; z-index: 30; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }
.topbar { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 3vw, 36px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand span { color: var(--ink-3); font-weight: 500; }
.tools { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(10px); display: grid; place-items: center; color: var(--ink-2); transition: all .2s var(--ease); font-size: 12px; font-weight: 650; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottombar { position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; pointer-events: none; }
.bottombar > * { pointer-events: auto; }
.counter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding: 0 6px; }
.counter b { color: var(--ink); }
.counter select { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 600; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ── slides ─────────────────────────────────────────── */
main { position: relative; z-index: 1; height: 100%; }
.slide { position: absolute; inset: 0; display: flex; overflow-y: auto; padding: 84px clamp(18px, 6vw, 96px) 104px; opacity: 0; visibility: hidden; transform: translateX(40px); transition: opacity .5s var(--ease), transform .5s var(--ease), visibility 0s .5s; }
[dir="rtl"] .slide { transform: translateX(-40px); }
.slide.before { transform: translateX(-40px); }
[dir="rtl"] .slide.before { transform: translateX(40px); }
.slide.active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; z-index: 2; }
.stage { margin: auto; width: 100%; max-width: 1120px; }
.slide.active .stage > * { animation: rise .7s var(--ease) both; }
.slide.active .stage > *:nth-child(2) { animation-delay: .08s; }
.slide.active .stage > *:nth-child(3) { animation-delay: .16s; }
.slide.active .stage > *:nth-child(4) { animation-delay: .24s; }
.slide.active .stage > *:nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide, .slide.active .stage > * { animation: none !important; transition: none !important; } }

.kicker { font-size: 12px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
[dir="rtl"] .kicker { letter-spacing: .04em; }
h1, h2 { margin: 0; letter-spacing: -.025em; line-height: 1.06; font-weight: 750; }
h1 { font-size: clamp(40px, 7vw, 84px); }
h2 { font-size: clamp(30px, 4.4vw, 52px); }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: -.01em; line-height: 1.15; }
.lead { margin: 18px 0 0; font-size: clamp(16px, 1.7vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 760px; }
.head { margin-bottom: clamp(24px, 4vh, 44px); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); line-height: 1.55; font-size: 15px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.teal { background: var(--accent-2-soft); color: var(--accent-2); }
.tag.ghost { background: var(--bg-2); color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
@media (min-width: 861px) and (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } }
.num { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .04em; margin-bottom: 12px; display: block; }
.note-line { margin-top: 22px; font-size: 14px; color: var(--ink-3); display: flex; gap: 10px; align-items: baseline; }
.callout { margin-top: 22px; padding: 16px 20px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: 15.5px; line-height: 1.5; border-inline-start: 3px solid var(--accent); }

/* title */
.title-slide { text-align: start; }
.title-slide h1 { max-width: 14ch; }
.title-slide .sub { margin-top: 22px; font-size: clamp(18px, 2.2vw, 26px); color: var(--ink-2); max-width: 640px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink-2); }
.start-hint { margin-top: 40px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
kbd { font-family: inherit; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 1px 0 var(--line-2); }

/* objectives */
.obj { display: grid; gap: 10px; }
.obj-row { display: grid; grid-template-columns: 64px 54px 1fr; align-items: center; gap: 14px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.obj-row .id { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-3); font-size: 14px; }
.obj-row .txt { font-size: 16px; line-height: 1.4; }
.k { font-size: 11px; font-weight: 700; padding: 4px 0; text-align: center; border-radius: 8px; letter-spacing: .06em; }
.k.K1 { background: var(--accent-2-soft); color: var(--accent-2); }
.k.K2 { background: var(--accent-soft); color: var(--accent); }
.k.K3 { background: rgba(168, 104, 14, .12); color: var(--warn); }

/* nested rings */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.nest { display: flex; flex-direction: column; border-radius: 28px; border: 1.5px solid; padding: 12px 14px 14px; transition: all .3s var(--ease); }
.nest > .lbl { font-size: 13px; font-weight: 650; padding: 2px 4px 10px; }
.nest.l0 { border-color: rgba(67, 56, 202, .22); background: rgba(67, 56, 202, .035); }
.nest.l1 { border-color: rgba(67, 56, 202, .32); background: rgba(67, 56, 202, .06); }
.nest.l2 { border-color: rgba(67, 56, 202, .46); background: rgba(67, 56, 202, .09); }
.nest.l3 { border-color: var(--accent); background: linear-gradient(135deg, rgba(67, 56, 202, .16), rgba(14, 159, 154, .14)); min-height: 74px; justify-content: center; }
.nest.hl { box-shadow: 0 0 0 4px var(--accent-soft); }
.legend { display: grid; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 12px 1fr; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: all .25s var(--ease); cursor: default; }
.legend-item:hover, .legend-item.hl { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.legend-item i { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.legend-item h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.legend-item p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.aside-pill { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1.5px dashed var(--line-2); font-size: 14px; color: var(--ink-2); }
.aside-pill b { color: var(--ink); }

/* tokens */
.sentence { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; margin: 4px 0 18px; }
.tok { padding: 8px 12px; border-radius: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: var(--accent-soft); color: var(--ink); border: 1px solid rgba(67, 56, 202, .16); white-space: pre; }
.tok:nth-child(3n+2) { background: var(--accent-2-soft); border-color: rgba(14, 159, 154, .22); }
.tok:nth-child(3n) { background: rgba(168, 104, 14, .10); border-color: rgba(168, 104, 14, .22); }
.vec { direction: ltr; font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.vec div { display: flex; gap: 10px; }
.vec b { min-width: 74px; color: var(--ink); }
.space { width: 100%; height: auto; max-height: 280px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.space text { font-size: 11px; fill: var(--ink-2); font-family: inherit; }
.space circle { fill: var(--accent); }
.space circle.far { fill: var(--ink-3); }
.space .ring { fill: var(--accent-soft); stroke: none; }
.cap { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; line-height: 1.45; }
.step-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
[dir="rtl"] .step-label { letter-spacing: .02em; }

/* next token */
.prompt { direction: ltr; font-size: clamp(18px, 2.3vw, 26px); font-weight: 600; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 18px; }
.prompt .blank { display: inline-block; min-width: 110px; border-bottom: 2px solid var(--accent); text-align: center; color: var(--accent); }
.bars { display: grid; gap: 10px; direction: ltr; }
.bar { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 12px; font-size: 14.5px; }
.bar .track { height: 12px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: opacity .3s; }
.bar.picked .fill { box-shadow: 0 0 0 3px var(--accent-soft); }
.bar.picked .w { font-weight: 700; color: var(--accent); }
.bar .p { text-align: end; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 650; font-size: 14px; background: var(--ink); color: var(--bg); transition: transform .2s var(--ease), opacity .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.history { margin-top: 14px; min-height: 30px; display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; }
.history span { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); }

/* context window */
.ctx { direction: ltr; display: flex; height: 64px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); }
.ctx .blk { display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--ink); border-inline-end: 1px solid var(--surface); min-width: 0; padding: 0 6px; text-align: center; overflow: hidden; }
.ctx .b0 { --c: rgba(67, 56, 202, .22); } .ctx .b1 { --c: rgba(14, 159, 154, .24); } .ctx .b2 { --c: rgba(168, 104, 14, .22); } .ctx .b3 { --c: rgba(210, 64, 90, .24); }
.ctx .blk { background: var(--c); }
.ctx-legend { direction: ltr; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.ctx-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.ctx-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); border: 1px solid var(--line-2); }
.ctx-legend small { color: var(--ink-3); }
.ctx-legend .b0, .ctx .b0 { --c: rgba(67, 56, 202, .30); } .ctx-legend .b1, .ctx .b1 { --c: rgba(14, 159, 154, .34); } .ctx-legend .b2, .ctx .b2 { --c: rgba(168, 104, 14, .30); } .ctx-legend .b3, .ctx .b3 { --c: rgba(210, 64, 90, .34); }
.hatch { background-image: repeating-linear-gradient(135deg, rgba(15, 19, 24, .22) 0 2px, transparent 2px 7px); }
.win-row { display: flex; align-items: center; gap: 16px; margin: 22px 0 8px; flex-wrap: wrap; }
.win-row label { font-size: 14px; font-weight: 650; }
input[type=range] { flex: 1; min-width: 200px; accent-color: var(--accent); }
.status { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 15px; line-height: 1.5; }
.status.ok { background: var(--good-soft); color: var(--good); }
.status.over { background: var(--bad-soft); color: var(--bad); }

/* ladder */
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; }
@media (max-width: 860px) { .ladder { grid-template-columns: 1fr; } }
.ladder .card { position: relative; }
.ladder .card:nth-child(2) { transform: translateY(-14px); }
.ladder .card:nth-child(3) { transform: translateY(-28px); border-color: rgba(67, 56, 202, .4); }
@media (max-width: 860px) { .ladder .card:nth-child(n) { transform: none; } }
.ladder dl { margin: 14px 0 0; display: grid; gap: 10px; }
.ladder dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
[dir="rtl"] .ladder dt { letter-spacing: .02em; }
.ladder dd { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }

/* multimodal flow */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } .flow .arrow { transform: rotate(90deg); justify-self: center; } }
.flow .arrow { color: var(--ink-3); font-size: 22px; }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm); }
.mock .bar-top { display: flex; gap: 5px; margin-bottom: 10px; } .mock .bar-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.mock .fake-btn { padding: 8px; border-radius: 8px; background: var(--accent); color: #fff; text-align: center; font-size: 12px; font-weight: 650; }
.mock .fake-in { height: 26px; border-radius: 7px; background: var(--bg-2); margin-bottom: 8px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.doc b { color: var(--ink); }
.out { background: var(--bad-soft); border: 1px solid rgba(210, 64, 90, .25); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; }
.out b { color: var(--bad); }

/* compare */
.cmp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cmp-row { display: grid; grid-template-columns: 160px 1fr 1fr; }
.cmp-row > div { padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.cmp-row:last-child > div { border-bottom: 0; }
.cmp-row.h > div { font-weight: 700; color: var(--ink); background: var(--surface-2); font-size: 15px; }
.cmp-row > div:first-child { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; }
[dir="rtl"] .cmp-row > div:first-child { letter-spacing: .02em; }
@media (max-width: 760px) { .cmp-row { grid-template-columns: 1fr; } .cmp-row > div { border-bottom: 0; padding: 8px 18px; } .cmp-row { border-bottom: 1px solid var(--line); padding: 8px 0; } }

/* quiz */
.quiz { max-width: 860px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-text { font-size: clamp(19px, 2.4vw, 27px); font-weight: 650; line-height: 1.35; letter-spacing: -.01em; margin: 0 0 22px; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; text-align: start; padding: 15px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); font-size: 15.5px; line-height: 1.45; transition: all .2s var(--ease); }
.opt:hover:not([disabled]) { border-color: var(--accent); transform: translateX(2px); }
[dir="rtl"] .opt:hover:not([disabled]) { transform: translateX(-2px); }
.opt .l { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .l { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .l { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.why { margin-top: 18px; padding: 16px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.why b.res { display: block; margin-bottom: 4px; font-size: 14px; }
.why b.res.ok { color: var(--good); } .why b.res.no { color: var(--bad); }
.q-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }

/* recap */
.terms { display: flex; flex-wrap: wrap; gap: 8px; }
.terms .chip { background: var(--surface); }
.traps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.traps li { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--ink-2); display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.traps li::before { content: '!'; width: 20px; height: 20px; border-radius: 50%; background: rgba(168, 104, 14, .14); color: var(--warn); font-weight: 800; font-size: 12px; display: grid; place-items: center; margin-top: 2px; }
.traps li b { color: var(--ink); }

/* notes drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 19, 24, .28); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(440px, 92vw); background: var(--surface); z-index: 50; border-inline-start: 1px solid var(--line); box-shadow: -20px 0 60px -30px rgba(15, 19, 24, .35); transform: translateX(105%); transition: transform .4s var(--ease); display: flex; flex-direction: column; }
[dir="rtl"] .drawer { transform: translateX(-105%); box-shadow: 20px 0 60px -30px rgba(15, 19, 24, .35); }
.drawer.on { transform: none; }
.drawer header { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer h3 { margin: 0; font-size: 17px; }
.drawer .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.drawer .body { padding: 22px 24px; overflow-y: auto; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.drawer .body p { margin: 0 0 14px; }
.hide { display: none !important; }


/* live demo */
.demo-slide { max-width: 860px; }
.demo-badge { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.demo-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow); }
.demo-ico svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.demo-ico svg .rec { fill: #fff; stroke: none; }
.demo-live { display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 999px; background: rgba(220, 38, 38, .1); color: #DC2626; font-size: 14px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
:root[data-theme="dark"] .demo-live { color: #FF6B6B; background: rgba(255, 107, 107, .14); }
.demo-live i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: demoPulse 1.4s ease-in-out infinite; }
@keyframes demoPulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .demo-live i { animation: none; } }
.demo-box { margin-top: 26px; padding: 20px 24px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line-2); }
.demo-steps-label { margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
[dir="rtl"] .demo-steps-label { letter-spacing: .04em; }
.demo-steps { margin: 0; padding: 0; list-style: none; counter-reset: ds; display: grid; gap: 9px; }
.demo-steps li { counter-increment: ds; display: flex; gap: 12px; align-items: baseline; font-size: 16px; line-height: 1.5; color: var(--ink); }
.demo-steps li::before { content: counter(ds); flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.demo-back { margin: 18px 0 0; font-size: 14px; color: var(--ink-3); }

/* editor / IDE mock */
.ed-wrap { display: grid; gap: 14px; direction: ltr; }
.ed-wrap.n2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .ed-wrap.n2 { grid-template-columns: 1fr; } }
.ed { border-radius: var(--radius-sm); background: #1e1f26; color: #d8dee9; overflow: hidden; border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; text-align: left; min-width: 0; }
.ed-top { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #15161b; }
.ed-top i { width: 10px; height: 10px; border-radius: 50%; background: #3a3d48; }
.ed-top i:nth-child(1) { background: #ff5f57; } .ed-top i:nth-child(2) { background: #febc2e; } .ed-top i:nth-child(3) { background: #28c840; }
.ed-tab { margin-inline-start: 12px; font-size: .78em; color: #aab3c5; padding: 3px 10px; border-radius: 6px 6px 0 0; background: #1e1f26; }
.ed-badge { margin-inline-start: auto; font-size: .72em; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: rgba(139,132,255,.2); color: #b4afff; font-family: Heebo, Inter, system-ui, sans-serif; }
.ed-body { display: flex; }
.ed-tree { flex: none; min-width: 150px; padding: 8px 0; background: #191a20; border-inline-end: 1px solid rgba(255,255,255,.07); font-size: .78em; color: #aab3c5; }
.ed-tree div { padding-block: 3px; padding-inline-end: 10px; } .ed-tree div.on { background: rgba(139,132,255,.18); color: #fff; }
.ed-code { flex: 1; min-width: 0; padding: 10px 0; font-size: .86em; line-height: 1.75; }
.ed-ln { display: flex; padding-inline-end: 14px; } .ed-ln.hot { background: rgba(139,132,255,.14); }
.ed-ln b { flex: none; width: 38px; text-align: right; padding-inline-end: 14px; color: #5b6275; font-weight: 400; user-select: none; }
.ed-ln code { font: inherit; background: none; padding: 0; border-radius: 0; border: 0; color: inherit; white-space: pre-wrap; word-break: break-word; }
.c-k { color: #c792ea; } .c-s { color: #a5e075; } .c-t { color: #4ec9b0; } .c-c { color: #7a8499; font-style: italic; } .c-f { color: #82aaff; }
.c-h { background: rgba(255,214,102,.25); border-radius: 3px; } .c-a { background: rgba(80,200,120,.22); border-radius: 3px; }
.c-e { text-decoration: underline wavy #f14c4c; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.ed-pop { margin: 2px 14px 6px 52px; padding: 8px 12px; border-radius: 6px; font-size: .82em; line-height: 1.5; font-family: Heebo, Inter, system-ui, sans-serif; direction: ltr; }
.ed-pop strong { display: block; margin-bottom: 2px; }
.ed-pop.error { background: #3a1d24; border: 1px solid #f14c4c; color: #ffd3d8; }
.ed-pop.hint { background: #1d2f3a; border: 1px solid #4aa8e0; color: #cfeaff; }
.ed-pop.suggest { display: inline-block; min-width: 190px; padding: 4px 0; background: #252733; border: 1px solid #3d4152; font-family: ui-monospace, Consolas, monospace; }
.ed-pop.suggest div { padding: 2px 14px; color: #c9d1e3; } .ed-pop.suggest div.on { background: #3b3f8f; color: #fff; }
.ed-term { margin: 0; padding: 10px 14px; background: #101116; border-top: 1px solid rgba(255,255,255,.08); font-size: .82em; line-height: 1.65; white-space: pre-wrap; color: #c9d1e3; }
.ed-term .cmd::before { content: '$ '; color: #6ee7b7; }
.ed-status { padding: 4px 12px; font-size: .72em; background: #4338CA; color: #fff; font-family: Heebo, Inter, system-ui, sans-serif; }
.ed-cap { margin: 10px 0 0; font-size: .86em; color: var(--ink-3); }
/* flow */
.fl { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.fl-node { flex: 1 1 170px; padding: 20px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); text-align: center; box-shadow: var(--shadow-sm); }
.fl-node.hot { border-color: var(--accent); background: var(--accent-soft); }
.fl-node h3 { margin: 6px 0 4px; font-size: 1.05em; } .fl-node p { margin: 0; font-size: .86em; color: var(--ink-2); line-height: 1.5; }
.fl-ico { font-size: 2em; line-height: 1.2; display: block; }
.fl-arrow { align-self: center; color: var(--ink-3); font-size: 1.5em; }
@media (max-width: 760px) { .fl-arrow { display: none; } }
/* browser mock */
.bw { border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); direction: ltr; text-align: left; }
.bw-top { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.bw-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.bw-url { margin-inline-start: 10px; flex: 1; font-size: .78em; padding: 4px 12px; border-radius: 99px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.bw-body { padding: 18px 22px; display: grid; gap: 12px; }
.bw-b { position: relative; }
.bw-tag { position: absolute; inset-inline-end: -8px; top: -8px; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72em; font-weight: 800; display: grid; place-items: center; font-family: Heebo, Inter, sans-serif; }
.bw-nav { display: flex; gap: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .86em; color: var(--ink-2); } .bw-nav .on { color: var(--accent); font-weight: 700; }
.bw-h { font-size: 1.35em; font-weight: 750; } .bw-p { font-size: .9em; color: var(--ink-2); line-height: 1.5; }
.bw-btn { display: inline-block; padding: 8px 18px; border-radius: 8px; background: var(--accent); color: #fff; font-size: .85em; font-weight: 650; } .bw-btn.ghost { background: var(--bg-2); color: var(--ink); }
.bw-in { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); } .bw-in small { display: block; font-size: .7em; color: var(--ink-3); } .bw-in span { font-size: .9em; }
.bw-msg { padding: 9px 14px; border-radius: 8px; font-size: .86em; } .bw-msg.ok { background: var(--good-soft); color: var(--good); } .bw-msg.err { background: var(--bad-soft); color: var(--bad); } .bw-msg.warn { background: rgba(168,104,14,.12); color: var(--warn); }
.bw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; } .bw-cards div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); } .bw-cards b { display: block; font-size: .88em; } .bw-cards span { font-size: .78em; color: var(--ink-2); }
.bw-list { margin: 0; padding-inline-start: 18px; font-size: .88em; color: var(--ink-2); line-height: 1.7; }
.split:has(> .bw) { grid-template-columns: 1.5fr 1fr; align-items: center; }
@media (max-width: 760px) { .split:has(> .bw) { grid-template-columns: 1fr; } }
/* big statement + icon list */
.big { text-align: center; padding: 10px 0; }
.big-n { font-size: clamp(54px, 9vw, 120px); font-weight: 800; line-height: 1; letter-spacing: -.03em; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-n.emo { background: none; -webkit-text-fill-color: initial; color: inherit; font-size: clamp(54px, 8vw, 96px); }
.big-l { margin-top: 8px; font-size: clamp(18px, 2.2vw, 28px); font-weight: 650; }
.big p { margin: 14px auto 0; max-width: 640px; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 20px); line-height: 1.55; }
.big .chips { justify-content: center; }
.lst { display: grid; gap: 12px; }
.lst-row { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lst-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5em; background: var(--accent-soft); }
.lst-row h3 { margin: 0 0 2px; font-size: 1.05em; } .lst-row p { margin: 0; font-size: .9em; color: var(--ink-2); line-height: 1.5; }

/* compact mode: deck embedded in a small frame (e.g. lesson page iframe) */
@media (max-height: 620px) {
  .topbar { padding: 10px 14px; } .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
  .bottombar { padding: 8px; } .slide { padding: 56px 24px 68px; }
  h1 { font-size: 34px; } h2 { font-size: 26px; }
  .kicker { margin-bottom: 8px; font-size: 11px; } .lead { font-size: 14px; margin-top: 8px; }
  .head { margin-bottom: 14px; } .card { padding: 14px; border-radius: 16px; } .card h3 { font-size: 15px; } .card p { font-size: 13px; }
  .callout { margin-top: 12px; padding: 10px 14px; font-size: 13px; } .title-slide .sub { font-size: 16px; margin-top: 12px; } .chips { margin-top: 16px; }
  .nest.l3 { min-height: 44px; } .legend-item { padding: 8px 10px; } .legend-item p, .obj-row .txt { font-size: 13px; } .obj-row { padding: 9px 14px; }
  .q-text { font-size: 17px; margin-bottom: 12px; } .opt { padding: 9px 12px; font-size: 14px; } .why { font-size: 13px; padding: 10px 14px; }
  .cmp-row > div { padding: 9px 12px; font-size: 13px; } .traps li, .terms .chip { font-size: 13px; }
  .demo-ico { width: 46px; height: 46px; border-radius: 13px; } .demo-ico svg { width: 26px; height: 26px; } .demo-badge { margin-bottom: 12px; } .demo-box { margin-top: 14px; padding: 12px 16px; } .demo-steps { gap: 5px; } .demo-steps li { font-size: 14px; }
  .split { gap: 16px; } .grid { gap: 10px; } .ladder .card:nth-child(n) { transform: none; }
}
.bottombar::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, var(--bg) 35%, transparent); }

/* embedded in a lesson page: the site owns language and theme chrome */
.embed #btn-lang, .embed #btn-theme, .embed .brand { display: none; }

/* embedded frames are narrow but still wide enough for multi-column slides */
@media (min-width: 600px) and (max-width: 900px) {
  .embed .cols-3 { grid-template-columns: repeat(3, 1fr); } .embed .cols-2 { grid-template-columns: repeat(2, 1fr); } .embed .cols-4 { grid-template-columns: repeat(4, 1fr); }
  .embed .split { grid-template-columns: 1.1fr 1fr; } .embed .ladder { grid-template-columns: repeat(3, 1fr); }
  .embed .ladder .card:nth-child(2) { transform: translateY(-8px); } .embed .ladder .card:nth-child(3) { transform: translateY(-16px); }
  .embed .flow { grid-template-columns: 1fr auto 1fr auto 1fr; } .embed .flow .arrow { transform: none; }
}

/* slides fit their frame by scaling; any remaining overflow scrolls without a visible bar */
.slide { scrollbar-width: none; }
.slide::-webkit-scrollbar { display: none; }

/* ── prompt anatomy and step flow (chapter 2) ───────── */
.pr { display: grid; gap: 10px; }
.pr-row { display: grid; grid-template-columns: 150px minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); border-inline-start: 5px solid var(--pc, var(--accent)); }
.pr-row.p0 { --pc: #4338CA; } .pr-row.p1 { --pc: #0E9F9A; } .pr-row.p2 { --pc: #D2405A; }
.pr-row.p3 { --pc: #A8680E; } .pr-row.p4 { --pc: #0B8F63; } .pr-row.p5 { --pc: #5E6E8C; }
.pr-tag { font-size: .8em; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--pc); }
.pr-text { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .86em; line-height: 1.5; direction: ltr; text-align: start; white-space: pre-wrap; }
.pr-note { margin: 0; font-size: .84em; color: var(--ink-2); line-height: 1.45; }
.steps { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.st { flex: 1 1 180px; position: relative; padding: 18px 18px 22px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); }
.st.chk { border-color: var(--good); background: var(--good-soft); }
.st-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 750; font-size: .85em; margin-bottom: 10px; }
.st h3 { margin: 0 0 6px; font-size: 1.05em; }
.st p { margin: 0; font-size: .88em; color: var(--ink-2); line-height: 1.5; }
.st-badge { display: inline-block; margin-top: 10px; font-size: .72em; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--good); color: #fff; }
.st-arrow { align-self: center; color: var(--ink-3); font-size: 1.4em; }
@media (max-width: 760px) { .pr-row { grid-template-columns: 1fr; } .st-arrow { display: none; } }

/* code, tree, shot slides */
.codes { display: grid; gap: 14px; }
.code-box { border-radius: var(--radius-sm); background: #0f1318; color: #e6edf3; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.code-label { padding: 8px 16px; font-size: .78em; font-weight: 700; letter-spacing: .04em; color: #9fb0c3; background: rgba(255,255,255,.06); }
.code-box pre { margin: 0; padding: 14px 18px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; line-height: 1.7; direction: ltr; text-align: left; white-space: pre-wrap; }
.code-box .ln.cmd::before { content: '$ '; color: #6ee7b7; }
.code-note { margin: 0; padding: 0 18px 12px; font-size: .84em; color: #9fb0c3; }
.tree { display: grid; gap: 6px; }
.tr-row { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr); gap: 16px; align-items: center; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.tr-row.hot { border-color: var(--accent); background: var(--accent-soft); }
.tr-name { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; direction: ltr; text-align: left; font-weight: 600; }
.tr-name i { font-style: normal; margin-inline-end: 8px; }
.tr-desc { font-size: .9em; color: var(--ink-2); line-height: 1.45; }
.shot { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 8px 12px; font-size: .8em; color: var(--ink-3); }
.pts { margin: 0; padding-inline-start: 22px; display: grid; gap: 12px; font-size: 1em; line-height: 1.55; color: var(--ink-2); }
.pts li::marker { color: var(--accent); font-weight: 800; }
@media (max-width: 760px) { .tr-row { grid-template-columns: 1fr; gap: 4px; } }
.split:has(> .shot) { grid-template-columns: 1.8fr 1fr; align-items: center; }
@media (max-width: 760px) { .split:has(> .shot) { grid-template-columns: 1fr; } }

/* recording mode (?record=1): the course-builder pipeline captures slides as video, so the deck chrome is hidden */
.record .topbar, .record .bottombar, .record .progress, .record .start-hint, .record .drawer, .record .scrim { display: none; }
/* off-screen slides are shifted 40px and widen the page (a band shows at the edge in RTL): clip them while recording */
.record #slides { position: fixed; inset: 0; overflow: hidden; }
/* no padding for the top/bottom bars: the stage is centred in the whole frame and scaled up by fitRecord() in deck.js */
.record .slide { padding: 0; }
