:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;line-height:1.6;--page:#FAF9F6;--surface:#FFFFFF;--panel:#F0EEEA;--text:#292824;--muted:#625F59;--border:#827D74;--line:#D8D4CD;--focus:#75402D;--hover:#191815;--selected:#EAE3D9;color:var(--text);background:var(--page)}
*{box-sizing:border-box}body{margin:0}a{color:var(--text);text-underline-offset:4px}a:hover{color:var(--focus)}
header,main,footer{max-width:1160px;margin:auto;padding:24px 32px}header{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);font-size:.85rem}.brand{font-weight:850;letter-spacing:.14em;text-decoration:none}
h1,h2,h3{line-height:1.12;letter-spacing:-.035em;color:var(--text)}h1{font-size:clamp(2.9rem,6vw,5rem);margin:18px 0 24px;font-weight:750}h2{font-size:2rem}h3{font-size:1.65rem;margin:12px 0 20px}p{margin:12px 0 20px}
.eyebrow{font-size:.875rem;font-weight:750;letter-spacing:.08em;color:var(--muted)}.lede{font-size:1.25rem;color:var(--muted)}.intro{display:grid;grid-template-columns:1fr 1fr;gap:36px;align-items:center;margin:28px 0}.intro figure{margin:0}svg{width:100%;height:auto;display:block}
/* Diagram labels/material colors are teaching semantics, independent of UI tokens. */
.diagram-label{font:12px system-ui,sans-serif;fill:#436075}figcaption,.hint,footer{font-size:.875rem;color:var(--muted)}figcaption{text-align:center;margin-top:10px}.notice{background:var(--panel);border-left:4px solid var(--border);padding:18px 22px;font-size:.9rem;margin:28px 0 40px}
.section-title{display:flex;align-items:center;justify-content:space-between}.section-title span{font-size:.9rem}.player-layout{display:grid;grid-template-columns:1.35fr 1fr;gap:32px}.stage{min-width:0}#paper{touch-action:none;cursor:grab;border:1px solid var(--line);border-radius:16px}#paper:active{cursor:grabbing}.hint{margin:10px 0}.instruction{padding:8px 0}.layers{font-size:.88rem;color:var(--muted)}.check{background:var(--panel);padding:14px 16px;border-radius:8px;font-size:.9rem}
.view-controls,.nav-controls,.transport>div{display:flex;gap:8px;flex-wrap:wrap}button,select{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--border);border-radius:7px;padding:10px 14px;min-height:44px;cursor:pointer}button:hover{background:var(--panel)}button:disabled{color:var(--muted);background:var(--panel);cursor:default;border-style:dashed}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,svg:focus-visible{outline:3px solid var(--focus);outline-offset:4px}#next,#play{background:var(--text);color:var(--surface);border-color:var(--text)}#next:hover,#play:hover{background:var(--hover)}#next:disabled,#play:disabled{background:var(--panel);color:var(--muted);border-color:var(--border)}
select{width:100%;margin:8px 0 14px}label{font-size:.875rem;font-weight:650}.nav-controls{justify-content:space-between}.transport{border-top:1px solid var(--line);margin-top:22px;padding:22px 0}.transport label{display:block;margin-top:18px}output{float:right}input[type=range]{width:100%;min-height:44px;accent-color:var(--text)}details{padding:15px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}summary{cursor:pointer;font-weight:650}
#complete-steps,#source{margin-top:64px}.overview{display:grid;grid-template-columns:1fr 1fr;gap:10px 28px;padding:0;list-style:none}.overview a{font-size:.93rem}.steps{list-style:none;padding:0}.static-step{display:grid;grid-template-columns:1fr 1fr;gap:34px;align-items:center;padding:32px 0;border-bottom:1px solid var(--line);scroll-margin-top:16px}.static-step h3{font-size:1.45rem}.static-step .eyebrow{font-size:.875rem}
.skip{position:absolute;left:20px;top:-100px}.skip:focus{top:12px;background:var(--surface);padding:12px;z-index:2}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}nav{font-size:.875rem}#interactive{scroll-margin-top:18px}
#interactive:not(.ready) .player-layout,#interactive:not(.ready) .transport,#interactive:not(.ready) details,.ready .loading-note{display:none}
#paper{max-height:580px}.static-step svg,.intro svg,.model-card svg{max-height:520px}
.stage .transport{margin-top:12px;padding-top:12px}.open-step{display:none}.interactive-ready .open-step{display:inline}
@media print{.interactive-ready .open-step{display:none}}
@media(max-width:700px){header,main,footer{padding:20px}header span{display:none}.intro,.player-layout,.static-step,.model-card{grid-template-columns:1fr;gap:16px}.intro{margin-top:20px}.intro figure{max-width:340px;margin:auto}.intro h1{font-size:3.3rem}.overview{grid-template-columns:1fr}.notice{margin-bottom:28px}.view-controls button{flex:1;padding:8px;font-size:.8rem}.static-step{padding:26px 0}.section-title h2{font-size:1.7rem}.model-card{padding:16px}.transport>div button{flex:1;padding:8px;font-size:.83rem}.instruction{padding-top:0}.diagram-label{font-size:16px}}
@media print{header,.transport,.view-controls,.open-step,#interactive,.skip{display:none}.intro{grid-template-columns:1fr 1fr}body{background:white}.static-step{break-inside:avoid;grid-template-columns:1fr 1fr;font-size:10pt;gap:20px}.static-step h3{font-size:15pt}.overview{display:none}a{color:inherit}main{padding:0}.notice{font-size:10pt}}

/* Shared site presentation; tutorial geometry and player sizing stay independent. */
header{align-items:center;gap:20px;font-size:.9rem}
.brand{letter-spacing:-.035em;font-size:1.2rem;line-height:1.2;color:var(--text)}
header nav,footer nav{display:flex;gap:12px 24px;flex-wrap:wrap}
header nav a,footer nav a{display:inline-flex;align-items:center;min-height:44px}
footer{border-top:1px solid var(--line);margin-top:48px;padding-bottom:40px}
footer p{max-width:700px}
:focus-visible{outline:3px solid var(--focus);outline-offset:4px}
[id]{scroll-margin-top:20px}
.primary-link{display:inline-block;background:var(--text);color:var(--surface);border-radius:8px;padding:12px 18px;text-decoration:none;font-weight:650;min-height:48px}
.primary-link:hover{background:var(--hover);color:var(--surface)}
.prose{max-width:860px}.prose h1{font-size:clamp(2.8rem,6vw,4rem)}
.prose h2{margin-top:40px}.prose li{margin:12px 0}
.source-entry{padding:16px 0;border-bottom:1px solid var(--line)}
.materials-heading{font-size:1.2rem;margin:24px 0 12px;letter-spacing:0}
.tutorial-actions{display:flex;align-items:flex-start;flex-direction:column;gap:12px;margin-top:24px}
.tutorial-actions .open-step{display:none}.interactive-ready .tutorial-actions .open-step{display:inline-block}
#source{border-block:1px solid var(--line);padding:8px 0;font-size:.9rem}
#source details{margin:0;padding:0;border:0}#source summary{padding:10px 0;min-height:44px;cursor:pointer;font-weight:650}
@media(max-width:900px){.card-grid{gap:14px}.card-grid .model-card section{padding:16px}}
@media(max-width:700px){
  header{align-items:flex-start;flex-direction:column;gap:6px;padding-bottom:12px}
  header nav{gap:22px}.brand{font-size:1.25rem}
  .home-hero{grid-template-columns:1fr;gap:24px;margin:12px 0 48px}
  .home-hero h1{font-size:3.2rem;margin-top:12px}
  .home-hero figure{padding:12px}.home-hero svg{height:220px}
  .hero-actions{align-items:flex-start;flex-direction:column;gap:16px}
  .card-grid{grid-template-columns:1fr;gap:24px}
  .card-grid .model-card section{padding:22px}.card-grid .eyebrow{min-height:0}
  .card-image svg{height:240px}.learning-path{padding:18px 22px}
  .intro h1{font-size:3rem}.intro figure{width:100%}
  footer nav{gap:8px 24px}
}
@media print{.tutorial-actions,.hero-actions{display:none}.card-grid{display:block}.home-hero{grid-template-columns:1fr 1fr}}

/* Compact content finder. Kept separate from tutorial/player layout. */
[hidden]{display:none!important}
.catalog-page{max-width:1040px}
.catalog-page h1{font-size:clamp(1.625rem,3.5vw,2rem);margin:8px 0 10px}
.catalog-page h2{font-size:1.3rem;margin:20px 0 10px;letter-spacing:-.02em}
.catalog-page:has(.method-chips) #results-heading{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.catalog-page:has(.method-chips) #result-count{margin-top:16px}
.finder-intro>p{margin:6px 0 14px}
.finder-controls label{font-size:.875rem;font-weight:650}
.search-line{display:flex;gap:8px;margin-top:4px}
.search-line input{min-width:0;flex:1;font:inherit;color:inherit;border:1px solid var(--border);border-radius:7px;background:var(--surface);padding:10px 12px;min-height:44px}
.search-line input::placeholder{color:var(--muted);opacity:1}
.method-chips{display:flex;flex-wrap:wrap;gap:8px}
.method-chips a{display:inline-flex;align-items:center;min-height:44px;padding:8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);text-decoration:none}
.method-chips a[aria-current]{background:var(--text);color:var(--surface);text-decoration:underline;text-underline-offset:4px}
.group-count{color:var(--muted);font-size:.875rem;font-weight:500}
.category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.category-card{display:block;padding:14px 18px;background:var(--panel);border:1px solid var(--border);border-radius:8px;color:inherit;text-decoration:none}
.category-card h3{display:inline;font-size:1.2rem;margin:0 12px 0 0}
.category-card>strong{white-space:nowrap;font-size:.875rem;color:var(--muted)}
.category-card p{font-size:.9rem;margin:6px 0 0;max-width:650px}
.category-card:hover{border-color:var(--text)}
#result-count{font-size:.875rem;margin:0 0 8px;color:var(--muted)}
.catalog-row{display:grid;grid-template-columns:112px 1fr;gap:18px;padding:16px 0;border-top:1px solid var(--line)}
.catalog-image{background:var(--panel);border-radius:8px;align-self:start}
.catalog-image svg{height:112px;width:100%}
.catalog-row h3{font-size:1.25rem;margin:0;line-height:1.25}
.catalog-row h3 a{display:inline-block;padding:6px 0;min-height:36px}
.catalog-row p{margin:4px 0;font-size:.9rem}
.catalog-row .entry-meta{font-size:.875rem;color:var(--muted)}
.catalog-row .entry-facts{line-height:1.6}
.catalog-row.compact{grid-template-columns:92px 1fr;padding:12px 0}
.compact .catalog-image svg{height:86px}
.catalog-note{font-size:.9rem;margin-top:24px}
#no-results{padding:20px;background:var(--panel);border-radius:8px}
@media(max-width:700px){
  header nav{gap:16px;font-size:.85rem}
  .catalog-page{padding:14px 16px}
  .catalog-page h2{margin-top:16px}
  .category-card{padding:12px}
  .catalog-row{grid-template-columns:68px 1fr;gap:12px;padding:12px 0}
  .catalog-row.compact{grid-template-columns:56px 1fr;gap:10px}
  .catalog-image svg{height:76px}.compact .catalog-image svg{height:64px}
  .catalog-row h3{font-size:1.12rem}
  .catalog-row h3 a{min-height:44px;display:inline-flex;align-items:center}
  .catalog-row p,.catalog-row .entry-meta{font-size:.875rem}
  .finder-intro>p{font-size:.9rem}
}

