/* Immersive gallery UI. All layout overrides are confined to gallery mode. */
body.gallery-mode{--gallery-ink:#292b26;--gallery-muted:#686b60;--gallery-paper:#f7f5ed;background:var(--gallery-paper);color:var(--gallery-ink);overflow:hidden}
body.gallery-mode .floating-header,body.gallery-mode .scroll-progress,body.gallery-mode #site-footer,body.gallery-mode .back-top{display:none!important}
body.gallery-mode #main{padding:0;margin:0;min-height:0;max-width:none;animation:none;transform:none}
.gallery-shell{position:relative;width:100%;height:100svh;min-height:500px;overflow:hidden;isolation:isolate;font-family:Arial,Helvetica,sans-serif;color:var(--gallery-ink,#292b26);background:#efeee5}
#gallery-stage{position:absolute;inset:0;z-index:0;touch-action:none}
#gallery-stage canvas{display:block;width:100%;height:100%;outline:none}
.gallery-shell button,.gallery-shell a,.gallery-map button,.gallery-help button,#gallery-works button{touch-action:manipulation}
.gallery-shell button:focus-visible,.gallery-shell a:focus-visible,.gallery-map button:focus-visible,.gallery-help button:focus-visible,#gallery-works a:focus-visible,#gallery-works button:focus-visible{outline:2px solid #52604d;outline-offset:5px}
.gallery-topbar{position:absolute;z-index:12;top:0;left:0;right:0;padding:max(28px,env(safe-area-inset-top)) max(36px,env(safe-area-inset-right)) 20px max(36px,env(safe-area-inset-left));display:flex;align-items:flex-start;justify-content:space-between;gap:30px;pointer-events:none;background:linear-gradient(#f6f4eceb,#f6f4ec00)}
.gallery-topbar>*{pointer-events:auto}
.gallery-brand{display:flex;flex-direction:column;gap:6px;font-size:24px;line-height:1.1;font-weight:600;letter-spacing:-1px;text-decoration:none}
.gallery-brand small{font-size:10px;font-weight:400;letter-spacing:.035em;color:var(--gallery-muted)}
.gallery-location{position:absolute;top:35px;left:50%;transform:translateX(-50%);text-align:center;font-size:10px;letter-spacing:.13em;text-transform:uppercase;white-space:nowrap}
.gallery-location small{font-size:inherit}
.gallery-toplinks{display:flex;align-items:center;gap:24px;font-size:11px;line-height:1.4}
.gallery-toplinks button,.gallery-toplinks a{display:flex;align-items:center;min-height:44px;padding:0 2px;color:inherit;border-bottom:1px solid transparent}
.gallery-toplinks button:hover,.gallery-toplinks a:hover{border-color:#74786b}
.gallery-intro,#room-caption{position:absolute;z-index:5;left:max(5vw,env(safe-area-inset-left));bottom:clamp(120px,17vh,200px);max-width:510px;pointer-events:none;text-shadow:0 1px 20px #f8f6ef85}
.gallery-intro .eyebrow,#room-caption .eyebrow{font-size:9px;letter-spacing:.2em;color:#565e50;margin-bottom:22px}
.gallery-intro h1{font-size:clamp(44px,5.8vw,86px);font-weight:400;line-height:.99;letter-spacing:-.065em;white-space:pre-line}
.gallery-intro h1 em{font-family:Georgia,'Times New Roman',serif;font-weight:400;letter-spacing:-.055em}
.gallery-intro p,#room-caption p{max-width:310px;margin-top:22px;font-size:12px;line-height:1.8;color:#565c51}
.gallery-enter{pointer-events:auto;display:inline-flex;align-items:center;justify-content:space-between;gap:34px;margin-top:28px;min-height:48px;padding:0 23px;background:#30372d!important;color:#fff!important;border:1px solid #30372d!important;border-radius:2px;font-size:11px;letter-spacing:.035em;box-shadow:0 5px 24px #34432b15;transition:background .2s,transform .2s}
.gallery-enter:hover{background:#4a5543!important;transform:translateY(-2px)}
#room-caption{bottom:116px;max-width:420px}
#room-caption h1{font-family:Georgia,'Times New Roman',serif;font-size:clamp(30px,4vw,54px);font-weight:400;line-height:1.08;letter-spacing:-.045em}
#room-caption .eyebrow{margin-bottom:12px}
#room-caption p{margin-top:12px}
.gallery-bottom{position:absolute;z-index:12;left:0;right:0;bottom:0;min-height:80px;padding:14px max(36px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(36px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;gap:24px;background:linear-gradient(#f6f4ec00,#f6f4eceb);pointer-events:none}
.gallery-bottom>*{pointer-events:auto}
#gallery-progress{font-size:10px;color:#4f574a;letter-spacing:.07em;white-space:nowrap}
#gallery-hint{font-size:10px;color:#72776b;text-align:center;line-height:1.6;max-width:330px}
.gallery-controls{display:flex;align-items:center;gap:8px}
.gallery-controls button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 13px;border:1px solid #545e4938;background:#f9f8f1a6;border-radius:50px;font-size:10px;transition:background .2s}
.gallery-controls button:hover{background:#fff}
#guide-button{position:absolute;z-index:15;right:max(36px,env(safe-area-inset-right));top:55%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;min-width:82px;min-height:100px;padding:13px;color:#45503d;font-size:11px;line-height:1.3;background:radial-gradient(ellipse,#f8f8efcf,transparent 72%);border-radius:50%;perspective:200px}
#guide-button small{font-size:8px;letter-spacing:.12em;color:#747e69}
.guide-crystal{display:block;position:relative;width:26px;height:26px;margin:10px 0 15px;transform-style:preserve-3d;transform:rotateX(35deg) rotateY(45deg);background:linear-gradient(135deg,#f5ffc6aa,#adc88088);border:1px solid #b4c690;box-shadow:0 0 30px #b9df6b77,inset 0 0 16px #f4ffd4;animation:gallery-crystal 12s linear infinite}
.guide-crystal::before,.guide-crystal::after{content:'';position:absolute;inset:-1px;border:1px solid #b4c690;background:#c9df9e99;backface-visibility:visible}
.guide-crystal::before{transform-origin:left;transform:rotateY(90deg)}
.guide-crystal::after{transform-origin:top;transform:rotateX(-90deg);background:#ecf7cfaa}
@keyframes gallery-crystal{from{transform:rotateX(25deg) rotateY(0deg) rotateZ(8deg)}to{transform:rotateX(25deg) rotateY(360deg) rotateZ(8deg)}}
.gallery-door{position:absolute;z-index:4;min-height:44px;min-width:44px;padding:10px 15px;border:1px solid #747d6359;background:#faf9f0d6;backdrop-filter:blur(8px);border-radius:2px;font-size:10px;letter-spacing:.06em;white-space:nowrap;transform:translate(-50%,-50%);box-shadow:0 4px 20px #2531240a;transition:background .2s,border-color .2s}
.gallery-door:hover{background:#fff;border-color:#697f54}
#gallery-crosshair{position:absolute;left:50%;top:50%;z-index:4;width:5px;height:5px;margin:-2px;background:#fff9;border:1px solid #454d4266;border-radius:50%;pointer-events:none}
#gallery-target{position:absolute;z-index:4;left:50%;top:calc(50% + 22px);transform:translateX(-50%);max-width:250px;text-align:center;font-size:10px;letter-spacing:.035em;padding:7px 12px;border-radius:3px;background:#f7f6efdc;pointer-events:none}
.gallery-touch-pad{display:none;position:absolute;z-index:12;bottom:95px;left:20px;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:4px;touch-action:none}
.gallery-touch-pad button{min-width:44px;min-height:44px;border:1px solid #7c866459;background:#faf9f0d9;border-radius:10px;user-select:none;touch-action:none;font-size:17px}
.gallery-touch-pad button:first-child{grid-column:2}
.gallery-touch-pad button:nth-child(2){grid-column:1;grid-row:2}
.gallery-touch-pad button:nth-child(3){grid-column:2;grid-row:2}
.gallery-touch-pad button:nth-child(4){grid-column:3;grid-row:2}
.gallery-map,.gallery-help,#gallery-works{box-sizing:border-box;color:#30362d;background:#f8f7f0;border:1px solid #dbded1;border-radius:8px;padding:0;box-shadow:0 30px 100px #24302035;font-family:Arial,Helvetica,sans-serif;overscroll-behavior:contain}
.gallery-map::backdrop,.gallery-help::backdrop,#gallery-works::backdrop{background:#303a304d;backdrop-filter:blur(8px)}
.gallery-map{width:min(1050px,calc(100vw - 80px));max-width:none;max-height:calc(100svh - 70px);overflow:auto}
.map-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:30px 34px;border-bottom:1px solid #d9dece}
.map-header h2{font:400 32px/1.1 Georgia,serif;letter-spacing:-.04em}
.map-header p{font-size:11px;line-height:1.7;color:#78806f;margin-top:8px}
.map-header button,.gallery-help button[data-close],#gallery-works button[data-close]{min-width:44px;min-height:44px;border:1px solid #d0d6c7;border-radius:50%;font-size:16px}
.map-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:25px 34px}
.map-room{position:relative;display:flex;flex-direction:column;text-align:left;min-height:146px;padding:20px;border:1px solid #d8ddcf;border-radius:3px;background:#fdfcf6;overflow:hidden;isolation:isolate;transition:border-color .2s,transform .2s}
.map-room:hover{border-color:#7c8f69;transform:translateY(-2px)}
.room-number{font-size:9px;letter-spacing:.1em;color:#7c856f;margin-bottom:24px}
.room-name{font:400 24px/1.15 Georgia,serif;letter-spacing:-.03em;max-width:85%}
.room-subtitle{font-size:10px;line-height:1.5;color:#7a816f;margin-top:6px;max-width:85%}
.room-visited{position:absolute;right:16px;top:17px;font-size:8px;color:#728162;letter-spacing:.07em}
.room-swatch{position:absolute;right:0;bottom:0;width:24%;height:62%;z-index:-1;opacity:.5;clip-path:polygon(35% 0,100% 17%,100% 100%,0 100%,0 25%);background:var(--room-tone,#d8e0c8)}
.map-room.locked,.map-room[data-locked="true"],.map-room:disabled{opacity:.55;background:#eeeee5;border-style:dashed}
.map-footer{display:flex;justify-content:space-between;gap:20px;padding:18px 34px 25px;border-top:1px solid #d9dece;font-size:10px;line-height:1.7;color:#76806a}
.gallery-help{width:min(540px,calc(100vw - 36px));max-height:calc(100svh - 40px);padding:30px;overflow:auto;font-size:13px;line-height:1.8}
.gallery-help h2{font:400 30px/1.2 Georgia,serif;margin-bottom:20px;letter-spacing:-.03em}
.gallery-help p,.gallery-help ul,.gallery-help dl{margin:16px 0;color:#626b58}
.gallery-help li{margin:8px 0}
.gallery-help kbd{display:inline-flex;align-items:center;justify-content:center;min-width:26px;padding:1px 6px;border:1px solid #d0d6c7;border-radius:4px;font:11px Arial;background:#fffef8}
.gallery-help>button:last-child{min-height:44px;padding:8px 18px;border:1px solid #cbd3bf;border-radius:3px}
#gallery-works{position:fixed;inset:0 0 0 auto;margin:0;width:min(470px,100vw);height:100svh;max-height:none;max-width:100vw;border-radius:0;padding:32px;overflow:auto}
#gallery-works h2{font:400 32px/1.2 Georgia,serif;letter-spacing:-.04em;margin:16px 0}
#gallery-works>p{font-size:12px;line-height:1.8;color:#727b65}
.room-work-list{display:grid;gap:14px;margin-top:28px}
.room-work-list a{display:flex;align-items:center;gap:16px;min-height:86px;padding:12px;border:1px solid #dce0d2;border-radius:4px;transition:background .2s}
.room-work-list a:hover{background:#fffef9}
.room-work-list img{width:78px;height:66px;flex-shrink:0;object-fit:cover;border-radius:2px}
.room-work-list strong{font-size:13px;font-weight:400;line-height:1.5}
.room-work-list small{display:block;font-size:10px;color:#78816c;margin-top:5px;line-height:1.6}
.gallery-fallback{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:30px;text-align:center;background:linear-gradient(145deg,#eceede,#f9f5e9);gap:20px}
.gallery-fallback h2{font:400 38px/1.1 Georgia,serif;letter-spacing:-.04em}
.gallery-fallback p{max-width:360px;font-size:13px;line-height:1.8}
.gallery-fallback a,.gallery-fallback button{min-height:44px;padding:12px 20px;border:1px solid #aab79c;border-radius:3px}
.gallery-transition{position:absolute;inset:0;z-index:25;background:#f4f3e9;opacity:0;pointer-events:none;transition:opacity .45s ease}
.gallery-transition.active,.gallery-transition.is-active{opacity:1}
.gallery-discovery{position:absolute;z-index:22;top:110px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px);padding:13px 22px;border:1px solid #c7d2b7;background:#f8fbedeb;backdrop-filter:blur(10px);border-radius:3px;text-align:center;font-size:11px;line-height:1.6;box-shadow:0 8px 32px #42533212}
.gallery-shell [hidden],.gallery-map [hidden],.gallery-help[hidden],.gallery-map[hidden],#gallery-works[hidden]{display:none!important}
@media(pointer:coarse){.gallery-touch-pad:not([hidden]){display:grid}#room-caption{bottom:205px}.gallery-door{min-height:48px}}
@media(max-width:900px){.gallery-location{display:none}.gallery-topbar{padding-left:24px;padding-right:24px}.gallery-intro{left:6vw;max-width:420px}.gallery-intro h1{font-size:64px}.map-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gallery-bottom{padding-left:24px;padding-right:24px}#gallery-hint{max-width:220px;font-size:9px}#guide-button{right:20px}.gallery-controls button{padding-inline:10px}}
@media(max-width:600px){
.gallery-shell{min-height:440px;height:100svh}.gallery-topbar{padding: max(18px,env(safe-area-inset-top)) 18px 18px;gap:12px}.gallery-brand{font-size:22px}.gallery-brand small{font-size:8px;max-width:120px}.gallery-toplinks{gap:12px;font-size:10px}.gallery-toplinks button,.gallery-toplinks a{min-height:44px}.gallery-toplinks button{max-width:65px;text-align:left;line-height:1.4}
.gallery-intro{left:24px;right:24px;bottom:126px;max-width:calc(100% - 48px)}.gallery-intro h1{font-size:clamp(42px,11vw,62px);max-width:340px}.gallery-intro .eyebrow{font-size:8px;margin-bottom:18px}.gallery-intro p{font-size:11px;max-width:250px;margin-top:18px}.gallery-enter{margin-top:20px;min-height:46px;padding:0 19px}
#room-caption{left:20px;right:90px;bottom:205px;max-width:none}#room-caption h1{font-size:31px}#room-caption p{font-size:10px;line-height:1.65;margin-top:8px;max-width:240px}#room-caption .eyebrow{font-size:8px;margin-bottom:8px}
#guide-button{right:12px;top:auto;bottom:125px;transform:none;min-width:66px;padding:8px;font-size:10px}#guide-button small{font-size:7px}.guide-crystal{width:22px;height:22px;margin-bottom:12px}
.gallery-bottom{padding:10px 18px max(14px,env(safe-area-inset-bottom));min-height:78px;gap:10px;align-items:center}#gallery-progress{font-size:8px;letter-spacing:.025em;max-width:95px;white-space:normal;line-height:1.6}#gallery-hint{display:none}.gallery-controls{gap:5px}.gallery-controls button{font-size:9px;min-width:44px;min-height:44px;padding:7px 10px}.gallery-touch-pad{left:18px;bottom:91px}.gallery-door{font-size:9px;padding:8px 11px;max-width:180px;white-space:normal}
.gallery-map{width:calc(100vw - 24px);max-height:calc(100svh - 28px);border-radius:5px}.map-header{padding:19px 18px;gap:12px}.map-header h2{font-size:27px}.map-header p{font-size:10px}.map-grid{gap:8px;padding:15px 14px}.map-room{padding:14px;min-height:135px}.room-number{font-size:8px;margin-bottom:22px}.room-name{font-size:21px;max-width:100%}.room-subtitle{font-size:9px;max-width:100%}.room-visited{font-size:7px;right:10px;top:13px}.room-swatch{opacity:.3}.map-footer{padding:15px 18px;flex-direction:column;gap:5px;font-size:9px}.gallery-help{padding:24px}.gallery-help h2{font-size:28px}#gallery-works{padding:24px 20px max(24px,env(safe-area-inset-bottom))}.gallery-discovery{top:100px;font-size:10px;padding:10px 15px}
}
@media(max-height:600px) and (min-width:601px){.gallery-topbar{padding-top:16px}.gallery-intro{bottom:85px}.gallery-intro h1{font-size:49px}.gallery-intro .eyebrow{margin-bottom:12px}.gallery-intro p{margin-top:12px;font-size:11px}.gallery-enter{margin-top:15px}.gallery-bottom{min-height:65px;padding-bottom:12px}#room-caption{bottom:95px}#room-caption p{font-size:11px}.gallery-map{max-height:calc(100svh - 24px)}}
@media(prefers-reduced-motion:reduce){.guide-crystal{animation:none}.gallery-shell *,.gallery-map *{transition:none!important;scroll-behavior:auto!important}}
html[data-motion="off"] .guide-crystal{animation:none}html[data-motion="off"] .gallery-shell *,html[data-motion="off"] .gallery-map *{transition:none!important;scroll-behavior:auto!important}
/* Final markup integration. */
.gallery-brand>span{font-size:10px;font-weight:400;letter-spacing:.035em;color:var(--gallery-muted)}
.gallery-location small{display:block;margin-top:7px;font-size:9px;letter-spacing:.03em;text-transform:none;color:#737669}
#guide-button>span:last-child{display:flex;flex-direction:column;gap:6px}
#room-caption .room-works-open{pointer-events:auto;display:inline-flex;align-items:center;gap:30px;min-height:44px;margin-top:12px;border-bottom:1px solid #6d7964;font-size:11px}
.gallery-close{min-height:44px;min-width:44px;border:1px solid #d0d6c7;border-radius:50%;font-size:24px;line-height:1}
.gallery-help>.gallery-close,#gallery-works>.gallery-close{float:right;margin:-8px -8px 15px 20px}
.gallery-discovery{opacity:0;pointer-events:none;transition:opacity .25s}.gallery-discovery.visible{opacity:1}
#gallery-target:empty{display:none}.room-swatch{background:var(--swatch,#d8e0c8)}
.room-swatch i{position:absolute;inset:20% 25% 0 25%;border:1px solid var(--swatch-accent);border-radius:50% 50% 0 0;transform:rotate(-12deg)}
.room-work-item>span:nth-child(2){flex:1}.work-placeholder{display:grid;place-items:center;width:78px;height:66px;flex-shrink:0;background:#e4e3d7;color:#5c6753;font-size:24px}.gallery-archive-link{display:inline-block;margin-top:30px;font-size:12px;border-bottom:1px solid #adb8a1;padding-bottom:8px}
.gallery-fallback>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.22;z-index:-1}.gallery-fallback a{background:#faf9f0}
.gallery-dark{--gallery-ink:#faf3e9;--gallery-muted:#c0b9ae}.gallery-dark .gallery-topbar{background:linear-gradient(#25252be6,#25252b00)}.gallery-dark .gallery-bottom{background:linear-gradient(#25252b00,#25252be6)}.gallery-dark #room-caption{text-shadow:0 2px 20px #202024}.gallery-dark #room-caption p,.gallery-dark #room-caption .eyebrow,.gallery-dark .gallery-location small,.gallery-dark #gallery-progress,.gallery-dark #gallery-hint{color:#e2dbd2}.gallery-dark #room-caption .room-works-open{color:#fff0df;border-color:#bc9c87}.gallery-dark #guide-button{color:#fff4dd;background:radial-gradient(ellipse,#29282bcd,transparent 72%)}.gallery-dark #guide-button small{color:#dbc9b8}
@media(max-width:600px){.gallery-brand>span{font-size:8px}.gallery-toplinks button span{display:none}.gallery-toplinks button{justify-content:center;width:44px;border:1px solid #8b917533;border-radius:50%}.gallery-dark .gallery-toplinks button{border-color:#b5aa9944}#room-caption .room-works-open{font-size:10px;margin-top:4px}}
.gallery-controls button,.gallery-door{color:#394035}
@media(max-width:600px){.gallery-touch-pad:not([hidden]){display:grid}}
/* Carry the gallery's restrained material palette into the reading rooms. */
html[data-theme="light"]{--bg:#f5f2e9;--panel:#ece8dc;--panel-2:#e2dfd2;--text:#292c25;--muted:#6b7061;--line:#d4d5c8;--accent:#c5cfaa}
body:not(.gallery-mode) .entry-title,body:not(.gallery-mode) .archive-heading h1{font-family:Georgia,'Times New Roman',serif;font-weight:400;letter-spacing:-.055em}
body:not(.gallery-mode) .floating-header{border-radius:4px}
body:not(.gallery-mode) .entry-card{border-radius:4px}
