/* Lex4: consistent hierarchy and compact controls without masking the landscape. */
:root{--accent:#ff8a36}html{scrollbar-color:#c48550 #d0e1eb}button,a,select,input{touch-action:manipulation}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #c25b16;outline-offset:4px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.header-actions{display:flex;gap:8px;justify-self:end}.round-button{min-width:44px;min-height:44px}.header-actions .round-button{background:#e6eff378;backdrop-filter:blur(8px)}.night .header-actions .round-button{background:#112338b3}
#view-button{font-family:'Source Sans 3',Arial,sans-serif;font-size:19px}#loading[hidden]{display:none}#loading.done{visibility:hidden;transition:opacity .45s,visibility 0s .45s}
.pill{min-height:44px;display:inline-flex;align-items:center;justify-content:center}.pill[aria-pressed=true]{border-color:#ba682d;background:#f3dbc0;color:#342718}.night .pill[aria-pressed=true]{background:#624225;color:#fff1d9}.pill:disabled{opacity:.45;cursor:default}
#timeline button{transition:color .25s;min-height:52px}#timeline strong{font-variant-numeric:tabular-nums}#timeline button[aria-current=step]{color:#984509}.night #timeline button[aria-current=step]{color:#ffbf8a}
footer #timeline{text-shadow:0 1px 9px #f3f4eb,0 0 3px #f3f4eb}.night footer #timeline{text-shadow:0 1px 9px #081525,0 0 3px #081525}
.journey-status{border-radius:4px;font-variant-numeric:tabular-nums}.status-orbit{background:var(--accent);border-color:#c06c2d;box-shadow:0 0 0 3px #ff8a3615}
.story #description{line-height:1.75}.event-button{min-height:44px;line-height:1.5}.landmark{border-radius:5px;max-width:210px;background:#f3f0e2db}.night .landmark{background:#102838db}
.story::before{transition:background .6s,opacity .6s}.night .story::before{opacity:.85}.story h2{text-wrap:balance}
.travel-controls{gap:8px}dialog{max-height:85dvh;overflow:auto;border-radius:12px;box-shadow:0 24px 100px #0004}.dialog-close{position:absolute;right:14px;top:14px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 0;border-top:1px solid #25312726;font-size:14px}.setting-row select{font:inherit;background:#fff9;border:1px solid #25312740;border-radius:5px;padding:11px;color:#253127}.setting-row input{accent-color:#b66025;width:22px;height:22px}dialog .settings-note{font-size:12px;line-height:1.7}
.reduced-motion *{animation:none!important;transition:none!important}
.story-mode #world,.story-mode #journey,.story-mode .story,.story-mode footer,.story-mode .travel-controls,.story-mode .intro,.story-mode .landmark,.story-mode .vignette{display:none}.reading-mode{max-width:780px;margin:140px auto 60px;padding:0 24px}.reading-mode h1{font:48px 'Source Serif 4',Georgia,serif}.reading-mode section{padding:28px 0;border-bottom:1px solid #25312726}.reading-mode p{line-height:1.8}.reading-mode a{display:inline-block;padding:12px 0;text-decoration:underline;text-underline-offset:4px}
@media(max-width:700px){
 header{padding:12px 6% 8px;row-gap:7px}.header-actions{grid-column:2;grid-row:1;gap:4px}.header-note{font-size:8px;letter-spacing:.8px}.brand{font-size:25px}
 .story,.is-digital .story{top:112px;left:6%;width:84%;max-width:340px}.village-hero .story{top:108px;left:50%;width:88%;max-width:420px}
 #year,.is-digital #year{font-size:62px;letter-spacing:-3px}.village-hero #year{font-size:54px}#era,.is-digital #era,.is-digital.night #era{font-size:18px}
 .date-row,.is-digital .date-row{margin:0 0 10px;gap:12px}h2,.is-digital h2{font-size:27px;line-height:1.15;letter-spacing:-.5px;margin:10px 0}.village-hero h2{font-size:29px}
 #description,.is-digital #description{font-size:12px;width:90%;line-height:1.7;max-width:300px}.village-hero #description{font-size:16px;line-height:1.5;margin:10px auto}
 .event-button,.is-digital .event-button,.village-hero .event-button{font-size:10px;margin-top:5px;padding:8px 0}.landmark,.village-hero .landmark{display:none}
 footer{left:6%;right:6%;bottom:max(16px,env(safe-area-inset-bottom))}.journey-status{margin-bottom:9px;min-height:30px;padding:6px 10px}.journey-status #place{font-size:8px;letter-spacing:.35px}.footer-caption{margin-bottom:4px;font-size:7px}
 #timeline{gap:3px}#timeline button{padding:8px 0 12px;min-height:48px}#timeline strong{font-size:20px}#timeline span{display:none}
 .travel-controls,.is-digital .travel-controls{left:6%;right:6%;bottom:155px;flex-wrap:wrap;justify-content:flex-end;gap:6px}.travel-controls .pill{font-size:10px;padding:9px 12px}.travel-controls .round-button{width:44px;height:44px}
 .story::before,.is-digital .story::before{inset:-12px -18px}.night .story::before{background:radial-gradient(ellipse at 30% 40%,#0a172ae6,transparent 77%);filter:blur(15px)}
}
@media(max-width:700px) and (max-height:740px){.story,.is-digital .story{top:99px}.village-hero .story{top:96px}#year,.is-digital #year,.village-hero #year{font-size:44px}h2,.is-digital h2,.village-hero h2{font-size:23px;margin:6px 0}#description,.is-digital #description{font-size:11px;line-height:1.45;margin:6px 0}.village-hero #description{font-size:14px;margin:6px auto}.event-button,.is-digital .event-button{font-size:9px;margin-top:0}.travel-controls,.is-digital .travel-controls{bottom:143px}.journey-status #place{max-width:230px}.header-note{font-size:7px}}
@media(max-height:520px) and (min-width:701px){header{padding:10px 4%}.header-note{font-size:8px}.story,.village-hero .story{top:72px;left:5%;width:350px;transform:none;text-align:left}.village-hero .date-row{justify-content:flex-start}#year,.village-hero #year{font-size:46px}.story h2,.village-hero h2{font-size:26px}.story #description{display:none}.event-button{margin-top:0}.landmark{display:none}.journey-status{display:none}.travel-controls{bottom:103px}footer{bottom:12px}.village-hero .event-button{margin:0}}

/* Clear aerial arrival: clouds frame the lettering, not the village. */
.in-arrival .vignette{background:none}
.in-arrival .vignette::after{opacity:calc(var(--arrival-cloud-opacity,0)*.15)}
.in-arrival .intro::before{opacity:.35;inset:-15px -25px}

/* Final chapter continues along the river crossing to the court. */
.is-bridge .landmark,.is-court .landmark{bottom:225px}
.is-court .story{top:140px;max-width:330px}.is-court #year{font-size:82px}.is-court h2{font-size:33px}
@media(max-width:700px){.is-bridge .story,.is-court .story{top:107px;max-width:305px}.is-bridge #year,.is-court #year{font-size:44px}.is-bridge h2,.is-court h2{font-size:25px}.is-bridge #description,.is-court #description{font-size:11px;line-height:1.5}.is-bridge .landmark,.is-court .landmark{display:none}}

/* Keep the temple close-up clear of the story and floating landmark card. */
.is-temple .landmark{display:none}.is-temple .story{top:140px;max-width:300px}.is-temple #year{font-size:72px}.is-temple h2{font-size:30px}
@media(max-width:700px){.is-temple .story{top:104px;max-width:300px}.is-temple #year{font-size:38px}.is-temple h2{font-size:23px;margin-top:10px}.is-temple #description{font-size:11px;line-height:1.45}}

.is-temple .story{text-shadow:0 1px 3px #05101a,0 0 12px #05101a}
/* Keep the right-hand flag clear of the informational overlay. */
@media(min-width:701px){.is-millennium .landmark{top:116px;bottom:auto}}

/* Keep the final landmark credit clear of Lex's entrance and parked cars. */
@media(min-width:701px){.is-digital:not(.is-bridge):not(.is-court):not(.is-temple) .landmark{top:220px;bottom:auto}}
/* Soft white-grey labels across day and night; orange remains on the route progress. */
footer #timeline button,.night footer #timeline button{color:#e2e4e5}
footer #timeline button[aria-current=step],.night footer #timeline button[aria-current=step],footer #timeline button:hover{color:#fafafa}
footer #timeline,.night footer #timeline{text-shadow:0 1px 3px #101922,0 0 8px #101922b3}
@media(min-width:701px){
 .landmark,.village-hero .landmark{box-sizing:border-box;width:280px;max-width:280px;right:5%;bottom:285px}
 .travel-controls,.is-digital .travel-controls{box-sizing:border-box;left:auto;right:5%;width:280px;display:grid;grid-template-columns:1fr 1fr;gap:8px;bottom:165px}
 .travel-controls #motion-toggle,.travel-controls #play{width:100%;padding:10px 6px}
 .travel-controls #replay{grid-column:1;width:44px;justify-self:start}
 .travel-controls #asklex-link{grid-column:2;padding:10px 6px;font-size:10px}
 .is-bridge .landmark,.is-court .landmark{bottom:285px}
}
/* A restrained backdrop keeps years legible over bright scenery. */
footer::before{content:"";position:absolute;z-index:-1;pointer-events:none;left:-6vw;right:-6vw;bottom:-30px;height:150px;background:linear-gradient(to bottom,transparent,rgba(0,0,0,.08) 45%,rgba(0,0,0,.30));}
footer{isolation:isolate}
body:not(.night) footer::before,.night footer::before{inset:auto -8vw -30px;height:140px;opacity:1;filter:none;background:linear-gradient(to bottom,transparent,rgba(0,0,0,.08) 45%,rgba(0,0,0,.30))}
@media(max-width:700px){body:not(.night) footer::before,.night footer::before{height:125px}}
/* Keep the brand stationary; only the surrounding rings animate. */
.lex-loading-logo{animation:none;transform:none}
.brand .header-lex-logo{width:80px;height:80px;object-fit:contain;filter:none;flex-shrink:0}
@media(max-width:700px){.brand .header-lex-logo{width:64px;height:64px}}
.brand,.brand .brand-lex{font-family:'Source Serif 4',Georgia,'Times New Roman',serif;font-weight:400}
.travel-controls{align-items:center}
.travel-controls .pill{min-height:44px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
.travel-controls #replay{height:44px;width:44px;display:flex;align-items:center;justify-content:center;line-height:1;padding:0;align-self:center}
@media(min-width:701px){.travel-controls #replay{justify-self:center}.travel-controls #asklex-link{width:100%;min-height:44px}}

/* Stationary brand, orbiting blocks and two precisely drawn ellipses. */
#loading{background:#d0e1eb;color:#182b3b;overflow:hidden}
#loading .loading-content{position:static;width:auto}
.lex-loading-mark{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
#loading .lex-loading-logo{position:relative;width:112px;height:112px;background:transparent;box-shadow:none;animation:none;transform:none;opacity:1}
.lex-loading-logo img{width:100%;height:100%;object-fit:contain}
.lex-loader-ovals{position:absolute;left:50%;top:50%;width:min(1600px,98vw);height:94vh;transform:translate(-50%,-50%);overflow:visible}
.lex-loader-ovals>ellipse{fill:none;stroke:#496174;stroke-width:1.2;stroke-linecap:round;vector-effect:non-scaling-stroke;stroke-dasharray:1 4;opacity:.55}
.lex-loader-ovals>.oval-tall{stroke:#786b55;opacity:.5}
.lex-loader-ovals .oval-draw{fill:none;stroke:white;stroke-width:6;stroke-dasharray:100;stroke-dashoffset:100;animation:lex-oval-draw 2.8s cubic-bezier(.3,.05,.2,1) forwards}
.lex-loader-ovals .oval-draw.delayed{animation-delay:.45s}
#loading .lex-loading-label,#loading .loading-track,#loading .loading-meta{position:absolute;left:50%;transform:translateX(-50%);width:min(260px,72vw);clip-path:none}
#loading .lex-loading-label{top:calc(50% + 125px);height:auto;margin:0;text-align:center;font-size:11px;letter-spacing:1.8px;color:#294555}
#loading .loading-track{top:calc(50% + 158px);height:2px;margin:0;background:#29455524;overflow:hidden;border-radius:4px}
#loading .loading-track i{background:#ff8a36;box-shadow:none}
#loading .loading-meta{top:calc(50% + 172px);height:auto;margin:0;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;color:#294555}
#loading .loading-meta small{font-size:10px;line-height:1.5;letter-spacing:0;text-align:left}
#loading-percent{font-size:11px;font-variant-numeric:tabular-nums;flex-shrink:0}
@keyframes lex-oval-draw{to{stroke-dashoffset:0}}
@media(max-width:700px){
 #loading .lex-loading-logo{width:86px;height:86px}
 .lex-loader-ovals{width:98vw;height:360px;max-height:64vh}
 .travel-controls,.is-digital .travel-controls{display:grid;grid-template-columns:1fr 1fr;width:280px;max-width:88vw;left:auto;right:6%;gap:6px}
 .travel-controls #motion-toggle,.travel-controls #play{width:100%}
 .travel-controls #replay{grid-column:1;justify-self:center}
 .travel-controls #asklex-link{grid-column:2;width:100%;padding:9px 5px;box-sizing:border-box}
}
@media(prefers-reduced-motion:reduce){.lex-loader-ovals ellipse{animation:none}.lex-loader-ovals ellipse{stroke-dashoffset:0}}

/* Matching bottom-row buttons: equal dimensions and common text baseline. */
.travel-controls #replay,.travel-controls #asklex-link{width:100%;height:44px;min-height:44px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;align-self:stretch;justify-self:stretch;margin:0;padding:10px 6px;border-radius:25px;font:10px 'Source Sans 3',Arial,Helvetica,sans-serif;line-height:1;gap:7px}
.travel-controls #replay span{font-size:18px;line-height:1}

/* Orange discovery lettering in both themes. */
.travel-controls #asklex-link,.night .travel-controls #asklex-link{color:#ff8a36}
.travel-controls #asklex-link:hover,.night .travel-controls #asklex-link:hover{color:#ffa15c}

/* Soft radial gradients already feather the arrival clouds; avoid a fullscreen blur pass. */
.in-arrival .vignette::after{filter:none;will-change:transform,opacity}

/* Viewing preferences: warm paper, quiet borders and orange selection accents. */
#view-settings{--ink:#253127;--muted:#657065;--line:#25312722;color:var(--ink);width:min(580px,calc(100vw - 32px));padding:38px;border:1px solid #ffffffa6;border-radius:24px;background:#f7f5ee;box-shadow:0 28px 100px #07182055;overflow:visible;max-height:calc(100dvh - 32px)}
#view-settings::backdrop{background:#0b202977;backdrop-filter:blur(9px)}
#view-settings .dialog-close{top:18px;right:18px;width:36px;height:36px;color:#39463d;background:#e9e9de;border:0;font:24px 'Source Sans 3',Arial}
#view-settings .dialog-close:hover{background:#dddccd}
#view-settings .eyebrow{color:#ab5a25;font-size:10px;letter-spacing:2px;margin:2px 0 15px}
#view-settings h2{font:400 clamp(28px,5vw,36px)/1.15 'Source Serif 4',Georgia,serif;letter-spacing:-1px;margin:0 0 12px}
#view-settings #view-description{font-size:13px;line-height:1.6;margin:0 0 26px;color:#657065;max-width:360px}
#view-settings .settings-card{border:1px solid #2531271c;border-radius:16px;background:#fffdf8}
#view-settings .setting-row{padding:22px;gap:20px;border:0;margin:0;min-height:94px}
#view-settings .setting-row+.setting-row{border-top:1px solid #25312716}
#view-settings .setting-copy{display:flex;flex-direction:column;gap:7px;font-size:14px;font-weight:600;line-height:1.3}
#view-settings .setting-copy small{font-size:11px;font-weight:400;color:#657065;line-height:1.5;max-width:215px}
#view-settings .quality-picker{position:relative;flex:0 0 150px}
#view-settings summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border:1px solid #293d3429;border-radius:10px;font-size:12px;background:#f0f0e6;cursor:pointer;min-height:46px}
#view-settings summary::-webkit-details-marker{display:none}
#view-settings summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;transition:transform .2s}
#view-settings details[open] summary{border-color:#cb722f;background:#fff4e9}
#view-settings details[open] summary svg{transform:rotate(180deg)}
#view-settings summary:focus-visible{outline:2px solid #b95b1f;outline-offset:3px}
#view-settings .quality-options{position:absolute;z-index:2;right:0;top:calc(100% + 8px);width:272px;padding:6px;background:#fffdf8;border:1px solid #dcdccf;border-radius:13px;box-shadow:0 12px 32px #14281f29}
#view-settings .quality-options label{position:relative;display:flex;align-items:center;gap:12px;padding:13px 12px;border-radius:8px;cursor:pointer;min-height:64px}
#view-settings .quality-options label:hover{background:#f2f1e8}
#view-settings .quality-options input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
#view-settings .quality-options label:has(input:checked){background:#fff0df;color:#9b4a16}
#view-settings .quality-options label:has(input:focus-visible){outline:2px solid #b95b1f;outline-offset:-2px}
#view-settings .quality-options strong{display:block;font-size:12px;font-weight:600;margin-bottom:5px}
#view-settings .quality-options small{display:block;font-size:10px;color:#657065}
#view-settings .quality-check{margin-left:auto;color:#b6551a;opacity:0;font-size:17px}
#view-settings input:checked~.quality-check{opacity:1}
#view-settings #reduce-motion{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 44px;width:44px;height:26px;border:1px solid #aeb6a8;border-radius:20px;background:#d6dbcf;margin:0;cursor:pointer;transition:background .2s,border-color .2s}
#view-settings #reduce-motion::after{content:'';position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #152d2933;transition:transform .2s}
#view-settings #reduce-motion:checked{background:#c56625;border-color:#c56625}
#view-settings #reduce-motion:checked::after{transform:translateX(18px)}
#view-settings .settings-note{font-size:11px;line-height:1.7;color:#657065;margin:18px 3px 24px;max-width:410px}
#view-settings .settings-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;border-top:1px solid #25312718;padding-top:22px}
#view-settings .settings-footer>span{font-size:10px;color:#657065}
#view-settings #done-view{display:flex;align-items:center;justify-content:center;gap:20px;min-height:44px;padding:12px 18px;border:0;border-radius:24px;background:#263e34;color:#fff9ed;font-size:11px;white-space:nowrap}
#view-settings #done-view:hover{background:#345344}
#view-settings #done-view span{color:#ff9b52;font-size:18px}
@media(max-width:600px){#view-settings{padding:28px 22px;border-radius:20px}#view-settings .setting-row{padding:18px 15px;gap:14px}#view-settings .quality-row{align-items:stretch;flex-direction:column}#view-settings .quality-picker{flex:auto;width:100%}#view-settings .quality-options{width:100%}#view-settings .settings-footer{flex-direction:column-reverse;gap:14px}#view-settings #done-view{width:100%}#view-settings .settings-note{margin-bottom:18px}#view-settings #view-description{padding-right:10px}}
@media(max-height:600px){#view-settings{overflow:auto}}
@media(prefers-reduced-motion:reduce){#view-settings *{transition:none!important}}

/* Keep both dialog close controls legible independently of the scene theme. */
#view-settings #close-view,#details #close-dialog{position:absolute;z-index:5;top:16px;right:16px;display:grid;place-items:center;width:40px;height:40px;padding:10px;border:1px solid #25312726;border-radius:50%;background:#e9e9de;color:#253127;opacity:1;visibility:visible;pointer-events:auto}
#view-settings #close-view svg,#details #close-dialog svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
#view-settings #close-view:hover,#details #close-dialog:hover{background:#dddccd;border-color:#a5ad9b}
#details{--ink:#253127;--muted:#596150;--line:#25312726;color:#253127;padding-top:62px}
#view-settings .eyebrow{padding-right:44px}

/* Visible immediately, including while the opening scene is being prepared. */
.scroll-cue{position:fixed;z-index:21;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:10px;color:#f3e7cc;pointer-events:none;transition:opacity .45s ease,visibility .45s ease,bottom .5s ease;text-shadow:0 1px 8px #07182066}
.scroll-cue svg{width:27px;height:43px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.scroll-cue span{font-family:inherit;font-weight:500;line-height:1.4;font-size:10px;letter-spacing:1.6px;text-transform:uppercase;white-space:nowrap}
.scroll-cue-wheel{animation:scroll-cue-wheel 1.8s ease-in-out infinite}
.scroll-cue-arrow{animation:scroll-cue-arrow 1.8s ease-in-out infinite}
.scroll-cue.is-ready{bottom:145px;color:#27372e;text-shadow:0 1px 10px #f4f0e6;background:#f4f0e6df;padding:7px 15px;border:1px solid #25312725;border-radius:30px}
.scroll-cue.is-dismissed{opacity:0;visibility:hidden}
@keyframes scroll-cue-wheel{0%,100%{transform:translateY(0);opacity:.4}55%{transform:translateY(5px);opacity:1}}
@keyframes scroll-cue-arrow{0%,100%{transform:translateY(-2px);opacity:.5}55%{transform:translateY(2px);opacity:1}}
@media(max-width:700px){.scroll-cue.is-ready{bottom:245px}.scroll-cue span{font-size:9px;letter-spacing:1.1px}}
@media(prefers-reduced-motion:reduce){.scroll-cue,.scroll-cue *{animation:none!important;transition:none!important}}

/* Keep historical links readable throughout the daylight journey. */
body:not(.night) .event-button{
 max-width:100%;min-height:44px;padding:10px 14px;gap:10px;
 background:#e6eee2f5;border:1px solid #ffffffa6;border-radius:6px;
 color:#263c30;font-size:12px;font-weight:600;line-height:1.5;
 text-shadow:none;box-shadow:0 2px 8px #263c3010;
}
body:not(.night) #event-label{min-width:0;white-space:normal;text-wrap:pretty}
body:not(.night) .event-dot,body:not(.night) .event-button>span:last-child{flex-shrink:0}
body:not(.night) .event-button>span:last-child{margin-left:2px;font-size:17px}
body:not(.night) .event-button:hover{background:#f2f6ed;border-color:#acbda6}
@media(max-width:700px){body:not(.night) .event-button{font-size:11px;padding:9px 12px}}

/* Let each era fade gently as the visitor scrolls onward. */
body.hero-fading #story{opacity:var(--hero-text-opacity,1);transition:opacity .12s linear}
body.hero-scrolled #story{visibility:hidden;pointer-events:none}
@media(prefers-reduced-motion:reduce){body.hero-fading #story{transition:none}}

/* Give long daylight chapters room above the footer's location label. */
@media(min-width:701px){
 body:not(.night):not(.village-hero) #story{top:max(110px,18vh);width:min(420px,42vw)}
}
@media(min-width:701px) and (max-height:740px){
 body:not(.night):not(.village-hero) #year{font-size:64px}
 body:not(.night):not(.village-hero) #headline{font-size:28px;margin:12px 0}
 body:not(.night):not(.village-hero) .date-row{margin:0 0 10px}
 body:not(.night):not(.village-hero) .event-button{margin-top:12px}
}
@media(min-width:701px) and (max-height:650px){
 body:not(.night):not(.village-hero) #year{font-size:48px}
}

/* Leave breathing room between the reform milestone and location card. */
@media(min-width:701px){
 body.is-millennium:not(.night) #story{top:max(110px,16vh)}
 body.is-millennium:not(.night) #description{width:100%;max-width:360px}
}

/* Keep night chapters clear of the persistent location card too. */
@media(min-width:701px){
 body.night #story{top:max(110px,16vh);width:min(420px,42vw)}
 body.night #description{width:100%;max-width:360px}
}
@media(min-width:701px) and (max-height:740px){
 body.night #year{font-size:64px}
 body.night #headline{font-size:28px;margin:12px 0}
 body.night .date-row{margin:0 0 10px}
 body.night .event-button{margin-top:12px}
}
@media(min-width:701px) and (max-height:650px){body.night #year{font-size:48px}}

/* The bridge's longer heading must not push its link into the footer. */
@media(min-width:701px){
 body.night.is-bridge .date-row{margin:0 0 12px}
 body.night.is-bridge #headline{margin:12px 0}
 body.night.is-bridge .event-button{margin-top:12px}
}
@media(min-width:701px) and (min-height:741px){
 body.night.is-bridge #year{font-size:82px}
 body.night.is-bridge #headline{font-size:32px}
}

@media(min-width:701px) and (max-height:600px){body.night.is-bridge #story{top:94px}}

@media(max-width:700px){
 body[data-chapter="2"] #description,body[data-chapter="3"] #description{min-height:5.25em}
}

/* Reserve room beneath the 2001 milestone even on wide, short screens. */
@media(min-width:701px) and (min-height:741px){
 body.is-millennium:not(.night) #year{font-size:82px}
 body.is-millennium:not(.night) #headline{font-size:32px;margin:12px 0}
 body.is-millennium:not(.night) .date-row{margin:0 0 12px}
}
@media(min-width:701px) and (max-height:600px){
 body.is-millennium:not(.night) #story{top:100px;width:min(480px,50vw)}
 body.is-millennium:not(.night) #description{max-width:100%}
}
@media(max-width:700px) and (max-height:600px){
 body.is-millennium #description{width:100%;max-width:100%}
 body.is-millennium #story{top:92px}
}
@media(min-width:701px) and (max-height:600px){
 body.is-millennium:not(.night) #year{font-size:36px}
 body.is-millennium:not(.night) #headline{font-size:24px;margin:8px 0}
 body.is-millennium:not(.night) #description{margin:8px 0}
 body.is-millennium:not(.night) .event-button{margin-top:8px}
}

/* Progress fills a circular vessel behind the fixed Lex mark. */
.lex-liquid-loader{--water-level:240px;position:relative;width:220px;height:220px;display:grid;place-items:center;border-radius:50%;overflow:hidden;isolation:isolate;border:1px solid #ffffffb3;background:#ffffff26;box-shadow:inset 0 0 0 7px #ffffff20,0 12px 40px #29455512}
.lex-liquid{position:absolute;inset:0;width:100%;height:100%;overflow:hidden}
.lex-liquid-level{transform:translateY(var(--water-level));transition:transform .65s cubic-bezier(.25,.6,.3,1)}
.lex-liquid-wave{animation:lex-liquid-flow 3.5s linear infinite;fill:#ff791e}
.lex-liquid-wave.back{fill:#ffb66e;animation-direction:reverse;animation-duration:4.5s}
.lex-liquid-wave.front{opacity:.94}
.lex-liquid-slosh{transform-origin:100px 100px}
#loading .lex-liquid-loader .lex-loading-logo{width:132px;height:132px;z-index:1;filter:none}
#loading .loading-track{display:none}
#loading .loading-meta{top:calc(50% + 155px)}
.liquid-bubble{fill:none;stroke:#ffffff65;stroke-width:1.3;animation:lex-liquid-bubble 3s ease-in infinite}
.liquid-bubble.second{animation-delay:-1.4s}
.liquid-complete .lex-liquid-slosh{animation:lex-liquid-settle 1s ease-out both}
@keyframes lex-liquid-flow{to{transform:translateX(-200px)}}
@keyframes lex-liquid-bubble{0%{transform:translateY(30px);opacity:0}25%{opacity:.7}100%{transform:translateY(-65px);opacity:0}}
@keyframes lex-liquid-settle{0%{transform:rotate(0)}20%{transform:rotate(7deg) translateY(3px)}45%{transform:rotate(-5deg)}70%{transform:rotate(2deg)}100%{transform:rotate(0)}}
@media(max-width:600px){.lex-liquid-loader{width:184px;height:184px}#loading .lex-liquid-loader .lex-loading-logo{width:116px;height:116px}}
@media(prefers-reduced-motion:reduce){.lex-liquid-wave,.liquid-bubble,.liquid-complete .lex-liquid-slosh{animation:none}.lex-liquid-level{transition:none}}

/* Visible bubbles rise through the orange fill and fade at its surface. */
.liquid-bubble{fill:#fff4df45;stroke:#fff8e2d9;stroke-width:1.5;animation:lex-liquid-bubble var(--bubble-duration,3.5s) linear infinite;animation-delay:var(--bubble-delay,0s)}
@keyframes lex-liquid-bubble{0%{transform:translate(0,10px);opacity:0}15%{opacity:.9}70%{opacity:.8}100%{transform:translate(5px,var(--bubble-rise,-80px));opacity:0}}
@media(prefers-reduced-motion:reduce){.liquid-bubble{animation:none;opacity:.7}}

.lex-liquid-slosh{transform-origin:100px 70px;animation:lex-liquid-rock 2.4s ease-in-out infinite}
@keyframes lex-liquid-rock{0%,100%{transform:rotate(-5deg) translateY(2px)}25%{transform:rotate(0deg) translateY(-3px)}50%{transform:rotate(5deg) translateY(2px)}75%{transform:rotate(0deg) translateY(4px)}}
@media(prefers-reduced-motion:reduce){.lex-liquid-slosh{animation:none}}

/* Keep journey guidance off the loading screen, including its completion animation. */
body:has(#loading:not(.done):not([hidden])) #scroll-cue{display:none}

/* Keep loading content together within short and dynamic mobile viewports. */
#loading{min-height:100dvh;padding:24px 16px;padding-bottom:max(24px,env(safe-area-inset-bottom))}
#loading .loading-content{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;width:min(300px,90vw)}
#loading .lex-loading-mark{position:relative;inset:auto;display:grid;place-items:center}
#loading .lex-loader-ovals{position:fixed;pointer-events:none}
#loading .lex-loading-label,#loading .loading-meta{position:static;transform:none;width:100%;margin:0}
#loading .lex-liquid-loader{width:clamp(110px,32dvh,220px);height:clamp(110px,32dvh,220px);flex-shrink:0}
#loading .lex-liquid-loader .lex-loading-logo{width:60%;height:60%}
#scroll-cue[hidden]{display:none}
#scroll-cue{pointer-events:auto;cursor:pointer;font:inherit;border:0;background:transparent;padding:6px 10px;min-height:44px;touch-action:manipulation}
body.in-arrival #scroll-cue.is-ready{bottom:max(24px,env(safe-area-inset-bottom));top:auto}
@media(max-width:700px){
 #scroll-cue.is-ready{top:72px;bottom:auto;max-width:85vw;padding:3px 10px;min-height:36px;gap:7px}
 #scroll-cue svg{width:18px;height:28px}
 #loading .lex-loader-ovals{height:85dvh}
}
@media(max-height:450px){#loading .loading-content{gap:8px}#loading .lex-loading-label{font-size:10px}body.in-arrival #scroll-cue.is-ready{left:auto;right:16px;transform:none;bottom:16px}}
@media(max-width:700px){
 .travel-controls,.is-digital .travel-controls{left:6%;right:6%;width:auto;max-width:none;display:grid;grid-template-columns:1fr 1.1fr 40px 1.35fr;gap:5px;bottom:103px}
 .travel-controls .pill,.travel-controls #motion-toggle,.travel-controls #play,.travel-controls #replay,.travel-controls #asklex-link{grid-column:auto;width:100%;height:40px;min-height:40px;padding:5px 3px;font-size:9px;line-height:1.15;gap:3px;border-radius:20px}
 .travel-controls #replay span{font-size:16px}
 .travel-controls #replay{font-size:0}
}
#scroll-cue.is-ready{color:#27372e;background:#f4f0e6ef;border:1px solid #25312725;border-radius:24px;text-shadow:none}
@media(max-width:700px){header .header-note{display:none}}

@media(max-width:700px){
 .travel-controls,.is-digital .travel-controls{left:auto;right:6%;width:auto;display:flex;gap:8px;bottom:var(--mobile-controls-bottom,110px)}
 .travel-controls .pill,.travel-controls #motion-toggle,.travel-controls #play,.travel-controls #replay,.travel-controls #asklex-link{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;font-size:0;gap:0;flex:none}
 .travel-controls #replay span{display:none}
 .travel-controls .pill:before{display:block;font:20px/1 'Source Sans 3',Arial,sans-serif}
 .travel-controls #motion-toggle:before{content:'Ⅱ'}
 .travel-controls #motion-toggle[aria-pressed="true"]:before{content:'▷'}
 .travel-controls #play:before{content:'▶';font-size:17px}
 .travel-controls #play[aria-pressed="true"]:before{content:'Ⅱ';font-size:20px}
 .travel-controls #replay:before{content:'↺';font-size:24px}
 .travel-controls #asklex-link:before{content:'↗';font-size:24px}
}
@media(max-width:700px){
 #loading .lex-loader-ovals{width:min(740px,145vw);height:auto;max-height:none;aspect-ratio:1200/680}
}
@media(max-width:700px) and (orientation:landscape){
 #loading .lex-loader-ovals{width:95vw}
}

/* One circular control treatment throughout the mobile journey. */
@media(max-width:700px){
 body #scroll-cue.is-ready,
 body .travel-controls .pill,
 body .header-actions .round-button{
  box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:1px solid #25312740;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;gap:0;
  background:#f4f0e6ef;color:#bc5b1d;box-shadow:0 2px 8px #15271b12;
  backdrop-filter:blur(8px);text-shadow:none;
 }
 body #scroll-cue.is-ready span{display:none}
 body #scroll-cue.is-ready svg{width:20px;height:30px}
 body .travel-controls .pill:before{font-size:20px;line-height:1}
 body .travel-controls .pill:hover,body .header-actions .round-button:hover,
 body #scroll-cue.is-ready:hover{background:#fff2df;border-color:#bc5b1d}
 body .travel-controls .pill[aria-pressed="true"]{background:#f3dbc0;border-color:#bc5b1d}
 body.night .travel-controls .pill,body.night .header-actions .round-button,
 body.night #scroll-cue.is-ready{background:#112338ed;border-color:#ffffff45;color:#ff8a36}
 body.night .travel-controls .pill[aria-pressed="true"]{background:#624225;border-color:#ff8a36}
 body #scroll-cue[hidden]{display:none}
}

.control-icon{display:inline-block;color:#111;font:18px/1 'Source Sans 3',Arial,sans-serif}
.travel-controls #skip-journey{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px}
@media(min-width:701px){
 .travel-controls #motion-toggle{display:none}
 .travel-controls #play{gap:7px}
}
@media(max-width:700px){
 body .travel-controls #skip-journey{width:44px;height:44px;min-width:44px;padding:0;border-radius:50%;font-size:0;gap:0;flex:none}
 body .travel-controls .pill .control-icon{display:none}
 body .travel-controls #skip-journey:before{content:'⏭';font-size:20px}
 body .travel-controls .pill:before{color:#111}
 body .header-actions .round-button,body.night .header-actions .round-button{color:#111;background:#f4f0e6ef}
 body .travel-controls .pill,body.night .travel-controls .pill{background:#f4f0e6ef;border-color:#25312740}
 body #scroll-cue.is-ready svg{color:#111}
 body #scroll-cue.is-ready,body.night #scroll-cue.is-ready{background:#f4f0e6ef}
 body .travel-controls .pill[aria-pressed="true"]{background:#f3dbc0}
}
/* Keep the symbols readable on the dark chapters, too. */
@media(min-width:701px){body.night .travel-controls .pill{background:#f4f0e6ef;color:#253127}}

.travel-controls .skip-icon{display:block;width:20px;height:20px;flex:none;fill:none;stroke:#111;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:700px){body .travel-controls #skip-journey:before{content:none}body .travel-controls #skip-journey .skip-label{display:none}}

/* SVG symbols avoid platform emoji colours and keep every control monochrome. */
.travel-controls svg.control-icon,.travel-controls svg.skip-icon{display:block;width:20px;height:20px;flex:none;fill:none;stroke:#000;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:#000}
@media(max-width:700px){
 body .travel-controls .pill:before{content:none}
 body .travel-controls .pill svg.control-icon,body .travel-controls .pill svg.skip-icon{display:block;color:#000;stroke:#000}
}
@media(max-width:700px){
 body .travel-controls #play:before,body .travel-controls #play[aria-pressed="true"]:before,
 body .travel-controls #motion-toggle:before,body .travel-controls #motion-toggle[aria-pressed="true"]:before,
 body .travel-controls #replay:before,body .travel-controls #skip-journey:before,
 body .travel-controls #asklex-link:before{content:none}
}

/* Shared Lucide icon sizing across navigation, preferences and dialogs. */
svg.lucide{width:20px;height:20px;flex:none;fill:none;stroke:#000;stroke-width:2;vertical-align:middle}
.header-actions .round-button{display:inline-flex;align-items:center;justify-content:center}
body .travel-controls svg.lucide,body .header-actions svg.lucide,body #scroll-cue svg.lucide{stroke:#000;stroke-width:2}
#skip,#done-view,#dialog-source{display:inline-flex;align-items:center;gap:12px}
#scroll-cue.is-ready svg.lucide{width:20px;height:24px}
#view-settings #close-view svg.lucide,#details #close-dialog svg.lucide,#view-settings summary svg.lucide{stroke:#000;stroke-width:2}

/* The journey Play/Pause toggle is the single playback control at every size. */
body .travel-controls #motion-toggle{display:none}

@media(max-width:700px){
 .travel-controls{transition:opacity .25s ease,transform .25s ease}
 html:not(.journey-started) .travel-controls{visibility:hidden;opacity:0;pointer-events:none;transform:translateY(8px)}
 html.journey-started body:not(.in-arrival) .travel-controls{visibility:visible;opacity:1;transform:none}
 body #scroll-cue.is-ready{width:auto;min-width:44px;padding:0 14px;gap:8px;border-radius:24px}
 body #scroll-cue.is-ready span{display:inline;font:10px/1.2 'Source Sans 3',Arial,sans-serif;color:#000}
 body #scroll-cue.is-ready svg.lucide{animation:mobile-scroll-prompt 1.6s ease-in-out infinite}
}
@keyframes mobile-scroll-prompt{0%,100%{transform:translateY(-2px)}50%{transform:translateY(3px)}}
@media(prefers-reduced-motion:reduce){body #scroll-cue.is-ready svg.lucide{animation:none}.travel-controls{transition:none}}

/* Keep the prompt anchored through loading and the camera arrival. */
@media(max-width:700px){
 body #scroll-cue.is-ready,body.in-arrival #scroll-cue.is-ready{
  top:auto;bottom:var(--mobile-controls-bottom,110px);left:50%;right:auto;
  transform:translateX(-50%);transition:opacity .25s ease,visibility .25s ease;
 }
}

/* The logo changes colour only below the rising liquid level. */
#loading .lex-liquid-loader .lex-loading-logo{background:transparent;filter:none}
#loading .lex-liquid-loader .lex-loading-logo img{opacity:1}
/* The same liquid geometry and animations reveal the light gold logo. */
.lex-liquid-logo-fill{
 position:absolute;inset:0;z-index:2;pointer-events:none;
 -webkit-mask:url('/assets/optimized/lex-logo.webp') center / 60% 60% no-repeat;
 mask:url('/assets/optimized/lex-logo.webp') center / 60% 60% no-repeat;
}
.lex-liquid-logo-fill .lex-liquid-wave{fill:#FFE8A8;opacity:1}

/* Only the orange front wave reveals light gold, never the pale rear wave. */
.lex-liquid-logo-fill .lex-liquid-wave.back{display:none}

/* Main journey navigation to the complete Lex website. */
.header-actions{align-items:center}
.header-actions .explore-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:44px;padding:10px 16px;border:1px solid #25312740;border-radius:24px;background:#f4f0e6ef;color:#172018;font:12px 'Source Sans 3',Arial,sans-serif;cursor:pointer}
.explore-button svg,#close-explore svg{width:20px;height:20px;flex:none}
.header-actions .explore-button:hover{background:#FFE8A8;border-color:#CBA13A}
#explore-menu{position:fixed;inset:0 0 0 auto;margin:0;width:min(540px,100%);max-width:100%;height:100dvh;max-height:100dvh;padding:30px 36px;background:#f4f0e6;color:#202720;border:0;border-radius:0;overflow:auto}
#explore-menu::backdrop{background:#07182099;backdrop-filter:blur(7px)}
#explore-menu .explore-top{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
#explore-menu h2{font:36px/1.1 'Source Serif 4',Georgia,serif;margin:0;letter-spacing:-1px}
#close-explore{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:1px solid #25312740;border-radius:50%;background:transparent;color:#000;cursor:pointer}
#explore-menu nav{display:grid}
#explore-menu nav a{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:48px;padding:15px 0;border-bottom:1px solid #25312725;font:16px/1.3 'Source Sans 3',Arial,sans-serif;color:#202720}
#explore-menu nav a:hover{color:#866716;background:#FFE8A840}
#explore-menu nav a span{font-size:20px;color:#000}
@media(max-width:700px){.header-actions{gap:6px}.header-actions .explore-button{padding:10px 12px;font-size:10px;gap:7px}#explore-menu{padding:25px 7%}#explore-menu h2{font-size:32px}}

/* Keep black header icons legible in every era and viewport. */
body .header-actions .round-button,body.night .header-actions .round-button,
body .header-actions .explore-button,body.night .header-actions .explore-button{background:#f4f0e6;color:#111;border-color:#b9b4a8;box-shadow:0 2px 10px #00000018}
body .header-actions button:hover,body.night .header-actions button:hover{background:#FFE8A8;border-color:#CBA13A}
body .header-actions button svg{stroke:#111}


/* Loader palette aligned with the editorial site's warm paper and ink. */
#loading{background:#faf9f5;color:#24231f}
#loading .lex-loading-label,#loading .loading-meta{color:#4f4c43}
#loading .loading-track{background:#24231f20}
#loading .lex-loader-ovals>ellipse{stroke:#8d887c}
#loading .lex-loader-ovals>.oval-tall{stroke:#a08b61}
#loading .lex-loader-ovals .oval-draw{stroke:#fffefa}
#loading .lex-liquid-loader{border-color:#d9d3c4;background:#fffdf780;box-shadow:inset 0 0 0 7px #ffffff60,0 12px 40px #24231f0c}

/* Restrained loading typography, consistent with the editorial site. */
#loading .loading-content{width:min(420px,90vw);gap:16px}
#loading .lex-loading-label{font:400 14px/1.5 'Source Sans 3',Arial,Helvetica,sans-serif;letter-spacing:0;color:#24231f}
#loading .loading-meta{gap:16px;align-items:baseline}
#loading .loading-meta small,#loading-percent{font:400 12px/1.5 'Source Sans 3',Arial,Helvetica,sans-serif;color:#4f4c43}
#loading .loading-description{margin:0;text-align:center;font:11px/1.65 'Source Sans 3',Arial,Helvetica,sans-serif;color:#666258;max-width:350px}
@media(max-height:450px){#loading .loading-content{gap:10px}#loading .loading-description{line-height:1.45}}

/* Lex brand scrollbars */
*{scrollbar-color:#CBA13A #F0EEE6;scrollbar-width:auto}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:#F0EEE6}::-webkit-scrollbar-thumb{background:#CBA13A;border:3px solid #F0EEE6;border-radius:12px}::-webkit-scrollbar-thumb:hover{background:#FFE8A8}::-webkit-scrollbar-corner{background:#F0EEE6}
@media(forced-colors:active){*{scrollbar-color:auto}}

/* Keep loading and journey typography aligned with the editorial pages. */
#loading,.intro,.story,.travel-controls,#scroll-cue{font-family:'Source Sans 3',Arial,Helvetica,sans-serif}
#loading .lex-loading-label,#loading .loading-meta small,#loading-percent,#loading .loading-description{font-family:'Source Sans 3',Arial,Helvetica,sans-serif}
.intro h1,.story h2,.story #year{font-family:'Source Serif 4',Georgia,serif;font-optical-sizing:auto}
.intro p,.story p,.story #era,.story .event-button{font-family:'Source Sans 3',Arial,Helvetica,sans-serif}
