/* ============================================================================
   Motion & composition layer (the 49-minute talk).
   - kinetic titles: words rise out of a blur, the highlighted phrase gets a sweeping underline
   - staged entrances: every block declares data-in (style) + --d (delay); .enter plays them
   - four figure compositions: classic · mirror · hero · stage
   - ambient chapter canvases, panel "power-on" scans, chapter sweep, statement backdrop
   - poll reveal bursts and small micro-interactions inside figures
   Everything collapses under prefers-reduced-motion (styles.css) and print never gets .enter.
   ========================================================================== */
:root{--ease-out:cubic-bezier(.2,.8,.2,1);--ease-io:cubic-bezier(.7,0,.3,1);--ease-back:cubic-bezier(.34,1.56,.64,1)}

/* ---------- ambient canvas ---------- */
.slide-inner>.ambient{position:absolute;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;opacity:.85;
  -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,.35),#000 55%);mask-image:linear-gradient(180deg,rgba(0,0,0,.35),#000 55%)}
.enter>.ambient{animation:ambIn 2.2s ease both}
@keyframes ambIn{from{opacity:0}to{opacity:.85}}
.slide-leaving{position:absolute!important;inset:0;z-index:3;pointer-events:none}

/* ---------- kinetic type ---------- */
.w{display:inline-block}
.enter .w{animation:wIn .85s var(--ease-out) both;animation-delay:calc(var(--t0,0ms) + 60ms + var(--i,0) * 55ms)}
@keyframes wIn{0%{opacity:0;transform:translateY(.55em) rotate(2.5deg);filter:blur(10px)}100%{opacity:1;transform:none;filter:blur(0)}}
.slide-inner h1 mark{background:linear-gradient(90deg,var(--signal),color-mix(in srgb,var(--signal) 40%,transparent)) 0 94%/100% .075em no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-bottom:.04em}
.enter h1 mark{animation:markSweep .9s var(--ease-io) both,markGlow 1.6s ease-out both;animation-delay:calc(var(--t0,0ms) + 420ms + var(--i,0) * 55ms)}
@keyframes markSweep{from{background-size:0 .075em}to{background-size:100% .075em}}
@keyframes markGlow{0%{text-shadow:0 0 0 transparent}35%{text-shadow:0 0 .45em rgba(208,248,84,.55)}100%{text-shadow:0 0 0 transparent}}

/* ---------- staged entrances ---------- */
.enter [data-in]{animation-duration:.85s;animation-timing-function:var(--ease-out);animation-fill-mode:both;animation-delay:calc(var(--t0,0ms) + var(--d,0ms))}
.enter [data-in=up]{animation-name:inUp}
.enter [data-in=left]{animation-name:inLeft}
.enter [data-in=right]{animation-name:inRight}
.enter [data-in=pop]{animation-name:inPop;animation-duration:.75s}
.enter [data-in=line]{animation-name:inLine;animation-duration:1s;animation-timing-function:var(--ease-io)}
.enter [data-in=spin]{animation-name:inSpin;animation-duration:1.1s}
.enter [data-in=numeral]{animation-name:numeralIn;animation-duration:1.8s}
.enter [data-in=panel]{animation-name:inPanel,panelGlow;animation-duration:1s,2.4s;animation-timing-function:var(--ease-io),ease-out;animation-delay:calc(var(--t0,0ms) + var(--d,0ms)),calc(var(--t0,0ms) + var(--d,0ms) + 600ms)}
.enter .slide-meta{animation:inFade .9s ease both;animation-delay:var(--t0,0ms)}
.enter .slide-foot{animation:inFade 1s ease both;animation-delay:calc(var(--t0,0ms) + 900ms)}
@keyframes inFade{from{opacity:0}to{opacity:1}}
@keyframes inUp{from{opacity:0;transform:translateY(1.4cqw);filter:blur(6px)}to{opacity:1;transform:none;filter:blur(0)}}
@keyframes inLeft{from{opacity:0;transform:translateX(-2.4cqw);filter:blur(4px)}to{opacity:1;transform:none;filter:blur(0)}}
@keyframes inRight{from{opacity:0;transform:translateX(2.4cqw);filter:blur(4px)}to{opacity:1;transform:none;filter:blur(0)}}
@keyframes inPop{0%{opacity:0;transform:translateY(1.2cqw) scale(.86)}60%{opacity:1;transform:scale(1.025)}100%{opacity:1;transform:none}}
@keyframes inLine{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(-1cqw -1cqw -1cqw -1cqw)}}
@keyframes inSpin{from{opacity:0;transform:rotate(-120deg) scale(.6)}to{opacity:1;transform:none}}
@keyframes numeralIn{from{opacity:0;transform:translateY(4cqw) scale(.94)}to{opacity:.6;transform:none}}
@keyframes inPanel{0%{opacity:.2;clip-path:inset(0 100% 0 0 round .5cqw)}100%{opacity:1;clip-path:inset(-3cqw -3cqw -3cqw -3cqw round .5cqw)}}
@keyframes panelGlow{0%{box-shadow:0 0 0 1px color-mix(in srgb,var(--chap) 70%,transparent),0 0 4cqw color-mix(in srgb,var(--chap) 22%,transparent)}100%{box-shadow:0 1.5cqw 3cqw rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.03)}}
/* the scan line that crosses a panel as it powers on */
.enter .fig-stage[data-in=panel]::after,.enter .interactive-mount[data-in=panel]::after{content:'';position:absolute;top:0;bottom:0;left:0;width:14%;pointer-events:none;z-index:6;border-radius:.5cqw;
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--chap) 30%,transparent) 70%,color-mix(in srgb,var(--chap) 80%,transparent) 99%,transparent);
  animation:scanX 1.15s var(--ease-io) both;animation-delay:calc(var(--t0,0ms) + var(--d,0ms) + 80ms)}
