:root{--ink:#203e3c;--muted:#53655d;--paper:#f2ead7;--accent:#914f55;--ease:cubic-bezier(.18,.8,.24,1)}
*{box-sizing:border-box}html,body{height:100%;overflow:hidden}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.5 Arial,Helvetica,sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;min-width:44px;min-height:44px}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:3px}a{color:inherit}
#experience{height:100svh;position:relative;overflow:hidden}#art{position:absolute;inset:0;pointer-events:none;background:#91a99d}#art>svg{display:block;width:100%;height:100%}.paper{position:absolute;inset:0;pointer-events:none;opacity:.09;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='3'/%3E%3C/filter%3E%3Cpath d='M0 0h140v140H0z' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E")}
.reading-wash{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 35%,#f2ead700 47%,#f2ead733 68%,#f2ead766 100%)}
header{position:absolute;top:21px;left:34px;right:34px;pointer-events:none;z-index:2}header p{font-size:14px;letter-spacing:.14em;font-weight:700;margin:0 0 0 -7px;min-height:38px;display:inline-flex;align-items:center;background:var(--paper);padding:0 7px;border-radius:2px}.map-caption{position:absolute;top:79px;left:27px;pointer-events:none;font-size:14px;color:var(--ink);max-width:330px;background:var(--paper);padding:3px 7px;border-radius:2px;z-index:2}#mapMode{display:none}
#locator{position:absolute;top:117px;left:28px;width:150px;pointer-events:none;color:var(--ink);text-align:center;font-size:14px;transition:opacity .8s var(--ease);z-index:2;background:radial-gradient(ellipse closest-side,#f2ead7f5 30%,#f2ead7c4 54%,#f2ead700 100%)}#locator svg{display:block;width:100%;height:145px}#locator span{white-space:nowrap;display:inline-block;background:var(--paper);padding:1px 7px;border-radius:2px;margin-top:-4px}#locator svg path{stroke:#f2ead7;stroke-width:1.5}body:not([data-mode="arrival"]):not([data-mode="return"]) #locator{opacity:0}
.story{position:absolute;right:5.8vw;bottom:116px;width:420px;max-width:calc(100vw - 40px);z-index:2}.story:before{content:"";position:absolute;inset:-120px -130px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse closest-side,#f2ead7f5 40%,#f2ead7e8 68%,#f2ead7b8 82%,#f2ead700 100%)}.eyebrow{font-size:14px;line-height:1.4;letter-spacing:.05em;display:flex;justify-content:space-between;gap:14px;color:var(--ink);font-weight:600}.story>.eyebrow>span{background:var(--paper);padding:3px 6px;margin:-3px -6px;border-radius:2px}#count{white-space:nowrap;font-weight:400;font-variant-numeric:tabular-nums}
h1{font:normal 56px/1.03 Georgia,'Times New Roman',serif;letter-spacing:-.05em;margin:22px 0}#narration{font:19px/1.55 Georgia,'Times New Roman',serif;margin:0;min-height:118px;max-width:410px}.actions{margin-top:27px;display:flex;gap:12px;align-items:center}.glyph{width:26px;height:26px;flex-shrink:0;display:block;transition:transform .4s var(--ease)}#back{padding:0;width:44px;display:flex;align-items:center;justify-content:center}#back:disabled{opacity:1;color:#53655d;cursor:default}.actions #note{margin-right:auto;padding:8px 0;display:flex;align-items:center;gap:7px;font-size:14px;white-space:nowrap}.actions #note .glyph{width:23px;height:23px}#next{background:#315d58;color:#fff7e5;padding:13px 17px;display:flex;gap:18px;align-items:center;justify-content:space-between;font-size:14px;min-height:50px;border-radius:2px;white-space:nowrap}#next:hover{background:#46756c}button:hover .glyph-next{transform:translateX(3px) rotate(-4deg)}button:hover .glyph-note{transform:rotate(-6deg)}button:hover .glyph-archive{transform:translateY(-2px)}button:active .glyph{transform:scale(.9)}.geo-label{display:none}
.flow-trace{animation:temple-light 6s ease-in-out infinite alternate}@keyframes temple-light{from{stroke-dashoffset:0;opacity:.3}to{stroke-dashoffset:90;opacity:.75}}

dialog{padding:0;width:620px;height:fit-content;max-height:calc(100svh - 40px);max-width:calc(100vw - 32px);overflow:hidden;border:1px solid #a8b0ac;background:#f5eedf;color:var(--ink);box-shadow:0 30px 100px #244e4955}dialog::backdrop{background:#244e4999;backdrop-filter:blur(5px)}.room-shell{height:auto;padding:26px 32px;display:flex;flex-direction:column;gap:18px;overflow:hidden}dialog .close{flex:none;align-self:flex-end;display:flex;align-items:center;gap:8px;margin:0;min-height:44px;padding:0 2px;font-size:14px;line-height:1.3}.close .glyph{width:24px;height:24px}.room-page{flex:none;min-height:0;overflow:hidden;outline:none}.room-page .eyebrow{margin:0 0 14px;font-size:14px;line-height:1.4}.room-page h2{font:normal 34px/1.12 Georgia,serif;letter-spacing:-.035em;margin:0 0 20px}.room-page p{margin:0 0 16px;font-size:17px;line-height:1.55}.room-page .citation{font-size:14px;line-height:1.4;margin-top:18px;margin-bottom:0;color:#53655d}.room-turns{display:flex;align-items:center;gap:12px;flex:none;border-top:1px solid #c6c8b9;padding-top:8px}.room-count{font-size:14px;color:#53655d;font-variant-numeric:tabular-nums;margin-right:auto;white-space:nowrap}.room-turns button{display:flex;align-items:center;justify-content:center;gap:9px;min-height:44px;min-width:44px;padding:4px 0;font-size:14px}.room-turns button:disabled{opacity:1;color:#53655d;cursor:default}.room-turns .glyph{width:24px;height:24px}.room-turns button:last-child{color:#315d58}dialog #sources,dialog #sourceOpen{display:flex;flex:none;align-items:center;justify-content:center;gap:9px;height:44px;min-height:44px;min-width:44px;margin:0;padding:0;border:0;background:#dce0ca;font-size:14px;text-decoration:none}dialog #sources .glyph{width:24px;height:24px}
dialog.room-measuring{height:min(720px,calc(100svh - 40px))}.room-measuring .room-shell{height:100%}.room-measuring .room-page{flex:1}.room-leaving::backdrop{animation:veil-out .42s ease both}dialog[open]:not(.room-leaving)::backdrop{animation:veil-in .42s ease both}@keyframes veil-in{from{background:#244e4900;backdrop-filter:blur(0)}to{background:#244e4999;backdrop-filter:blur(5px)}}@keyframes veil-out{from{background:#244e4999;backdrop-filter:blur(5px)}to{background:#244e4900;backdrop-filter:blur(0)}}
@media(min-width:1400px){.story{width:460px;right:6vw;bottom:126px}h1{font-size:62px}#narration{font-size:20px;max-width:440px}}
@media(max-width:800px){header{top:10px;left:22px;right:22px}header p{letter-spacing:.1em}.map-caption{top:64px;left:15px;right:auto;font-size:14px;max-width:calc(100vw - 30px)}.story{left:22px;right:22px;bottom:28px;width:auto;max-width:none}.story:before{display:none}.eyebrow{font-size:14px;letter-spacing:.025em;gap:8px}h1{font-size:43px;line-height:1.04;margin:15px 0}#narration{font-size:17px;line-height:1.48;min-height:100px;max-width:none}.actions{margin-top:18px;gap:9px}.actions #note{gap:5px}.actions #note .glyph{width:22px;height:22px}#next{font-size:14px;padding:12px;gap:10px;min-height:48px}.reading-wash{background:linear-gradient(180deg,#f2ead755 0,#f2ead700 80px,#f2ead700 var(--art-end,350px),#f2ead7f5 var(--read-start,420px),#f2ead7 100%)}#locator{left:13px;top:102px;width:96px;font-size:14px}#locator svg{height:106px}#locator span{margin-top:-7px}dialog{max-height:calc(100svh - 24px);width:calc(100vw - 24px);max-width:none}.room-shell{padding:16px 20px;gap:14px}.room-page h2{font-size:30px;margin-bottom:16px}.room-page p{font-size:16px;line-height:1.5}.room-page .citation{font-size:14px;line-height:1.4;margin-top:16px}.room-page .eyebrow{margin-bottom:10px}.room-turns{gap:10px}dialog.room-measuring{height:calc(100svh - 24px)}}
@media(max-width:350px){header{left:18px;right:18px}.map-caption{left:11px;max-width:calc(100vw - 22px)}.story{left:18px;right:18px}h1{font-size:37px}.actions{gap:4px}.actions #note{min-width:66px;max-width:66px;gap:3px}#next{flex:1;padding:12px 10px;gap:7px}#next .glyph{width:24px;height:24px}#narration{font-size:16px;line-height:1.44}#locator{width:84px;left:9px}#locator svg{height:92px}}
@media(max-height:690px) and (max-width:800px){.story{bottom:24px}h1{font-size:34px;margin:10px 0}#narration{font-size:16px;line-height:1.4;min-height:90px}.actions{margin-top:12px}#locator{top:94px;width:78px}#locator svg{height:85px}.reading-wash{background:linear-gradient(180deg,#f2ead722 0,#f2ead700 65px,#f2ead700 var(--art-end,225px),#f2ead7f5 var(--read-start,280px),#f2ead7 100%)}}
@media(max-height:650px){.room-shell{padding:12px 18px;gap:10px}.room-page h2{font-size:27px;margin-bottom:12px}.room-page .eyebrow{margin-bottom:8px}.room-page p{margin-bottom:12px}.room-page .citation{margin-top:12px}.room-turns{padding-top:5px}}
@media(min-width:801px) and (max-height:600px){header{top:8px;left:22px}.map-caption{top:62px;left:15px}.story{bottom:24px;width:43vw;right:4vw}.story:before{inset:-60px -80px}h1{font-size:36px;margin:12px 0}#narration{font-size:16px;line-height:1.4;min-height:86px}.actions{margin-top:12px;gap:8px}#next{padding:12px;gap:8px;min-height:48px}#locator{left:18px;top:104px;width:96px}#locator svg{height:100px}}
@media(min-width:650px) and (max-height:500px){dialog{width:min(800px,calc(100vw - 24px));max-height:calc(100svh - 24px);max-width:none}.room-shell{display:grid;grid-template-columns:minmax(0,1fr) 185px;grid-template-rows:44px auto 44px;padding:12px 18px;gap:10px 18px}.room-page{grid-column:1;grid-row:1 / 4;height:auto}dialog .close{grid-column:2;grid-row:1;font-size:14px;justify-self:end}.room-turns{grid-column:2;grid-row:2;align-self:end;flex-wrap:wrap;gap:4px 10px;padding-top:5px}.room-count{order:-1;flex-basis:100%;margin:0 0 2px}.room-turns button:last-child{margin-left:auto}.room-turns button{gap:5px}dialog #sources,dialog #sourceOpen{grid-column:2;grid-row:3}.room-page h2{font-size:27px}.room-page p{font-size:16px;line-height:1.5}.room-page .citation{font-size:14px}dialog.room-measuring{height:calc(100svh - 24px)}.room-measuring .room-shell{grid-template-rows:44px minmax(0,1fr) 44px}.room-measuring .room-page{height:100%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}#locator,.wind-motion{transition:opacity .12s ease!important}dialog[open]::backdrop{animation-duration:.12s!important}}
/* A continuous paper-to-water transition, never a light rectangle or fog bubble. */
@media(min-width:801px){.story:before{display:none}.reading-wash{background:linear-gradient(90deg,#f2ead700 30%,#f2ead755 48%,#f2ead7cc 68%,#f2ead7e8 86%,#f2ead7ef 100%)}}
/* The phone locator sits beside the masthead, clear of the relief. */
@media(max-width:800px){#locator{left:auto;right:8px;top:7px;width:84px}#locator svg{height:82px}#locator span{margin-top:-8px}}
/* Short laptop/landscape text needs a little more paper at its left edge. */
@media(min-width:801px) and (max-height:600px){.reading-wash{background:linear-gradient(90deg,#f2ead700 15%,#f2ead755 35%,#f2ead7cc 55%,#f2ead7e8 80%,#f2ead7ef 100%)}}
@media(min-width:801px) and (max-height:600px){#locator{left:234px;right:auto;top:7px;width:84px}#locator svg{height:78px}#locator span{margin-top:-8px}}

/* Short landscape uses a full-height relief beside the reading column. */
@media(min-width:650px) and (max-width:800px) and (max-height:500px){
 #locator{display:none}
 .story{left:auto;right:3vw;bottom:22px;width:45vw;max-width:none}
 .reading-wash{background:linear-gradient(90deg,#f2ead700 14%,#f2ead755 34%,#f2ead7cc 53%,#f2ead7e8 76%,#f2ead7ef 100%)}
 h1{font-size:34px;margin:10px 0}
 #narration{font-size:16px;line-height:1.4;min-height:86px}
 .actions{margin-top:12px;gap:6px}
 #next{padding:12px 10px;gap:8px;min-height:48px}
 .map-caption{max-width:30vw}
}

/* Keep the geographic key beside the masthead, away from the main forest scene. */
@media(min-width:801px) and (min-height:601px){#locator{left:250px;right:auto;top:7px;width:110px}#locator svg{height:104px}#locator span{margin-top:-6px}}

/* Selective spatial views, never a reconstruction of building phases. */
.whole-model,.gateway-model,.sanctuaries-model,.tank-model,.hall-model,.layers-model{transition:opacity 1s var(--ease)}
.gateway-model,.sanctuaries-model,.tank-model,.hall-model,.layers-model{opacity:0}
body[data-mode="gateway"] .gateway-model,body[data-mode="sanctuaries"] .sanctuaries-model,body[data-mode="tank"] .tank-model,body[data-mode="hall"] .hall-model,body[data-mode="layers"] .layers-model{opacity:1}
body:not([data-mode="arrival"]):not([data-mode="return"]) .whole-model{opacity:0}
#back:disabled,.room-turns button:disabled{opacity:1;color:#53655d}
.room-turns button:disabled:hover .glyph{transform:none}
#back{background:var(--paper);border-radius:2px}
#art{z-index:0;isolation:isolate}.paper,.reading-wash{z-index:1}.story,header,.map-caption,#locator{z-index:3}
body:not([data-mode="arrival"]):not([data-mode="return"]) #locator{opacity:1}
#locator .site-index{display:block;height:66px!important}
body[data-mode="arrival"] #locator .site-index,body[data-mode="return"] #locator .site-index{display:none}
body:not([data-mode="arrival"]):not([data-mode="return"]) #locator .country-index{display:none}
@media(max-width:800px){#locator{width:100px}}
@media(min-width:650px) and (max-width:800px) and (max-height:500px){#locator{display:none}}
@media(prefers-reduced-motion:reduce){.whole-model,.gateway-model,.sanctuaries-model,.tank-model,.hall-model,.layers-model{transition:opacity .12s ease!important}}

.shrine-label{z-index:2;position:absolute;display:none;font:14px/1.2 Arial,sans-serif;color:#244b48;background:#f2ead7ed;padding:4px 6px;border-radius:2px;transform:translate(-50%,-50%);pointer-events:none}body[data-mode="sanctuaries"] .shrine-label{display:block}

/* Controls that cannot act yet are hidden, not painted disabled. The slot stays (visibility, not display) so nothing shifts. */
.not-ready{visibility:hidden!important;pointer-events:none}
/* Short portrait phones: tighten reading-room spacing so long source entries fit a page with readable type. */
@media(max-height:500px) and (max-width:649px){.room-shell{padding:10px 18px;gap:8px}.room-page .eyebrow{margin-bottom:6px}.room-page h2{font-size:26px;margin-bottom:8px}.room-page p{margin-bottom:8px}.room-page .citation{margin-top:8px}.room-turns{padding-top:3px}}
