/* The Machine Gallery at / (Milestone 1, 8 November 2026). Ported from the approved reference
   (reference/machine-gallery, The Machine Gallery.html: layout, still, appearance, destinations and refinement
   styles, in their order), with the Console renamed Directory, the Library moved to /papers/, and the
   production fixes at the end of this file. scripts/gallery.mjs writes the still's address into /assets/gallery/still.606c441a00.jpg. */
@font-face{font-family:"Raleway";src:url("/assets/fonts/Raleway-300.woff2") format("woff2");font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo";src:url("/assets/fonts/Archivo-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo";src:url("/assets/fonts/Archivo-500.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo";src:url("/assets/fonts/Archivo-600.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url("/assets/fonts/JBMono-400.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
:root{--still:url("/assets/gallery/still.606c441a00.jpg")}
@media(max-width:860px) and (orientation:portrait){:root{--still:url("/assets/gallery/still-phone.0034203ae5.jpg")}}
:root{color-scheme:dark;
  --bg:#111517; --surface:#23262A; --panel:#181C1F; --ink:#F8F9FA; --muted:#A3A7AD; --hair:#2E3236; --rule:#6B7178; --red:#D8412F;
  --ease:cubic-bezier(.65,0,.35,1);
  --sans:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;
  --display:"Raleway","Archivo",system-ui,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Menlo,monospace;
  --gl:max(24px,env(safe-area-inset-left,0px)); --gr:max(24px,env(safe-area-inset-right,0px));}
html,body{background:var(--bg);height:100%}
body{margin:0;color:var(--ink);font-family:var(--sans);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.u{position:relative;padding:6px 0;transition:color .25s var(--ease)}
.u::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--red);transform:scaleX(0);transform-origin:0 50%;transition:transform .35s var(--ease)}
.u:hover::after,.u:focus-visible::after,.u[aria-current="true"]::after{transform:scaleX(1)}
.top{position:fixed;z-index:30;top:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:calc(env(safe-area-inset-top,0px) + 24px) var(--gr) 0 var(--gl);pointer-events:none}
.top>*{pointer-events:auto}
.top img{height:30px;width:auto;display:block}
.top img.mk{display:none}
.top .r{display:flex;align-items:center;gap:32px}
.modes{display:flex;gap:24px;font-size:20px;color:var(--muted)}
.modes .u[aria-current="true"]{color:var(--ink)}
.modes .u:hover{color:var(--ink)}
.menu-btn{font-size:20px;font-weight:500}
body.directory .top{position:sticky;background:rgba(17,21,23,.94);padding-bottom:18px;border-bottom:1px solid var(--hair)}
#gallery{position:fixed;inset:0}
body.directory #gallery{display:none}
#gl{position:absolute;inset:0;width:100%;height:100%;display:block;outline:none;touch-action:none}
#gl.hot{cursor:pointer}
.bar{position:absolute;z-index:10;left:0;right:0;bottom:calc(env(safe-area-inset-bottom,0px) + 30px);display:flex;justify-content:center;align-items:center;gap:clamp(16px,2.6vw,40px);padding-left:var(--gl);padding-right:var(--gr);transition:opacity .6s var(--ease),transform .6s var(--ease)}
.bar .sec{font-family:var(--display);font-weight:300;font-size:clamp(20px,1.9vw,28px);color:#c9ccd0}
.bar .sec:hover,.bar .sec[aria-current="true"]{color:var(--ink)}
body.focused .bar .sec{display:none}
.shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(17,21,23,.55),rgba(17,21,23,0) 18%,rgba(17,21,23,0) 78%,rgba(17,21,23,.7));z-index:2}
.panel{position:absolute;z-index:12;top:50%;right:var(--gr);width:min(440px,38vw);transform:translate(24px,-50%);opacity:0;visibility:hidden;background:rgba(24,28,31,.97);padding:30px 32px 34px;transition:opacity .6s var(--ease),transform .6s var(--ease),visibility 0s linear .6s}
body.focused .panel{opacity:1;visibility:visible;transform:translate(0,-50%);transition:opacity .6s var(--ease) .35s,transform .7s var(--ease) .3s}
.panel .back{font-size:20px;color:#c9ccd0}
.panel .back:hover{color:var(--ink)}
.panel h2{font-family:var(--display);font-weight:300;font-size:clamp(44px,4.2vw,64px);line-height:1.02;letter-spacing:-.01em;margin:22px 0 12px}
.panel .line{font-size:20px;line-height:1.4;color:#c9ccd0;margin:0 0 18px}
.doors{list-style:none;margin:0;padding:0}
.doors li a{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:22px;padding:13px 0;border-bottom:1px solid var(--hair);transition:color .2s var(--ease)}
.doors li a span{opacity:0;transform:translateX(-6px);transition:opacity .25s var(--ease),transform .25s var(--ease)}
.doors li a:hover span,.doors li a:focus-visible span{opacity:1;transform:none}
.enter{display:flex;justify-content:space-between;align-items:center;margin-top:26px;font-size:22px;font-weight:500}
#directory{display:none}
body.directory #directory{display:block}
@media (max-width:860px){
.top img{height:24px}
.top .r{gap:20px}
.modes{font-size:20px;gap:16px}
.menu-btn{font-size:20px}
.panel{left:var(--gl);right:var(--gr);width:auto;top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 92px);transform:translateY(24px);max-height:50vh;overflow:auto;padding:22px 22px 24px}
body.focused .panel{transform:none}
.panel h2{font-size:40px;margin:14px 0 8px}
.doors li a{font-size:20px;padding:11px 0}
#secs{display:grid!important;grid-template-columns:repeat(3,auto);gap:6px 22px;justify-items:center}
.bar .sec{font-size:20px}
body.focused #secs{display:none!important}
}
.photos{display:none}
@media (max-width:860px){
.photos{display:block;position:absolute;inset:0;z-index:3;pointer-events:none}
.photos .ph{position:absolute;inset:0;background:var(--bg);opacity:0;visibility:hidden;transition:opacity .6s var(--ease),visibility 0s linear .6s}
.photos .ph.on{opacity:1;visibility:visible;transition:opacity .6s var(--ease)}
.photos .ph img{position:absolute;left:0;top:0;width:100%;height:64%;display:block;object-fit:cover;object-position:50% 50%}
.photos .ph::after{content:"";position:absolute;left:0;right:0;top:0;height:64%;background:linear-gradient(180deg,rgba(17,21,23,.62),rgba(17,21,23,0) 24%,rgba(17,21,23,0) 58%,var(--bg))}
.photos .ph[data-id="data"] img{object-position:58% 50%}
.photos .ph[data-id="data"]::after{background:linear-gradient(180deg,rgba(17,21,23,.31),rgba(17,21,23,0) 24%,rgba(17,21,23,0) 58%,var(--bg))}
}
@media (max-width:520px){
.top img.lk{display:none}
.top img.mk{display:block}
}
@media (prefers-reduced-motion:reduce){
*,*::before,*::after{transition-duration:.01ms!important;transition-delay:0s!important}
}
.top{padding-top:calc(env(safe-area-inset-top,0px) + 18px)}
.top .r{gap:clamp(15px,2.4vw,36px)}
#gl{visibility:hidden;touch-action:pan-y}
.scene-ready #gl{visibility:visible}
#gallery{background:var(--bg) var(--still) center / cover no-repeat}
#gallery::before{content:"";position:absolute;inset:0;background:#11151769}
.scene-ready #gallery::before{display:none}
.gallery-lead{position:absolute;z-index:8;top:calc(env(safe-area-inset-top,0px) + 82px);left:var(--gl);right:var(--gr);pointer-events:none}
.gallery-lead h1{font:300 clamp(32px,4.3vw,66px)/1.03 var(--display);letter-spacing:-.032em;margin:0;max-width:22ch}
.gallery-lead p{color:#c9ccd0;font-size:16px;margin:10px 0 0}
.focused .gallery-lead{visibility:hidden}
.bar{bottom:env(safe-area-inset-bottom,0px);min-height:71px;gap:0;background:linear-gradient(0deg,#0a0c0eef,#111517db);border-top:1px solid #6b717855}
#secs{display:flex!important;align-items:stretch;justify-content:space-between;width:min(100%,1200px);gap:8px}
.bar .sec,body.focused .bar .sec{display:grid;place-items:center;box-sizing:border-box;min-width:0;min-height:50px;padding:8px 10px;font-size:clamp(19px,1.8vw,25px)}
.bar .sec[aria-current]{color:var(--ink)}
.bar .sec[aria-current]::after{transform:scaleX(1);background:var(--ink)}
.bar .sec:hover::after,.bar .sec:focus-visible::after{background:var(--ink)}
.panel{box-sizing:border-box;top:calc((100% - 54px)/2);max-height:calc(100% - 175px);width:min(460px,39vw);overflow:auto;background:#181c1ff5;border-top:1px solid #6b7178;padding:22px clamp(18px,2.4vw,34px) 26px;transition:none}
body.focused .panel{transition:none}
.panel h2{margin:12px 0 8px}
.panel .line{margin-bottom:14px}
.doors li a{min-height:44px;box-sizing:border-box;font-size:19px;padding:9px 0}
.doors li a span{opacity:.65;transform:none}
.enter{margin-top:18px}
#p-h:focus{outline:none}
.scene-ready .photos{display:none}
#p-doors .u::after,#p-enter::after,#explore::after{background:var(--ink)}
@media(max-width:860px){
:root{--gl:max(16px,env(safe-area-inset-left,0px));--gr:max(16px,env(safe-area-inset-right,0px))}
.gallery-lead{top:calc(env(safe-area-inset-top,0px) + 72px)}
.gallery-lead h1{max-width:17ch;font-size:clamp(27px,5.3vw,42px)}
.gallery-lead p{font-size:15px;margin-top:5px}
#secs,body.focused #secs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;justify-items:stretch}
.bar .sec,body.focused .bar .sec{font-size:19px;min-height:44px;padding:6px 1px}
.panel{top:auto;width:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 128px);max-height:min(48vh,calc(100% - 222px));padding:14px 16px 17px}
.panel .line,.panel .back,.enter{font-size:17px}
.panel h2{font-size:34px}
.panel .line{margin-bottom:7px}
.doors li a{font-size:17px}
.top .r{gap:14px}
.modes{gap:12px}
.modes,.menu-btn{font-size:16px}
}
@media(max-height:480px) and (orientation:landscape){
.gallery-lead{top:68px}
.gallery-lead h1{font-size:31px}
.panel{max-height:calc(100% - 143px);top:calc(50% - 5px)}
.bar{min-height:55px}
}
.panel{display:flex;flex-direction:column;overflow:hidden}
.panel > :not(.doors){flex-shrink:0}
.panel .back{align-self:flex-start}
.panel .doors{overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#65696d transparent}
@media(max-width:860px){
.panel{background:#181c1f}
.panel .enter{margin-top:9px;padding:7px 0 0;border-top:1px solid var(--hair);min-height:30px}
}
:root{--hair:#383d41}
#gl{touch-action:none;cursor:grab}
#gl.hot{cursor:pointer}
#gl.dragging,#gl.dragging.hot{cursor:grabbing}
.gallery-lead h1{max-width:19ch;font-size:clamp(32px,3.8vw,58px)}
.gallery-lead p{color:#d5d7d9}
.scene-ready .drag-instruction{display:inline}
.drag-instruction{display:none}
.scene-tools{position:absolute;z-index:14;right:var(--gr);bottom:calc(env(safe-area-inset-bottom,0px) + 86px);display:none;gap:22px}
.scene-ready .scene-tools{display:flex}
.scene-tools button{min-height:40px;color:#e0e2e3;font-size:14px}
/* Reset view only once the view has moved (body.walked, set by the scene), so the corner is empty at rest */
.scene-tools #reset-view{display:none}
.walked .scene-tools #reset-view{display:inline-block}
/* Pause motion lives in the Explore DAP Menu's footer row, as plain text, while the room runs */
#motion{display:none}
.scene-ready #motion{display:inline-block}
.menu-footer #motion{margin-left:auto;min-height:24px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}
.menu-footer #motion:hover{text-decoration:underline;text-underline-offset:4px}
.feature{border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);padding:4px 0 12px;margin-bottom:3px}
.feature-switch{display:flex;align-items:center;gap:14px;color:#cbd0d3}
.feature-switch button{padding:4px 0;min-height:44px;min-width:38px;text-align:center}
.feature-switch button[aria-pressed=true]{box-shadow:inset 0 -1px #eee;color:white}
.feature-detail{padding-top:7px}
.feature-detail h3{font:300 23px/1.12 var(--display);margin:0 0 5px}
.feature-detail p{font-size:14px;line-height:1.3;color:#cbd0d3;margin:0}
.feature-detail small{display:block;font-size:12px;color:#cbd0d3;line-height:1.5;margin-top:5px}
.feature-figure{display:flex;align-items:flex-end;gap:17px;justify-content:space-between}
.feature-figure strong{display:block;font:300 42px/.98 var(--display);font-variant-numeric:lining-nums}
.feature-figure span{font-size:14px;display:block}
.feature-figure svg{width:40%;min-width:80px}
.feature-figure path{stroke:#d8412f;stroke-width:2.1;fill:none}
[data-feature=research] .panel .line{display:none}
.panel:has(.feature:not([hidden])){max-height:calc(100% - 143px)}
@media(max-width:860px){
.scene-tools{bottom:calc(env(safe-area-inset-bottom,0px) + 89px);gap:16px}
.scene-tools button{min-height:34px}
.panel:has(.feature:not([hidden])){max-height:min(51vh,calc(100% - 215px))}
.feature-switch button{min-height:44px}
.feature-figure strong{font-size:34px}
.feature-detail h3{font-size:21px}
.panel:has(.feature:not([hidden])) .doors{min-height:44px}
}
@media(max-height:750px) and (max-width:860px){
.panel:has(.feature:not([hidden])){max-height:min(58vh,calc(100% - 210px))}
.feature-detail small{font-size:11px}
.feature-switch button{min-height:40px}
.feature-detail{padding-top:3px}
.feature{padding-bottom:6px}
}
@media(pointer:coarse){
.dolly-instruction{display:none}
}
@media(max-width:860px){
[data-feature=data] .panel .line{display:none}
}
.scene-ready .choose-instruction{display:none}
.bar{--dock-surface:#101417ed; min-height:72px;z-index:16; background:var(--dock-surface);border-top:1px solid #90989f5c; box-shadow:0 -12px 30px #02040540;}
.dock-label{position:absolute;left:50%;bottom:100%;transform:translateX(-50%); display:flex;align-items:center;gap:12px; padding:6px 16px;background:#111619;border:1px solid #90989f65;border-bottom:0; color:#e3e6e7;font-size:12px;letter-spacing:.055em;white-space:nowrap}
.dock-label span{font-size:14px;color:#e55b4a;line-height:1}
#secs{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));gap:0}
.bar .sec,body.focused .bar .sec{display:flex;align-items:center;justify-content:center;flex-direction:column; min-height:65px;padding:8px 5px;color:#e6e8e9;line-height:1.13; transition:min-height .26s var(--ease),background .26s var(--ease),color .26s var(--ease)}
.bar .sec + .sec{border-left:1px solid #8d969a28}
.bar .sec[aria-current]{background:#c8d2d712}
.bar .sec:hover,.bar .sec:focus-visible{color:white;background:#c8d2d71c}
.dock-description{font:400 12px/1.35 var(--sans);color:#b9c2c9;opacity:0;max-height:0;overflow:hidden; transition:opacity .22s var(--ease),max-height .22s var(--ease),margin .22s var(--ease);}
.bar:hover .sec,.bar:focus-within .sec{min-height:88px}
.bar:hover .dock-description,.bar:focus-within .dock-description{opacity:1;max-height:20px;margin-top:6px}
.scene-tools{bottom:calc(env(safe-area-inset-bottom,0px) + 101px)}
.panel{background:#191e22f5; border:1px solid #9ba6ae56;border-top-color:#b8c1c77a; box-shadow:0 20px 72px #05080b80,inset 0 1px #ffffff16; padding:22px clamp(20px,2.2vw,32px) 20px; max-height:calc(100% - 178px)}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
.panel{background:linear-gradient(155deg,#20272dd1,#111619e8 76%); backdrop-filter:blur(17px) saturate(.76); -webkit-backdrop-filter:blur(17px) saturate(.76)}
}
body.focused .panel{animation:open-glass .32s var(--ease) both}
@keyframes open-glass{from{opacity:0;translate:10px 0}to{opacity:1;translate:0 0}}
.panel h2{font-size:clamp(37px,3.45vw,54px);margin:9px 0 7px}
.panel .line{font-size:16px;color:#d5dadf;line-height:1.37;margin:0 0 11px}
.panel:has(.feature:not([hidden])){max-height:calc(100% - 179px)}
.feature{padding:0 0 12px;border-color:#a9b3ba36;margin:0}
.feature-switch{gap:14px;min-height:44px;margin:0 0 4px;font-size:14px}
.feature-switch button{color:#d7dce0}
.feature-switch button:hover,.feature-switch button:focus-visible{color:#fff}
.feature-kind{display:block;color:#bfc9cf;font-size:11px;letter-spacing:.05em;margin:0 0 5px}
.feature-detail h3{font-size:clamp(21px,2vw,29px)}
.feature-detail p{line-height:1.38}
.feature-detail .paper-summary{color:#b7c1c8;font-size:13px;margin-top:5px}
.shelf-label{margin-right:auto;color:#e9ebec}
.feature-switch .shelf-toggle{padding:0 0 0 8px;font-size:12px;white-space:nowrap}
.shelf-count{min-width:27px;text-align:center;font-variant-numeric:tabular-nums}
[data-feature=research] .feature-detail{display:grid;grid-template-columns:60px minmax(0,1fr);align-items:start;gap:14px}
.paper-cover{width:60px;aspect-ratio:4/5;box-sizing:border-box;padding:9px 6px;border:1px solid #b9b9b1; background:linear-gradient(105deg,#f3f1e9,#d4d5cc);color:#22292d;font:500 9px var(--sans); box-shadow:3px 5px 0 #71808b6b}
.paper-cover i{display:block;height:1px;background:#626b6c80;margin:6px 0}
.paper-cover i:first-of-type{background:#d8412f;margin-top:11px}
.paper-cover i:nth-of-type(2){width:65%}
.paper-cover-1{background:linear-gradient(110deg,#aebac2,#dbded9)}
.paper-cover-2{background:linear-gradient(110deg,#e1d5be,#edeee6)}
.doors li a{min-height:46px;gap:14px;font-size:15px;border-color:#a9b3ba29;padding:8px 2px}
.doors li a:hover,.doors li a:focus-visible{background:#b8c7d013}
.doors li a .door-label{opacity:1;transform:none}
.door-label small{display:block;color:#bfc7cd;font-size:12px;line-height:1.3;margin-top:2px}
.destination-label{display:block}
.destination-label strong{display:block;font-size:17px;font-weight:500}
.destination-label small{display:block;color:#bac5cb;font-size:11px;font-weight:400;margin-top:1px}
.panel .enter{margin:12px 0 0;padding:10px 13px; background:#c8d4dd17;border:1px solid #a9b3ba55; box-shadow:inset 2px 0 #d8412f;color:#fafbfc;min-height:44px;}
.panel .enter:hover,.panel .enter:focus-visible{background:#c8d4dd29}
#p-enter::after{content:none}
@media(max-width:860px){
#secs,.focused #secs{grid-template-columns:repeat(3,minmax(0,1fr));}
.bar .sec,body.focused .bar .sec,.bar:hover .sec,.bar:focus-within .sec{min-height:45px;font-size:19px}
.bar .sec:nth-child(3n+1){border-left:0}
.bar .sec:nth-child(n+4){border-top:1px solid #8d969a28}
.dock-description{display:none}
.dock-label{padding:4px 12px}
.scene-tools{bottom:calc(env(safe-area-inset-bottom,0px) + 118px)}
.panel,.panel:has(.feature:not([hidden])){bottom:calc(env(safe-area-inset-bottom,0px) + 155px); padding:13px 15px 15px;max-height:min(53vh,calc(100% - 212px)); background:#1a2024eb}
.panel h2{font-size:32px;margin:5px 0}
.panel .line{font-size:14px}
.panel .enter{margin-top:9px;padding:7px 9px;min-height:42px}
.feature-switch{font-size:13px;gap:10px}
.feature-switch .shelf-toggle{font-size:11px;padding-left:1px}
.feature-switch button{min-width:32px}
[data-feature=research] .feature-detail{grid-template-columns:44px minmax(0,1fr);gap:10px}
.paper-cover{width:44px;padding:5px 4px}
.paper-cover i{margin:5px 0}
.paper-cover i:first-of-type{margin-top:7px}
}
@media(max-width:375px){
.panel:has(.feature:not([hidden])){max-height:calc(100% - 222px)}
.feature-detail .paper-summary{display:none}
.feature-switch{gap:7px}
}
@media(max-height:560px){
.panel,.panel:has(.feature:not([hidden])){overflow:auto;overscroll-behavior:contain}
.panel .doors{overflow:visible;flex-shrink:0}
.panel .enter{position:sticky;bottom:0;background:#232b30}
}
@media(prefers-reduced-motion:reduce){
body.focused .panel{animation:none}
}
@media(pointer:coarse){
.dock-label span{display:none}
}
:root{--rounded-surface:24px;
  --quiet-border:rgba(182,198,208,.19);
  --surface-text:#d3d9dd;
  --gallery-red:#e35241;}
.top .modes{gap:2px;align-items:center;padding:3px;border:1px solid var(--quiet-border); border-radius:30px;background:#151b1ed9;font-size:15px}
.top .modes .u{padding:7px 13px;border-radius:22px;line-height:1.2;color:#c6cdd1}
.top .modes .u::after,.top .menu-btn::after{content:none}
.top .modes .u[aria-current=true]{background:#bac8d320;color:#f8f9fa}
.top .menu-btn{font-size:15px;padding:9px 15px;border-radius:22px;border:1px solid var(--quiet-border);background:#151b1ed9}
.top .menu-btn:hover,.top .modes .u:hover{background:#bac8d320}
body.directory .top{padding-top:16px;padding-bottom:16px;background:#111719f5}
.panel{border-radius:var(--rounded-surface)}
.panel-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px}
.panel-toolbar .back{font-size:14px;min-height:34px}
.panel-toolbar .back::after{content:none}
#panel-directory{border-radius:22px;padding:7px 11px;border:1px solid var(--quiet-border); font-size:13px;line-height:1.35;white-space:nowrap;color:#dce2e5}
#panel-directory:hover{background:#b8c7d01a;border-color:#adb6bd79}
.panel .enter{border-radius:14px;box-shadow:none;position:relative}
.panel .enter::before{content:"";position:absolute;left:-1px;top:26%;bottom:26%;width:2px;border-radius:2px;background:var(--gallery-red)}
.panel .doors li a{border-radius:9px}
.paper-cover{border-radius:2px 6px 6px 2px}
.dock-label{border-radius:14px 14px 0 0}
.directory-shell{max-width:1260px;margin:0 auto;padding:clamp(28px,5vw,67px) var(--gr) 70px var(--gl)}
.directory-heading{display:flex;align-items:end;justify-content:space-between;gap:22px;margin-bottom:30px}
.directory-heading h2{font:300 clamp(44px,6vw,82px)/1 var(--display);letter-spacing:-.035em;margin:0}
.directory-heading p{color:var(--surface-text);font-size:17px;margin:12px 0 0}
.directory-return{display:inline-flex;align-items:center;gap:10px;padding:9px 16px;border:1px solid var(--quiet-border); border-radius:24px;color:#e2e7ea;white-space:nowrap;min-height:24px;font-size:14px}
.directory-return:hover{background:#d0dde514}
.directory-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:24px;align-items:start}
.directory-sections{display:grid;gap:5px}
.directory-sections{position:sticky;top:92px}
.directory-workspace{overflow:hidden;border:1px solid var(--quiet-border);border-radius:var(--rounded-surface); background:linear-gradient(130deg,#1e262c,#141a1e 63%);box-shadow:0 18px 55px #06090b47;}
.directory-feature{position:relative;min-height:340px;display:grid;grid-template-columns:minmax(0,1.52fr) minmax(0,1fr);}
.directory-feature-copy{position:relative;z-index:1;padding:clamp(20px,3vw,38px)}
.directory-photo{position:absolute;inset:0 0 0 auto;width:48%; background-image:linear-gradient(90deg,#1c2329 0%,#18212626 55%),linear-gradient(0deg,#171e22 0%,transparent 42%),var(--section-photo); background-position:center;background-size:cover;}
.directory-feature h3{font:300 clamp(35px,4.5vw,60px)/1.03 var(--display);letter-spacing:-.028em;margin:0}
.directory-feature h3:focus{outline:none}
.directory-feature-copy>p{color:var(--surface-text);line-height:1.45;margin:9px 0 16px}
.directory-item-switch{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 17px}
.directory-item-switch a{padding:5px 11px;border:1px solid var(--quiet-border);border-radius:24px;font-size:12px;color:#d9dfe3}
.directory-item-switch a:hover,.directory-item-switch a[aria-current]{background:#afc2d022;color:#fff}
.directory-spotlight{max-width:420px}
.directory-item-kind{font-size:11px;color:#c6d0d7;letter-spacing:.05em}
.directory-spotlight h4{font:300 clamp(21px,2.45vw,33px)/1.1 var(--display);margin:5px 0}
.directory-spotlight p{color:#d5dee3;margin:0 0 7px;line-height:1.42}
.directory-spotlight small{display:block;font-size:12px;color:#c3cdd3}
.directory-stat strong{font:300 28px/1.2 var(--display);color:#f6f8f9;font-variant-numeric:lining-nums}
.directory-spotlight .route-cta{margin-top:13px}
.directory-destinations{border-top:1px solid var(--quiet-border);padding:19px clamp(20px,3vw,38px) 26px}
.directory-destinations>h4{font:300 23px/1.2 var(--display);margin:0 0 8px}
@media(max-width:860px){
.directory-layout{grid-template-columns:1fr;gap:16px}
.directory-sections{position:static;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.directory-sections .section-index-link{min-height:44px;border-color:var(--quiet-border);padding:6px 9px}
.directory-sections .section-index-link strong{font-size:14px}
.directory-sections .section-index-link small,.directory-sections .route-arrow{display:none}
.panel{border-radius:20px}
.panel-toolbar .back{font-size:13px}
#panel-directory{font-size:12px}
}
@media(max-width:540px){
.top .r{gap:8px}
.top .modes .u{padding:6px 8px;font-size:13px}
.top .menu-btn{padding:7px 9px;font-size:13px}
.directory-heading{align-items:start;flex-direction:column;margin-bottom:16px;gap:12px}
.directory-heading h2{font-size:46px}
.directory-heading p{font-size:15px}
.directory-return{font-size:12px;min-height:19px;padding:6px 11px}
.directory-feature{display:block;min-height:0}
.directory-feature-copy{padding:24px 18px}
.directory-photo{width:100%;height:190px;mask-image:none;background-image:linear-gradient(90deg,#1c2329ed,#18212675),linear-gradient(0deg,#1c2329,transparent 72%),var(--section-photo)}
.directory-item-switch a{font-size:11px}
}
@media(max-width:540px){
.top .r{gap:6px}
.top .modes .u{padding:6px 7px}
}
@media(max-width:360px){
.top{gap:8px}
.top img.mk{height:20px}
.top .modes .u{padding:5px 5px;font-size:12px}
.top .menu-btn{padding:6px 7px;font-size:12px}
}
@media(min-width:861px){
.panel{left:calc(50% - 6px);right:auto;width:min(440px,calc(50% - 38px))}
}
@media(max-width:860px){
.panel{bottom:calc(env(safe-area-inset-bottom,0px) + 150px)}
}
.top .modes{border:0;border-radius:0;background:none;padding:0;gap:clamp(10px,2vw,24px)}
.top .modes .u,.top .menu-btn,.top .modes .u[aria-current=true]{border:0;border-radius:0;background:none;padding:7px 0;line-height:1.25}
.top .modes .u::after,.top .menu-btn::after{content:"";height:1px;background:#e8edef;transform:scaleX(0);transform-origin:left}
.top .modes .u[aria-current=true]::after,.top .modes .u:hover::after,.top .menu-btn:hover::after,.top .modes .u:focus-visible::after,.top .menu-btn:focus-visible::after{transform:scaleX(1)}
.top .modes .u:hover,.top .menu-btn:hover{background:none;color:#fff}
#panel-directory,.directory-return{border:0;border-radius:0;background:none;padding-inline:0;}
#panel-directory:hover,.directory-return:hover{background:none;text-decoration:underline;text-underline-offset:4px}
.directory-item-switch{gap:14px;border-bottom:1px solid var(--quiet-border)}
.directory-item-switch a,.directory-item-switch a:hover,.directory-item-switch a[aria-current]{border:0;border-bottom:1px solid transparent;border-radius:0;padding:5px 0;background:none; font-size:14px;}
.directory-item-switch a[aria-current],.directory-item-switch a:hover{border-bottom-color:#e8edef}
.directory-sections .section-index-link{border:0;border-radius:0;border-bottom:1px solid var(--quiet-border);background:none}
.directory-sections .section-index-link:hover{background:#c5d3df0c}
.directory-sections .section-index-link[aria-current]{background:#c5d3df12;border-left:2px solid var(--gallery-red)}
@media(max-width:540px){
.top .r{gap:15px}
.top .modes{gap:12px}
.top .modes .u,.top .menu-btn{font-size:13px}
.directory-item-switch{gap:8px 14px}
.directory-item-switch a,.directory-item-switch a:hover,.directory-item-switch a[aria-current]{font-size:13px}
}
@media(max-width:360px){
.top .r{gap:11px}
.top .modes{gap:9px}
.top .modes .u,.top .menu-btn{font-size:12px}
}

/* ---------- production fixes (handoff section 4, problems to resolve) ---------- */
/* If the page script never runs (a failed fetch, an old engine) the Directory still opens by its own anchor. */
body:not(.gallery-js) #directory:is(:target,:has(:target)){display:block}
body:not(.gallery-js):has(#directory:is(:target,:has(:target))) #gallery{display:none}
body:not(.gallery-js):has(#directory:is(:target,:has(:target))) .top{position:sticky;background:#111719f5;padding-bottom:16px}
body:not(.gallery-js):has(#directory:is(:target,:has(:target))){height:auto}
.panel[hidden],.directory-section[hidden],.directory-spotlight[hidden],#motion[hidden]{display:none!important}
.top .modes{display:flex}
.top .modes a{text-decoration:none}
/* The selected view reads by its underline. */
.top .modes .u[aria-current=true]{color:#f8f9fa}
/* A visible cue while more of the panel sits below (G15). */
.panel-cue{display:none}
.panel.more .panel-cue{display:block;position:sticky;bottom:54px;height:30px;margin-top:-30px;pointer-events:none;background:linear-gradient(180deg,#1a202400,#1a2024f0);text-align:center;color:#e8edef;font-size:14px;line-height:30px}
.panel.more .panel-cue::after{content:"\2193"}
/* Hover expands the dock where the device hovers; keyboard focus expands it at every size; touch never does (G10). */
@media(hover:none){
.bar:hover .sec,.bar:focus-within .sec{min-height:65px}
.bar:hover .dock-description,.bar:focus-within .dock-description{opacity:0;max-height:0;margin-top:0}
}
.bar:has(.sec:focus-visible) .sec{min-height:88px}
.bar:has(.sec:focus-visible) .dock-description{opacity:1;max-height:20px;margin-top:6px}
@media(max-width:860px){
.bar:has(.sec:focus-visible) .sec{min-height:58px}
.bar:has(.sec:focus-visible) .dock-description{display:block;margin-top:3px;font-size:11px}
#gallery:has(.bar .sec:focus-visible) .scene-tools{bottom:calc(env(safe-area-inset-bottom,0px) + 150px)}
/* Phones: the artwork stays in view above the panel at every size (G13). The panel holds the rest and
   scrolls on its own, with the one primary action held at its foot. */
.panel,.panel:has(.feature:not([hidden])){max-height:calc(100% - 150px - 80px - 152px - 24px - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain}
.panel .doors,.panel:has(.feature:not([hidden])) .doors{overflow:visible;flex-shrink:0;min-height:0}
.panel,.panel:has(.feature:not([hidden])){padding-bottom:0}
.panel::after{content:"";display:block;flex:0 0 14px}
/* the cue rides the panel's foot while more sits below; it never covers a link's whole target */
.panel.more .panel-cue{bottom:0;height:22px;margin-top:-22px;line-height:22px;font-size:13px}
}
@media(max-width:860px) and (max-height:699px){
.panel,.panel:has(.feature:not([hidden])){max-height:calc(100% - 150px - 80px - 132px - 24px - env(safe-area-inset-bottom,0px))}
}
/* Under reduced motion nothing moves, so there is nothing to pause (G7). */
@media(prefers-reduced-motion:reduce){#motion{display:none!important}}
/* The skip link and the Menu button sit in the gallery's own header. */

body.directory .top{position:sticky}
body.directory{height:auto}
html:has(body.directory){height:auto}