@keyframes scanX{0%{left:-14%;opacity:1}85%{opacity:1}100%{left:100%;opacity:0}}

/* ---------- figure compositions ---------- */
/* mirror: notes on the left, figure on the right, title set flush right */
.slide-figure[data-layout=mirror] .fig-body{grid-template-columns:minmax(0,1fr) minmax(0,2.75fr)}
.slide-figure[data-layout=mirror] .fig-points{order:-1}
.slide-figure[data-layout=mirror] .fig-titles{margin-left:auto;text-align:right;display:flex;flex-direction:column;align-items:flex-end}
.slide-figure[data-layout=mirror] .fig-head .slide-title{max-width:72cqw}
.slide-figure[data-layout=mirror] .fig-head .slide-subtitle{max-width:62cqw}

/* hero: a tall editorial title column, the figure takes the full height beside it */
.slide-figure[data-layout=hero]{display:grid;grid-template-columns:minmax(0,27cqw) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);column-gap:3cqw}
.slide-figure[data-layout=hero] .fig-head{grid-column:1;grid-row:1;min-width:0}
.slide-figure[data-layout=hero] .fig-body{display:contents}
.slide-figure[data-layout=hero] .fig-stage{grid-column:2;grid-row:1/3;margin:.2cqw 0 1.4cqw}
.slide-figure[data-layout=hero] .fig-points{grid-column:1;grid-row:2;align-self:end;margin:1cqw 0 1.4cqw;overflow:visible;min-width:0}
.slide-figure[data-layout=hero] .fig-head .slide-title{font-size:clamp(22px,3.2cqw,62px);line-height:1.03;letter-spacing:-.05em;max-width:none}
.slide-figure[data-layout=hero] .fig-head .slide-subtitle{font-size:clamp(11px,1.16cqw,22px);margin-top:1cqw;max-width:none}
.slide-figure[data-layout=hero] .fig-titles .talk-hook{margin:1.3cqw 0 0}
.slide-figure[data-layout=hero] .fig-points .item-copy p{display:none}
.slide-figure[data-layout=hero] .fig-points .ruled-list{border-top:1px solid var(--line)}
.slide-figure[data-layout=hero] .fig-points .item-row{padding:.55cqw 0;border-bottom:1px solid var(--line)}
.slide-figure[data-layout=hero] .fig-points .item-copy h3{font-size:clamp(10px,1.1cqw,21px)}
.hero-numeral{position:absolute;left:3.2cqw;bottom:-3.4cqw;z-index:-1;pointer-events:none;font:700 23cqw/.8 var(--display);letter-spacing:-.09em;color:transparent;
  -webkit-text-stroke:.07cqw color-mix(in srgb,var(--chap) 55%,transparent);opacity:.6;
  background:linear-gradient(180deg,color-mix(in srgb,var(--chap) 10%,transparent),transparent 70%);-webkit-background-clip:text;background-clip:text}

