/* Hallmark · macrostructure: Map / Diagram · theme: Plain · nav: N9 · footer: Ft2
 * Audience: environmental engineering students. Use: visual plant visit. Tone: quiet, observant.
 * The spatial scene is the content; no marketing sections. P4 H4 E4 S5 R5 V4. */
:root{--paper:#f3f0e8;--panel:#faf8f2;--ink:#243b38;--muted:#53625a;--rule:#c5cbc0;--accent:#285e51;--accent-ink:#faf8f2;--hover:#e4e9df;--focus:#b24721;--shadow:#132b2526;--swatch-concrete:#a5a797;--swatch-water:#777357;--swatch-warm:#d1b799;--swatch-mint:#69aa9a;--swatch-dark:#152938;--swatch-blue:#69c5d4;--font-display:'Trebuchet MS',sans-serif;--font-body:'Segoe UI',sans-serif;--knob-angle:54deg}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow-x:clip}body{font-family:var(--font-body);color:var(--ink);background:var(--paper);font-size:14px}button,input{font:inherit}button{color:inherit;cursor:pointer;white-space:nowrap;min-height:44px;border:1px solid var(--rule);background:var(--panel);border-radius:5px;padding:10px 14px;transition:background .16s,color .16s}button:hover{background:var(--hover)}button:active{transform:translateY(1px)}button:disabled{opacity:.55;cursor:wait}:focus-visible{outline:3px solid var(--focus);outline-offset:3px}button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}button.primary:hover{filter:brightness(1.12)}button.quiet{background:var(--panel)}[hidden]{display:none!important}#world{position:fixed;inset:0;touch-action:none}#world canvas{display:block;width:100%;height:100%}.masthead{position:absolute;top:26px;left:32px;right:32px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.masthead>*{pointer-events:auto}.brand{display:flex;align-items:center;gap:11px}.mark{font-family:var(--font-display);font-size:38px;line-height:1}.brand b{font-size:18px;letter-spacing:.12em}.brand div>span{display:block;font-size:9px;letter-spacing:.2em;margin-top:2px}.masthead button{border:0}.masthead button span{margin-left:12px;border:1px solid var(--rule);border-radius:50%;padding:0 6px}.titleblock{position:absolute;top:112px;left:34px;pointer-events:none}.eyebrow,.section-label{font-size:10px;font-weight:650;letter-spacing:.16em}.eyebrow{margin:0 0 12px}.titleblock h1{font-family:var(--font-display);font-size:42px;letter-spacing:-.04em;line-height:1.08;margin:0;font-weight:500;overflow-wrap:anywhere;min-width:0}.subtitle{margin:12px 0 0;color:var(--muted)}.panel{position:absolute;right:32px;top:112px;width:286px;background:var(--panel);border:1px solid var(--rule);border-radius:8px;box-shadow:0 8px 30px var(--shadow)}.panel-toggle{width:100%;display:flex;justify-content:space-between;border:0;border-radius:8px 8px 0 0;background:var(--panel);font-weight:600;padding:14px 18px}.panel-toggle span{font-size:18px;font-weight:400}#panel-body{padding:4px 18px 18px}.section-label{color:var(--muted);margin:12px 0}.style-list{display:grid;gap:6px}.style-list button{display:flex;align-items:center;text-align:left;width:100%;padding:10px 9px;gap:10px;border-color:transparent;background:transparent}.style-list button:hover{background:var(--hover)}.style-list button[aria-pressed=true]{border-color:var(--accent);background:var(--hover)}.style-list b{font-size:12px;font-weight:600;display:block}.style-list small{font-size:10px;display:block;color:var(--muted);margin-top:3px}.style-list em{margin-left:auto;font-style:normal;font-size:10px;color:var(--muted)}.swatch{width:32px;height:36px;flex-shrink:0;border-radius:3px;display:block;border-bottom:14px solid var(--swatch-water);background:var(--swatch-concrete);transform:skewY(-7deg)}.swatch.diorama{background:var(--swatch-warm);border-color:var(--swatch-mint)}.swatch.technical{background:var(--swatch-dark);border-color:var(--swatch-blue)}.aeration-head{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--rule);margin-top:19px;padding-top:19px;font-size:12px;font-weight:600}.aeration-head output{font-variant-numeric:tabular-nums}.knob-row{display:flex;align-items:center;gap:15px;margin-top:16px}#knob{height:49px;width:49px;border:6px solid var(--rule);border-radius:50%;background:var(--ink);position:relative;transform:rotate(var(--knob-angle));flex-shrink:0}#knob i{position:absolute;left:17px;top:3px;width:3px;height:12px;background:var(--panel);border-radius:2px}.slider-block{flex:1;min-width:0}input[type=range]{width:100%;margin:0;height:32px;accent-color:var(--accent);cursor:pointer}.range-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--muted)}.fine{font-size:10px;color:var(--muted);margin:14px 0}.options{display:flex;gap:7px}.options button{padding:8px 10px;font-size:11px;flex:1}.bottom-bar{position:absolute;left:34px;bottom:35px}.view-controls{display:flex;gap:8px}.view-controls .primary{min-width:183px;display:flex;gap:26px;justify-content:space-between}.bottom-bar p{font-size:11px;color:var(--muted);margin:12px 0 0;background:var(--paper);padding:5px 9px;border-radius:3px;display:inline-block}.location{position:absolute;right:32px;bottom:39px;display:flex;align-items:center;gap:9px;font-size:11px;background:var(--panel);padding:11px 13px;border:1px solid var(--rule);border-radius:4px}.live-dot{width:6px;height:6px;border-radius:50%;background:var(--accent)}.separator{color:var(--rule);padding:0 3px}.hotspot{position:absolute;display:flex;align-items:center;gap:7px;padding:5px 10px;font-size:11px;min-height:32px;border-radius:3px;transform:translate(-50%,-50%);box-shadow:0 2px 12px var(--shadow)}.hotspot:before{content:'+';font-size:15px;color:var(--accent)}#hotspots{position:fixed;inset:0;pointer-events:none}.hotspot{pointer-events:auto}#crosshair{display:none;position:absolute;left:50%;top:50%;width:5px;height:5px;border:1px solid var(--panel);border-radius:50%;background:var(--ink);pointer-events:none}body.walking #crosshair{display:block}#loading,#error{position:fixed;inset:0;background:var(--paper);display:flex;align-items:center;justify-content:center;flex-direction:column;z-index:20}#error{padding:24px;text-align:center}dialog{background:var(--panel);color:var(--ink);border:1px solid var(--rule);padding:36px;max-width:510px;width:calc(100% - 32px);border-radius:9px;position:fixed;inset:0;margin:auto;max-height:85dvh;overflow-y:auto;box-shadow:0 20px 70px var(--shadow)}dialog::backdrop{background:var(--shadow)}dialog h2{font-family:var(--font-display);font-weight:500;font-size:29px;margin:16px 0}dialog p{line-height:1.65;color:var(--muted)}dialog .primary{margin-top:12px}.dialog-close{position:absolute;right:10px;top:10px;border:0;font-size:24px;background:transparent}#touch-controls{display:none;position:absolute;bottom:112px;left:20px;text-align:center;touch-action:none}#touch-controls button{width:46px;height:46px;padding:0;font-size:23px;margin:2px}.technical-theme{--paper:#152938;--panel:#182d3b;--ink:#e0ebe8;--muted:#b5c9ce;--rule:#4b6370;--accent:#9acdc3;--accent-ink:#152938;--hover:#2c4653;--focus:#f1bd7f;--shadow:#07101955}.diorama-theme{--paper:#eee3ce;--panel:#fcf4e5;--ink:#4b4739;--muted:#68634e;--rule:#c3b9a2;--accent:#466957;--accent-ink:#fcf4e5;--hover:#e8e7d3}
@media(pointer:coarse){body.walking #touch-controls{display:block}.hotspot{min-height:44px}}
@media(max-width:900px){.masthead{left:20px;right:20px;top:20px}.titleblock{left:22px;top:103px}.titleblock h1{font-size:34px}.panel{right:20px;top:185px;width:260px}.subtitle{font-size:12px}.location{bottom:24px;right:20px}.bottom-bar{left:20px;bottom:67px}.bottom-bar p{max-width:calc(100vw - 40px)}}
@media(max-width:540px){.masthead{top:15px;left:16px;right:16px}.brand b{font-size:15px}.brand div>span{font-size:8px}.masthead button{font-size:11px;padding:8px}.masthead button span{display:none}.titleblock{top:90px;left:18px}.titleblock h1{font-size:30px}.subtitle{display:none}.panel{top:162px;right:16px;width:240px;max-height:calc(100dvh - 290px);overflow-y:auto}.panel-toggle{padding:10px 14px}#panel-body{padding:0 14px 12px}.bottom-bar{left:16px;bottom:58px;right:16px}.view-controls{gap:5px}.view-controls button{font-size:11px;padding:9px 10px}.view-controls .primary{min-width:0;gap:12px;flex:1}.bottom-bar p{font-size:9px;line-height:1.6;margin-top:7px;padding:4px 6px;max-width:100%}.location{bottom:14px;left:16px;right:auto;font-size:10px;padding:8px 10px}.hotspot{font-size:10px}.titleblock .eyebrow{font-size:9px}.panel .style-list small{font-size:9px}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
:root{--liquid:#367e85;--solids:#93661e;--map-land:#e4e6da;--map-tank:#afcac0;--map-building:#b6bbad;--map-path:#f3f0e8}
.technical-theme{--liquid:#82cdd5;--solids:#e4b974;--map-land:#223a47;--map-tank:#3d6674;--map-building:#526773;--map-path:#304e5c}
.diorama-theme{--map-land:#e5dbc5;--map-tank:#a6c6b0;--map-building:#c6b69b;--map-path:#faf0db}
.titleblock h1{font-size:38px}.panel{max-height:calc(100dvh - 220px);overflow-y:auto}.secondary-options{margin-top:7px}.flow-key,.map-caption{display:flex;flex-wrap:wrap;gap:14px;font-size:10px;margin:12px 0 0}.water-key{color:var(--liquid)}.sludge-key{color:var(--solids)}.hotspot{min-height:36px;font-size:10px}.hotspot:before{display:none}.dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.dialog-actions .primary{margin:0}.dialog-actions button{flex:1}#visit-card{position:absolute;left:34px;bottom:150px;padding:15px 17px;width:270px;border:1px solid var(--rule);border-radius:6px;background:var(--panel);box-shadow:0 3px 14px var(--shadow)}#visit-card .eyebrow{font-size:9px;margin-bottom:7px}#visit-card h2{font-family:var(--font-display);font-size:19px;font-weight:500;margin:0 0 12px}#visit-card>div{display:flex;gap:8px}#visit-card button{font-size:11px;padding:8px 11px;flex:1}#map-dialog{max-width:900px;padding:30px}#map-dialog h2{margin:12px 0 8px}#map-dialog>p:not(.eyebrow){font-size:12px}.map-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);align-items:center;gap:20px}#plant-map{position:relative;aspect-ratio:122/94;width:100%;border:1px solid var(--rule);border-radius:6px;overflow:clip;background:var(--map-land)}#plant-map svg{width:100%;height:100%;display:block}.map-site{fill:var(--map-land)}.map-path{fill:none;stroke:var(--map-path);stroke-width:2.5}.map-tank{fill:var(--map-tank);stroke:var(--muted);stroke-width:.25}.map-building{fill:var(--map-building)}.map-baffles{fill:none;stroke:var(--map-land);stroke-width:.4}.map-flow{fill:none;stroke:var(--liquid);stroke-width:.6}.map-sludge{fill:none;stroke:var(--solids);stroke-width:.5;stroke-dasharray:1 .6}.map-stop{position:absolute;transform:translate(-50%,-50%);width:26px;height:26px;min-height:26px;border-radius:50%;padding:0;font-size:10px;border-color:var(--ink);background:var(--panel);color:var(--ink);z-index:1}.map-stop:before{content:'';position:absolute;inset:-9px}.map-stop:hover,.map-stop[aria-current=true]{background:var(--accent);color:var(--accent-ink)}.map-stop:active{transform:translate(-50%,-50%)}#stop-list{display:grid;gap:3px;max-height:440px;overflow-y:auto}#stop-list button{display:flex;align-items:center;gap:10px;text-align:left;padding:7px 10px;font-size:11px;border-color:transparent;min-height:35px}#stop-list button span{font-size:10px;color:var(--muted)}#stop-list button[aria-current=true]{background:var(--hover);border-color:var(--accent)}#stop-list button.visited:after{content:'✓';margin-left:auto;color:var(--accent)}#map-you{position:absolute;width:9px;height:9px;background:var(--focus);border:2px solid var(--panel);border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:2}.map-caption{justify-content:space-between}.walking .titleblock{display:none}
@media(max-width:900px){#visit-card{left:20px;bottom:180px;width:245px}.titleblock h1{font-size:32px}#map-dialog{padding:24px}.map-layout{grid-template-columns:minmax(0,1fr)}#plant-map{max-width:520px;margin:auto}#stop-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:220px}#stop-list button{font-size:10px;min-height:44px}}
@media(max-width:540px){.titleblock h1{font-size:27px}.view-controls{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,.8fr)}.view-controls #reset{display:none}.view-controls .primary{gap:5px}.view-controls button{padding:8px 7px;font-size:10px}.panel{top:153px;width:240px;max-height:calc(100dvh - 300px)}#visit-card{left:16px;bottom:155px;padding:10px 12px;width:232px}#visit-card h2{font-size:16px;margin-bottom:6px}#visit-card button{font-size:10px;min-height:38px}.walking #visit-card{left:auto;right:16px;bottom:160px;width:210px}#touch-controls{left:12px;bottom:110px}#touch-controls button{width:40px;height:44px;margin:1px}#touch-controls div{display:flex;flex-wrap:wrap;width:84px;justify-content:center}#touch-controls div button:last-child{order:-1}#map-dialog{padding:22px 16px}#map-dialog h2{font-size:25px}#stop-list{grid-template-columns:minmax(0,1fr);max-height:180px}#stop-list button{font-size:11px}.map-layout{gap:12px}.map-caption{gap:5px 12px}.hotspot{font-size:9px;min-height:32px;max-width:160px;padding:5px 7px}}
.walking .brand{background:var(--panel);color:var(--ink);padding:6px 9px;border-radius:4px}
@media(max-width:540px){#touch-controls{width:132px;bottom:160px}#touch-controls>button{display:block;margin:0 auto 4px}#touch-controls div{width:132px;flex-wrap:nowrap;gap:3px}#touch-controls div button:last-child{order:0}}
@media(max-width:360px) and (pointer:coarse){.walking #visit-card{bottom:265px;width:calc(100% - 32px)}}
/* Projected labels must retain their centering transform while pressed. */
#hotspots{z-index:3}.hotspot{min-height:44px;touch-action:manipulation;user-select:none}.hotspot:active{transform:translate(-50%,-50%)}
.panel,.masthead,.bottom-bar,#visit-card,.location,#touch-controls{z-index:5}.titleblock{z-index:2}

/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 */




@media(min-width:901px){#stop-list{max-height:500px}}

/* Overview shows numbered pins; the full name appears on hover or focus, and always in walk mode. */
.hotspot b{font-weight:700;letter-spacing:.02em}
body:not(.walking) .hotspot{min-height:26px;padding:3px 8px;border-radius:13px;gap:0}
body:not(.walking) .hotspot span{display:none}
body:not(.walking) .hotspot:hover span,body:not(.walking) .hotspot:focus-visible span{display:block;position:absolute;left:100%;top:50%;transform:translateY(-50%);margin-left:6px;padding:4px 8px;border-radius:3px;background:inherit;color:inherit;white-space:nowrap;box-shadow:0 2px 12px var(--shadow)}
body:not(.walking) .hotspot:before{display:none}

/* Longer welcome heading wraps instead of running under the control panel. */
.titleblock{max-width:min(46vw,520px)}
.titleblock h1{font-size:clamp(26px,3.4vw,40px)}
@media(max-width:900px){.titleblock{max-width:70vw}}

/* Brand block links to the lab home page. */
a.brand{text-decoration:none;color:inherit;pointer-events:auto;cursor:pointer;background:var(--panel);padding:6px 9px;border-radius:4px;box-shadow:0 2px 12px var(--shadow)}
a.brand:hover b{text-decoration:underline;text-underline-offset:3px}

/* Status pill retired; the elements stay for state updates and tests. */
.location[hidden]{display:none!important}

/* Speech bubble above a staff figure when the visitor walks up to them. */
#speech{position:fixed;transform:translate(-50%,-100%);max-width:270px;padding:9px 12px;border-radius:10px;background:var(--panel);color:var(--ink);box-shadow:0 2px 12px var(--shadow);font-size:12px;line-height:1.4;pointer-events:none;z-index:4}
#speech b{display:block;font-size:10px;letter-spacing:.14em;text-transform:uppercase;margin-bottom:3px;color:var(--accent)}
#speech:after{content:'';position:absolute;left:50%;bottom:-7px;margin-left:-6px;border:6px solid transparent;border-top-color:var(--panel);border-bottom:0}
#speech.toast{transform:translate(-50%,-100%);max-width:360px}
#speech.toast:after{display:none}
/* Staff dialogue is deliberately distinct from compact equipment labels. */
#speech{box-sizing:border-box;width:max-content;max-width:min(360px,calc(100vw - 32px));padding:16px 20px 18px;border:2px solid #53756c;border-radius:22px;background:#fff9e9;color:#203b35;box-shadow:0 6px 24px #0004;font-size:18px;line-height:1.5;z-index:5}
#speech b{font-size:13px;letter-spacing:.06em;color:#42675d;margin-bottom:7px;text-transform:none}
#speech-line{display:block;font-weight:500}
#speech:after{left:var(--tail-x,50%);bottom:-16px;margin-left:-10px;border-left:11px solid transparent;border-right:11px solid transparent;border-top:16px solid #fff9e9;border-bottom:0;filter:drop-shadow(0 2px 0 #53756c)}
#speech.toast{max-width:min(420px,calc(100vw - 32px))}

/* Loading overlay: the Delta mark turns so the wait reads as loading, not a static page. */
#loading .mark{display:inline-block;transform-origin:50% 56%;animation:deltaLoad 1.8s cubic-bezier(.55,.05,.3,1) infinite;will-change:transform}
#loading p{animation:deltaPulse 1.8s ease-in-out infinite}
@keyframes deltaLoad{0%{transform:rotateY(0deg)}50%{transform:rotateY(180deg) scale(1.08)}100%{transform:rotateY(360deg)}}
@keyframes deltaPulse{0%,100%{opacity:.55}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){#loading .mark,#loading p{animation:none}}
