/* Curriculum 3.0: continuous chapter reading layer */
.chapter-module-button{grid-template-columns:30px minmax(0,1fr) auto;padding-block:.85rem}
.module-nav.is-active .chapter-module-button{border-left:4px solid var(--orange);padding-left:.75rem}
.chapter-overview .phase-section{padding-top:3.25rem}
.journey-strip{display:grid;grid-template-columns:repeat(5,1fr);margin:2.75rem 0 1rem;border-block:1px solid var(--dark-line)}
.journey-strip>div{position:relative;padding:1.1rem 1rem 1.25rem;border-right:1px solid var(--line)}
.journey-strip>div:last-child{border-right:0}
.journey-strip span,.section-index{display:block;color:var(--orange);font:600 .66rem var(--mono);letter-spacing:.1em}
.journey-strip strong{display:block;margin:.4rem 0 .2rem;font:700 1rem var(--display)}
.journey-strip p{margin:0;color:#68757c;font-size:.7rem;line-height:1.45}
.chapter-list{border-top:2px solid var(--ink)}
.chapter-row{display:grid;grid-template-columns:80px minmax(260px,1fr) minmax(230px,.7fr) 72px;align-items:center;width:100%;padding:1.2rem 0;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;cursor:pointer}
.chapter-row:hover{background:#edf1ed}
.chapter-row-code{padding-left:.7rem;color:var(--orange);font:600 .7rem var(--mono)}
.chapter-row-main{display:grid;gap:.25rem;padding-right:1rem}
.chapter-row-main strong{font:700 1.05rem/1.45 var(--display)}
.chapter-row-main small{color:#5e6a71;font-size:.73rem;line-height:1.55}
.chapter-row-artifact{display:grid;gap:.25rem;padding:0 1rem;border-left:1px solid var(--line);color:#384950;font-size:.72rem;line-height:1.5}
.chapter-row-artifact small{color:#7a858a;font:600 .6rem var(--mono);letter-spacing:.08em}
.chapter-row-progress{display:flex;align-items:center;justify-content:flex-end;gap:.45rem;padding-right:.7rem;color:var(--dark-steel);font:.68rem var(--mono)}
.chapter-row-progress svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8}

.chapter-page{max-width:1440px;margin:0 auto;padding:clamp(1.5rem,4vw,4rem) clamp(1rem,4vw,4rem) 7rem}
.chapter-hero{padding-bottom:2rem;border-bottom:4px solid var(--ink)}
.chapter-kicker{color:var(--orange);font:600 .7rem var(--mono);letter-spacing:.1em}
.chapter-hero-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);gap:clamp(2rem,6vw,5rem);align-items:end;margin-top:1.2rem}
.chapter-question{margin:0;color:var(--steel);font:600 .75rem var(--mono);letter-spacing:.08em}
.chapter-hero h1{max-width:18ch;margin:.65rem 0 1.25rem;font:900 clamp(2.25rem,5vw,4.4rem)/1.14 var(--display)}
.chapter-goal{max-width:68ch;margin:0;color:var(--soft-ink);font-size:1.02rem;line-height:1.9}
.chapter-hero-grid>aside{padding:1.25rem 0 0 1.5rem;border-left:1px solid var(--dark-line)}
.chapter-hero-grid>aside span{display:block;margin-top:1rem;color:#6c777d;font:600 .62rem var(--mono);letter-spacing:.08em}
.chapter-hero-grid>aside span:first-child{margin-top:0}
.chapter-hero-grid>aside p{margin:.35rem 0 0;font-size:.8rem;line-height:1.7}
.chapter-hero-grid>aside strong{display:block;margin-top:.35rem;color:var(--dark-steel);font:700 .92rem/1.6 var(--display)}
.chapter-outcomes{display:grid;grid-template-columns:130px 1fr;gap:1.25rem;margin-top:1.8rem;padding-top:1.25rem;border-top:1px solid var(--line)}
.chapter-outcomes>strong{color:var(--dark-steel);font:.7rem var(--mono)}
.chapter-outcomes ol{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin:0;padding:0;list-style:none;counter-reset:outcome}
.chapter-outcomes li{position:relative;padding-left:2rem;font-size:.78rem;line-height:1.65;counter-increment:outcome}
.chapter-outcomes li:before{content:counter(outcome);position:absolute;left:0;top:-.1rem;color:var(--orange);font:700 1rem var(--mono)}

.chapter-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:clamp(2rem,5vw,5rem);align-items:start}
.chapter-outline{position:sticky;top:calc(var(--header) + 1rem);max-height:calc(100vh - var(--header) - 2rem);overflow:auto;padding:2rem 0}
.chapter-outline>a{display:block;padding:.42rem 0;color:#5e6a71;border-bottom:1px solid transparent;font-size:.69rem;line-height:1.4}
.chapter-outline>a:hover{color:var(--steel);border-bottom-color:var(--line)}
.chapter-outline>a span{display:inline-block;width:2rem;color:#9a5a3d;font:.58rem var(--mono)}
.chapter-outline button{width:100%;margin-top:1rem;padding:.65rem;border:1px solid var(--dark-steel);background:transparent;color:var(--dark-steel);cursor:pointer;font-size:.68rem;font-weight:700}
.chapter-main{min-width:0}
.chapter-main>section{scroll-margin-top:calc(var(--header) + 1.5rem)}
.chapter-focus{margin:0 -1.5rem;padding:2.6rem 1.5rem 2.8rem;color:#f4f0e7;background:var(--ink)}
.chapter-focus h2{max-width:24ch;margin:.6rem 0 1.5rem;font:700 clamp(1.65rem,3vw,2.4rem)/1.3 var(--display)}
.chapter-focus ol{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem;margin:0;padding:0;list-style:none;counter-reset:memory}
.chapter-focus li{position:relative;padding:1.1rem 0 0;border-top:1px solid #526067;color:#dce2e3;font-size:.87rem;line-height:1.75;counter-increment:memory}
.chapter-focus li:before{content:"0" counter(memory);display:block;margin-bottom:.5rem;color:#e98b5c;font:600 .67rem var(--mono)}

.chapter-vocabulary,.chapter-story,.chapter-examples{padding:3.5rem 0;border-bottom:1px solid var(--dark-line)}
.chapter-vocabulary>header,.chapter-story>header,.chapter-examples>header,.chapter-coursework>header{max-width:760px;margin-bottom:1.8rem}
.chapter-vocabulary h2,.chapter-story h2,.chapter-examples h2,.chapter-coursework>header h2,.chapter-bridge h2{margin:.45rem 0 .7rem;font:700 clamp(1.65rem,3vw,2.3rem)/1.3 var(--display)}
.chapter-vocabulary header p,.chapter-coursework>header p{color:#647178;line-height:1.75}
.chapter-vocabulary dl{margin:0;border-top:2px solid var(--ink)}
.chapter-vocabulary dl>div{display:grid;grid-template-columns:210px minmax(0,1fr);gap:1.5rem;padding:1.1rem 0;border-bottom:1px solid var(--line)}
.chapter-vocabulary dt{font:700 .95rem/1.55 var(--display)}
.chapter-vocabulary dd{margin:0}
.chapter-vocabulary dd p{margin:0 0 .4rem;font-size:.86rem;line-height:1.75}
.chapter-vocabulary dd small{display:block;color:#59676e;font-size:.72rem;line-height:1.65}
.chapter-vocabulary dd small strong{color:var(--orange)}
.chapter-story>.chapter-lead,.chapter-story>p{max-width:780px;font-size:.95rem;line-height:1.95}
.chapter-story>.chapter-lead{font-size:1.04rem}
.chapter-story h3{margin:2.2rem 0 .8rem;font:700 1.25rem/1.4 var(--display)}

.chapter-flow{display:flex;align-items:stretch;margin:1.7rem 0 2rem;overflow:auto}
.chapter-flow-node{min-width:135px;flex:1;padding:1rem .8rem;border-block:1px solid var(--dark-line)}
.chapter-flow-node>span{color:var(--orange);font:600 .58rem var(--mono)}
.chapter-flow-node strong{display:block;margin:.35rem 0;font:700 .85rem var(--display)}
.chapter-flow-node p{margin:0;color:#647178;font-size:.68rem;line-height:1.5}
.chapter-flow-arrow{align-self:center;padding:0 .25rem;color:var(--orange);font:700 1rem var(--mono)}
.teaching-code{margin:1.35rem 0 1.7rem}
.teaching-code figcaption,.trace-figure figcaption{padding:.65rem .85rem;color:#d8dfe1;background:#263238;font:.68rem/1.5 var(--mono)}
.teaching-code pre{margin:0;border-left:4px solid var(--orange)}
.trace-figure{margin:1.5rem 0 2rem}
.trace-scroll{overflow:auto}
.trace-figure table{width:100%;border-collapse:collapse;background:#fffdf8}
.trace-figure th,.trace-figure td{padding:.7rem .8rem;border:1px solid var(--line);text-align:left;font-size:.72rem;line-height:1.55}
.trace-figure th{color:var(--dark-steel);background:#e8eeed;font-weight:700}
.concept-compare{display:grid;grid-template-columns:repeat(3,1fr);margin:1.4rem 0;border-block:1px solid var(--dark-line)}
.concept-compare>div{padding:1rem;border-right:1px solid var(--line)}
.concept-compare>div:last-child{border-right:0}
.concept-compare strong{font:700 .9rem var(--display)}
.concept-compare p{font-size:.78rem;line-height:1.65}
.concept-compare small{color:#657279;font-size:.68rem;line-height:1.55}

.chapter-examples>div{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem}
.chapter-examples article{padding:1.1rem 0;border-top:3px solid var(--steel)}
.chapter-examples article>span{color:var(--orange);font:600 .62rem var(--mono)}
.chapter-examples h3{margin:.5rem 0;font:700 1rem var(--display)}
.chapter-examples p{margin:0;color:#536169;font-size:.78rem;line-height:1.75}

.chapter-coursework{padding:4rem 0 0}
.chapter-topic{scroll-margin-top:calc(var(--header) + 1.25rem);padding:3.5rem 0;border-top:1px solid var(--dark-line)}
.topic-header{display:grid;grid-template-columns:70px minmax(0,1fr);gap:1.5rem;align-items:start}
.topic-step{color:#b9c0c2;font:700 2.2rem var(--mono)}
.topic-connection{margin:0 0 .45rem;color:var(--orange);font-size:.72rem;line-height:1.6}
.topic-header h2{max-width:24ch;margin:0 0 .7rem;font:700 clamp(1.55rem,3vw,2.15rem)/1.3 var(--display)}
.topic-header h2+p{max-width:720px;margin:0;color:#5d6a70;font-size:.87rem;line-height:1.75}
.topic-narrative{margin:1.8rem 0 0 70px}
.topic-section{display:grid;grid-template-columns:120px minmax(0,1fr);gap:1.4rem;padding:1.5rem 0;border-top:1px solid var(--line)}
.topic-section>span,.topic-lab>header>span{color:var(--steel);font:600 .62rem var(--mono);letter-spacing:.08em}
.topic-section h3,.topic-lab h3{margin:-.25rem 0 .8rem;font:700 1.13rem/1.4 var(--display)}
.topic-section p,.topic-section li{font-size:.86rem;line-height:1.85}
.topic-section .definition{font-size:.9rem}
.topic-section .block-body{min-width:0}
.topic-check{margin:1.6rem 0;padding:1.25rem 1.4rem;border-left:4px solid #d7b54f;background:#fff7df}
.topic-check h4{margin:0 0 .6rem;font:700 1rem var(--display)}
.topic-check>p{font-size:.86rem;line-height:1.75}
.topic-check details{margin-top:.7rem;border-top:1px solid #decc94}
.topic-check details summary{padding:.7rem 0}
.topic-lab{padding:1.8rem 0;border-top:1px solid var(--line)}
.topic-lab>header{margin-bottom:1rem}
.topic-lab>header p{color:#627078;font-size:.78rem}
.topic-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1.5rem;align-items:center;margin:1.6rem 0 0 70px;padding-top:1.2rem;border-top:1px dashed var(--dark-line)}
.topic-footer p{margin:0;color:#59686f;font-size:.76rem;line-height:1.65}
.topic-complete{padding:.65rem .85rem;border:1px solid var(--dark-steel);background:transparent;color:var(--dark-steel);cursor:pointer;font-size:.68rem;font-weight:700}
.topic-complete.is-complete{color:#fff;background:var(--success);border-color:var(--success)}
.chapter-bridge{margin-top:2rem;padding:2.5rem;border-left:5px solid var(--orange);background:#f0e9da}
.chapter-bridge p{max-width:780px;margin:0;font-size:.92rem;line-height:1.85}
.chapter-footer{display:grid;grid-template-columns:1fr auto 1fr;gap:1rem;margin-top:2rem}
.chapter-footer button{padding:.75rem;border:1px solid var(--dark-line);background:var(--surface);cursor:pointer;font-size:.72rem}
.chapter-footer .next{justify-self:end;color:#fff;background:var(--dark-steel)}

body.presentation .chapter-page{width:min(1440px,96vw);height:96vh;overflow:auto;background:var(--surface);padding:3rem 4rem 5rem}
body.presentation .chapter-outline{top:1rem;max-height:90vh}
body.presentation .chapter-hero h1{font-size:3.6rem}

@media(max-width:1100px){
  .chapter-row{grid-template-columns:64px minmax(220px,1fr) 72px}
  .chapter-row-artifact{display:none}
  .chapter-layout{grid-template-columns:1fr}
  .chapter-outline{position:relative;top:auto;display:flex;gap:.35rem;max-height:none;overflow:auto;padding:1rem 0;border-bottom:1px solid var(--line)}
  .chapter-outline>.section-index,.chapter-outline button{display:none}
  .chapter-outline>a{flex:0 0 auto;padding:.45rem .65rem;border:1px solid var(--line);white-space:nowrap}
}
@media(max-width:760px){
  .journey-strip{grid-template-columns:1fr}
  .journey-strip>div{border-right:0;border-bottom:1px solid var(--line)}
  .chapter-row{grid-template-columns:52px minmax(0,1fr) 54px}
  .chapter-row-main small{display:none}
  .chapter-page{padding:1.2rem 1rem 5rem}
  .chapter-hero-grid{grid-template-columns:1fr;gap:1.5rem}
  .chapter-hero h1{font-size:2.25rem}
  .chapter-hero-grid>aside{padding:1rem 0 0;border-left:0;border-top:1px solid var(--dark-line)}
  .chapter-outcomes{grid-template-columns:1fr}
  .chapter-outcomes ol{grid-template-columns:1fr}
  .chapter-focus{margin-inline:-1rem;padding-inline:1rem}
  .chapter-focus ol,.chapter-examples>div,.concept-compare{grid-template-columns:1fr}
  .concept-compare>div{border-right:0;border-bottom:1px solid var(--line)}
  .chapter-vocabulary dl>div{grid-template-columns:1fr;gap:.4rem}
  .topic-header{grid-template-columns:44px minmax(0,1fr);gap:.75rem}
  .topic-step{font-size:1.4rem}
  .topic-narrative,.topic-footer{margin-left:0}
  .topic-section{grid-template-columns:1fr;gap:.5rem}
  .topic-footer{grid-template-columns:1fr}
  .topic-complete{justify-self:start}
  .chapter-footer{grid-template-columns:1fr}
  .chapter-footer .next{justify-self:stretch}
}
@media print{
  .chapter-outline,.topic-complete{display:none!important}
  .chapter-layout{display:block}
  .chapter-page{max-width:none;padding:1cm}
}


/* Prevent code and horizontal chapter navigation from setting the page's min-content width. */
.chapter-layout,.chapter-main,.chapter-coursework,.chapter-topic,.topic-narrative,.topic-section>div{min-width:0}
.chapter-outline,.chapter-flow,.trace-scroll,.result-table-wrap{max-width:100%}
.topic-section pre,.topic-section .output,.topic-lab .lab-panel{max-width:100%}
@media(max-width:1100px){.chapter-outline{width:100%;min-width:0}}
