:root{font-family:Arial,Helvetica,sans-serif;color:#292820;background:#e6dfd2}*{box-sizing:border-box}body{margin:0;overflow:hidden;overscroll-behavior:none}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible{outline:2px solid #956c3a;outline-offset:5px}button:active{transform:translateY(1px)}#gallery{position:fixed;inset:0;width:100%;height:100%;touch-action:none;display:block}.gallery-header{position:fixed;z-index:3;top:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;padding:calc(26px + env(safe-area-inset-top)) 34px 22px;background:linear-gradient(#f1eadee8,#f1eade00);pointer-events:none}.gallery-header>*{pointer-events:auto}.home{font-size:21px;display:flex;gap:12px;align-items:center}.home span{font-weight:bold;letter-spacing:-1px}.gallery-brand{font-family:Georgia,serif;font-size:27px;text-align:center}.gallery-brand small{display:block;font:9px Arial;letter-spacing:1.1px;margin-top:7px;text-transform:uppercase}.text-button{border:0;background:transparent;color:#4b473b;font-size:12px;padding:12px}.text-button span{margin-left:10px}.welcome{position:fixed;z-index:4;left:7vw;top:50%;transform:translateY(-43%);max-width:490px;padding:35px 40px 32px;background:#f3eee4ed;box-shadow:0 18px 80px #554c3518;backdrop-filter:blur(14px)}.eyebrow{font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#8e704c;margin:0 0 22px}.welcome h1{font:400 clamp(45px,5vw,76px)/1.02 Georgia,serif;letter-spacing:-3px;margin:0 0 22px}.welcome p:not(.eyebrow){font-size:13px;line-height:1.7;color:#726b5d}.welcome button,#fallback button{background:#3e4939;color:#f5f0e7;border:0;width:100%;padding:18px 22px;text-align:left;margin:16px 0 22px;display:flex;justify-content:space-between;font-size:13px}.welcome button:disabled{opacity:.5;cursor:wait}.welcome small{display:block;font-size:10px;color:#8b8171;line-height:1.8}#loading{margin-bottom:0!important;font-size:10px!important}.hud{position:fixed;bottom:32px;left:35px;right:24px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px}.hud[hidden]{display:none}.hall-label{font-size:12px}.hall-label span{color:#827563}.hud #inspect{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);border:1px solid #d0c4b3;background:#f8f3e9ee;color:#4b4030;padding:13px 20px;white-space:nowrap;border-radius:2px}.joystick{display:none;position:fixed;left:30px;bottom:75px;width:108px;height:108px;border:1px solid #ffffffa0;background:#f7f0e84a;border-radius:50%;z-index:3;touch-action:none;box-shadow:0 3px 25px #52442b15}.joystick:before{content:'';position:absolute;inset:15px;border:1px solid #ffffff50;border-radius:50%}#stick{position:absolute;left:34px;top:34px;width:40px;height:40px;border-radius:50%;background:#faf5ebc9;box-shadow:0 3px 12px #63544222;pointer-events:none}.look-hint{display:none;position:fixed;right:24px;bottom:115px;font-size:10px;color:#7c6b56;pointer-events:none}body.playing .welcome{display:none}dialog{border:0;background:#f3eee4;padding:30px;color:#292820;max-width:1100px;width:90vw;max-height:86dvh;box-shadow:0 30px 100px #0003}dialog::backdrop{background:#27251ede;backdrop-filter:blur(7px)}.dialog-header{display:flex;justify-content:space-between;align-items:start;margin-bottom:25px}.dialog-header .eyebrow{margin:0 0 10px}.dialog-header h2{font:400 42px Georgia,serif;margin:0}.close{background:transparent;border:0;font-size:30px;padding:0 5px;color:#74644d;z-index:1}.art-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:28px}.art-grid button{text-align:left;background:none;border:0;padding:0;color:#64563f}.art-grid img{width:100%;height:190px;object-fit:contain;background:#e5ddcf;display:block;padding:12px;margin-bottom:12px}.art-grid span{font-size:11px;letter-spacing:1px}#artwork{max-width:1000px;text-align:center;padding:34px}#artwork>.close{position:absolute;right:10px;top:3px}#artImage{display:block;max-width:100%;max-height:65dvh;margin:auto;object-fit:contain}.art-detail{display:flex;justify-content:space-between;align-items:center;text-align:left;margin-top:22px;gap:15px}.art-detail span{font:22px Georgia}.art-detail p{font-size:11px;color:#8b7a62}#fallback{position:fixed;z-index:4;inset:150px 10vw auto;max-width:500px}#fallback h1{font:40px Georgia}#fallback p{line-height:1.6}body.no-webgl .welcome,body.no-webgl .hud{display:none}body.no-webgl #fallback{display:block}@media(pointer:coarse){body.playing .joystick{display:block}body.playing .look-hint{display:block}}@media(max-width:650px){.gallery-header{padding:calc(19px + env(safe-area-inset-top)) 18px 20px}.home{font-size:18px}.home span{display:none}.gallery-brand{font-size:24px}.gallery-brand small{font-size:7px;letter-spacing:.7px}.text-button{font-size:10px;padding:10px 4px}.welcome{left:6vw;right:6vw;padding:28px;max-width:none;top:49%;transform:translateY(-40%)}.welcome h1{font-size:52px}.welcome p:not(.eyebrow){font-size:12px}.hud{left:20px;right:20px;bottom:calc(20px + env(safe-area-inset-bottom))}.hall-label{font-size:10px}.hall-label span{display:none}.hud #inspect{bottom:35px;font-size:11px;padding:12px 16px}.joystick{left:25px;bottom:calc(70px + env(safe-area-inset-bottom))}.look-hint{max-width:95px;text-align:right;line-height:1.6;bottom:115px;right:25px}.art-grid{grid-template-columns:repeat(2,1fr);gap:20px 14px}.art-grid img{height:145px;padding:7px}dialog{padding:22px;width:94vw}.dialog-header h2{font-size:34px}#artwork{padding:30px 15px 15px}.art-detail{display:block}.art-detail p{font-size:10px}.art-detail span{font-size:20px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Keep the long exhibition title inside the entrance panel on every screen. */
.welcome{container-type:inline-size;width:490px;max-width:86vw}.welcome h1{font-size:clamp(32px,11cqw,55px);letter-spacing:-1.8px;overflow-wrap:normal}@media(max-width:650px){.welcome{width:auto;max-width:none}.welcome h1{font-size:clamp(30px,11cqw,42px);letter-spacing:-1.1px}}

.work-author{font-size:12px;line-height:1.6;color:#4b4030;margin:8px 0 0}.art-credit{text-align:right}.art-credit #artAuthor{font-size:14px;color:#463b2d;margin:0 0 7px}.art-credit #artDate{margin:0;color:#8b7a62;font-size:11px}@media(max-width:650px){.art-credit{text-align:left;margin-top:13px}.art-credit #artAuthor{font-size:13px}.work-author{font-size:11px}}

/* The complete gallery stays landscape, including on iPhone with rotation locked. */
.gallery-stage{position:fixed;left:0;top:0;overflow:hidden;width:100%;height:100%;isolation:isolate}
body.rotated .gallery-stage{left:50%;top:50%;transform:translate(-50%,-50%) rotate(90deg)}
.hud-actions{display:flex;align-items:center;gap:16px;margin-left:auto}
.controls-panel{position:fixed;z-index:5;right:24px;bottom:75px;width:270px;padding:20px;background:#f4eee3f5;box-shadow:0 8px 40px #40351f22;border:1px solid #cfc1ac;border-radius:4px}
.controls-panel label{display:flex;justify-content:space-between;font-size:12px;gap:16px}.controls-panel output{font-variant-numeric:tabular-nums;color:#806542}
.controls-panel input{width:100%;margin:18px 0 8px;accent-color:#566046;touch-action:none}
.controls-panel p{font-size:10px;color:#87785f;line-height:1.5;margin:0}
.controls-panel[hidden]{display:none}
body.rotated dialog{position:fixed;inset:auto;left:50%;top:50%;margin:0;transform:translate(-50%,-50%) rotate(90deg);width:min(1100px,calc(var(--view-width)*.92));max-width:none;max-height:calc(var(--view-height)*.88)}
.touch-layout .gallery-header{padding:calc(12px + env(safe-area-inset-top)) max(22px,env(safe-area-inset-left)) 12px;background:linear-gradient(#f1eadef2,#f1eade00)}
.touch-layout .home{font-size:18px}.touch-layout .home span{display:inline}
.touch-layout .gallery-brand{font-size:22px}.touch-layout .gallery-brand small{font-size:7px;letter-spacing:1px}
.touch-layout .welcome{left:6%;right:auto;width:min(430px,calc(var(--view-width) - 60px));max-width:none;top:50%;transform:translateY(-44%);max-height:calc(var(--view-height) - 100px);overflow:auto;padding:20px 26px}
.touch-layout .welcome .eyebrow{font-size:8px;margin:0 0 10px}
.touch-layout .welcome h1{font-size:34px;letter-spacing:-1px;margin:0 0 10px}
.touch-layout .welcome p:not(.eyebrow){font-size:11px;line-height:1.5;margin:8px 0}
.touch-layout .welcome button{padding:12px 16px;margin:10px 0;font-size:12px}
.touch-layout .welcome small{font-size:8px;line-height:1.5}
.touch-layout #loading{font-size:8px!important;margin:8px 0 0!important}
.touch-layout .hud{bottom:max(12px,env(safe-area-inset-bottom));left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));gap:12px}
.touch-layout .hud .text-button{font-size:10px;padding:10px 4px}
.touch-layout .hall-label{font-size:10px}.touch-layout .hall-label span{display:inline}
.touch-layout .joystick{left:max(28px,env(safe-area-inset-left));bottom:55px;width:108px;height:108px}
.touch-layout .look-hint{right:28px;bottom:83px;max-width:110px;font-size:9px;line-height:1.6}
.touch-layout .hud #inspect{bottom:28px;font-size:11px;padding:10px 16px}
.touch-layout .controls-panel{bottom:54px;right:max(22px,env(safe-area-inset-right));padding:16px}
.touch-layout dialog{padding:20px;width:min(1100px,calc(var(--view-width)*.92));max-width:none;max-height:calc(var(--view-height)*.88)}
.touch-layout .art-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.touch-layout .art-grid img{height:120px;margin-bottom:8px}.touch-layout .art-grid span{font-size:10px;letter-spacing:.4px}.touch-layout .work-author{font-size:10px;line-height:1.5}
.touch-layout .dialog-header{margin-bottom:15px}.touch-layout .dialog-header .eyebrow{font-size:8px;margin-bottom:8px}.touch-layout .dialog-header h2{font-size:28px}
.touch-layout #artwork[open]{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.4fr);align-items:center;gap:22px;padding:25px}
.touch-layout #artImage{max-height:calc(var(--view-height) - 110px);max-width:100%}
.touch-layout .art-detail{display:block;margin:0}.touch-layout .art-credit{text-align:left}.touch-layout .art-detail span{font-size:23px}.touch-layout .art-credit #artAuthor{font-size:13px;line-height:1.6}.touch-layout .art-credit #artDate{font-size:10px}

/* Single active viewer and direct artwork / plaque interaction. */
dialog[open]{animation:viewer-appear .2s ease-out}
@keyframes viewer-appear{from{opacity:0}to{opacity:1}}
.art-viewport{position:relative;display:flex;justify-content:center;align-items:center;min-width:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;height:65dvh;cursor:zoom-in;background:#eae2d3}
.art-viewport.zoomed{cursor:grab}.art-viewport.zoomed:active{cursor:grabbing}
#artImage{transform-origin:center;will-change:transform;pointer-events:none;user-select:none;-webkit-user-drag:none;margin:auto;flex:0 0 auto}
.zoom-toolbar{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:flex;align-items:center;background:#f8f3e8eb;border:1px solid #cfc2ac;border-radius:4px;box-shadow:0 3px 15px #31251615;z-index:1;touch-action:manipulation}
.zoom-toolbar button{border:0;background:transparent;color:#50432f;padding:8px 12px;min-width:40px;min-height:36px;font-size:20px}
.zoom-toolbar #zoomReset{font-size:10px;min-width:60px;font-variant-numeric:tabular-nums}
.zoom-toolbar button:hover{background:#e6dbc7}
#plaqueViewer{width:min(620px,90vw);padding:48px;background:#f0ebdf}
#plaqueViewer>.close{position:absolute;right:14px;top:7px}
.large-plaque{border-left:2px solid #ab8a50;padding:12px 0 12px 28px}
.large-plaque .eyebrow{font-size:10px;margin:0 0 24px}
#plaqueNumber{font:400 38px Georgia,serif;margin:0 0 26px}
#plaqueAuthor{font:400 26px/1.5 Georgia,serif;color:#393228;margin:0 0 26px}
#plaqueDate{font-size:12px;line-height:1.7;color:#88765b;margin:0}
.touch-layout .art-viewport{height:calc(var(--view-height) - 110px)}
.touch-layout #plaqueViewer{width:min(620px,calc(var(--view-width)*.8));padding:28px 36px;max-height:calc(var(--view-height)*.85)}
.touch-layout .large-plaque{padding:8px 0 8px 24px}
.touch-layout .large-plaque .eyebrow{margin-bottom:15px;font-size:9px}
.touch-layout #plaqueNumber{font-size:29px;margin-bottom:15px}
.touch-layout #plaqueAuthor{font-size:24px;margin-bottom:18px}
.touch-layout #plaqueDate{font-size:11px}
.touch-layout .look-hint{max-width:170px}
@media(prefers-reduced-motion:reduce){dialog[open]{animation:none}}

/* Viewers live inside the landscape stage. No native modal top layer or inert
   document state is used, so touch controls resume reliably on iOS Safari. */
.gallery-stage :is(#collection,#artwork,#plaqueViewer).viewer{position:absolute;inset:0;left:0;top:0;z-index:20;transform:none;margin:0;width:100%;height:100%;max-width:none;max-height:none;padding:0;border:0;box-shadow:none;background:#25231de8;backdrop-filter:blur(8px);display:grid;place-items:center;overflow:hidden;animation:viewer-appear .18s ease-out}
.gallery-stage .viewer[hidden]{display:none!important}
.viewer-card{position:relative;width:min(1100px,92%);max-height:88%;padding:28px;background:#f3eee4;overflow:auto;box-shadow:0 20px 80px #0003}
.gallery-stage #plaqueViewer.viewer .viewer-card{width:min(620px,84%);padding:34px 40px}
.gallery-stage #plaqueViewer .close{position:absolute;top:7px;right:14px}
.gallery-stage #artwork.viewer{background:#171713;backdrop-filter:none}
.gallery-stage #artwork.viewer .viewer-card{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;padding:0;margin:0;border:0;box-shadow:none;background:#171713;overflow:hidden;display:block}
.gallery-stage #artwork .art-viewport{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;background:#171713;border:0;padding:0}
.gallery-stage #artwork #artImage{display:block;width:auto;height:auto;max-width:100%;max-height:100%;margin:auto;object-fit:contain;flex:0 0 auto}
.gallery-stage #artwork .close{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));z-index:4;color:#fff8ed;background:#171713ad;border:1px solid #fff3;border-radius:50%;width:44px;height:44px;font-size:30px;line-height:40px;padding:0}
.gallery-stage #artwork .art-detail{position:absolute;left:max(22px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));z-index:2;display:block;width:auto;max-width:45%;padding:12px 15px;margin:0;background:#171713ad;border-radius:3px;pointer-events:none;text-align:left;transition:opacity .15s}
.gallery-stage #artwork .art-detail span{color:#fff9ef;font:22px Georgia}
.gallery-stage #artwork .art-credit{text-align:left;margin-top:7px}
.gallery-stage #artwork .art-credit #artAuthor{color:#eee6d6;font-size:12px;margin:0 0 3px;line-height:1.5}
.gallery-stage #artwork .art-credit #artDate{color:#b6ad9c;font-size:10px;margin:0}
.gallery-stage #artwork .zoom-toolbar{position:absolute;z-index:3;bottom:max(18px,env(safe-area-inset-bottom));background:#f4ecdfed}
.viewing .joystick,.viewing .hud,.viewing .look-hint{visibility:hidden;pointer-events:none}
.image-zoomed #artwork .art-detail{opacity:0}
.touch-layout .viewer-card{padding:20px}
.touch-layout #collection .art-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.touch-layout #collection .art-grid img{height:115px}
.touch-layout #plaqueViewer .large-plaque{padding:8px 0 8px 24px}
.touch-layout #artwork .art-detail span{font-size:17px}
.touch-layout #artwork .art-credit #artAuthor{font-size:11px}
.touch-layout #artwork .art-credit #artDate{font-size:9px}
.touch-layout #artwork .art-detail{padding:8px 12px;max-width:42%}

/* Zoom only the artwork, never the room/browser viewport. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
.gallery-stage{touch-action:none;overscroll-behavior:none}
.viewer,.viewer-card,.large-plaque,.viewer .close{touch-action:none}
#collection .viewer-card{touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.viewer-hint{position:absolute;z-index:2;left:18px;right:80px;top:15px;margin:0;font-size:10px;line-height:1.5;color:#e7decb;pointer-events:none;text-shadow:0 1px 4px #000;opacity:.75}
.image-zoomed .viewer-hint{opacity:0}
.touch-layout .viewer-hint{font-size:9px;top:17px;right:74px}

.plaque-viewport{--plaque-zoom:1;max-height:calc(var(--view-height)*.78 - 120px);overflow:auto;touch-action:none;overscroll-behavior:contain;scrollbar-width:thin;user-select:none;-webkit-user-select:none}
.gallery-stage #plaqueNumber{font-size:calc(32px * var(--plaque-zoom));line-height:1.2}
.gallery-stage #plaqueAuthor{font-size:calc(25px * var(--plaque-zoom));line-height:1.4;overflow-wrap:anywhere}
.gallery-stage #plaqueDate{font-size:calc(12px * var(--plaque-zoom))}
.plaque-zoom-tools{display:flex;align-items:center;gap:5px;margin-top:15px;border-top:1px solid #cdbd9f;padding-top:10px}
.plaque-zoom-tools button{background:#e5dbc9;border:0;color:#57482f;border-radius:3px;min-width:40px;min-height:36px;font-size:21px;touch-action:none}
.plaque-zoom-tools #plaqueZoomReset{font-size:11px;min-width:58px;font-variant-numeric:tabular-nums}
.plaque-zoom-tools small{font-size:9px;line-height:1.5;color:#918064;margin-left:10px}
@media(max-height:450px){.plaque-viewport{max-height:calc(var(--view-height)*.8 - 100px)}}
