/* ==========================================================================
   Slide-specific styles. Organised by slide, in deck order.
   ========================================================================== */

svg { overflow: visible; }
.grid { stroke: #E3E8F0; stroke-width: 1; }
.x-axis { stroke: #9AA6B8; stroke-width: 2; }

/* ---------- Title / closing: the logo stage ---------- */
.logo-stage { position: absolute; width: 680px; }
.ls-prompt { font-size: 30px; color: var(--ink); height: 44px; margin-bottom: 26px; }
.ls-out { color: var(--signal); font-weight: 700; }
.ls-frame { position: relative; width: 680px; height: 480px; }
.ls-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ls-word { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(81% 0 0 0); opacity: 0; transition: opacity .9s ease; }
.ls-word.on { opacity: 1; }
.ls-bar { transition: opacity .45s; }
.ls-bar.dim { opacity: .28; }
.ls-tok { font-family: var(--mono); font-size: 50px; font-weight: 700; opacity: 0; transition: opacity .4s; }
.ls-bar.lbl .ls-tok { opacity: 1; }
.ls-cap { font-family: var(--head); font-size: 28px; font-weight: 500; color: var(--ink-2); margin-top: 26px; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .7s, transform .7s var(--ease); }
.ls-cap.on { opacity: 1; transform: none; }

/* ---------- Hook ---------- */
.bubble { border-radius: 18px; padding: 18px 24px; font-size: 24px; line-height: 1.5; margin-bottom: 18px; }
.bubble.you { background: #2A3464; color: #fff; margin-left: auto; width: fit-content; max-width: 640px; }
.bubble.ai { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #E9EEF7; min-height: 210px; }
.tk { border-radius: 4px; }
.tk.t0 { background: rgba(52, 195, 241, .16); }
.tk.t1 { background: rgba(143, 182, 230, .07); }

/* ---------- Part 1 opener timeline ---------- */
.timeline { position: absolute; left: 150px; right: 150px; bottom: 110px; height: 230px; }
.tl-line { position: absolute; left: 0; right: 0; top: 150px; height: 2px; background: rgba(255, 255, 255, .35); }
.tl-pt { position: absolute; bottom: 92px; width: 210px; margin-left: -105px; text-align: center; font-size: 18px; color: #B9C6DE; }
.tl-pt b { display: block; font-family: var(--head); font-size: 30px; color: #fff; }
.tl-pt::after { content: ""; position: absolute; left: 50%; bottom: -21px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--sky); }
.tl-pt.low { bottom: auto; top: 172px; }
.tl-pt.low::after { bottom: auto; top: -29px; }
.tl-dot { position: absolute; top: 143px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(209, 35, 42, .25); }
.tl-burst { position: absolute; right: -40px; bottom: 100px; width: 560px; text-align: right; font-size: 19px; color: #DCE6F5; }
.tl-burst b { display: block; font-family: var(--head); font-size: 30px; color: #fff; }
.tl-winter { position: absolute; top: 96px; height: 54px; background: rgba(143, 182, 230, .10); border-top: 1px dashed rgba(143, 182, 230, .5); }
.tl-winter span { position: absolute; top: -26px; left: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: #8FB6E6; white-space: nowrap; }
.tl-scale { position: absolute; left: 0; top: 230px; }

/* ---------- Neuron ---------- */
.n-edge { stroke: #C7D0DD; stroke-width: 4; transition: stroke .3s; }
.n-edge.live { stroke: var(--steel); }
.n-wpill { fill: #fff; stroke: var(--rule); stroke-width: 2; transition: fill .3s, stroke .3s; }
.n-wtext { font-family: var(--mono); font-size: 20px; fill: var(--ink); }
.hot .n-wpill { fill: var(--deep); stroke: var(--deep); }
.hot .n-wtext { fill: #fff; }
.zero .n-wpill { fill: #EEF1F6; }
.zero .n-wtext { fill: var(--muted); }
.n-label { font-family: var(--body); font-size: 22px; fill: var(--ink); }
.n-in, .n-sum { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.n-val { font-family: var(--mono); font-size: 30px; fill: var(--ink); }
.n-bias { font-family: var(--mono); font-size: 18px; fill: var(--muted); }
.n-sigma { font-family: var(--head); font-size: 64px; fill: var(--ink); }
.n-eq { font-family: var(--mono); font-size: 24px; fill: var(--ink); }
.n-out { fill: #fff; stroke: var(--ink); stroke-width: 3; transition: fill .4s, stroke .4s; }
.n-out.fire { fill: var(--deep); stroke: var(--deep); }
.n-glyph { fill: none; stroke: var(--ink); stroke-width: 4; }
.n-out.fire + .n-glyph { stroke: #fff; }
.n-verdict { font-family: var(--head); font-size: 25px; font-weight: 600; fill: var(--muted); }
.n-verdict.yes { fill: var(--deep); }
.n-pulse { fill: var(--sky); stroke: var(--deep); stroke-width: 2; }

/* ---------- Perceptron retina ---------- */
.retina { display: grid; grid-template-columns: repeat(20, 24px); gap: 3px; padding: 18px; background: var(--night); border-radius: 16px; width: fit-content; }
.retina i { width: 24px; height: 24px; border-radius: 5px; background: #1F2853; transition: background .25s; }
.retina i.on { background: var(--sky); }
.retina-out { margin-top: 18px; font-size: 21px; color: var(--ink); min-height: 32px; }
.ro-guess.good { color: var(--ok); }
.ro-guess.bad { color: var(--signal); }

/* ---------- XOR ---------- */
.xor-wrap { display: flex; gap: 40px; }
.xor-fig { margin: 0; }
.xor-fig figcaption { margin-top: 10px; font-size: 20px; }
.x-bg { fill: #fff; stroke: var(--rule); }
.x-line { stroke: var(--steel); stroke-width: 5; stroke-linecap: round; }
.x-line.good { stroke: var(--ok); }
.x-yes { fill: var(--deep); }
.x-no { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.x-ring { fill: none; stroke: transparent; stroke-width: 5; }
.x-ring.bad { stroke: var(--signal); }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--ink-2); }
.dot-yes, .dot-no { display: inline-block; width: 18px; height: 18px; border-radius: 50%; }
.dot-yes { background: var(--deep); }
.dot-no { background: #fff; border: 3px solid var(--ink); }

/* ---------- Descent ---------- */
.d-curve { fill: none; stroke: var(--deep); stroke-width: 4; }
.d-ground { fill: rgba(44, 83, 163, .10); }
.faint { opacity: .16; }
.d-tan { stroke: var(--signal); stroke-width: 4; stroke-linecap: round; }
.d-walker { fill: var(--ink); stroke: #fff; stroke-width: 3; }

/* ---------- Worked example ---------- */
.gd-curve { fill: none; stroke: var(--deep); stroke-width: 3; }
.gd-best { stroke: var(--ok); stroke-width: 3; }
.gd-ball { fill: var(--deep); stroke: #fff; stroke-width: 3; }
.gd-ball.red { fill: var(--signal); }
.gd-trail { fill: var(--steel); opacity: .5; }
.gd-tag { font-family: var(--mono); font-size: 17px; fill: var(--ink); }
.gd-tag.red { fill: var(--signal); }
.gd-jump { fill: none; stroke: var(--signal); stroke-width: 3; stroke-dasharray: 8 6; transition: opacity .4s; }
.gd-table td, .gd-table th { padding-right: 12px; }
.gd-table td { font-size: 20px; }
tr.frag { transform: none; }

/* ---------- Backprop ---------- */
.bp-edge { stroke: #C7D0DD; transition: stroke .4s, opacity .4s; }
.bp-edge.fwd { stroke: var(--steel); }
.bp-edge.bwd { stroke: var(--signal); }
.bp-node { fill: #fff; stroke: var(--ink); stroke-width: 3; transition: fill .3s; }
.bp-node.lit { fill: var(--sky); }
.bp-loss { fill: #fff; stroke: var(--signal); stroke-width: 3; }
.bp-loss-t { font-family: var(--mono); font-size: 18px; fill: var(--signal); }
.bp-val { font-family: var(--mono); font-size: 19px; fill: var(--ink); }
.bp-val.small { font-size: 16px; }
.bp-pulse { fill: var(--sky); stroke: var(--deep); stroke-width: 1.5; }
.bp-pulse.red { fill: var(--signal); stroke: #fff; }
.bp-step { opacity: .38; transition: opacity .3s, border-color .3s; padding-left: 16px; border-left: 4px solid transparent; }
.bp-step p { margin-top: 6px; }
.bp-step.past { opacity: .7; }
.bp-step.cur { opacity: 1; border-left-color: var(--deep); }

/* ---------- Training loop ---------- */
.train-line { fill: none; stroke: var(--deep); stroke-width: 2.5; stroke-linejoin: round; }

/* ---------- Big bang bars ---------- */
.hbar { display: grid; grid-template-columns: 130px 1fr 90px; align-items: center; gap: 14px; margin-top: 14px; }
.hb-l { font-weight: 600; font-size: 22px; }
.hb-track { height: 34px; border-left: 2px solid var(--ink); }
.hb-fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; transition: width 1.1s var(--ease) .5s; }
.slide.active .hb-fill { width: var(--w); }
.hb-fill.deep { background: var(--deep); }
.hb-fill.grey { background: #AEB8C7; }
.hb-v { font-family: var(--mono); font-size: 22px; }

/* ---------- Tokens ---------- */
.tok-box { background: #fff; border: 1px solid var(--rule); border-radius: 16px; padding: 22px 30px 18px; min-height: 280px; }
.tok-head { display: flex; justify-content: space-between; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.tok-rows { margin-top: 26px; min-height: 150px; }
.tok-row { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 30px; }
.tok-lead { width: 170px; font-size: 20px; color: var(--muted); }
.tok-row .chip { animation: chipIn .5s var(--ease) both; }
@keyframes chipIn { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- Embeddings ---------- */
.e-bg { fill: #fff; stroke: var(--rule); }
.e-dot { fill: var(--deep); }
.e-label { font-family: var(--body); font-size: 20px; fill: var(--ink); }
.e-arrow { stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--ease); }
.e-arrow.deep { stroke: var(--deep); }
.e-arrow.steel { stroke: var(--steel); }
.on .e-arrow { stroke-dashoffset: 0; }
.e-note { font-family: var(--mono); font-size: 16px; fill: var(--deep); }
.e-note.steel { fill: var(--ink-2); }

/* ---------- Next token ---------- */
.nt-text { font-size: 40px; line-height: 1.4; color: var(--ink); min-height: 120px; }
.nt-new { background: rgba(52, 195, 241, .28); border-radius: 6px; }
.ntb { display: grid; grid-template-columns: 160px 1fr 64px; gap: 14px; align-items: center; margin-bottom: 10px; padding: 6px 10px; border-radius: 8px; outline: 2px solid transparent; transition: outline-color .3s, background .3s; }
.ntb-t { font-size: 22px; }
.ntb-track { height: 26px; border-left: 2px solid var(--ink); }
.ntb-track i { display: block; height: 100%; width: 0; background: var(--deep); border-radius: 0 4px 4px 0; transition: width .8s var(--ease); }
.ntb.pick { background: rgba(209, 35, 42, .06); outline-color: var(--signal); }
.ntb.other .ntb-t { color: var(--muted); font-size: 18px; }
.ntb.other .ntb-track { border-left-color: var(--rule); }
.ntb-v { font-size: 20px; text-align: right; }

/* ---------- RNN ---------- */
.rnn-queue { position: absolute; left: 0; top: 0; width: 260px; display: flex; flex-direction: column; gap: 8px; font-size: 22px; }
.rnn-queue span { padding: 3px 12px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; width: fit-content; transition: transform .38s var(--ease), opacity .38s; }
.rnn-queue span.go { transform: translateX(320px); opacity: .5; }
.rnn-queue span.gone { display: none; }
.rnn-hole { position: absolute; left: 300px; top: -8px; width: 120px; height: 56px; border: 3px solid var(--ink); border-radius: 10px; background: repeating-linear-gradient(-45deg, #fff 0 8px, #EEF1F6 8px 16px); }
.rnn-hole span { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); width: 140px; text-align: center; font-family: var(--mono); font-size: 14px; color: var(--muted); line-height: 1.3; }
.rnn-mem { position: absolute; left: 450px; top: 0; width: 380px; height: 480px; background: var(--night); border-radius: 16px; padding: 22px 24px; color: #fff; }
.rnn-words { margin-top: 14px; font-family: var(--mono); font-size: 24px; line-height: 1.75; }
.rw { display: inline-block; margin-right: 12px; transition: opacity .5s; }
.rw.it { color: #FF8A8E; font-weight: 700; opacity: 1 !important; }
.rnn-note { position: absolute; left: 24px; right: 24px; bottom: 22px; font-size: 16px; color: #FF8A8E; opacity: 0; transition: opacity .5s; }
.rnn-note.on { opacity: 1; }

/* ---------- Alignment heatmap ---------- */
.heat { display: grid; align-items: end; }
.heat-corner { height: 120px; font-size: 12px; color: var(--muted); display: flex; align-items: flex-end; padding-bottom: 8px; }
.heat-col { height: 120px; position: relative; }
.heat-col span { position: absolute; left: 50%; bottom: 8px; transform-origin: left bottom; transform: rotate(-55deg); white-space: nowrap; font-size: 16px; color: var(--ink); }
.heat-row { font-size: 16px; text-align: right; padding-right: 12px; height: 32px; line-height: 32px; }
.heat-cell { width: 32px; height: 32px; border: 1px solid var(--paper); transition: background .4s; }
.heat-box { position: absolute; border: 3px solid var(--signal); border-radius: 6px; opacity: 0; transition: opacity .5s; pointer-events: none; }
.heat-box.on { opacity: 1; }

/* ---------- QKV ---------- */
.qkv-grid { margin-top: 12px; }
.qkv-row { display: grid; grid-template-columns: 54px 130px 230px 1fr; gap: 14px; align-items: center; height: 50px; }
.qkv-row.head { font-size: 13px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; height: 32px; }
.qkv-q { color: var(--signal); font-weight: 700; font-size: 19px; }
.qkv-k { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 3px 10px; font-size: 19px; width: fit-content; }
.qkv-k.top { border-color: var(--deep); color: var(--deep); font-weight: 700; }
.qb { display: grid; grid-template-columns: 150px 60px; gap: 10px; align-items: center; }
.qb.wt { grid-template-columns: 220px 60px; }
.qb i { display: block; height: 20px; width: 0; background: #AEB8C7; border-radius: 0 3px 3px 0; transition: width .8s var(--ease); }
.qb.on i { width: var(--w); }
.qb.wt i { background: var(--steel); }
.qb.wt i.top { background: var(--deep); }
.qb b { font-weight: 400; font-size: 17px; }
.qkv-blend { margin-top: 18px; }
.qkv-stack { display: flex; height: 46px; border-radius: 8px; overflow: hidden; margin-top: 10px; gap: 2px; }
.qs { background: #C9D2DF; color: var(--ink); font-family: var(--mono); font-size: 15px; display: flex; align-items: center; padding-left: 10px; white-space: nowrap; overflow: hidden; }
.qs.top { background: var(--deep); color: #fff; }

/* ---------- "it" arcs ---------- */
.it-arc { fill: none; stroke: var(--deep); stroke-linecap: round; }
.it-word { font-size: 34px; fill: var(--ink); }
.it-word.it { fill: var(--signal); font-weight: 700; }
.it-word.target { fill: var(--deep); font-weight: 700; }
.it-wl { font-size: 18px; fill: var(--deep); font-weight: 700; }

/* ---------- Heads ---------- */
.head-row { display: grid; grid-template-columns: 300px 1fr; align-items: end; height: 172px; }
.head-name b { display: block; font-family: var(--head); font-size: 26px; }
.head-sw { display: inline-block; width: 30px; height: 8px; border-radius: 4px; margin-bottom: 10px; }

/* ---------- Transformer block ---------- */
.blk-shadow { fill: rgba(44, 83, 163, .05); stroke: rgba(44, 83, 163, .22); stroke-width: 1.5; }
.blk-main { fill: #fff; stroke: var(--rule); stroke-width: 2; }
.blk-n { font-family: var(--mono); font-size: 20px; fill: var(--deep); }
.blk-att { fill: rgba(52, 195, 241, .12); }
.blk-mix { stroke: rgba(44, 83, 163, .16); stroke-width: 1.5; }
.blk-ffband { fill: rgba(74, 137, 200, .10); }
.blk-ff { fill: #fff; stroke: var(--steel); stroke-width: 2; }
.blk-res { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 6 5; }
.blk-plus { fill: #fff; stroke: var(--muted); stroke-width: 2.5; }
.blk-tok { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.blk-out { fill: var(--deep); }
.blk-dot { fill: var(--sky); stroke: var(--deep); stroke-width: 2; }

/* ---------- Pipeline ---------- */
.pbox { position: absolute; top: 40px; width: 190px; height: 190px; background: #fff; border: 2px solid var(--rule); border-radius: 14px; padding: 14px; transition: border-color .25s, box-shadow .25s, transform .25s; }
.pbox.hot { border-color: var(--deep); box-shadow: 0 0 0 5px rgba(44, 83, 163, .14); transform: translateY(-4px); }
.pbox-h { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pbox-b { margin-top: 12px; font-size: 16px; }
.parrow { position: absolute; top: 112px; width: 32px; text-align: center; color: var(--muted); font-size: 26px; }
.ploop { position: absolute; left: 0; top: 0; pointer-events: none; }
.ploop-path { fill: none; stroke: var(--signal); stroke-width: 4; }
.ploop-t { font-family: var(--mono); font-size: 15px; fill: var(--signal); }
.ptext { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.ptext b { background: rgba(52, 195, 241, .35); font-weight: 400; border-radius: 3px; }
.pchip { display: inline-block; font-family: var(--mono); font-size: 14px; padding: 3px 6px; margin: 0 4px 6px 0; border-radius: 5px; background: rgba(52, 195, 241, .18); border-bottom: 2px solid var(--sky); }
.vcell { display: inline-block; width: 22px; height: 22px; margin: 2px; border-radius: 3px; background: var(--steel); transition: opacity .3s; }
.tlayer { display: block; height: 14px; margin: 7px 0; border-radius: 4px; background: linear-gradient(90deg, var(--deep), var(--sky)); opacity: .35; }
.pbox.hot .tlayer { animation: tlPulse .45s ease-in-out infinite alternate; }
.pbox.hot .tlayer:nth-child(2) { animation-delay: .09s; }
.pbox.hot .tlayer:nth-child(3) { animation-delay: .18s; }
.pbox.hot .tlayer:nth-child(4) { animation-delay: .27s; }
.pbox.hot .tlayer:nth-child(5) { animation-delay: .36s; }
@keyframes tlPulse { to { opacity: 1; } }
.pbar { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; margin-bottom: 8px; }
.pbar span { width: 62px; }
.pbar i { height: 12px; background: var(--deep); border-radius: 0 3px 3px 0; }
.pbar em { font-style: normal; color: var(--muted); }
.ppick { font-family: var(--mono); font-size: 30px; color: var(--signal); font-weight: 700; }

/* ---------- n² + KV ---------- */
.n2-grid canvas { width: 470px !important; height: 470px !important; border-radius: 10px; background: #fff; border: 1px solid var(--rule); }
.kv-row { display: grid; grid-template-columns: 80px 1fr 1fr 130px; gap: 14px; align-items: center; height: 46px; }
.kv-row.head { font-size: 13px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; height: 30px; }
.kv-cells { display: flex; gap: 3px; }
.kv-cells i { flex: 1; height: 26px; border-radius: 3px; background: var(--deep); opacity: .85; }
.kv-row.new .kv-cells i { background: var(--sky); opacity: 1; }
.kv-tag { color: var(--muted); }
.kv-row.new .kv-tag { color: var(--deep); font-weight: 700; }
.frag.on .kv-row.new { animation: kvIn .9s .5s both; }
@keyframes kvIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ---------- Scale ---------- */
.logbars { margin-top: 18px; }
.lb { display: grid; grid-template-columns: 150px 1fr 70px; gap: 14px; align-items: center; height: 58px; }
.lb-l { font-size: 20px; }
.lb-track { height: 30px; border-left: 2px solid var(--ink); }
.lb-track i { display: block; height: 100%; width: 0; background: var(--deep); border-radius: 0 4px 4px 0; transition: width 1.2s var(--ease) .3s; }
.slide.active .lb-track i { width: var(--w); }
.lb:nth-child(2) .lb-track i { transition-delay: .5s; }
.lb:nth-child(3) .lb-track i { transition-delay: .7s; }
.lb-v { font-family: var(--mono); font-size: 20px; }
.lb-axis { position: relative; height: 24px; margin: 8px 84px 0 164px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); }
.lb-axis span { position: absolute; top: 6px; transform: translateX(-50%); }

/* ---------- Base model / windows ---------- */
.base-out, .asst-out { min-height: 230px; }

/* ---------- Post-training stages ---------- */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stage { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 22px 22px 20px; }
.stage.on { border-color: var(--deep); box-shadow: 0 10px 28px rgba(44, 83, 163, .10); }
.st-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--head); font-weight: 700; font-size: 21px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stage h3 { font-size: 25px; margin: 12px 0 8px; }
.st-adds { margin-top: 14px; font-family: var(--mono); font-size: 15px; color: var(--deep); }

/* ---------- Tool sequence ---------- */
.toolseq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.ts { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 20px; position: relative; }
.ts + .ts::before { content: "→"; position: absolute; left: -26px; top: 36%; color: var(--muted); font-size: 24px; }
.ts p.small { margin-top: 10px; }

/* ---------- Agent loop ---------- */
.al-orbit { fill: none; stroke: var(--signal); stroke-width: 6; }
.al-orbit.back { opacity: .3; }
.al-model { font-family: var(--mono); font-size: 14px; letter-spacing: .14em; fill: var(--muted); }
.al-st rect { fill: #fff; stroke: var(--signal); stroke-width: 2; transition: fill .2s; }
.al-st text { font-family: var(--mono); font-size: 15px; font-weight: 700; fill: var(--signal); transition: fill .2s; }
.al-st.on rect { fill: var(--signal); }
.al-st.on text { fill: #fff; }
.al-dot { fill: var(--signal); stroke: #fff; stroke-width: 3; }
.al-dot.back { opacity: .45; }
.al-done { font-family: var(--head); font-size: 24px; font-weight: 600; fill: var(--ok); }
.al-stack { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.al-block { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 12px; border-radius: 6px; font-size: 15px; line-height: 1.1; background: rgba(52, 195, 241, .16); border-left: 4px solid var(--sky); animation: alIn .5s var(--ease) both; overflow: hidden; }
.al-block.sys { background: rgba(44, 83, 163, .12); border-left-color: var(--deep); }
.al-block.mem { background: rgba(74, 137, 200, .14); border-left-color: var(--steel); }
.al-block.goal { background: #fff; border-left-color: var(--ink); }
.al-block.bad { border-left-color: var(--signal); background: rgba(209, 35, 42, .08); }
.al-block.good { border-left-color: var(--ok); background: rgba(14, 159, 82, .10); }
.al-block em { font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.al-total { font-size: 20px; margin-top: 12px; color: var(--ink); }
@keyframes alIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---------- Pace ---------- */
#s-pace .hero-num { font-size: 100px; }
.eras { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--ink); }
.era { padding: 14px 16px 0 0; font-size: 19px; color: var(--ink-2); }
.era b { display: block; font-family: var(--head); font-size: 26px; color: var(--ink); }

/* ---------- Recap ---------- */
ol.recap { margin: 44px 0 0; padding: 0; list-style: none; counter-reset: r; }
ol.recap li { counter-increment: r; font-size: 30px; margin-bottom: 24px; padding-left: 70px; position: relative; max-width: 1320px; color: #DCE6F5; }
ol.recap li::before { content: counter(r); position: absolute; left: 0; top: -6px; font-family: var(--head); font-size: 42px; font-weight: 700; color: var(--sky); }
ol.recap b { color: #fff; }

/* ---------- Break ---------- */
.break-orbit { width: 230px; }
.break-mark { width: 230px; height: auto; display: block; }

/* ==========================================================================
   PART 2
   ========================================================================== */

/* ---------- Part 2 opener ---------- */
.p2-map { position: absolute; left: 96px; right: 96px; bottom: 120px; display: grid; grid-template-columns: repeat(7, 1fr); border-top: 2px solid rgba(255, 255, 255, .3); }
.p2-map div { padding: 16px 12px 0 0; font-size: 20px; color: #B9C6DE; }
.p2-map b { display: block; font-family: var(--mono); font-size: 15px; color: var(--sky); letter-spacing: .1em; margin-bottom: 4px; }

/* ---------- Anatomy ---------- */
.anat-lines { position: absolute; left: 0; top: 0; }
.anat-lines line { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 6 6; }
.an-box { position: absolute; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 16px 20px; font-size: 20px; }
.an-box p { margin-top: 8px; }
.an-you { border-color: var(--signal); }
.an-harness { position: absolute; border: 3px dashed var(--steel); border-radius: 28px; padding: 18px 24px; background: rgba(74, 137, 200, .06); }
.an-harness .cap { margin-top: 8px; }
.an-model { position: absolute; width: 160px; height: 160px; margin-top: 10px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--head); font-weight: 700; font-size: 30px; display: flex; align-items: center; justify-content: center; }

/* ---------- Spectrum ---------- */
.spectrum { position: absolute; height: 200px; }
.sp-track { position: absolute; left: 0; right: 0; top: 18px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #A9C8EA, var(--deep) 60%, var(--signal)); }
.sp-stop { position: absolute; top: 0; width: 200px; margin-left: -100px; text-align: center; }
.sp-stop::before { content: ""; display: block; width: 26px; height: 26px; margin: 8px auto 18px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
.sp-stop b { display: block; font-family: var(--head); font-size: 23px; line-height: 1.15; }
.sp-stop span { display: block; margin-top: 8px; font-size: 18px; color: var(--muted); }
.sp-arrows { display: grid; gap: 14px; }
.sp-arrow { position: relative; height: 40px; background: linear-gradient(90deg, rgba(44, 83, 163, .06), rgba(44, 83, 163, .22)); border-radius: 6px; display: flex; align-items: center; padding-left: 18px; font-size: 20px; font-weight: 600; color: var(--deep); clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 0 100%); }
.sp-arrow.red { background: linear-gradient(90deg, rgba(209, 35, 42, .05), rgba(209, 35, 42, .2)); color: var(--signal); }

/* ---------- Workflow ---------- */
.wf { position: absolute; }
.wf-loop { display: block; opacity: 0; transition: opacity .5s; }
.wf-loop.on { opacity: 1; }
.wf-arc { fill: none; stroke: var(--signal); stroke-width: 4; }
.wf-dot { fill: var(--signal); stroke: #fff; stroke-width: 3; }
.wf-arc-t { font-family: var(--mono); font-size: 15px; fill: var(--signal); }
.wf-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.wf-st { background: #fff; border: 2px solid var(--rule); border-radius: 16px; padding: 20px 22px; min-height: 190px; opacity: .5; transition: opacity .35s, border-color .35s, box-shadow .35s; }
.wf-st b { font-family: var(--head); font-size: 28px; }
.wf-st p { margin-top: 10px; font-size: 20px; color: var(--ink-2); opacity: 0; transition: opacity .4s; }
.wf-st.on { opacity: 1; }
.wf-st.on p { opacity: 1; }
.wf-st.cur { border-color: var(--deep); box-shadow: 0 10px 26px rgba(44, 83, 163, .12); }
.wf-st.key.on { border-color: var(--signal); box-shadow: 0 10px 26px rgba(209, 35, 42, .12); }

/* ---------- Prompt anatomy ---------- */
.pr-strong { font-size: 24px; line-height: 1.75; }
.pp { border-radius: 4px; padding: 2px 3px; transition: background .35s, box-shadow .35s; }
.pp.on.p-sym { background: rgba(44, 83, 163, .13); box-shadow: inset 0 -3px 0 var(--deep); }
.pp.on.p-where { background: rgba(52, 195, 241, .2); box-shadow: inset 0 -3px 0 var(--sky); }
.pp.on.p-con { background: rgba(209, 35, 42, .09); box-shadow: inset 0 -3px 0 var(--signal); }
.pp.on.p-ver { background: rgba(14, 159, 82, .12); box-shadow: inset 0 -3px 0 var(--ok); }
.pr-legend { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 20px; font-size: 19px; }
.pr-legend i { display: inline-block; width: 22px; height: 12px; border-radius: 3px; margin-right: 8px; }
.pr-legend i.p-sym { background: var(--deep); }
.pr-legend i.p-where { background: var(--sky); }
.pr-legend i.p-con { background: var(--signal); }
.pr-legend i.p-ver { background: var(--ok); }
.pr-weak { border-color: var(--rule); color: var(--muted); }

/* ---------- Shine / struggle ---------- */
.shine-list li { font-size: 24px; margin-bottom: 18px; padding-left: 40px; }
ul.clean.shine-list li::before { background: none !important; width: auto !important; height: auto !important; top: -2px !important; left: 0 !important; font-weight: 700; font-size: 24px; }
ul.clean.shine-list.good li::before { content: "✓"; color: var(--ok); }
ul.clean.shine-list.bad li::before { content: "✕"; color: var(--signal); }

/* ---------- Context window ---------- */
.ctx-col::before { content: "CONTEXT IN USE · ILLUSTRATIVE"; position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.ctx-bar { position: absolute; left: 0; bottom: 0; width: 300px; display: flex; flex-direction: column-reverse; gap: 2px; }
.cb { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 12px; font-size: 14px; border-radius: 4px; overflow: hidden; white-space: nowrap; transition: height .45s var(--ease), opacity .4s, filter .4s; }
.cb em { font-style: normal; font-family: var(--mono); font-size: 12px; }
.cb.sys { background: var(--deep); color: #fff; }
.cb.mcp { background: var(--steel); color: #fff; }
.cb.mem { background: rgba(74, 137, 200, .32); color: var(--ink); }
.cb.conv { background: rgba(52, 195, 241, .28); color: var(--ink); }
.cb.fail { background: rgba(209, 35, 42, .15); }
.cb.rot { opacity: .32; filter: blur(1.2px); }
.cb.summary { background: var(--ink); color: #fff; }
.ctx-read .cr { display: flex; justify-content: space-between; }
.ctx-read .cr b { font-weight: 400; color: #fff; }
.ctx-read .cr.tot { border-top: 1px solid #3A4677; margin-top: 8px; padding-top: 8px; }
.ctx-read .cr.tot b { font-weight: 700; color: #7FE0F7; }
.ctx-msg { min-height: 120px; }

/* ---------- Techniques ---------- */
.tech { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tc { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 250px; }
.tc code { width: fit-content; font-size: 16px; }
.tc b { font-family: var(--head); font-size: 24px; line-height: 1.15; font-weight: 600; }
.tc span { font-size: 18px; color: var(--muted); line-height: 1.4; }

/* ---------- Sub-agent ---------- */
.sa-win { position: absolute; top: 0; width: 560px; height: 500px; border-radius: 16px; padding: 22px 26px; }
.sa-main { left: 0; background: #fff; border: 1px solid var(--rule); }
.sa-sub { right: 0; background: var(--night); color: #DCE6F5; opacity: .14; transform: scale(.96); transition: opacity .5s, transform .5s var(--ease); }
.sa-sub.on { opacity: 1; transform: none; }
.sa-h { font-size: 13px; letter-spacing: .14em; color: var(--muted); }
.sa-sub .sa-h { color: #8D97B5; }
.sa-task { font-size: 22px; margin-top: 12px; }
.sa-meter { height: 16px; border-radius: 8px; background: #E6EBF2; margin-top: 18px; overflow: hidden; }
.sa-sub .sa-meter { background: #2A3464; }
.sa-meter i { display: block; height: 100%; width: 0; background: var(--deep); transition: width .3s; }
.sa-sub .sa-meter i { background: var(--sky); }
.sa-count { font-size: 15px; margin-top: 8px; }
.sa-files { font-size: 15px; line-height: 1.75; margin-top: 14px; height: 310px; overflow: hidden; color: #B9C6DE; }
.sa-files div.in { animation: fadeUp .3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sa-inbox { margin-top: 26px; }
.sa-card { background: rgba(52, 195, 241, .14); border-left: 4px solid var(--sky); border-radius: 8px; padding: 12px 16px; font-size: 18px; animation: alIn .5s var(--ease) both; }
.sa-card b { display: block; font-size: 13px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--deep); margin-bottom: 6px; }
.sa-flyer { position: absolute; top: 400px; right: 40px; width: 440px; background: var(--sky); color: var(--ink); border-radius: 10px; padding: 12px 16px; font-size: 16px; opacity: 0; transition: opacity .3s, transform 1s var(--ease); z-index: 3; }
.sa-flyer.show { opacity: 1; }
.sa-flyer.go { transform: translate(-808px, -150px); }

/* ---------- Pricing ---------- */
table.price td { font-size: 24px; padding: 16px 16px 16px 0; }

/* ---------- Cache rows ---------- */
.cache-legend { display: flex; gap: 32px; font-size: 18px; color: var(--ink-2); }
.cache-legend i { display: inline-block; width: 22px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.c-read { background: var(--deep); }
.c-write { background: var(--sky); }
.c-miss { background: var(--signal); }
.crow { display: flex; align-items: center; gap: 18px; height: 52px; margin-bottom: 12px; opacity: 0; transform: translateX(-14px); transition: opacity .45s, transform .45s var(--ease); }
.crow.on { opacity: 1; transform: none; }
.cbar { display: flex; gap: 2px; width: 900px; flex: none; }
.cs { height: 42px; border-radius: 4px; font-size: 13px; font-family: var(--mono); display: flex; align-items: center; padding-left: 8px; white-space: nowrap; overflow: hidden; flex: none; }
.cs.r { background: var(--deep); color: #fff; }
.cs.w { background: var(--sky); color: var(--ink); }
.cs.m { background: var(--signal); color: #fff; }
.cnote { font-size: 16px; color: var(--ink-2); }
.crow.break .cnote, .crow.switch .cnote { color: var(--signal); font-weight: 700; }

/* ---------- Cost chart ---------- */
.cc-legend { display: flex; gap: 28px; font-size: 18px; margin: 0 0 10px 70px; color: var(--ink-2); }
.cc-legend i { display: inline-block; width: 26px; height: 4px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.cc-line { fill: none; stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linejoin: round; }
.cc-line.un { stroke: var(--signal); }
.cc-line.ca { stroke: var(--deep); }
.cc-end { font-family: var(--mono); font-size: 18px; font-weight: 700; fill: var(--ink); }
.cc-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; transition: opacity .15s; }
.cc-dot { stroke: #fff; stroke-width: 2.5; transition: opacity .15s; }
.cc-dot.un { fill: var(--signal); }
.cc-dot.ca { fill: var(--deep); }
.cc-tip { position: absolute; margin-top: 38px; pointer-events: none; background: var(--night); color: #fff; font-size: 14px; line-height: 1.6; padding: 8px 12px; border-radius: 8px; opacity: 0; transition: opacity .15s; white-space: nowrap; }

/* ---------- Breaks / checklists ---------- */
.x-list li, .ok-list li { font-size: 23px; margin-bottom: 16px; padding-left: 38px; }
ul.clean.x-list li::before, ul.clean.ok-list li::before { background: none !important; width: auto !important; height: auto !important; top: -1px !important; left: 0 !important; font-weight: 700; font-size: 22px; }
ul.clean.x-list li::before { content: "✕"; color: var(--signal); }
ul.clean.ok-list li::before { content: "✓"; color: var(--ok); }
ul.checklist { list-style: none; padding: 0; margin: 0; }
ul.checklist li { position: relative; padding-left: 52px; font-size: 23px; line-height: 1.45; margin-bottom: 18px; }
ul.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 26px; height: 26px; border: 2.5px solid var(--deep); border-radius: 6px; }
ul.checklist li::after { content: ""; position: absolute; left: 9px; top: 6px; width: 8px; height: 15px; border: solid var(--deep); border-width: 0 3px 3px 0; transform: rotate(45deg); }
ul.checklist.monday li { font-size: 27px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--rule); }

/* ---------- Extension table ---------- */
table.ext td { font-size: 19px; padding: 10px 14px 10px 0; line-height: 1.3; }
.ext-line { font-family: var(--head); font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.ext-line b { color: var(--deep); font-weight: 600; }

/* ---------- Skills ---------- */
.sk-task { background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 18px; font-size: 21px; }
.sk-task span { display: block; color: #8FB6E6; letter-spacing: .14em; margin-bottom: 4px; }
.sk-shelf { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sk-card { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 9px 16px; transition: border-color .4s, box-shadow .4s; }
.sk-card b { font-size: 17px; color: var(--deep); }
.sk-card span { grid-column: 1; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-card em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-size: 13px; color: var(--muted); }
.sk-card.match { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(209, 35, 42, .12); }
.sk-meter { margin-top: 16px; font-size: 16px; color: var(--ink-2); }
.sk-meter b { font-weight: 700; }
.sk-tree { margin-top: 20px; font-size: 17px; line-height: 1.8; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px 20px; }
.sk-tree span { margin-left: 10px; font-size: 14px; }

/* ---------- MCP ---------- */
.mcp-l { fill: none; stroke: rgba(28, 36, 75, .26); stroke-width: 2; }
.mcp-l.hubl { stroke: var(--deep); stroke-width: 3; }
.mcp-box { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.mcp-box.sys { stroke: var(--steel); }
.mcp-bt { font-family: var(--body); font-size: 20px; font-weight: 600; fill: var(--ink); }
.mcp-hub { fill: var(--ink); }
.mcp-hub-t { font-family: var(--head); font-size: 30px; font-weight: 700; fill: #fff; }
.mcp-count { font-family: var(--mono); font-size: 18px; fill: var(--signal); }
.mcp-count.ok { fill: var(--ok); }
.mcp-tangle { transition: opacity .5s; }

/* ---------- Hooks ---------- */
.hk-line { position: absolute; left: 0; right: 68px; top: 40px; height: 3px; background: var(--rule); }
.hk-ev { position: absolute; top: 0; width: 220px; transform: translateX(-50%); text-align: center; }
.hk-ev i { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); margin: 29px auto 10px; transition: background .3s, border-color .3s; }
.hk-ev.hit i { background: var(--deep); border-color: var(--deep); }
.hk-ev span { font-size: 16px; color: var(--ink); }
.hk-ev.plain span { color: var(--muted); font-style: italic; }
.hk-card { position: absolute; top: 120px; width: 230px; transform: translateX(-50%); background: #fff; border: 2px solid var(--rule); border-radius: 12px; padding: 12px 14px; font-size: 17px; transition: box-shadow .3s, border-color .3s; }
.hk-card span { display: block; color: var(--muted); letter-spacing: .14em; margin-bottom: 4px; }
.hk-card b { font-weight: 600; }
.hk-card.fire.red { border-color: var(--signal); box-shadow: 0 0 0 5px rgba(209, 35, 42, .14); }
.hk-card.fire.green { border-color: var(--ok); box-shadow: 0 0 0 5px rgba(14, 159, 82, .14); }
.hk-card.fire.neutral { border-color: var(--deep); box-shadow: 0 0 0 5px rgba(44, 83, 163, .14); }
.hk-dot { position: absolute; left: 0; top: 33px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 6px rgba(209, 35, 42, .2); z-index: 2; }

/* ---------- Plugins ---------- */
.plug { background: var(--night); border-radius: 16px; padding: 22px 24px; }
.plug-items { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.plug-items span { font-family: var(--mono); font-size: 16px; color: #DCE6F5; background: #2A3464; border-radius: 8px; padding: 8px 12px; }

/* ---------- Permissions ---------- */
.perm { display: grid; grid-template-columns: repeat(5, 1fr); padding-top: 30px; }
.pm { border-top: 6px solid var(--steel); padding: 18px 20px 0 0; }
.pm:nth-child(1) { border-color: #A9C8EA; }
.pm:nth-child(2) { border-color: var(--steel); }
.pm:nth-child(3) { border-color: var(--deep); }
.pm:nth-child(4) { border-color: var(--ink); }
.pm.danger { border-color: var(--signal); }
.pm code { font-size: 19px; }
.pm span { display: block; margin-top: 12px; font-size: 19px; color: var(--ink-2); line-height: 1.4; }
.pm.danger span { color: var(--signal); }

/* ---------- Trifecta ---------- */
.tri-e { stroke: var(--signal); stroke-width: 8; stroke-linecap: round; transition: stroke .5s, stroke-width .5s; }
.tri-e.off { stroke: #C7D0DD; stroke-width: 4; stroke-dasharray: 4 14; }
.tri-n circle { fill: #fff; stroke: var(--ink); stroke-width: 4; }
.tri-n { transition: opacity .5s; }
.tri-n.off { opacity: .3; }
.tri-t { font-family: var(--head); font-size: 24px; font-weight: 600; fill: var(--ink); }
.tri-s { font-family: var(--body); font-size: 16px; fill: var(--muted); }
.tri-msg { font-family: var(--mono); font-size: 20px; font-weight: 700; fill: var(--signal); }
.tri-msg.safe { fill: var(--ok); }

/* ---------- Demo ---------- */
ol.demo-list { list-style: none; padding: 0; margin: 0; counter-reset: d; }
ol.demo-list li { counter-increment: d; display: grid; grid-template-columns: 44px 210px 1fr 60px; align-items: baseline; gap: 10px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: 20px; }
ol.demo-list li::before { content: counter(d); font-family: var(--head); font-weight: 700; color: var(--sky); font-size: 24px; }
ol.demo-list b { color: #fff; font-family: var(--head); font-size: 23px; font-weight: 600; }
ol.demo-list span { color: #B9C6DE; }
ol.demo-list em { font-style: normal; font-family: var(--mono); font-size: 16px; color: #8D97B5; text-align: right; }
