:root{color-scheme:light;--ink:#242424;--muted:#606060;--blue:#234e70;--rust:#a54f32;--teal:#007f73;--rule:#dededb;--serif:Georgia,'Times New Roman',serif;--sans:Arial,Helvetica,sans-serif}*{box-sizing:border-box}html{scroll-padding-top:1rem}body{margin:0;background:#fff;color:var(--ink);font:18px/1.65 var(--serif)}h1,h2,h3,p,figure{margin:0}a{color:var(--blue);text-underline-offset:.23em}a:hover{color:var(--rust)}:focus-visible{outline:3px solid var(--rust);outline-offset:5px}::selection{background:#e5eef4}.skip{position:fixed;top:-100px;left:16px;padding:14px;background:white;z-index:100}.skip:focus{top:10px}header{display:flex;align-items:center;justify-content:space-between;margin:0 auto;padding:19px 4%;max-width:1600px;border-bottom:1px solid var(--rule);font:11px/1.3 var(--sans);letter-spacing:.03em}header a{text-decoration:none}header>a:first-child{letter-spacing:.13em}header>span{color:var(--muted)}.hero{max-width:1440px;min-height:calc(100svh - 54px);margin:auto;padding:5.5rem 6% 4rem;display:grid;grid-template-columns:minmax(280px,.78fr) minmax(0,1.22fr);align-items:center;column-gap:1rem;position:relative}.eyebrow{font:10px/1.5 var(--sans);letter-spacing:.18em;text-transform:uppercase;color:var(--blue)}h1{font-size:clamp(72px,8.8vw,132px);font-weight:400;line-height:1.05;letter-spacing:-.065em;margin:.8rem 0 1.4rem}.subtitle{font-size:clamp(28px,3vw,44px);font-weight:400;line-height:1.2;letter-spacing:-.025em}.intro{font-size:17px;color:var(--muted);line-height:1.6;margin-top:1.7rem}.begin{display:inline-flex;gap:45px;margin-top:2rem;border-bottom:1px solid var(--blue);padding-bottom:.4rem;text-decoration:none;font:12px/1.8 var(--sans)}.hero-art img{width:100%;height:auto;display:block}.hero-art figcaption{display:flex;justify-content:space-between;padding:0 12%;font:11px/1.5 var(--sans);color:var(--muted)}.hero-foot{position:absolute;bottom:22px;left:6%;right:6%;display:flex;justify-content:space-between;align-items:center;font:11px/1.5 var(--sans);color:var(--muted);border-top:1px solid var(--rule);padding-top:13px}.hero-foot .katex{font-size:20px;color:var(--blue)}.story{position:relative;height:1700svh;border-top:1px solid var(--rule)}.stage{position:sticky;top:0;height:100svh;max-width:1440px;margin:auto;padding:22px 4% 16px;display:flex;flex-direction:column;overflow:hidden;background:#fff}.progress-track{position:absolute;top:0;left:0;right:0;height:3px;background:#f0f0ed}.progress-track>div{height:100%;background:var(--blue);width:0}.stage-top{font:10px/1.4 var(--sans);display:flex;justify-content:space-between;gap:15px;letter-spacing:.09em;color:var(--muted);text-transform:uppercase}.stage-top a{text-decoration:none}.scene-layout{display:grid;grid-template-columns:minmax(240px,.73fr) minmax(0,1.5fr);gap:5%;flex:1;min-height:0;align-items:center}.narration{padding-bottom:20px}.narration h2{font:400 clamp(29px,3vw,44px)/1.14 var(--serif);letter-spacing:-.035em;margin:18px 0 23px}.narration>p:not(.eyebrow):not(.detail){font-size:18px;line-height:1.65}.equation{margin:24px 0;color:var(--blue);font-size:18px;min-height:35px}.equation .katex-display{margin:0;text-align:left}.equation .katex-display>.katex{text-align:left}.detail{font:12px/1.6 var(--sans);color:var(--muted);border-top:1px solid var(--rule);padding-top:15px}.visual{min-width:0;width:100%;height:100%;max-height:620px;display:flex;flex-direction:column;justify-content:center}.visual svg{display:block;width:100%;max-height:540px;min-height:0;flex:1;overflow:visible}.visual>figcaption{text-align:center;font:11px/1.5 var(--sans);color:var(--muted);padding:10px 8px 20px;min-height:42px}.visual text{font-family:var(--sans);fill:var(--ink)}.visual .mathbox{display:flex;justify-content:center;align-items:center;height:100%;width:100%;line-height:1.2}.visual .mathbox .katex{font-size:1em}.stage-bottom{display:flex;justify-content:space-between;border-top:1px solid var(--rule);padding-top:12px;gap:15px;font:10px/1.5 var(--sans);color:var(--muted)}.afterword{max-width:800px;padding:7rem 2rem 4rem;margin:auto}.afterword h2{font-size:45px;letter-spacing:-.035em;line-height:1.17;font-weight:400;margin:1rem 0 2rem}.afterword>p{margin-top:1.5rem}.afterword h3{font-size:25px;font-weight:400;margin-top:3rem;letter-spacing:-.02em}.closing-math{margin:2.2rem 0;overflow-x:auto;font-size:18px;color:var(--blue)}.afterword .katex{font-size:1.05em}details{border-top:1px solid var(--rule);padding:1.3rem 0;margin-top:2rem}summary{font:14px/1.5 var(--sans);color:var(--blue);cursor:pointer}details p{font-size:16px;margin-top:1rem}#transcript section{margin:2rem 0}#transcript h3{margin:0}#transcript .transcript-eq{margin-top:1rem;overflow-x:auto}.return{display:flex;justify-content:space-between;font:12px/1.6 var(--sans)}footer{padding:1.5rem;text-align:center;border-top:1px solid var(--rule);font:11px/1.5 var(--sans);color:var(--muted)}.no-script{padding:1rem;max-width:800px;margin:auto}
@media(min-width:1450px){.stage{padding-top:30px}.scene-layout{gap:6%}}
@media(max-width:760px){header{padding:16px 5%;font-size:10px}header>span{display:none}.hero{grid-template-columns:1fr;padding:2.7rem 7% 5rem;gap:1.6rem;min-height:calc(100svh - 46px)}.hero-copy{text-align:center}h1{font-size:80px;margin:.55rem 0 .8rem}.subtitle{font-size:31px}.intro{font-size:15px;margin-top:1rem}.begin{margin-top:1.25rem}.hero-art{max-width:500px;width:100%;margin:auto}.hero-art figcaption{font-size:10px}.hero-foot{bottom:18px;font-size:9px;left:7%;right:7%}.hero-foot .katex{font-size:17px}.stage{padding:14px 5% 12px}.stage-top{font-size:9px;letter-spacing:.04em}.scene-layout{display:flex;flex-direction:column;gap:0;justify-content:center}.narration{padding:16px 0 0;flex-shrink:0;width:100%}.narration .eyebrow{display:none}.narration h2{font-size:29px;margin:0 0 11px;max-width:100%;line-height:1.13}.narration>p:not(.eyebrow):not(.detail){font-size:15px;line-height:1.5}.equation{margin:13px 0 9px;font-size:15px;min-height:28px}.detail{font-size:10px;border:0;padding:0;line-height:1.4}.visual{flex:1;min-height:0;max-height:49svh;padding-top:4px}.visual>figcaption{font-size:9px;line-height:1.35;padding:5px 0 8px;min-height:28px}.stage-bottom{font-size:8px;padding-top:8px;gap:10px}.stage-bottom>span:last-child{text-align:right;max-width:130px}.afterword{padding:4rem 6%}.afterword h2{font-size:34px}.afterword>p{font-size:17px}.closing-math{font-size:13px}.afterword .katex{font-size:1em}}
@media(max-height:700px) and (min-width:761px){.stage{padding-top:14px}.narration h2{font-size:32px;margin:12px 0 16px}.narration>p:not(.eyebrow):not(.detail){font-size:16px}.equation{margin:15px 0;font-size:16px}.detail{font-size:11px}.visual>figcaption{padding-bottom:5px}.stage-bottom{padding-top:8px}}
@media(max-height:720px) and (max-width:760px){.stage{padding-top:10px}.narration{padding-top:10px}.narration h2{font-size:24px;margin-bottom:8px}.narration>p:not(.eyebrow):not(.detail){font-size:13px}.equation{margin:9px 0 6px;font-size:13px;min-height:23px}.detail{font-size:9px}.visual{max-height:45svh}.stage-bottom{font-size:7px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
@media print{header,.hero-art,.story,.return,footer{display:none}.hero{display:block;min-height:0;padding:2rem}.hero-foot,.begin{display:none}.afterword{padding:2rem;max-width:none}details{display:block}details>div,details>p{display:block!important}summary{font-size:20px}}
.equation .katex{font-size:1.05em}.equation>.katex{white-space:nowrap;display:inline-block}.detail .katex{font-size:1.05em}
@media(max-width:760px){.visual text{font-size:24px}}
@media(max-width:760px){.visual .column-label{font-size:22px}}
.route-link{font:12px/1.5 var(--sans);margin-top:1.2rem}.route-link a{text-decoration-thickness:1px}.hero .intro{max-width:34em}.interpretation-guide{padding-top:5rem}.table-scroll{overflow-x:auto;margin-top:1.7rem}.interpretation-table{width:100%;border-collapse:collapse;font:14px/1.5 var(--sans)}.interpretation-table th{text-align:left;font-weight:400;color:var(--blue);border-bottom:1px solid var(--ink)}.interpretation-table th,.interpretation-table td{padding:14px 12px 14px 0;vertical-align:top}.interpretation-table td{border-bottom:1px solid var(--rule)}.interpretation-table th:first-child{width:28%}.interpretation-table th:nth-child(2){width:36%}.section-links{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem;font:12px/1.6 var(--sans)}.chapter-intro{max-width:1100px;margin:auto;padding:5rem 6% 4rem;border-top:1px solid var(--rule)}.chapter-intro h2{font-size:clamp(36px,5vw,60px);font-weight:400;letter-spacing:-.035em;line-height:1.15;margin:1rem 0 1.5rem}.chapter-intro>p:last-child{max-width:43rem;color:var(--muted)}
@media(max-width:760px){.hero-foot>span:first-child{max-width:240px}.route-link{font-size:11px}.interpretation-table{font-size:12px}.interpretation-table th,.interpretation-table td{padding:12px 10px 12px 0}.chapter-intro{padding:3.2rem 6%}.chapter-intro>p:last-child{font-size:16px}.interpretation-guide{padding-top:3.5rem}}
@media print{.chapter-intro{padding:2rem;break-before:page}.interpretation-table{font-size:11px}.route-link,.section-links{display:none}}
#story,#mechanics-story,#decoder-story{scroll-margin-top:-1rem}


/* The sentence-led route is complete on its own; arithmetic remains optional. */
.sentence-examples{margin:1rem 0 1.2rem}.sentence-examples[hidden]{display:none}.sentence-examples blockquote{margin:0 0 .9rem;padding-left:1rem;border-left:2px solid var(--rule)}.sentence-examples blockquote p{font:18px/1.4 var(--serif)}.sentence-examples cite{display:block;margin-top:.3rem;font:13px/1.3 var(--sans);font-style:normal;color:var(--muted)}.sentence-story[data-has-quotes="true"] .narration h2{margin-bottom:14px}.sentence-story[data-has-quotes="true"] .equation{margin:14px 0}.worked-appendix{max-width:none;padding:0;margin:0;border-top:1px solid var(--rule)}.worked-appendix>summary{padding:1.5rem 6%;font:18px/1.5 var(--serif)}.appendix-intro{max-width:850px;margin:0 auto!important;padding:0 2rem 2rem;font-size:17px!important}.worked-appendix .chapter-intro{border:0}.worked-appendix[open]>summary{border-bottom:1px solid var(--rule)}
@media(max-width:760px){.sentence-examples{margin:.6rem 0}.sentence-examples blockquote{margin:0 0 .6rem;padding-left:.7rem}.sentence-examples blockquote p{font-size:16px;line-height:1.3}.sentence-examples cite{font-size:12px}.sentence-story[data-has-quotes="true"] .narration>p:not(.detail){font-size:16px}.sentence-story[data-has-quotes="true"] .narration h2{font-size:26px;margin-bottom:8px}.sentence-story[data-has-quotes="true"] .equation{display:none}.sentence-story[data-has-quotes="true"] .visual{max-height:42svh}.worked-appendix>summary{font-size:17px}.appendix-intro{padding:1rem 6%;font-size:16px!important}}

/* The next scene repeats both full sentences. On narrow displays, reserve the
   opening stage for the architecture instead of duplicating those quotes. */
@media(max-width:760px){.sentence-story[data-has-quotes="true"] .sentence-examples{display:none}.sentence-story[data-has-quotes="true"] .visual{max-height:58svh;min-height:clamp(180px,35svh,300px)}}

/* The illustrated title leads into the complete, scroll-driven lesson. */
#story{border-top:0;scroll-margin-top:0}
.lesson-header{width:100%;max-width:none;margin:0 0 14px;padding:0 0 12px;flex-shrink:0;font-size:12px;gap:14px}
.lesson-heading{align-items:baseline;flex-shrink:0;gap:20px;margin-bottom:6px;font-size:12px}
.lesson-heading .lesson-name{text-decoration:none;font:400 clamp(42px,4.7vw,64px)/1.05 var(--serif);letter-spacing:-.045em;margin:0;color:var(--ink);text-transform:none}
.lesson-heading #chapter{margin-left:auto;text-align:right}
.lesson-heading #counter{white-space:nowrap}

@media(max-height:760px){.sentence-story[data-has-quotes="true"] .sentence-examples{display:none}.lesson-heading .lesson-name{font-size:42px}}
@media(max-width:760px){
 .lesson-header{font-size:12px;margin-bottom:12px;padding-bottom:10px;gap:10px}
 .lesson-heading{display:grid;grid-template-columns:1fr auto;gap:6px 12px;margin-bottom:4px;font-size:11px}
 .lesson-heading .lesson-name{font-size:38px;grid-column:1;grid-row:1}
 .lesson-heading #chapter{grid-column:1;grid-row:2;margin:0;text-align:left}
 .lesson-heading #counter{grid-column:2;grid-row:1;align-self:center}
 .sentence-story[data-has-quotes="true"] .visual{min-height:0;max-height:none}

}
@media print{.lesson-heading{display:none}}

.trained-story{height:400svh}.trained-explorer-section{max-width:1180px;padding-top:4rem}.trained-explorer-controls{display:grid;grid-template-columns:2fr 1fr 1fr 2fr;gap:1rem;margin:2rem 0;font:14px/1.5 var(--sans)}.trained-explorer-controls label{display:flex;flex-direction:column;gap:.4rem}.trained-explorer-controls select{width:100%;min-height:44px;padding:8px;border:1px solid var(--rule);border-radius:3px;background:white;color:var(--ink);font:inherit}.trained-explorer-summary,.trained-explorer-status{font:15px/1.6 var(--sans);margin:1rem 0}.trained-explorer-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(230px,1fr);gap:2rem;margin-top:1.5rem}.trained-heatmap-scroll{overflow-x:auto}.trained-heatmap{display:block;width:100%;min-width:500px}.trained-weight-table{width:100%;border-collapse:collapse;font:13px/1.5 var(--sans)}.trained-weight-table td,.trained-weight-table th{text-align:left;padding:6px 8px;border-bottom:1px solid #e5e5e2}.trained-weight-table th{font-weight:400;color:var(--blue)}.trained-provenance{font:13px/1.6 var(--sans);color:var(--muted)}.trained-token-key{font:13px/1.6 var(--sans)}
@media(max-width:760px){.trained-explorer-controls{grid-template-columns:1fr 1fr;gap:.75rem}.trained-explorer-grid{grid-template-columns:1fr}.trained-explorer-section{padding:3rem 5%}.trained-explorer-section h2{font-size:32px}.trained-explorer-section>p{font-size:15px}.trained-story .visual{max-height:none}}

.trained-heatmap svg{display:block;width:100%;font-family:var(--sans)}.trained-weight-table table{width:100%;border-collapse:collapse}.trained-weight-table caption{text-align:left;color:var(--blue);padding-bottom:.5rem}.trained-explorer-note{font:13px/1.6 var(--sans);color:var(--muted);margin-top:1rem}.trained-explorer-controls>*{min-width:0}

/* Let the two sentences carry the comparison scene on their own. */
#story[data-scene-id="sentence-contrast"] #narration{display:none}
#story[data-scene-id="sentence-contrast"] .scene-layout{grid-template-columns:minmax(0,1fr)}
#story[data-scene-id="sentence-contrast"] .visual{max-width:760px;max-height:none;margin-inline:auto}

/* Contextual meaning introduces the existing residual-stream sequence. */
.intuition-story{height:700svh;border-top:0}
.intuition-story .lesson-chapter{margin-left:auto;text-align:right}
.intuition-story .lesson-counter{white-space:nowrap}
@media(max-width:760px){
 .intuition-story .lesson-chapter{grid-column:1;grid-row:2;margin:0;text-align:left}
 .intuition-story .lesson-counter{grid-column:2;grid-row:1;align-self:center}
 .intuition-story .visual{max-height:none}
}

/* Center the measured prediction cards; model context precedes the stage. */
#trained-story[data-scene="0"] #trained-narration{display:none}
#trained-story[data-scene="0"] .scene-layout{grid-template-columns:minmax(0,1fr)}
#trained-story[data-scene="0"] .visual{max-width:840px;max-height:none;margin-inline:auto}

/* The token-update diagram carries this scene on its own. */
#intuition[data-scene="5"] #intuition-narration{display:none}
#intuition[data-scene="5"] .scene-layout{grid-template-columns:minmax(0,1fr)}
#intuition[data-scene="5"] .visual{max-width:840px;max-height:none;margin-inline:auto}

/* Guided observations precede the optional full-tensor explorer. */
.equation[hidden]{display:none}
.chapter-intro>.trained-takeaway{margin-top:1.4rem;color:var(--ink)}
.trained-explorer-presets{max-width:46rem;margin-top:1.8rem;font:14px/1.5 var(--sans)}
.trained-explorer-presets label{display:flex;flex-direction:column;gap:.4rem}
.trained-explorer-presets select{width:100%;min-height:44px;padding:8px;border:1px solid var(--rule);border-radius:3px;background:white;color:var(--ink);font:inherit}
.trained-explorer-presets+.trained-explorer-controls{margin-top:1rem}
#trained-reading{scroll-margin-top:2rem}
@media(max-width:760px){
 .trained-story .stage-bottom>span:last-child{max-width:58%}
 .trained-story .equation{overflow-x:auto;max-width:100%}
 .trained-explorer-presets{font-size:13px}
}

/* The lookup-pooling animation states its takeaway above the diagram. */
#mechanics-story:is([data-scene-id="socks-lookup-pooling"],[data-scene-id="socks-position-pooling"],[data-scene-id="socks-residual-readout"]) #mechanics-narration{display:none}
#mechanics-story:is([data-scene-id="socks-lookup-pooling"],[data-scene-id="socks-position-pooling"],[data-scene-id="socks-residual-readout"]) .scene-layout{grid-template-columns:minmax(0,1fr)}
#mechanics-story:is([data-scene-id="socks-lookup-pooling"],[data-scene-id="socks-position-pooling"],[data-scene-id="socks-residual-readout"]) .visual{max-width:840px;max-height:none;margin-inline:auto}

/* The measured sequence is one centered visual, with no narration sidebar. */
#trained-story[data-scene] .scene-layout{display:flex;flex-direction:column;justify-content:center;gap:8px}
#trained-story[data-scene] #trained-narration{display:block;text-align:center;flex:0 0 auto;width:100%;padding:10px 0 0}
#trained-story #trained-narration h2{font-size:clamp(25px,3.2vw,39px);line-height:1.15;margin:0 0 9px}
#trained-story #trained-narration>p:not(.eyebrow):not(.detail){font-size:16px;line-height:1.45;max-width:65ch;margin:auto}
#trained-story[data-scene] .visual{width:100%;max-width:760px;max-height:none;min-height:0;flex:1;margin-inline:auto;padding:0}
#trained-story .visual svg{width:100%;height:100%;max-height:540px;flex:1}
#trained-story .visual>figcaption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;min-height:0;white-space:nowrap}
#trained-story .stage-bottom{flex:0 0 auto}
#trained-story .stage-bottom>span:last-child{max-width:none}
.trained-methods{margin-top:2rem}
@media(max-width:760px){
 #trained-story .stage{padding:14px 4% 10px}
 #trained-story[data-scene] #trained-narration{padding-top:14px}
 #trained-story #trained-narration h2{font-size:26px;max-width:23ch;margin:0 auto 9px}
 #trained-story #trained-narration>p:not(.eyebrow):not(.detail){font-size:14px;max-width:41ch}
 #trained-story .stage-top{letter-spacing:0;font-size:9px;gap:7px}
 #trained-story .stage-bottom{font-size:8px;gap:8px}
 #trained-story .stage-bottom>span:first-child{display:none}
 #trained-story .stage-bottom>span:last-child{width:100%;text-align:center}
}
@media(max-height:700px){
 #trained-story[data-scene] #trained-narration{padding-top:6px}
 #trained-story #trained-narration h2{font-size:25px;margin-bottom:7px}
 #trained-story #trained-narration>p:not(.eyebrow):not(.detail){font-size:13px}
 #trained-story[data-scene] .scene-layout{gap:2px}
}


/* Let the paired desert sentences fill their own scene. */
#intuition[data-scene-id="desert-senses"] #intuition-narration{display:none}
#intuition[data-scene-id="desert-senses"] .scene-layout{grid-template-columns:minmax(0,1fr)}
#intuition[data-scene-id="desert-senses"] .visual{max-width:760px;max-height:none;margin-inline:auto}
