@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/manrope-latin-wght-normal.woff2) format('woff2-variations');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/manrope-latin-ext-wght-normal.woff2) format('woff2-variations');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
:root{color-scheme:dark;--ink:#f4efe6;--muted:#a9a3b4;--glass:rgba(10,12,22,.62);--line:rgba(200,190,220,.14);--gold:#f1b867;--blue:#2f6bff;--mono:ui-monospace,'SF Mono',Menlo,monospace}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;background:#07080f;color:var(--ink);font:15px/1.5 'Manrope',ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
button,a,input{touch-action:manipulation}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
:focus-visible{outline:3px solid var(--gold);outline-offset:3px;border-radius:8px}
#stage{position:fixed;inset:0}
#stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
#fallback{position:absolute;z-index:5;inset:0 16px;height:fit-content;max-width:560px;margin:auto;padding:18px 20px;border-radius:14px;text-align:center;color:var(--ink);background:var(--glass);border:1px solid var(--line)}
#fallback b{display:block;margin-bottom:6px}
#fallback span{display:block;font-size:13px;line-height:1.5;color:var(--muted)}
#fallback video{display:block;width:100%;border-radius:10px;margin-bottom:14px}
body.failed :is(.building,.story,.timeline,.live,#moment,#pin,#leader,#labels){display:none!important}
#fallback a{color:var(--gold)}
[hidden]{display:none!important}

.top{position:fixed;top:16px;left:20px;right:20px;display:flex;align-items:center;gap:18px;pointer-events:none}
.top>*{pointer-events:auto}
.brand{display:flex;align-items:center;gap:9px;color:#fff;text-decoration:none;font-weight:800;letter-spacing:-.02em}
/* The building on show: name and place */
.building{display:flex;align-items:baseline;gap:10px;min-width:0;padding:8px 14px;border-radius:12px;background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
#name{font-size:14px;font-weight:700;white-space:nowrap}
#place{min-width:0;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#empty{display:none;position:fixed;z-index:4;inset:0;width:min(470px,calc(100% - 32px));height:fit-content;margin:auto;padding:22px 24px;border-radius:16px;background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
#empty h1{margin:0 0 8px;font-size:22px;letter-spacing:-.02em;line-height:1.2}
#empty p{margin:0 0 14px;color:var(--muted);font-size:14px}
#empty code{display:block;padding:10px 12px;border-radius:9px;background:rgba(0,0,0,.35);font:600 13px var(--mono);color:var(--gold)}
body.empty #empty{display:block}
body.empty :is(.building,.story,.timeline,.live,#moment,#pin,#leader){display:none!important}
/* ?clean: the scene alone, to compare it with a photo. ?embed: scene and timeline only */
body.embed :is(.top,.story,.live){display:none!important}
/* ?clean&caption: the scene with only the phase date and title, for recordings */
body.clean.caption .story{display:block!important;left:16px;bottom:16px;width:auto;max-width:70%;padding:10px 14px}
body.caption :is(#text,#source,#model-note){display:none!important}
body.caption #title{font-size:20px;margin:2px 0 0}
body.clean :is(.top,.timeline,.live,#moment,#pin,#leader,#labels){display:none!important}
body.clean:not(.caption) .story{display:none!important}

.live{position:fixed;top:16px;right:20px;width:220px;padding:14px 16px;border-radius:14px;background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
#live span{display:block;font:600 10px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
#live b{display:block;font-size:34px;line-height:1.1;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
#facts{list-style:none;margin:12px 0 0;padding:10px 0 0;border-top:1px solid var(--line);display:grid;gap:4px;font-size:12px;color:var(--muted)}
#facts b{color:var(--ink);font-weight:700}

.story{position:fixed;left:20px;bottom:104px;width:min(420px,calc(100% - 40px));padding:18px 20px;border-radius:16px;background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
#when{font:600 11px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--gold)}
#title{font-size:28px;line-height:1.1;letter-spacing:-.03em;margin:6px 0 8px}
#text{margin:0;color:#d7d1c8;font-size:14px}
#source{display:inline-block;margin-top:10px;font-size:11px;color:var(--muted)}
#source:hover{color:#fff}

.timeline{position:fixed;left:20px;right:20px;bottom:20px;display:flex;align-items:flex-end;gap:16px;padding:12px 18px 14px;border-radius:16px;background:var(--glass);border:1px solid var(--line);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
/* Timeline: one segment per phase (date, title, progress bar), moments as diamonds, white playhead */
#play{flex:none;display:grid;place-items:center;width:38px;height:38px;margin-bottom:-12px;border-radius:50%;background:rgba(241,184,103,.14);box-shadow:inset 0 0 0 1px rgba(241,184,103,.55);color:var(--gold)}
#play:hover{background:rgba(241,184,103,.26)}
#play svg{width:14px;height:14px;fill:currentColor}
#speed{flex:none;height:26px;min-width:46px;margin:0 -6px -6px -8px;padding:0 9px;border-radius:13px;box-shadow:inset 0 0 0 1px var(--line);font:600 11px var(--mono);color:var(--muted);font-variant-numeric:tabular-nums}
#speed:hover{color:#fff;box-shadow:inset 0 0 0 1px rgba(241,184,103,.55)}
.track{position:relative;flex:1;min-width:0}
#phases{display:flex;gap:12px;margin:0;padding:0;list-style:none}
.seg{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.seg-label{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;padding:0;text-align:left;color:var(--muted)}
.seg-date,.seg-title{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seg-date{font:600 10px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:rgba(169,163,180,.7)}
.seg-title{font-size:12px;line-height:1.25}
.seg.done .seg-title{color:#cfc8bd}
.seg.on .seg-date{color:var(--gold)}
.seg.on .seg-title{color:#fff;font-weight:700}
.seg-label:hover .seg-title{color:#fff}
.seg-bar{position:relative;height:4px;margin-top:auto;border-radius:2px;background:rgba(255,255,255,.12);cursor:pointer;touch-action:none}
.seg-bar::before{content:'';position:absolute;inset:-9px 0}
.seg-fill{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:2px;background:var(--gold)}
.seg.done .seg-fill{width:100%;background:rgba(241,184,103,.5)}
.tick{position:absolute;top:50%;z-index:1;width:8px;height:8px;margin:-4px 0 0 -4px;padding:0;transform:rotate(45deg);background:#17141f;box-shadow:0 0 0 1.5px rgba(241,184,103,.55);transition:transform .15s}
.tick::after{content:'';position:absolute;inset:-6px}
.tick.seen{background:var(--gold);box-shadow:0 0 0 1.5px var(--gold)}
.tick:hover,.tick:focus-visible{transform:rotate(45deg) scale(1.4)}
#head{position:absolute;left:0;top:0;z-index:2;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px rgba(241,184,103,.45),0 1px 4px rgba(0,0,0,.5);transform:translate(-50%,-50%);pointer-events:none}
#scrub{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
#scrub:focus-visible~#head{box-shadow:0 0 0 3px var(--gold),0 0 0 6px rgba(241,184,103,.3)}
/* Real plan labels: streets, courtyard, garden */
#labels span{position:fixed;left:0;top:0;z-index:1;font:600 10px var(--mono);letter-spacing:.12em;text-transform:uppercase;color:rgba(232,222,204,.8);text-shadow:0 1px 4px #000,0 0 2px #000;white-space:nowrap;pointer-events:none}
/* Moments: a construction detail pinned on the piece concerned */
#pin{position:fixed;z-index:2;width:16px;height:16px;margin:-8px 0 0 -8px;border-radius:50%;border:2px solid var(--gold);background:rgba(241,184,103,.25);box-shadow:0 0 0 6px rgba(241,184,103,.12);pointer-events:none;animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 12px rgba(241,184,103,.05)}}
#leader{position:fixed;z-index:2;height:1px;background:rgba(241,184,103,.7);transform-origin:0 50%;pointer-events:none}
#moment{position:fixed;z-index:3;width:270px;padding:12px 14px;border-radius:12px;background:rgba(10,12,22,.82);border:1px solid rgba(241,184,103,.45);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);animation:appear .35s ease-out}
@keyframes appear{from{opacity:0;transform:translateY(6px)}}
#m-tag{display:block;font:600 10px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--gold)}
#m-title{display:block;font-size:16px;letter-spacing:-.02em;margin:4px 0 4px}
#m-text{margin:0;font-size:13px;color:#d7d1c8}
#m-source{display:inline-block;margin-top:8px;font-size:11px;color:var(--muted)}

@media(max-height:640px) and (min-width:721px){
 .story{width:min(330px,40vw);bottom:84px;padding:12px 14px}
 #title{font-size:19px;margin:4px 0 6px}
 #text{font-size:12px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
 .live{padding:10px 12px;width:auto}
 #live b{font-size:24px}
 #facts{display:none}
 .timeline{padding:8px 14px 10px;bottom:14px}
 #play{width:34px;height:34px;margin-bottom:-10px}
 .seg{gap:6px}
 .seg-title{font-size:11px}
}
/* When a title no longer fits its segment (see fitTimeline), the timeline keeps only dates */
#phases.measure .seg-title{font-weight:700}
#phases.dates .seg-title{display:none}
#phases.dates .seg-date{white-space:normal}
@media(max-width:720px){
 #moment{width:min(230px,calc(100% - 24px));padding:10px 12px}
 #m-title{font-size:14px}
 #m-text{font-size:12px}
 .top{top:12px;left:12px;right:12px;flex-wrap:wrap;gap:10px}
 .live{top:112px;right:12px;width:auto;padding:10px 12px}
 #live b{font-size:24px}
 #facts{display:none}
 .story{left:12px;bottom:88px;width:calc(100% - 24px);padding:14px 16px}
 #title{font-size:22px}
 #text{font-size:13px}
 .timeline{left:12px;right:12px;bottom:12px;padding:12px 14px;align-items:center}
 #play{margin-bottom:0}
 #speed{margin:0 -4px 0 -6px}
 .seg-label{display:none}
 #phases{gap:4px}
 .tick{width:6px;height:6px;margin:-3px 0 0 -3px}
}
@media(prefers-reduced-motion:reduce){.tick{transition:none}}
@media(max-width:600px){.building{flex-direction:column;gap:0;padding:6px 12px}}

#model-note{font-size:10px;line-height:1.4;color:#d8bd92;border-top:1px solid var(--line);padding-top:8px;margin:8px 0 0}
.live:has(#live:empty){display:none}
/* Panels sit above the plan labels */
.story,.timeline,.live,.top,#moment{z-index:4}

/* Leave the measured scene room in medium-width preview panels. */
@media(min-width:721px) and (max-width:1100px){.story{width:calc(100% - 40px);left:20px}.top{right:216px}.live{top:16px;width:180px;padding:10px 12px}.live #facts{display:none}}
@media(min-width:1101px){.top{right:260px}}