/* stage: the figure runs the full width, notes become a ribbon underneath */
.slide-figure[data-layout=stage] .fig-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:1.2cqw;margin:1.6cqw 0 1.3cqw}
.slide-figure[data-layout=stage] .fig-points{display:flex;flex-direction:row;gap:1.4cqw;align-items:stretch;align-self:stretch;overflow:visible}
.slide-figure[data-layout=stage] .fig-points>*{margin:0!important}
.slide-figure[data-layout=stage] .talk-hook{flex:1.15;min-width:0}
.slide-figure[data-layout=stage] .ruled-list{flex:2.1;display:flex;gap:1.2cqw;border:0;min-width:0}
.slide-figure[data-layout=stage] .ruled-list .item-row{flex:1;display:block;border:0;border-left:1px solid var(--line-2);padding:.1cqw 0 .1cqw 1cqw;min-width:0}
.slide-figure[data-layout=stage] .item-ordinal{display:block;margin-bottom:.45cqw}
.slide-figure[data-layout=stage] .item-copy h3{font-size:clamp(10px,1.08cqw,21px)}
.slide-figure[data-layout=stage] .item-copy p{font-size:clamp(9px,.9cqw,17px);margin-top:.25em}
.slide-figure[data-layout=stage] .talk-poll{flex:1.3;min-width:0;padding:.6cqw .85cqw}
.slide-figure[data-layout=stage] .talk-poll-q{margin:.3cqw 0 .45cqw}
.slide-figure[data-layout=stage] .talk-hook p{font-size:clamp(10px,1.02cqw,20px)}

.enter .px-row>button{animation:inPop .7s var(--ease-back) both}
.enter .px-row>button:nth-child(2){animation-delay:calc(var(--t0,0ms) + 700ms)}
.enter .px-row>button:nth-child(3){animation-delay:calc(var(--t0,0ms) + 760ms)}
.enter .px-row>button:nth-child(4){animation-delay:calc(var(--t0,0ms) + 820ms)}
.enter .px-row>button:nth-child(5){animation-delay:calc(var(--t0,0ms) + 880ms)}
.enter .px-row>button:nth-child(6){animation-delay:calc(var(--t0,0ms) + 940ms)}
.enter .px-row>button:nth-child(7){animation-delay:calc(var(--t0,0ms) + 1000ms)}
.enter .px-row>button:nth-child(8){animation-delay:calc(var(--t0,0ms) + 1060ms)}
.enter .px-row>button:nth-child(9){animation-delay:calc(var(--t0,0ms) + 1120ms)}
.enter .px-row>button:nth-child(10){animation-delay:calc(var(--t0,0ms) + 1180ms)}
.enter .px-row>button:nth-child(11){animation-delay:calc(var(--t0,0ms) + 1240ms)}
.px-row>button>span:first-child{transition:transform .35s var(--ease-back),border-color .3s,box-shadow .3s!important}
.px-row>button:hover>span:first-child{transform:scale(1.12) translateY(-.2em)!important;box-shadow:0 .5em 1.4em rgba(0,0,0,.4)}