/* One transport, fixed only while the enhanced mobile guide is in view. */
@media(max-width:360px){
  header{padding-top:12px;padding-bottom:8px}
  .catalog-page{padding-top:8px}
  .catalog-page h1{margin-top:4px;margin-bottom:8px}
  .catalog-page:has(.method-chips) #result-count{margin-top:8px;margin-bottom:4px}
}
.primary-controls{display:flex;gap:8px;width:100%}.primary-controls button{flex:1;white-space:nowrap}
.secondary-controls>div{display:flex;gap:8px;margin-top:12px}
@media(max-width:700px),(max-height:500px) and (max-width:1000px){
  #interactive{scroll-margin-top:8px;overflow-anchor:none}
  #interactive .section-title h2{font-size:1.35rem;margin:8px 0}
  #interactive .player-layout{display:flex;flex-direction:column;gap:8px}
  #interactive .stage,#interactive .instruction{display:contents}
  #step-title{order:0;font-size:1.3rem;line-height:1.2;margin:4px 0;min-height:2.4em}
  #paper{order:1;width:100%;height:42vh;height:42svh;height:calc(var(--follow-height, 100dvh) * .42);min-height:160px;max-height:360px}
  #step-text{order:2;margin:4px 0 8px;line-height:1.5}
  #interactive .transport{order:3;margin:0;padding:0;border:0}
  #interactive .stage>.hint,#interactive .view-controls,#reference,#layers,#check,#interactive .instruction>label,#step-select{order:4;margin:4px 0}
  .primary-slot{min-height:64px}
  .primary-controls{padding:8px 0}
  .follow-active .primary-controls{position:fixed;z-index:20;left:0;right:0;bottom:var(--follow-bottom, 0px);padding:8px max(12px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:var(--page);border-top:1px solid var(--line);box-shadow:0 -4px 16px #29282412}
  .primary-controls button{min-height:48px;padding:8px;font-size:.9rem}
  #interactive.ready{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
  .follow-active{scroll-padding-bottom:calc(80px + env(safe-area-inset-bottom))}
  .secondary-controls{font-size:.9rem;margin:8px 0}
}
@media(max-height:500px) and (min-width:600px) and (max-width:1000px){
  header,main,footer{padding-left:max(32px,env(safe-area-inset-left));padding-right:max(32px,env(safe-area-inset-right))}
  #interactive .player-layout{display:grid;grid-template-columns:1fr 1fr;column-gap:20px}
  #interactive .player-layout>* ,#interactive .stage>*,#interactive .instruction>*{grid-column:1 / -1}
  #interactive #step-title{min-height:1.2em}
  #interactive #paper{grid-column:1;grid-row:2;height:calc(var(--follow-height,100dvh) - 160px - env(safe-area-inset-bottom));max-height:340px}
  #interactive #step-text{grid-column:2;grid-row:2;font-size:1rem;align-self:start}
}
@media print{.primary-controls{display:none}}

/* Camera and occasional actions belong to the model, not the page below it. */
.model-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;gap:4px;padding:4px 0;font-size:.8rem}
.model-tools button{min-width:0;padding:6px 2px;font-size:13px;line-height:1.2;height:44px;min-height:44px;white-space:nowrap}
.model-tools button[aria-pressed="true"]{background:var(--text);color:var(--surface);border-color:var(--text);box-shadow:inset 0 -3px 0 var(--surface);font-weight:700}
#more{font-size:22px;line-height:1}
#model-options{position:fixed;inset:auto;margin:0;width:360px;max-width:calc(100vw - 24px);padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);box-shadow:0 8px 32px #29282430;overflow:auto;overscroll-behavior:contain}
.option-actions{display:flex;gap:8px;flex-wrap:wrap}.option-actions button{padding:8px 10px}
.diagram-help{margin:8px 0 0;font-size:.9rem}.diagram-help summary{min-height:44px;padding:10px 0;cursor:pointer}.diagram-help p:last-child{margin-bottom:0}
@media(max-width:700px),(max-height:500px) and (max-width:1000px){
  .model-tools{order:1;padding:0}
  #paper{height:min(calc(var(--follow-height,100dvh) * .42),calc(var(--follow-height,100dvh) - 250px - env(safe-area-inset-bottom)))}
  #interactive .transport{display:flex;flex-direction:column}
  .transport .primary-slot{order:2}
}
@media(max-height:500px) and (min-width:600px) and (max-width:1000px){
  #interactive .model-tools{grid-row:2;grid-column:1 / -1}
  #interactive #paper{grid-row:3;height:calc(var(--follow-height,100dvh) - 214px - env(safe-area-inset-bottom));min-height:110px}
  #interactive #step-text{grid-row:3}
}

/* Reserved from first layout only in explicit local-mock mode. Never sticky. */
.ad-slot{display:none}
.ad-preview .ad-slot{display:block;max-width:760px;margin:32px auto;padding:12px 15px;background:var(--panel);border:1px solid var(--line);height:146px;text-align:center}
.ad-label{font-size:14px;line-height:20px;color:var(--muted);margin:0 0 10px;letter-spacing:.04em}
.ad-mock{height:90px;max-width:728px;margin:auto;display:flex;flex-direction:column;justify-content:center;gap:4px;background:var(--surface);font-size:14px;color:var(--muted);border:1px dashed var(--border)}
.is-filtered .ad-slot{display:none}
@media(max-width:799px){.ad-preview .ad-slot{max-width:352px;height:156px;padding:12px 15px}.ad-mock{height:100px;max-width:320px}}
@media print{.ad-preview .ad-slot{display:none}}
