/* Five complete viewport slides. Detail controls stay within their chapter. */
html{scroll-snap-type:y mandatory;scroll-padding:0;scroll-behavior:auto}
html.is-navigating{scroll-snap-type:none}
#presentation-status{position:fixed;top:0;left:0}
main>.chapter{height:100svh;min-height:0;max-height:100svh;overflow:hidden;scroll-snap-align:start;scroll-snap-stop:always}
.five-slide-presentation .sticky-scene,.five-slide-presentation .mechanism-wrap{height:100%;min-height:0;max-height:none}
.five-slide-presentation .sticky-scene{padding:clamp(22px,4vh,48px) 4.5vw 84px}
.five-slide-presentation .chapter .stage-stack{min-height:0}
.five-slide-presentation .chapter .stage-stack>.stage{display:none;position:relative;inset:auto;margin:0}
.five-slide-presentation .chapter .stage-stack>.stage.is-active{display:block}
.five-slide-presentation .section-heading h2{font-size:clamp(40px,4.5vw,76px);line-height:1.08;margin:0}
.five-slide-presentation .context-scene{display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
.five-slide-presentation .context-layout{height:auto;min-height:0;margin:0;display:grid;grid-template-columns:minmax(265px,31%) minmax(0,69%);align-items:center;gap:0}
.five-slide-presentation .context-copy{padding:0 1.7vw 80px 0;min-height:0}
.five-slide-presentation .context-step h3{font-size:clamp(28px,2.5vw,44px);line-height:1.13;margin:0 0 20px;max-width:470px}
.five-slide-presentation .context-step p{font-size:clamp(16px,1.22vw,22px);line-height:1.6;max-width:460px}
.five-slide-presentation #context .context-takeaway{font-size:clamp(13px,1.05vw,17px);line-height:1.6;margin-top:22px}
.five-slide-presentation #context .context-note{font-size:12px;line-height:1.55;margin-top:18px}
.five-slide-presentation .context-scene .piston-figure{height:100%;min-height:0;align-self:stretch}
.five-slide-presentation #context #piston-3d{height:100%;min-height:0;max-height:none;overflow:hidden}
.five-slide-presentation .engine-cycle{position:absolute;bottom:0;left:0;width:29.5%;font-size:clamp(12px,1vw,16px);margin:0}
.five-slide-presentation .engine-cycle>i{margin-top:10px}
.lesson-nav{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);width:max-content;display:flex;align-items:center;justify-self:center;gap:5px;padding:5px;background:#f1f3f3;border:1px solid #e3e8e8;border-radius:15px;z-index:4}
.lesson-nav button{font-size:14px;line-height:1.2;font-weight:550;padding:10px 19px;border:1px solid transparent;border-radius:10px;color:#687174;transition:background .15s,color .15s}
.lesson-nav button:hover{color:#202b2e;background:#ffffffa6}
.lesson-nav button[aria-pressed=true]{background:#fff;border-color:#e0e5e5;color:#253236;box-shadow:0 2px 6px #192e3008}
.lesson-nav button:focus-visible,.parts-nav button:focus-visible{outline:2px solid #9f7446;outline-offset:3px}

.five-slide-presentation .inventor-scene{display:grid;grid-template-columns:minmax(0,41%) minmax(0,1fr);gap:5%;align-items:center}
.five-slide-presentation .portrait{width:100%;max-width:none;padding:0}
.five-slide-presentation .portrait-frame{height:calc(100svh - 155px);min-height:0;max-height:none;aspect-ratio:auto}
.five-slide-presentation .portrait img{height:100%;width:100%;object-fit:cover;object-position:50% 25%}
.five-slide-presentation .portrait figcaption{font-size:10px;padding-top:12px;flex-direction:row}
.five-slide-presentation .inventor-copy h2{font-size:clamp(48px,5.5vw,92px);line-height:1.04;margin:0;letter-spacing:normal}
.five-slide-presentation .birthplace{font-size:13px;margin-top:14px}
.inventor-summary{font-size:clamp(16px,1.35vw,22px);color:#4e5b62;line-height:1.6;margin-top:22px;max-width:750px}
.history-milestones{list-style:none;margin:25px 0 0;padding:22px 0 0;border-top:1px solid #dfe5e5;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 18px}
.history-milestones li{padding:0;margin:0}
.history-milestones time{display:block;font-size:clamp(25px,2.1vw,36px);font-weight:600;line-height:1.1;color:#a07a51;letter-spacing:normal;margin-bottom:8px}
.history-milestones strong{display:block;font-size:clamp(12px,1vw,17px);line-height:1.35;font-weight:600;color:#28373c}
.history-milestones span{display:block;font-size:clamp(11px,.88vw,15px);line-height:1.5;color:#778187;margin-top:4px;max-width:230px}

.five-slide-presentation .mechanism-scene{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:14px}
.five-slide-presentation .mechanism-layout{height:auto;min-height:0;display:grid;grid-template-columns:minmax(230px,27%) minmax(0,73%);gap:0;margin:0;align-items:center}
.five-slide-presentation .mechanism-labels{min-height:0;padding:0 2vw 0 0}
.five-slide-presentation .mechanism-step h3{font-size:clamp(37px,3.7vw,64px);line-height:1.08;margin:0}
.five-slide-presentation .mechanism-step p{font-size:clamp(16px,1.25vw,22px);line-height:1.6;margin-top:18px}
.five-slide-presentation #cutaway-locomotive{height:100%;min-height:0;max-height:none;align-self:stretch;overflow:hidden}
.five-slide-presentation .mechanism-footer{position:static;inset:auto;margin:0;padding:0;border:0;display:flex;justify-content:center}
.five-slide-presentation .parts-nav{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;width:auto}
.five-slide-presentation .parts-nav span{display:none}
.five-slide-presentation .parts-nav button{font-size:13px;padding:8px 16px;border:1px solid #e4e8e9;border-radius:9px;background:#fff}
.five-slide-presentation .parts-nav button.active{background:#253136;color:#fff;border-color:#253136}
.railway-impact{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:25px;border-top:1px solid #e1e6e6;padding-top:15px}
.railway-impact strong{font-size:clamp(15px,1.3vw,21px);font-weight:600;letter-spacing:normal;color:#34454b}
.railway-impact p{font-size:clamp(11px,.9vw,15px);line-height:1.5;color:#7a8388;margin-top:5px;max-width:280px}
.five-slide-presentation .bibliography{padding:4vh 6vw 85px;gap:clamp(20px,4vh,44px);align-content:center}
.five-slide-presentation .bibliography h2{font-size:clamp(48px,6.5vw,108px)}
.five-slide-presentation .sources li{padding:clamp(13px,2.2vh,22px) 0;font-size:clamp(16px,1.2vw,21px)}
.five-slide-presentation .sources small{font-size:clamp(12px,.9vw,16px)}

@media(max-height:780px) and (min-width:801px){
 .five-slide-presentation .sticky-scene{padding-top:24px;padding-bottom:76px}
 .five-slide-presentation .context-copy{padding-bottom:65px}
 .five-slide-presentation .context-step h3{font-size:30px;margin-bottom:16px}
 .five-slide-presentation .context-step p{font-size:16px}
 .five-slide-presentation .engine-cycle{font-size:12px}
 .five-slide-presentation .inventor-copy h2{font-size:60px}
 .inventor-summary{font-size:16px;margin-top:16px}
 .history-milestones{margin-top:17px;padding-top:17px;gap:16px}
 .history-milestones time{font-size:27px;margin-bottom:5px}
 .five-slide-presentation .mechanism-scene{gap:11px}
 .railway-impact{padding-top:11px;gap:18px}
 .five-slide-presentation .mechanism-step h3{font-size:42px}
 .five-slide-presentation .mechanism-step p{font-size:16px}
}

@media(max-width:800px){
 .five-slide-presentation .sticky-scene{padding:24px 5.5vw 76px}
 .five-slide-presentation .section-heading h2{font-size:clamp(30px,8vw,46px)}
 .five-slide-presentation .context-scene{gap:12px}
 .five-slide-presentation .context-layout{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto auto;align-items:stretch;gap:8px}
 .five-slide-presentation .context-scene .piston-figure{grid-row:1;max-width:none}
 .five-slide-presentation .context-copy{grid-row:2;min-height:0;padding:0}
 .five-slide-presentation .context-step h3{font-size:25px;line-height:1.15;margin-bottom:9px;max-width:none}
 .five-slide-presentation .context-step p{font-size:14px;line-height:1.5;max-width:none}
 .five-slide-presentation #context .context-takeaway{font-size:12px;margin-top:10px;padding-left:10px;line-height:1.5}
 .five-slide-presentation #context .context-note{font-size:10px;margin-top:9px;line-height:1.45}
 .five-slide-presentation .engine-cycle{position:relative;grid-row:3;left:auto;bottom:auto;order:initial;width:100%;font-size:11px;margin-top:4px}
 .five-slide-presentation .engine-cycle strong{margin-bottom:3px;font-size:1.03em}
 .five-slide-presentation .engine-cycle>span{line-height:1.4}
 .five-slide-presentation .engine-cycle>i{margin-top:7px}
 .lesson-nav{gap:2px;padding:4px;border-radius:12px}
 .lesson-nav button{padding:9px 12px;font-size:12px;border-radius:8px}
 .five-slide-presentation .engine-label{font-size:10px;padding:5px 7px}
 .five-slide-presentation .inventor-scene{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(150px,26svh) minmax(0,1fr);align-items:start;gap:16px;padding-top:22px}
 .five-slide-presentation .portrait{height:100%;width:100%;max-width:none;margin:0}
 .five-slide-presentation .portrait-frame{height:calc(100% - 20px);min-height:0;max-height:none;border-radius:13px}
 .five-slide-presentation .portrait img{object-position:50% 23%}
 .five-slide-presentation .portrait figcaption{font-size:8px;padding-top:6px;line-height:1.3}
 .five-slide-presentation .inventor-copy h2{font-size:34px;margin:0;line-height:1.03}
 .five-slide-presentation .inventor-copy h2 br{display:none}
 .five-slide-presentation .birthplace{font-size:10px;margin-top:7px}
 .inventor-summary{font-size:13px;line-height:1.5;margin-top:12px;max-width:none}
 .history-milestones{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 12px;margin-top:13px;padding-top:13px}
 .history-milestones time{font-size:24px;margin-bottom:5px}
 .history-milestones strong{font-size:11px;line-height:1.3}
 .history-milestones span{font-size:10px;line-height:1.4;margin-top:3px}
 .five-slide-presentation .mechanism-scene{gap:11px}
 .five-slide-presentation .mechanism-layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;gap:10px}
 .five-slide-presentation #cutaway-locomotive{grid-row:1;height:100%;min-height:0;max-height:none}
 .five-slide-presentation .mechanism-labels{grid-row:2;padding:0;min-height:0}
 .five-slide-presentation .mechanism-step h3{font-size:28px;line-height:1.1}
 .five-slide-presentation .mechanism-step h3 br{display:none}
 .five-slide-presentation .mechanism-step p{font-size:13px;line-height:1.5;margin-top:8px}
 .five-slide-presentation .parts-nav{gap:5px}
 .five-slide-presentation .parts-nav button{padding:7px 11px;font-size:11px}
 .railway-impact{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 17px;padding-top:12px}
 .railway-impact strong{font-size:13px;letter-spacing:normal}
 .railway-impact p{font-size:10px;line-height:1.35;margin-top:3px}
 .five-slide-presentation .bibliography{padding:30px 6vw 80px;gap:28px}
 .five-slide-presentation .bibliography h2{font-size:clamp(39px,10.5vw,60px)}
 .five-slide-presentation .sources li{font-size:15px;padding:16px 0}
 .five-slide-presentation .sources small{font-size:11px}
}

@media(max-width:800px) and (max-height:740px){
 .five-slide-presentation .sticky-scene{padding-top:18px;padding-bottom:72px}
 .five-slide-presentation .context-scene{gap:8px}
 .five-slide-presentation .section-heading h2{font-size:30px}
 .five-slide-presentation .context-step h3{font-size:22px;margin-bottom:7px}
 .five-slide-presentation .context-step p{font-size:12px;line-height:1.45}
 .five-slide-presentation #context .context-takeaway{font-size:10px;margin-top:7px}
 .five-slide-presentation .engine-cycle{font-size:10px}
 .lesson-nav button{font-size:11px;padding:7px 11px}
 .five-slide-presentation .inventor-scene{grid-template-rows:20svh minmax(0,1fr);gap:12px}
 .five-slide-presentation .inventor-copy h2{font-size:30px}
 .inventor-summary{font-size:12px;margin-top:10px}
 .history-milestones{gap:10px 12px;padding-top:10px;margin-top:10px}
 .history-milestones time{font-size:21px}
 .history-milestones strong{font-size:10px}
 .history-milestones span{font-size:9px}
 .five-slide-presentation .mechanism-scene{gap:8px}
 .five-slide-presentation .mechanism-step h3{font-size:24px}
 .five-slide-presentation .mechanism-step p{font-size:12px;margin-top:6px}
 .five-slide-presentation .parts-nav button{font-size:10px;padding:6px 10px}
 .railway-impact{gap:8px 15px;padding-top:9px}
 .railway-impact strong{font-size:12px}
 .railway-impact p{font-size:9px}
}

@media print{
 html{scroll-snap-type:none}
 main>.chapter{height:auto;max-height:none;min-height:0;overflow:visible;break-after:page}
 .five-slide-presentation .sticky-scene{height:auto;display:block;padding:25px}
 .five-slide-presentation .stage-stack>.stage{display:block!important;opacity:1!important;visibility:visible!important;position:relative!important;margin:18px 0!important}
 .lesson-nav,.railway-impact,.presentation-controls{display:none}
}

@media screen and (max-width:1000px){
 .five-slide-presentation .context-scene{padding-bottom:132px}
 .lesson-nav{bottom:76px;max-width:calc(100% - 24px)}
}

/* Invention: one detail panel, an unobstructed model, then the four outcomes. */
@media screen{
 #inventia .mechanism-scene{grid-template-rows:auto minmax(0,1fr) auto;gap:clamp(16px,2.5vh,28px)}
 #inventia .section-heading h2{font-size:clamp(38px,3.6vw,62px);letter-spacing:normal}
 #inventia .mechanism-layout{grid-template-columns:minmax(260px,29%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:clamp(24px,3.4vw,64px);align-items:stretch}
 #inventia .mechanism-detail-panel{position:relative;z-index:2;align-self:center;min-width:0;padding:clamp(18px,1.8vw,30px);background:#f5f7f7;border:1px solid #e8edec;border-radius:20px}
 #inventia .section-heading{position:relative;z-index:2;pointer-events:none}
 #inventia .part-picker-label{font-size:12px;line-height:1.4;font-weight:600;color:#6c777b;margin:0 0 12px}
 #inventia .parts-nav{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:6px;width:100%;pointer-events:auto}
 #inventia .parts-nav button{font-size:12px;line-height:1.2;padding:9px 11px;border-radius:8px;border-color:#dde5e3;color:#58676b;white-space:nowrap;background:#fff}
 #inventia .parts-nav button.active{background:#29383c;border-color:#29383c;color:#fff}
 #inventia .mechanism-labels{padding:22px 0 0;margin:20px 0 0;border-top:1px solid #dfe6e4;min-height:0;grid-row:auto}
 #inventia .mechanism-step h3{font-size:clamp(29px,2.6vw,44px);line-height:1.13;letter-spacing:normal;margin:0}
 #inventia .mechanism-step h3 br{display:none}
 #inventia .mechanism-step p{font-size:clamp(15px,1.12vw,19px);line-height:1.6;margin:14px 0 0;max-width:36ch}
 #inventia #cutaway-locomotive:not(.in-explorer){display:grid;grid-template-rows:minmax(0,1fr);gap:0;min-width:0;height:100%;overflow:visible;grid-row:auto}
 #cutaway-locomotive .model-stage{position:relative;min-width:0;min-height:0;overflow:hidden}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-stage{overflow:visible}
 #inventia #cutaway-locomotive:not(.in-explorer) .three-canvas{mask-image:linear-gradient(to bottom,#000 calc(100% - clamp(40px,6vh,80px)),transparent);-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - clamp(40px,6vh,80px)),transparent)}
 #cutaway-locomotive.in-explorer .model-stage{position:absolute;inset:0}
 #inventia #cutaway-locomotive:not(.in-explorer) .flow-lesson,
 #inventia #cutaway-locomotive:not(.in-explorer) .process-legend,
 #inventia #cutaway-locomotive:not(.in-explorer) .hotspot-layer{display:none}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar{display:none}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar button{height:38px;min-width:38px;border-radius:8px}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar [data-3d-action="section"]{border:0;margin:0;padding:0 14px;font-size:12px;letter-spacing:0;background:#f1f4f4}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar .explore-button{font-size:13px;padding:0 18px;margin:0}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar [data-3d-action="out"],
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar [data-3d-action="in"],
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar [data-3d-action="reset"],
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar .zoom-value,
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar .toolbar-rule{display:none}
 .model-toolbar .overview-label{display:none}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar{width:max-content;max-width:100%;padding:6px;gap:6px;border:1px solid #e4e9e8;border-radius:12px;background:#fff;box-shadow:0 4px 18px #263b3808}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar [data-3d-action="reset"]{display:inline-flex;align-items:center;gap:6px;padding:0 10px;font-size:12px;color:#475b60}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .overview-label{display:inline}
 #inventia .railway-impact{position:relative;z-index:2;background:#fff;grid-template-columns:repeat(4,minmax(0,1fr));padding-top:18px;gap:24px;border-color:#e2e8e6}
 #inventia .railway-impact strong{font-size:clamp(15px,1.2vw,20px);font-weight:600;color:#435358}
 #inventia .railway-impact p{font-size:clamp(11px,.85vw,14px);line-height:1.45;margin-top:5px;max-width:28ch}
}
@media screen and (min-width:801px) and (max-height:780px){
 #inventia .mechanism-scene{gap:16px}
 #inventia .mechanism-detail-panel{padding:18px}
 #inventia .mechanism-labels{padding-top:16px;margin-top:16px}
 #inventia .mechanism-step h3{font-size:30px}
 #inventia .mechanism-step p{font-size:15px;line-height:1.5;margin-top:10px}
 #inventia .railway-impact{padding-top:12px;gap:20px}
}
@media screen and (max-width:800px){
 #inventia .mechanism-scene{gap:12px}
 #inventia .section-heading h2{font-size:clamp(29px,7.5vw,40px)}
 #inventia .mechanism-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:14px}
 #inventia .mechanism-detail-panel{grid-row:2;padding:12px 14px;border-radius:13px;align-self:stretch}
 #inventia .part-picker-label{display:none}
 #inventia .parts-nav{gap:5px}
 #inventia .parts-nav button{font-size:11px;padding:7px 9px}
 #inventia .mechanism-labels{padding-top:10px;margin-top:10px}
 #inventia .mechanism-step h3{font-size:23px}
 #inventia .mechanism-step p{font-size:12px;line-height:1.45;margin-top:6px;max-width:none}
 #inventia #cutaway-locomotive:not(.in-explorer){grid-row:1;gap:0}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar{min-height:40px;padding-top:4px;gap:8px}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar button{height:30px;min-width:30px}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar .explore-button{font-size:11px;padding:0 14px}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar [data-3d-action="section"]{font-size:11px;padding:0 12px}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar{gap:3px;padding:4px}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar [data-3d-action="reset"]{font-size:10px;padding:0 6px;gap:4px}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar .explore-button{gap:5px;padding:0 9px}
 #inventia #cutaway-locomotive:not(.in-explorer).is-focused .model-toolbar [data-3d-action="section"]{padding:0 8px}
 #inventia .railway-impact{grid-template-columns:repeat(2,minmax(0,1fr));padding-top:10px;gap:9px 16px}
 #inventia .railway-impact strong{font-size:12px}
 #inventia .railway-impact p{font-size:10px;line-height:1.35;margin-top:3px;max-width:none}
}
@media screen and (max-width:800px) and (max-height:740px){
 #inventia .mechanism-scene{gap:8px}
 #inventia .mechanism-layout{gap:8px}
 #inventia .mechanism-detail-panel{padding:9px 11px}
 #inventia .parts-nav{gap:4px}
 #inventia .parts-nav button{padding:6px 8px;font-size:10px}
 #inventia .mechanism-labels{padding-top:8px;margin-top:8px}
 #inventia .mechanism-step h3{font-size:21px}
 #inventia .mechanism-step p{font-size:11px}
 #inventia .railway-impact p{font-size:9px}
}
@media screen and (max-height:600px) and (min-aspect-ratio:4/3){
 #inventia .mechanism-scene{padding:12px 4.5vw 68px;gap:10px}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar{min-height:44px}
 #inventia .section-heading h2{font-size:28px}
 #inventia .mechanism-layout{grid-template-columns:minmax(210px,34%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:18px}
 #inventia .mechanism-detail-panel{grid-row:1;align-self:stretch;min-height:0;max-height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:12px;border-radius:13px}
 #inventia .part-picker-label{display:none}
 #inventia .parts-nav{gap:4px}
 #inventia .parts-nav button{padding:6px 8px;font-size:10px}
 #inventia .mechanism-labels{padding-top:10px;margin-top:10px}
 #inventia .mechanism-step h3{font-size:23px}
 #inventia .mechanism-step p{font-size:12px;line-height:1.45;margin-top:6px}
 #inventia #cutaway-locomotive:not(.in-explorer){grid-row:1;gap:0}
 #inventia #cutaway-locomotive:not(.in-explorer) .model-toolbar button{height:30px;min-width:30px}
 #inventia .railway-impact{grid-template-columns:repeat(4,minmax(0,1fr));padding-top:9px;gap:15px}
 #inventia .railway-impact strong{font-size:12px}
 #inventia .railway-impact p{font-size:10px;line-height:1.35;margin-top:3px}
}
@media print{
 #inventia .parts-nav{display:none}
}

/* The inventor's story sits above a single, uninterrupted chronology. */
@media screen{
 #inventator .inventor-scene{display:grid;grid-template-columns:minmax(0,29%) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;column-gap:clamp(32px,5vw,88px);row-gap:clamp(24px,4vh,44px);align-items:stretch;padding:clamp(24px,4vh,48px) 4.5vw 92px}
 #inventator .portrait{grid-column:1;grid-row:1;display:flex;flex-direction:column;min-height:0;width:100%;height:100%;max-width:none;margin:0;padding:0}
 #inventator .portrait-frame{flex:1;min-height:0;max-height:none;height:auto;aspect-ratio:auto;border-radius:12px;box-shadow:none;background:#f3f3f1}
 #inventator .portrait-frame::after{display:none}
 #inventator .portrait img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 25%}
 #inventator .portrait figcaption{flex:none;display:flex;justify-content:space-between;flex-direction:row;gap:12px;padding-top:10px;font-size:11px;line-height:1.4;letter-spacing:0;color:#70797c}
 #inventator .inventor-copy{grid-column:2;grid-row:1;min-width:0;align-self:center;display:grid;gap:clamp(22px,3.5vh,38px)}
 #inventator .inventor-copy h2{font-size:clamp(40px,4.2vw,72px);line-height:1.06;letter-spacing:normal;margin:0;text-wrap:balance}
 #inventator .birthplace{font-size:clamp(12px,1vw,15px);line-height:1.5;margin:14px 0 0;color:#70797c}
 #inventator .inventor-intro{max-width:62ch}
 #inventator .inventor-lead{font-size:clamp(21px,2vw,30px);line-height:1.35;letter-spacing:normal;color:#000;margin:0 0 14px;text-wrap:balance}
 #inventator .inventor-summary{font-size:clamp(16px,1.3vw,21px);line-height:1.6;color:#49575b;margin:0;max-width:none}
 #inventator .inventor-takeaway{border-left:2px solid #bec9c5;padding:2px 0 2px 18px;margin-top:22px;color:#354448;font-size:clamp(15px,1.15vw,19px);line-height:1.5}
 #inventator .inventor-takeaway strong{display:block;font-size:12px;font-weight:600;margin-bottom:5px;color:#667276}
 #inventator .inventor-history{grid-column:1 / -1;grid-row:2;min-width:0;min-height:0;padding-top:clamp(18px,2.5vh,28px);border-top:1px solid #e1e7e4}
 #inventator .history-milestones{--timeline-axis:46px;position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;margin:0;padding:0;border:0}
 #inventator .history-milestones::before{content:"";position:absolute;top:var(--timeline-axis);left:0;right:20%;height:1px;background:#d7dfdd}
 #inventator .history-milestones li{position:relative;min-width:0;padding:0 22px 0 0;margin:0}
 #inventator .history-milestones li:last-child{padding-right:0}
 #inventator .history-milestones li::before{content:"";position:absolute;left:0;top:calc(var(--timeline-axis) - 4px);width:9px;height:9px;border:2px solid #fff;border-radius:50%;background:#29383c;box-shadow:0 0 0 1px #bcc8c4}
 #inventator .history-milestones time{display:block;color:#000;font-size:clamp(26px,2.3vw,38px);font-weight:600;line-height:1;letter-spacing:normal;margin:0 0 36px}
 #inventator .history-milestones strong{display:block;color:#253136;font-size:clamp(13px,1.15vw,18px);line-height:1.35;font-weight:600;text-wrap:balance}
 #inventator .history-milestones span{display:block;font-size:clamp(12px,.95vw,15px);line-height:1.5;color:#667276;margin-top:6px;max-width:26ch}
}
@media screen and (max-height:780px) and (min-width:801px){
 #inventator .inventor-scene{padding-top:22px;padding-bottom:82px;row-gap:22px}
 #inventator .inventor-copy{gap:18px}
 #inventator .inventor-copy h2{font-size:clamp(38px,4.2vw,60px)}
 #inventator .inventor-lead{font-size:22px;margin-bottom:10px}
 #inventator .inventor-summary{font-size:16px;line-height:1.5}
 #inventator .inventor-takeaway{font-size:15px;margin-top:16px;padding-left:14px}
 #inventator .history-milestones{--timeline-axis:38px}
 #inventator .history-milestones time{font-size:28px;margin-bottom:28px}
 #inventator .history-milestones strong{font-size:13px}
 #inventator .history-milestones span{font-size:12px}
}
@media screen and (max-width:800px){
 #inventator .inventor-scene{grid-template-columns:minmax(90px,28%) minmax(0,1fr);grid-template-rows:clamp(125px,21svh,180px) auto minmax(0,1fr);gap:18px 22px;padding:24px 5.5vw 80px}
 #inventator .portrait figcaption{font-size:9px;padding-top:7px}
 #inventator .portrait figcaption span:first-child{display:none}
 #inventator .portrait-frame{border-radius:12px}
 #inventator .inventor-copy{display:contents}
 #inventator .inventor-heading{grid-column:2;grid-row:1;align-self:center;min-width:0}
 #inventator .inventor-copy h2{font-size:clamp(29px,5.3vw,42px);line-height:1.08;letter-spacing:normal}
 #inventator .birthplace{font-size:11px;line-height:1.45;margin-top:12px;max-width:24ch}
 #inventator .inventor-intro{grid-column:1 / -1;grid-row:2;max-width:none}
 #inventator .inventor-lead{font-size:19px;line-height:1.3;text-wrap:initial;margin-bottom:10px}
 #inventator .inventor-summary{font-size:13px;line-height:1.5}
 #inventator .inventor-takeaway{font-size:12px;line-height:1.4;margin-top:12px;padding-left:12px}
 #inventator .inventor-takeaway strong{font-size:10px;margin-bottom:3px}
 #inventator .inventor-history{grid-row:3;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:16px 4px 0 0}
 #inventator .history-milestones{grid-template-columns:1fr;gap:15px}
 #inventator .history-milestones::before{left:61px;right:auto;top:8px;bottom:20px;height:auto;width:1px}
 #inventator .history-milestones li{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:28px;padding:0}
 #inventator .history-milestones li::before{left:57px;top:6px}
 #inventator .history-milestones time{grid-column:1;grid-row:1 / 3;font-size:22px;line-height:1.15;margin:0}
 #inventator .history-milestones strong{grid-column:2;grid-row:1;font-size:13px;line-height:1.35}
 #inventator .history-milestones span{grid-column:2;grid-row:2;font-size:11px;line-height:1.4;max-width:none;margin-top:3px}
}
@media screen and (max-width:800px) and (max-height:700px){
 #inventator .inventor-scene{grid-template-rows:110px auto minmax(0,1fr);gap:12px 18px;padding-top:16px;padding-bottom:72px}
 #inventator .inventor-copy h2{font-size:28px}
 #inventator .birthplace{font-size:10px;margin-top:8px}
 #inventator .inventor-lead{font-size:17px;margin-bottom:8px}
 #inventator .inventor-summary{font-size:12px}
 #inventator .inventor-takeaway{font-size:11px;margin-top:10px}
 #inventator .history-milestones{gap:12px}
}
@media screen and (max-height:600px) and (min-aspect-ratio:4/3){
 #inventator .inventor-scene{grid-template-columns:minmax(0,27%) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;column-gap:30px;row-gap:16px;padding:14px 4.5vw 68px}
 #inventator .portrait figcaption{font-size:9px;padding-top:5px}
 #inventator .inventor-copy{display:grid;gap:10px}
 #inventator .inventor-copy h2{font-size:34px;line-height:1.05}
 #inventator .inventor-heading,#inventator .inventor-intro{grid-column:auto;grid-row:auto}
 #inventator .birthplace{font-size:10px;margin-top:6px;max-width:none}
 #inventator .inventor-lead{font-size:17px;line-height:1.25;margin-bottom:6px}
 #inventator .inventor-summary{font-size:12px;line-height:1.4}
 #inventator .inventor-takeaway{font-size:11px;line-height:1.35;margin-top:8px;padding-left:10px}
 #inventator .inventor-takeaway strong{display:inline;font-size:inherit;margin:0 6px 0 0}
 #inventator .inventor-history{grid-row:2;overflow:visible;padding:12px 0 0}
 #inventator .history-milestones{--timeline-axis:29px;grid-template-columns:repeat(5,minmax(0,1fr));gap:0}
 #inventator .history-milestones::before{left:0;right:20%;top:var(--timeline-axis);bottom:auto;width:auto;height:1px}
 #inventator .history-milestones li{display:block;padding:0 12px 0 0}
 #inventator .history-milestones li::before{left:0;top:calc(var(--timeline-axis) - 4px)}
 #inventator .history-milestones time{font-size:21px;line-height:1;margin-bottom:24px}
 #inventator .history-milestones strong{font-size:11px}
 #inventator .history-milestones span{font-size:10px;line-height:1.35;margin-top:4px}
}

/* A single type treatment throughout each slide heading. */
.five-slide-presentation .chapter :is(h1,h2,h3){color:#000;font-family:var(--sans);font-weight:600;font-style:normal}
.five-slide-presentation .chapter :is(h1,h2,h3) :is(em,strong,b,span){color:inherit;font:inherit}

/* Explanations anchored to the firebox instruments in the 3D view. */
.instrument-label-layer{position:absolute;inset:0;z-index:4;pointer-events:none}
.instrument-label-layer>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.instrument-label-layer line{stroke:#88979b;stroke-width:1.2}
.instrument-label-layer circle{fill:#fff;stroke:#596b72;stroke-width:1.3}
.model-instrument-label{position:absolute;width:max-content;max-width:160px;padding:8px 10px;border:1px solid #e1e7e6;border-radius:8px;background:#fffffff2;box-shadow:0 3px 14px #25383d0a;color:#202326;font:12px/1.35 var(--sans)}
.model-instrument-label strong{display:block;font-weight:600}
.model-instrument-label span{display:block;margin-top:2px;color:#58676b;font-size:11px}
.instrument-label-layer[hidden],.model-instrument-label[hidden]{display:none}
@media(max-width:800px){
 .model-instrument-label{max-width:136px;padding:6px 8px;font-size:11px}
 .model-instrument-label span{font-size:10px}
}
/* One model selector in the persistent presentation footer. */
#presentation-model-picker{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:30;display:flex;align-items:center;gap:3px;padding:4px;background:#f0f3f2ed;border:1px solid #dde3e1;border-radius:14px;box-shadow:0 2px 4px #20303004,0 8px 24px #20303008;backdrop-filter:blur(18px);font:12px/1.3 var(--sans)}
#presentation-model-picker button{appearance:none;position:relative;min-height:34px;padding:0 15px;border:0;border-radius:10px;background:transparent;color:#65716f;font:inherit;font-weight:550;white-space:nowrap;cursor:pointer;transition:background .18s,color .18s,box-shadow .18s}
#presentation-model-picker button:hover{background:#e4eae7;color:#25312e}
#presentation-model-picker button[aria-checked="true"]{background:#26322f;color:#fff;box-shadow:0 2px 5px #16252025,inset 0 1px 0 #ffffff15}
#presentation-model-picker button:focus-visible{outline:2px solid #9d7d49;outline-offset:3px}
#presentation-model-picker .model-option-year{margin-left:3px;opacity:.65;font-variant-numeric:tabular-nums}
.five-slide-presentation .context-scene{padding-bottom:142px}
.lesson-nav{bottom:78px}
#inventia .parts-nav button[hidden]{display:none}
/* Fade only the models; the slide, navigation, and explanations stay steady. */
#rocket-journey,#piston-3d,#cutaway-locomotive .model-stage{transition:opacity .22s cubic-bezier(.2,.7,.2,1)}
html.model-switching :is(#rocket-journey,#piston-3d,#cutaway-locomotive .model-stage){opacity:0;transition-duration:.14s;pointer-events:none}
#cutaway-locomotive.is-driving :is(.hotspot-layer,.instrument-label-layer){visibility:hidden;pointer-events:none}
#cutaway-locomotive.is-driving .model-stage{pointer-events:none}
@media(max-width:700px){
 #presentation-model-picker{bottom:12px;gap:2px;padding:3px;border-radius:12px}
 #presentation-model-picker button{min-height:30px;padding:0 9px;border-radius:8px;font-size:11px}
 #presentation-model-picker .model-option-prefix{display:none}
 .five-slide-presentation .presentation-controls{left:10px;bottom:12px;gap:5px}
 .five-slide-presentation .presentation-controls button{font-size:0;min-width:36px;width:36px;height:38px;padding:0;gap:0;border-radius:10px}
 .five-slide-presentation .presentation-controls button>span{font-size:18px}
 .five-slide-presentation .presentation-tools{right:10px;bottom:12px;height:38px;gap:8px}
 .five-slide-presentation .presentation-tools .chapter-indicator{font-size:11px;letter-spacing:0}
 .five-slide-presentation .presentation-tools .divider{margin:0 5px}
 .five-slide-presentation .presentation-tools .fullscreen{width:34px;height:38px;border-radius:10px}
 .five-slide-presentation .context-scene{padding-bottom:128px}
 .lesson-nav{bottom:66px}
}
@media(prefers-reduced-motion:reduce){#rocket-journey,#piston-3d,#cutaway-locomotive .model-stage{transition:none}}
@media print{#presentation-model-picker{display:none}}
@media(max-width:360px){#presentation-model-picker{bottom:60px}}
@media(prefers-reduced-motion:reduce){#presentation-model-picker button{transition:none}}
/* Touch screens, including interactive classroom displays. */
@media screen and (any-pointer:coarse){
 button,a{-webkit-tap-highlight-color:transparent}
 .five-slide-presentation .presentation-controls button,
 .five-slide-presentation .presentation-tools .fullscreen,
 #presentation-model-picker button,
 .lesson-nav button,#inventia .parts-nav button{min-width:44px;min-height:44px;touch-action:manipulation}
 .five-slide-presentation .presentation-tools{height:44px}
 #inventia .parts-nav{flex-wrap:wrap;gap:5px}
}
@media screen and (max-width:700px) and (any-pointer:coarse){
 #presentation-model-picker{bottom:calc(66px + env(safe-area-inset-bottom,0px))}
 .five-slide-presentation .presentation-controls,.five-slide-presentation .presentation-tools{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
 .lesson-nav{bottom:calc(124px + env(safe-area-inset-bottom,0px));gap:2px;padding:3px;max-width:calc(100% - 20px)}
 .lesson-nav button{padding:8px;font-size:12px}
 .five-slide-presentation .context-scene{padding-bottom:calc(186px + env(safe-area-inset-bottom,0px))}
 .five-slide-presentation #inventia .mechanism-scene{padding-bottom:calc(128px + env(safe-area-inset-bottom,0px))}
}
/* Override the old minimum scene height, also with reduced motion enabled. */
html .five-slide-presentation.enhanced.static-motion .context-scene,
html .five-slide-presentation .context-scene{min-height:0;height:100%}
@media screen and (max-height:500px) and (min-aspect-ratio:4/3){
 .five-slide-presentation .context-scene{padding:14px 4vw 128px;gap:8px}
 .five-slide-presentation .context-layout{grid-template-columns:minmax(220px,36%) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
 .five-slide-presentation .context-copy{grid-row:1;padding:0 12px 0 0;max-height:100%;overflow:auto}
 .five-slide-presentation .context-scene .piston-figure{grid-row:1;grid-column:2}
 .five-slide-presentation .context-step h3{font-size:22px;margin-bottom:8px}
 .five-slide-presentation .context-step p{font-size:13px;line-height:1.45}
 .five-slide-presentation .section-heading h2{font-size:32px}
 .five-slide-presentation .bibliography{align-content:start;padding-top:16px;gap:12px;grid-template-rows:auto minmax(0,1fr)}
 .five-slide-presentation .bibliography h2{font-size:34px}
 .five-slide-presentation .bibliography .sources{min-height:0;overflow:auto;overscroll-behavior:contain}
 .five-slide-presentation .sources li{font-size:14px;padding:8px 0}
 .five-slide-presentation .sources small{font-size:12px}
}