/* ---------- hook, ribbon, poll ---------- */
.talk-hook{position:relative;overflow:hidden}
.talk-hook::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent 30%,rgba(208,248,84,.12) 50%,transparent 70%);transform:translateX(-120%)}
.enter .talk-hook::after{animation:sheen 1.4s var(--ease-io) both;animation-delay:calc(var(--t0,0ms) + var(--d,0ms) + 500ms)}
@keyframes sheen{to{transform:translateX(120%)}}
.talk-hook.ribbon{margin:0}
.talk-poll{position:relative}
.talk-poll:not(.revealed)::before{content:'';position:absolute;inset:-1px;border-radius:inherit;border:1px solid var(--signal);opacity:0;pointer-events:none;animation:pollBreath 3.2s 2.2s ease-in-out infinite}
@keyframes pollBreath{0%,100%{opacity:0}50%{opacity:.55}}
.talk-poll-option{transition:background .25s,border-color .25s,opacity .3s,transform .2s var(--ease-back)!important}
.talk-poll-option:hover{transform:translateY(-1px)}
.talk-poll-option:active{transform:scale(.97)}
.talk-poll.revealed .talk-poll-option.right{animation:rightBurst .8s var(--ease-out)}
.talk-poll.revealed .talk-poll-option.wrong{animation:wrongShake .5s ease}
@keyframes rightBurst{0%{box-shadow:0 0 0 0 rgba(208,248,84,.75);transform:scale(1)}35%{transform:scale(1.045)}100%{box-shadow:0 0 0 1.4cqw rgba(208,248,84,0);transform:scale(1)}}
@keyframes wrongShake{0%,100%{transform:none}20%{transform:translateX(-.35cqw)}40%{transform:translateX(.35cqw)}60%{transform:translateX(-.2cqw)}80%{transform:translateX(.2cqw)}}
.talk-poll.revealed .talk-poll-why{animation:whyIn .5s var(--ease-out) both}
@keyframes whyIn{from{opacity:0;transform:translateY(.4cqw);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}

/* ---------- chapter sweep ---------- */
.chapter-sweep{position:absolute;inset:0;z-index:6;pointer-events:none;display:flex;align-items:center;gap:2.6cqw;padding:0 7cqw;background:var(--sweep,#d0f854);color:#0e1216;
  animation:sweepFwd 1.4s var(--ease-io) both}
.chapter-sweep[data-dir=back]{animation-name:sweepBack}
.chapter-sweep[data-chapter=foundations]{--sweep:#d0f854}.chapter-sweep[data-chapter=practice]{--sweep:#5cd5c7}.chapter-sweep[data-chapter=building]{--sweep:#5ea8f9}.chapter-sweep[data-chapter=frontier]{--sweep:#c493e8}
.chapter-sweep b{font:700 15cqw/.8 var(--display);letter-spacing:-.08em;animation:inUp .7s .12s var(--ease-out) both}
.chapter-sweep strong{display:block;font:700 6cqw/1 var(--display);letter-spacing:-.05em;animation:inLeft .6s .2s var(--ease-out) both}
.chapter-sweep span{display:block;margin-top:1cqw;font:500 1.2cqw/1.3 ui-monospace,'Cascadia Mono',Consolas,monospace;letter-spacing:.16em;text-transform:uppercase;animation:inLeft .6s .3s var(--ease-out) both}
@keyframes sweepFwd{0%{clip-path:inset(0 100% 0 0)}32%{clip-path:inset(0 0 0 0)}62%{clip-path:inset(0 0 0 0)}100%{clip-path:inset(0 0 0 100%)}}
@keyframes sweepBack{0%{clip-path:inset(0 0 0 100%)}32%{clip-path:inset(0 0 0 0)}62%{clip-path:inset(0 0 0 0)}100%{clip-path:inset(0 100% 0 0)}}

/* ---------- cover ---------- */
.cover-title .l,.cover-title .cover-word{display:inline-block;color:inherit}
.cover-title .cover-second{display:block;color:var(--ink-3)}
.cover-title .cover-word{white-space:nowrap}
.enter .cover-title .l{animation:letterIn 1.05s var(--ease-out) both;animation-delay:calc(var(--t0,0ms) + 250ms + var(--i,0) * 42ms);transform-origin:50% 100%}
@keyframes letterIn{0%{opacity:0;transform:translateY(45%) rotateX(-75deg) scale(.9);filter:blur(14px)}100%{opacity:1;transform:none;filter:blur(0)}}
.cover-sweep{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1;pointer-events:none;
  background:linear-gradient(100deg,transparent 42%,rgba(208,248,84,.07) 49%,rgba(208,248,84,.16) 50%,rgba(208,248,84,.07) 51%,transparent 58%) no-repeat;background-size:250% 100%;background-position:120% 0}
.enter .cover-sweep{animation:coverScan 7s 1.2s ease-in-out infinite}
@keyframes coverScan{0%{background-position:120% 0}55%,100%{background-position:-20% 0}}

/* ---------- statement backdrop ---------- */
.stmt-backdrop{position:absolute;right:2.5cqw;top:16.5cqw;z-index:-1;pointer-events:none;display:flex;flex-direction:column;align-items:flex-end}
.stmt-num{position:relative;font:700 15cqw/.82 var(--display);letter-spacing:-.08em;color:transparent;-webkit-text-stroke:.1cqw rgba(196,147,232,.45);font-variant-numeric:tabular-nums}
.stmt-strike{position:absolute;left:6%;right:2%;top:33%;height:.8cqw;border-radius:1cqw;background:linear-gradient(90deg,#fe7d4e,#ff9d76);transform-origin:left center;transform:rotate(-7deg);box-shadow:0 0 3cqw rgba(254,125,78,.45)}
.enter .stmt-strike{animation:strike .75s var(--ease-io) both;animation-delay:calc(var(--t0,0ms) + 1900ms)}
@keyframes strike{from{transform:rotate(-7deg) scaleX(0)}to{transform:rotate(-7deg) scaleX(1)}}
.stmt-after{margin-top:1.6cqw;font:500 1.25cqw/1 ui-monospace,'Cascadia Mono',Consolas,monospace;letter-spacing:.22em;text-transform:uppercase;color:#ff9d76}
.enter .stmt-after{animation:inRight .7s var(--ease-out) both;animation-delay:calc(var(--t0,0ms) + 2500ms)}
.enter .stmt-num{animation:inFade 1s ease both;animation-delay:calc(var(--t0,0ms) + 200ms)}

/* ---------- micro-interactions inside figures ---------- */
.fx-btn:active:not(:disabled),.fx-chip:active{transform:scale(.96)!important}
.fx-btn.primary{box-shadow:0 0 0 0 rgba(208,248,84,.5);transition:background .15s,transform .15s,box-shadow .3s}
.fx-btn.primary:hover:not(:disabled){box-shadow:0 0 1.4em rgba(208,248,84,.35)}
.fx-chip{transition:border-color .2s,background .25s,color .2s,box-shadow .3s,transform .2s var(--ease-back)}
.fx-chip.on{box-shadow:0 0 1.2em rgba(208,248,84,.28)}
.fx-chip:hover:not(.on){transform:translateX(2px)}
.fx-seg button.is-on{animation:segOn .35s var(--ease-back)}
@keyframes segOn{from{transform:scale(.9)}to{transform:none}}
.fx input[type=range]::-webkit-slider-thumb,.lx input[type=range]::-webkit-slider-thumb{transition:transform .2s var(--ease-back),box-shadow .2s}
.fx input[type=range]:hover::-webkit-slider-thumb,.lx input[type=range]:hover::-webkit-slider-thumb{transform:scale(1.25);box-shadow:0 0 1.2em rgba(208,248,84,.6)}
.fx-step-enter{animation:fxIn2 .45s var(--ease-out) both}
@keyframes fxIn2{from{opacity:0;transform:translateY(.4em) scale(.98);filter:blur(3px)}to{opacity:1;transform:none;filter:blur(0)}}
.fx-card.dark{position:relative;overflow:hidden}
.fx-card.dark::after{content:'';position:absolute;inset:0;pointer-events:none;background:radial-gradient(60% 80% at var(--gx,20%) 0%,rgba(208,248,84,.12),transparent 70%);animation:cardGlow 6s ease-in-out infinite alternate}
@keyframes cardGlow{from{--gx:10%;opacity:.6}to{--gx:90%;opacity:1}}
@property --gx{syntax:'<percentage>';inherits:false;initial-value:20%}
.fx-callout{animation:fxIn2 .45s var(--ease-out) both}

@media print{.slide-inner>.ambient{opacity:.5}.chapter-sweep,.cover-sweep{display:none}}

/* stage ribbon: keep it lean so the figure gets the height */
.slide-figure[data-layout=stage] .ruled-list .item-copy p{display:none}
.slide-figure[data-layout=stage] .ruled-list .item-row{align-self:center}
.slide-figure[data-layout=stage] .talk-hook{padding:.6cqw .9cqw .7cqw}
.slide-figure[data-layout=stage] .talk-hook p{font-size:clamp(9px,.95cqw,18px);margin-top:.3cqw}
.slide-figure[data-layout=stage] .talk-poll-q{font-size:clamp(9px,.95cqw,18px)}
.slide-figure[data-layout=stage] .talk-poll-option{padding:.28cqw .5cqw;font-size:clamp(8px,.86cqw,16px)}
.slide-figure[data-layout=stage] .talk-poll-options{flex-direction:row;flex-wrap:wrap}
.slide-figure[data-layout=stage] .talk-poll-option{flex:1 1 auto;grid-template-columns:auto minmax(0,1fr)}
.slide-figure[data-layout=hero] .hero-numeral{opacity:.5}
/* in the ribbon the answer pops up as a speech bubble instead of growing the ribbon */
.slide-figure[data-layout=stage] .talk-poll-why{position:absolute;left:-.2cqw;right:-.2cqw;bottom:calc(100% + .8cqw);margin:0;z-index:8;background:#1a2026;color:var(--ink);border:1px solid color-mix(in srgb,var(--signal) 60%,transparent);border-radius:.45cqw;padding:.7cqw .9cqw;font-size:clamp(9px,.98cqw,19px);box-shadow:0 1.2cqw 3cqw rgba(0,0,0,.55),0 0 2cqw rgba(208,248,84,.12)}
.slide-figure[data-layout=stage] .talk-poll-why::after{content:'';position:absolute;right:2.4cqw;top:100%;border:.6cqw solid transparent;border-top-color:color-mix(in srgb,var(--signal) 60%,transparent)}
.slide-figure[data-layout=hero][data-long-title] .fig-head .slide-title{font-size:clamp(20px,2.75cqw,54px)}
.w-glue{white-space:nowrap;display:inline-block}
.slide-figure[data-layout=mirror] .fig-points.has-poll .item-copy p{display:none}
