:root{color-scheme:dark;--bg:#091624;--panel:#0d2032;--panel2:#10283c;--line:#264256;--ink:#e8f0f4;--muted:#96acbb;--cyan:#5bdcd5;--amber:#efbc6c;--blue:#70a9ec;--green:#6dc1ac;--purple:#ba9be1;--radius:14px;font-family:Inter,'Segoe UI',sans-serif;font-size:16px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}button,input,a{ -webkit-tap-highlight-color:transparent}button,input{font:inherit}button{cursor:pointer;color:var(--ink);background:#12293c;border:1px solid var(--line);border-radius:8px;min-height:42px;padding:9px 15px;transition:background .15s,border-color .15s}button:hover{background:#1b3b4f;border-color:#507888}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid var(--cyan);outline-offset:4px}button:disabled{opacity:.35;cursor:default}button[aria-pressed=true],button[aria-current=true]{background:#214c54;border-color:var(--cyan);color:#c5fffa}.quiet{background:transparent;border-color:transparent}.outline{background:transparent;border-color:#497989;color:#b3dedc}.primary{background:var(--cyan);color:#09262b;border-color:var(--cyan);font-weight:600}.primary:hover{background:#8aeee8;color:#09262b}.amber{color:var(--amber);background:#302a21;border-color:#816643}.tiny{font-size:12px;color:var(--muted);line-height:1.5}.eyebrow{font-size:12px;letter-spacing:.13em;font-weight:600;color:var(--cyan)}.appbar{display:flex;justify-content:space-between;align-items:center;padding:17px 30px;border-bottom:1px solid var(--line);gap:20px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-weight:650;letter-spacing:.08em;font-size:16px}.brand-mark{font-size:35px;font-weight:400;color:var(--cyan)}.brand small{display:block;font-weight:400;font-size:12px;letter-spacing:.03em;color:var(--muted);margin-top:4px}.header-actions{display:flex;align-items:center;gap:14px}.prototype{font-size:10px;letter-spacing:.12em;color:var(--muted)}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 305px;max-width:2000px;margin:auto}.teaching{min-width:0;padding:26px 28px 22px}.lesson-head{display:flex;justify-content:space-between;align-items:start;gap:15px;min-height:105px}.lesson-head h1{font-size:clamp(23px,2.2vw,35px);font-weight:550;letter-spacing:-.035em;margin:9px 0}.lesson-head p{color:var(--muted);margin:0 0 14px;line-height:1.5;font-size:15px}.lesson-head .amber{font-size:13px;white-space:nowrap}.scene-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:9px 0 15px;flex-wrap:wrap}.contexts,.segmented{display:flex;gap:4px}.contexts button{border-color:transparent;background:transparent;color:var(--muted);font-size:14px;min-height:38px;padding:8px 13px}.contexts button[aria-pressed=true]{background:#19374a;color:var(--ink);border-color:#355c70}.segmented{padding:3px;border:1px solid var(--line);border-radius:10px;background:#07121d}.segmented button{background:transparent;border-color:transparent;font-size:13px;min-height:34px;padding:7px 15px}.segmented button[aria-pressed=true]{background:var(--cyan);color:#082b2d}.stages{display:grid;gap:12px}.stages.compare{grid-template-columns:1.12fr 1fr}.stages.world,.stages.diagram{grid-template-columns:1fr}.stages.world .diagram-stage,.stages.diagram .world-stage{display:none}.stage{position:relative;min-width:0;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:radial-gradient(ellipse at 50% 60%,#163448 0%,#0c1d2d 70%)}.stage-top{height:46px;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 16px;font-size:14px;color:#d1e1e8}.stage-top button{font-size:12px;min-height:28px;padding:2px 0;color:var(--muted)}#world{position:relative;width:100%;height:380px}#world canvas{display:block;width:100%;height:100%;touch-action:pan-y}#world-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}.world-label{position:absolute;transform:translate(-50%,-50%);font-size:12px;line-height:1.15;padding:5px 9px;min-height:30px;max-width:128px;border:1px solid #476075;border-radius:5px;background:#0b1d2bef;color:#e2ebf3;pointer-events:auto;box-shadow:0 3px 8px #0004;text-align:center}.world-label[aria-pressed=true]{border-color:var(--amber);background:#393120;color:#ffe0ad}.stage-bottom{height:34px;display:flex;justify-content:space-between;align-items:center;padding:0 14px;font-size:11px;color:var(--muted);gap:8px}#diagram{height:380px;padding:4px 12px 6px}#diagram svg{width:100%;height:100%;overflow:visible}.diagram-node{cursor:pointer}.diagram-node rect,.diagram-node polygon{fill:#143248;stroke:#436478;stroke-width:1.4;transition:fill .2s}.diagram-node text{fill:var(--ink);font-family:inherit;font-size:14px;font-weight:500}.diagram-node.active rect,.diagram-node.active polygon{stroke:var(--amber);stroke-width:2;fill:#343021}.diagram-node.selected rect,.diagram-node.selected polygon{stroke:var(--cyan);stroke-width:3}.diagram-node:focus{outline:none}.diagram-node:focus-visible rect,.diagram-node:focus-visible polygon{stroke:#fff;stroke-width:3}.diagram-edge{stroke:#486071;stroke-width:1.5;fill:none}.diagram-edge.active{stroke:var(--amber);stroke-width:2}.edge-label{fill:#a9bdc9;font-size:12px;paint-order:stroke;stroke:#0c1d2d;stroke-width:5px;stroke-linejoin:round}.selection{min-height:35px;padding:10px 4px 5px;color:var(--muted);font-size:13px;line-height:1.4}.selection strong{color:var(--cyan);font-weight:500}.reveal{border-top:1px solid var(--line);padding:17px 0 12px;min-height:130px}.reveal-label{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--amber)}#step-number{font-variant-numeric:tabular-nums;color:var(--muted)}#step-title{font-weight:550}#step-copy{font-size:17px;line-height:1.5;margin:9px 0 12px;max-width:80ch}#step-actions{display:flex;flex-wrap:wrap;gap:8px}#step-actions button{font-size:14px}#feedback{font-size:14px;line-height:1.5;margin-top:8px;color:#b3d6cf}.navigation{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0 18px}.navigation button{font-size:14px}.step-dots{display:flex;gap:6px;margin-right:auto}.step-dots button{height:9px;min-height:9px;width:23px;padding:0;border-radius:3px;border:0;background:#294155}.step-dots button[aria-current=true]{background:var(--amber)}.route-head{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:18px 0 11px;font-size:11px;letter-spacing:.1em;color:var(--muted)}#filmstrip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.scene-card{padding:0;overflow:hidden;text-align:left;background:#0d2234;border:1px solid var(--line);border-radius:9px;min-width:0}.mini{height:50px;display:flex;align-items:center;justify-content:center;background:linear-gradient(140deg,#1a3549,#0c1b2a);opacity:.8}.mini svg{width:96px;height:38px}.scene-card strong{display:block;padding:10px 11px 4px;font-size:13px;font-weight:500}.scene-card small{display:block;padding:0 11px 11px;font-size:11px;color:var(--muted)}.teacher{border-left:1px solid var(--line);background:#0b1b2a;min-width:0;display:flex;flex-direction:column}.teacher-top{padding:29px 22px 12px}.teacher h2{font-size:20px;line-height:1.4;font-weight:500;letter-spacing:-.02em;margin:9px 0 20px}.searchbox{display:flex;align-items:center;border:1px solid #3e5b70;border-radius:8px;padding-left:11px;gap:8px;background:#122a3d}.searchbox input{background:transparent;border:0;outline:0;color:var(--ink);min-width:0;width:100%;font-size:14px;padding:12px 0}.searchbox:focus-within{outline:2px solid var(--cyan)}.searchbox button{padding:5px 10px;min-height:36px}.results{padding:0 16px;max-height:400px;overflow:auto}.result{display:block;width:100%;text-align:left;margin:0 0 8px;padding:14px;background:transparent;border-color:#203c50}.result strong{display:block;font-size:14px;font-weight:500;line-height:1.4}.result small{display:block;font-size:12px;color:var(--muted);line-height:1.4;margin-top:5px}.result .tag{color:var(--cyan);font-size:11px;margin-top:8px;display:block}.teacher-note,.teacher-footer{margin:23px 22px 0;padding-top:21px;border-top:1px solid var(--line)}.teacher-note p{font-size:16px;line-height:1.6;margin:12px 0}.boundary{padding:17px 22px}.boundary summary{font-size:13px;cursor:pointer;color:var(--amber)}.boundary p{font-size:13px;line-height:1.6;color:var(--muted)}.teacher-footer{margin-top:auto;padding-bottom:24px}.teacher-footer p{font-size:13px;line-height:1.6;color:var(--muted)}.teacher-footer button{font-size:12px;text-align:left;width:100%}.footer{padding:14px 30px;display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}a{color:#9cd9d7}dialog{background:#102538;color:var(--ink);border:1px solid #466171;border-radius:18px;max-width:760px;width:calc(100% - 36px);padding:28px;max-height:85vh;overflow:auto;box-shadow:0 25px 90px #0009}dialog::backdrop{background:#020912bb;backdrop-filter:blur(5px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:14px}.dialog-head h2{font-size:24px;font-weight:500}dialog p,dialog li{line-height:1.7;color:#c1d1dc}dialog li{margin-bottom:12px}#atlas-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}#atlas-list button{text-align:left;font-size:14px}#atlas-list small{display:block;font-size:11px;color:var(--muted);margin-top:5px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}.audience .teacher,.audience .header-actions,.audience .navigation,.audience .scene-toolbar,.audience #filmstrip,.audience .route-head,.audience .footer,.audience #resume,.audience #camera{display:none}.audience .workspace{display:block}.audience .teaching{max-width:1600px;margin:auto}.audience .stage #world,.audience #diagram{height:clamp(400px,58vh,720px)}.audience #step-actions button{pointer-events:none}.audience .brand small:after{content:' · Ecran public'}#webgl-error{position:absolute;inset:20% 12%;line-height:1.6;color:var(--muted)}
@media(min-width:1600px){#world,#diagram{height:470px}.workspace{grid-template-columns:minmax(0,1fr) 340px}}
@media(max-width:1150px){.workspace{grid-template-columns:minmax(0,1fr) 265px}.teaching{padding:22px 18px}.teacher-top{padding:24px 16px 10px}.stage-top .tiny{display:none}.stages.compare{grid-template-columns:1fr 1fr}#world,#diagram{height:330px}.segmented button{padding:7px 11px}.contexts button{padding:7px 9px}.world-label{font-size:11px;max-width:100px;padding:4px 6px}.prototype{display:none}.navigation .quiet{font-size:12px}}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.teacher{border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr}.teacher-top{grid-column:1/-1}.teacher h2{margin-bottom:10px}.teacher-top .tiny{display:none}.results{grid-column:1;grid-row:2/5}.teacher-note{margin-top:0}.teacher-footer{margin-top:0}.appbar{padding:14px 18px}.stages.compare{grid-template-columns:1.05fr 1fr}#world,#diagram{height:370px}.stage-top{font-size:13px}.header-actions{gap:2px}.header-actions button{font-size:12px}.brand{font-size:13px}.navigation{gap:8px}}
@media(max-width:570px){.stages.compare{grid-template-columns:1fr}.stages.compare #world{height:310px}.stages.compare #diagram{height:340px}.teaching{padding:20px 13px}.lesson-head{display:block}.lesson-head h1{font-size:25px}.lesson-head .amber{margin-bottom:12px}.stage-top .tiny{display:block}#filmstrip{grid-template-columns:1fr 1fr}.route-head .tiny{display:none}.teacher{display:block}.teacher-footer{padding-bottom:20px}.teacher-note{margin-top:22px}.header-actions #guide{display:none}.brand small{font-size:10px}.brand-mark{font-size:28px}.appbar{gap:6px;padding:12px}.header-actions button{max-width:105px;font-size:11px}.scene-toolbar{gap:10px}.segmented{width:100%}.segmented button{flex:1}.navigation .step-dots{order:4;justify-content:center;width:100%;margin:8px 0}.navigation{justify-content:space-between}.navigation button{font-size:12px;padding:8px 11px}.reveal{min-height:145px}.scene-card strong{font-size:13px}.selection{font-size:12px}.teacher-footer button{font-size:13px}.footer{padding:13px}#atlas-list{grid-template-columns:1fr}.audience .stage #world,.audience #diagram{height:340px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* v0.2: restrained stage materials, legible structure, emphasis instead of hidden edges. */
.stage{background:radial-gradient(ellipse at 52% 44%,#15364c 0%,#0b2033 54%,#091b2c 100%);border-color:#28516a;box-shadow:inset 0 1px 0 #a2d5ee05}
.stage-top{height:54px;align-items:center;font-size:15px;font-weight:500;color:#d9eaf4;padding:10px 18px}
.stage-top button{font-weight:400;color:#99b5c8}
.stages.compare{grid-template-columns:1.15fr 1fr}
#world,#diagram{height:410px}
.world-label{font-size:12px;font-weight:550;line-height:1.2;max-width:140px;padding:7px 10px;border-radius:5px;background:linear-gradient(#e4dfd3,#cbc7be);border:1px solid #a9a79d;color:#263443;box-shadow:0 3px 9px #0005,0 1px 0 #fff5 inset;min-height:31px}
.world-label:hover{background:#efeadf;color:#173b51;border-color:#eff7fb}
.world-label[aria-pressed=true]{background:#173e50;color:#d3fff9;border-color:#62e5d9;box-shadow:0 0 14px #49c5bf35}
.flow-label{position:absolute;transform:translate(-50%,-50%);padding:4px 9px;border-radius:6px;background:#163044ed;border:1px solid #7697a7;color:#d8e6ef;box-shadow:0 3px 9px #0005;font-size:11px;line-height:1.2;pointer-events:none;white-space:nowrap}
.flow-label.active{background:#4b331aeb;border-color:#eac27e;color:#ffe6b3;box-shadow:0 0 9px #d8963033}
.diagram-node.tone-blue rect{fill:#153d65;stroke:#438ac0}.diagram-node.tone-teal rect{fill:#11464c;stroke:#37a4ab}.diagram-node.tone-green rect{fill:#194638;stroke:#4c9c7e}.diagram-node.tone-purple rect{fill:#30324e;stroke:#8084b0}.diagram-node.tone-amber rect,.diagram-node.tone-amber polygon{fill:#46371f;stroke:#bc9858}
.diagram-node.active rect,.diagram-node.active polygon{stroke:#f2c174;stroke-width:2;filter:drop-shadow(0 0 3px #b7873828)}
.diagram-node.selected rect,.diagram-node.selected polygon{stroke:#71ece0;stroke-width:2.5;filter:drop-shadow(0 0 5px #50cabc44)}
.diagram-edge{stroke:#7295ab;stroke-width:2.15;stroke-linecap:round;stroke-linejoin:round}.diagram-edge.active{stroke:#f0bd6b;stroke-width:2.75;filter:drop-shadow(0 0 2px #d68f354d)}
.edge-label{fill:#afc9db;stroke:#0b2033;stroke-width:6px;font-size:12px;font-weight:500}.edge-label.active{fill:#f4cb83}
.diagram-node text{font-size:14px;fill:#e6f2f8}
.lesson-head{min-height:95px}.reveal{min-height:118px}.teacher h2{font-size:21px}.selection{color:#adc3d1}
@media(min-width:1600px){#world,#diagram{height:500px}}
@media(max-width:1150px){#world,#diagram{height:355px}.world-label{font-size:11px;padding:5px 7px;max-width:115px}.flow-label{font-size:11px;padding:3px 6px}.stage-top{font-size:13px;padding:8px 12px}}
@media(max-width:900px){#world,#diagram{height:375px}}
@media(max-width:570px){.stages.compare{grid-template-columns:1fr}.stages.compare #world{height:340px}.stages.compare #diagram{height:365px}.world-label{font-size:12px}.stage-top{font-size:14px}}
/* 0.3: free camera and persistent ontology/instance comparison. */
#world canvas{touch-action:none;cursor:grab}#world canvas.rotating{cursor:grabbing}#world canvas:focus-visible{outline:2px solid var(--cyan);outline-offset:-3px}
.model-switch{align-items:center;gap:7px;margin:0 0 12px}.model-switch span{font-size:12px;color:var(--muted)}
.ontology-layout.compare{grid-template-columns:.85fr 1.45fr}.ontology-layout #diagram{height:auto;min-height:410px;padding:8px 12px 2px}
.ontology-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ontology-half{min-width:0}.ontology-half+section{border-left:1px solid var(--line);padding-left:12px}.ontology-half h3{font-size:13px;letter-spacing:.05em;margin:4px 0 5px;color:var(--cyan);font-weight:600}.ontology-half p{font-size:12px;margin:0 0 7px;color:var(--muted)}.ontology-half svg{display:block;width:100%;height:345px}.ontology-caption{font-size:12px!important;line-height:1.4;color:var(--muted);margin:4px 0 8px}
.simulation-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:0 0 14px}.simulation-controls:empty{display:none}.simulation-controls button{font-size:13px}.state-current{font-size:14px;color:var(--cyan);margin-right:auto}
#filmstrip{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(min-width:1600px){.ontology-layout #diagram{min-height:500px}.ontology-half svg{height:420px}}
@media(max-width:1300px){.ontology-layout.compare{grid-template-columns:1fr}.ontology-layout.compare .world-stage #world{height:350px}.ontology-layout .ontology-half svg{height:340px}}
@media(max-width:600px){.ontology-pair{grid-template-columns:1fr}.ontology-half+section{border-left:0;border-top:1px solid var(--line);padding-left:0;padding-top:12px}.ontology-layout .ontology-half svg{height:325px}.ontology-caption{margin-top:8px}#filmstrip{grid-template-columns:1fr 1fr}}
.audience .model-switch{display:none}.audience .ontology-layout .ontology-half svg{height:400px}.audience .simulation-controls button{display:none}
