:root { --bg: #030202; --accent: #e8772e; }
html { background: var(--bg); }
section { min-height: 170lvh; justify-content: flex-start; padding-top: 14lvh; }
section:first-child { justify-content: flex-start; padding-top: 14lvh; padding-bottom: 0; }
section:last-child { min-height: 130lvh; justify-content: flex-start; padding-top: 14lvh; padding-bottom: 0; }
/* No words on screen until the act card: chapter text stays in the page for screen
   readers and scroll length, but is not drawn. */
section > * { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hud-ch, .stat, .bar { display: none; }
.act { position: fixed; inset: 0 auto 0 0; width: min(46vw, 34rem); z-index: 3; display: grid; align-content: center; justify-items: start; gap: .9rem; padding-left: clamp(1.25rem, 6vw, 5rem); pointer-events: none; opacity: 0; color: #f1e9da; }
@media (max-aspect-ratio: 4/5) { .act { width: 100%; align-content: start; padding-top: 18lvh; } }
.act span { font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .7rem; letter-spacing: .42em; text-transform: uppercase; color: var(--accent); }
.act b { font-family: "Newsreader", Georgia, serif; font-weight: 400; font-style: italic; font-size: clamp(2.4rem, 7vw, 5.2rem); line-height: 1; letter-spacing: -0.01em; }
.act::after { content: ""; width: 3.5rem; height: 1px; background: var(--accent); opacity: .7; }
/* Size the scene to the small (always visible) viewport so Safari's toolbars never
   cover it; when they collapse, the strip below is the same black as the floor. */
.sea { height: 100svh; }
/* A final held shot, then the invitation on a real, scrollable end slate. */
.finale { position: relative; z-index: 4; min-height: 76svh; display: grid; place-items: center; padding: 4.5rem 1.2rem max(3rem, env(safe-area-inset-bottom)); text-align: center; color: #f1e9da; background: #070405; }
.finale::before { content: ""; position: absolute; inset: auto 0 100%; height: min(12svh, 5rem); background: linear-gradient(transparent, #070405); pointer-events: none; }
.finale-inner { width: min(100%, 30rem); }
.finale-inner::before { content: ""; display: block; height: 1px; width: 3.5rem; margin: 0 auto 1.6rem; background: rgba(143,205,179,.42); }
.finale-k { margin: 0 0 .7rem; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .7rem; letter-spacing: .42em; text-transform: uppercase; color: #8fcdb3; }
.finale h2 { margin: 0; font-family: "Newsreader", Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.01em; }
.finale-sub { margin: .6rem 0 1.4rem; font-size: 1rem; color: rgba(241,233,218,.7); }
.finale-btn { display: inline-block; padding: .85rem 1.6rem; border: 1px solid #8fcdb3; color: #8fcdb3; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; transition: background .3s, color .3s; }
.finale-btn:hover, .finale-btn:focus-visible { background: #8fcdb3; color: #030202; }
/* The cut between sets: a dip through black, with the act card on it. */
.dip { position: fixed; inset: 0; z-index: 2; background: #000; opacity: 0; pointer-events: none; }
.finale-lead { margin: 0 auto 1rem; max-width: 26rem; font-size: .95rem; line-height: 1.5; color: rgba(241,233,218,.7); }
.finale-route { display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem clamp(.5rem, 4vw, 1.4rem); margin-top: .9rem; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; }
.finale-route a { color: rgba(241,233,218,.6); text-decoration: none; border-bottom: 1px solid rgba(232,119,46,.6); padding: .9rem .2rem; min-height: 44px; }
.finale-route a:hover, .finale-route a:focus-visible { color: #f1e9da; }
/* For return visitors only (set once the film has been seen). */
.skip { position: fixed; z-index: 5; top: 1.1rem; right: clamp(1rem, 5vw, 3rem); display: none; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(241,233,218,.6); text-decoration: none; }
.seen .skip { display: block; }
.skip:hover, .skip:focus-visible { color: #f1e9da; }
/* Focus: a tower's words in the city, or the file on the table. Scroll holds. */
.focused, .focused body { overflow: hidden; }
.focused .finale { visibility: hidden; }
.focused .act { opacity: 0 !important; pointer-events: none !important; }
.panel { position: fixed; z-index: 6; left: clamp(1rem, 6vw, 5rem); top: 50%; transform: translateY(-46%); width: min(88vw, 27rem); color: #f1e9da; opacity: 0; transition: opacity .7s ease .35s, transform .9s ease .3s; pointer-events: none; }
.panel.on { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
@media (max-aspect-ratio: 4/5) { .panel { left: 50%; top: auto; bottom: 1.5rem; transform: translate(-50%, 4%); width: min(92vw, 27rem); } .panel.on { transform: translate(-50%, 0); } }
.panel-k { margin: 0 0 .6rem; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .66rem; letter-spacing: .42em; text-transform: uppercase; color: #e8772e; }
.panel-h { margin: 0 0 1.1rem; font-family: "Newsreader", Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1; }
.panel-body p { margin: 0 0 .9rem; font-family: "Newsreader", Georgia, serif; font-size: 1.05rem; line-height: 1.55; color: rgba(241,233,218,.86); text-shadow: 0 1px 12px rgba(0,0,0,.9); }
.panel-stance { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(232,119,46,.6); font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: clamp(1.3rem, 4.4vw, 1.75rem); line-height: 1.2; }
.panel-nav, .dossier-nav { display: flex; gap: 1.2rem; align-items: center; margin-top: 1.6rem; }
.panel-nav button, .dossier-back { background: none; border: 0; padding: .3rem 0; cursor: pointer; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(241,233,218,.65); border-bottom: 1px solid rgba(232,119,46,.6); }
.panel-next { color: #f1e9da !important; }
.panel-nav button:hover, .panel-nav button:focus-visible, .dossier-back:hover, .dossier-back:focus-visible { color: #fff; }
/* The file on the table, filled in: paper, typewriter fields, the green way in. */
.dossier { position: fixed; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -46%) rotate(-1.2deg); width: min(90vw, 24rem); max-height: 92svh; overflow: auto; padding: 1.4rem 1.4rem 1.2rem; background: #e9dfcc; color: #1a1412; box-shadow: 0 30px 80px rgba(0,0,0,.6); opacity: 0; transition: opacity .6s ease .5s, transform .9s ease .45s; pointer-events: none; }
.dossier::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2.4rem; background: #b9ad98; z-index: -1; }
.dossier.on { opacity: 1; transform: translate(-50%, -50%) rotate(-1.2deg); pointer-events: auto; }
.dossier-k { margin: 0 0 1.1rem; font-family: "Familjen Grotesk", system-ui, sans-serif; font-weight: 600; font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; }
.dossier-h { margin: 0 0 1rem; padding-bottom: .6rem; border-bottom: 2px solid #1a1412; font-family: "Newsreader", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.9rem; line-height: 1.05; }
.dossier label { display: block; margin: 0 0 .9rem; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; }
.dossier .opt { letter-spacing: .08em; text-transform: none; color: rgba(26,20,18,.55); }
.dossier input, .dossier textarea { display: block; width: 100%; margin-top: .3rem; padding: .35rem 0; border: 0; border-bottom: 1px solid rgba(26,20,18,.5); background: transparent; color: #1a1412; font: 1rem/1.4 "Courier New", ui-monospace, monospace; border-radius: 0; resize: vertical; }
.dossier input:focus, .dossier textarea:focus { outline: none; border-bottom-color: #2f7a5c; }
.dossier .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dossier-msg { min-height: 1.2em; margin: 0; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .78rem; color: #8a2a12; }
.dossier-send { padding: .75rem 1.3rem; border: 1px solid #2f7a5c; background: #2f7a5c; color: #e9dfcc; cursor: pointer; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; }
.dossier-send:hover, .dossier-send:focus-visible { background: #1f5a42; }
.dossier-send:disabled { opacity: .6; }
.dossier-back { color: rgba(26,20,18,.6); border-bottom-color: rgba(26,20,18,.4); }
.dossier-back:hover, .dossier-back:focus-visible { color: #1a1412; }
.dossier-done p { margin: 0 0 .6rem; font-family: "Newsreader", Georgia, serif; font-size: 1.05rem; line-height: 1.5; }
.dossier.sent label, .dossier.sent .dossier-send { display: none; }
.panel::before { content: ""; position: absolute; inset: -2.5rem -3rem; z-index: -1; background: radial-gradient(closest-side, rgba(3,2,2,.78), rgba(3,2,2,.45) 60%, rgba(3,2,2,0)); }
/* The entrance: black, the name, the line filling, then Enter. */
.gated, .gated body { overflow: hidden; }
.gate { position: fixed; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 1.1rem; background: #030202; color: #f1e9da; transition: opacity 1.4s ease; }
.entered .gate { opacity: 0; pointer-events: none; }
.gate-mark { margin: 0; font-family: "Familjen Grotesk", system-ui, sans-serif; font-weight: 600; font-size: .95rem; letter-spacing: -.02em; }
.gate-k { margin: 0; font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1; }
.gate-line { width: min(60vw, 16rem); height: 1px; background: rgba(232,119,46,.2); overflow: hidden; }
.gate-line i { display: block; height: 100%; background: #e8772e; transform: scaleX(0); transform-origin: left; }
.gate-enter { margin-top: .6rem; padding: .7rem 1.6rem; background: none; border: 1px solid rgba(241,233,218,.5); color: #f1e9da; font-family: "Familjen Grotesk", system-ui, sans-serif; font-size: .74rem; letter-spacing: .32em; text-transform: uppercase; cursor: pointer; opacity: 0; transition: opacity .9s ease, background .3s, color .3s; }
.ready .gate-enter { opacity: 1; }
.gate-enter:hover, .gate-enter:focus-visible { background: #f1e9da; color: #030202; }

/* The complete reading cut is available before JavaScript, without WebGL,
   or when the visitor requests reduced motion. No stage or modal traps focus. */
.gate-read { color: #f1e9da; font: .8rem system-ui, sans-serif; text-underline-offset: .3em; padding: .5rem; }
.finale-secondary { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.1rem; margin-top: 1.4rem; font: .72rem system-ui, sans-serif; }
.finale-secondary a { color: #d4cabc; display: inline-grid; align-items: center; min-height: 44px; text-underline-offset: .25em; }
:is(.ready,.direct-entry:not(.static-film)) .story-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.ready):not(.direct-entry:not(.static-film)) body { background: #080506; color: #f1e9da; overflow: auto; }
html:not(.ready):not(.direct-entry:not(.static-film)).gated { overflow: auto; }
html:not(.ready):not(.direct-entry:not(.static-film)) :is(.gate,.sea,.dip,.act,.skip) { display: none; }
html.no-gl body::before { display: none; }
html:not(.ready):not(.direct-entry:not(.static-film)) main { display: block; width: min(100%, 60rem); padding: clamp(1.3rem,5vw,3rem); margin: 0 auto; pointer-events: auto; }
html:not(.ready):not(.direct-entry:not(.static-film)) .story-title { width: min(100%, 60rem); margin: 0 auto; padding: clamp(1.3rem,5vw,3rem) clamp(1.3rem,5vw,3rem) 0; font: italic 400 clamp(3rem, 10vw, 6rem)/1 Georgia, serif; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section { display: block; min-height: auto; margin: 0 0 1.1rem; padding: clamp(1.2rem,4vw,2.8rem); border: 1px solid #483124; background: #110b0b; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section > * { position: static; width: auto; height: auto; clip: auto; white-space: normal; overflow: visible; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section h2 { margin: .35rem 0 .6rem; font: italic 400 clamp(1.8rem,5vw,3.2rem)/1.02 Georgia, serif; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section p { max-width: 38rem; line-height: 1.55; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section .k { color: #f2a56e; letter-spacing: .16em; }
html:not(.ready):not(.direct-entry:not(.static-film)) main section[class^="still-"] { padding-top: clamp(8rem, 30vw, 20rem); background-image: linear-gradient(transparent 0%, #110b0b 86%), var(--still); background-size: 100% 100%, cover; background-position: top, center; }
.still-ridge { --still: url('/lab/room/art/bg/ridge-mid.jpg'); }
.still-plan { --still: url('/lab/room/art/set/plan-wall.jpg'); }
.still-cris { --still: url('/lab/room/art/bg/dealership.jpg'); }
.still-louie { --still: url('/lab/room/art/bg/home-street.jpg'); }
.still-skyline { --still: url('/lab/room/art/bg/downtown-far.jpg'); }
.dossier input[aria-invalid="true"] { border-color: #9a351e; }
.dossier [tabindex="-1"]:focus { outline: 0; }

.opening-titles { display:none; }
:is(.ready,.direct-entry:not(.static-film)) .opening-titles {
  display:block; position:fixed; left:clamp(1.45rem,7vw,7.5rem); bottom:clamp(2.2rem,10svh,7.8rem);
  z-index:3; pointer-events:none; text-shadow:0 3px 40px #0008; color:#f7e8d5;
}
.opening-titles p, .opening-titles em {
  color:#f3d1b9; text-transform:uppercase; font:600 .63rem/1.35 system-ui,sans-serif; letter-spacing:.29em; margin:0;
}
.opening-titles strong { display:block; font:italic 400 clamp(3.4rem,11vw,10rem)/.74 Georgia,serif; letter-spacing:-.075em; margin:.25em 0 .22em; }
.opening-titles strong span { color:#f2a263; }
.opening-titles em { color:#e3a77f; font-size:.57rem; }
@media (max-aspect-ratio:4/5) {
  :is(.ready,.direct-entry:not(.static-film)) .opening-titles { left:clamp(1.45rem,7vw,3.5rem); bottom:auto; top:clamp(2.5rem,13svh,7.5rem); }
  .opening-titles strong { font-size:clamp(3.8rem,14.5vw,6.1rem); }
}

/* The first frame is the film, not a loading dialog. HTML and the responsive still
   appear first, then the matched WebGL frame takes over without moving the layout. */
.entry-poster,.entry-controls { display:none; }
.direct-entry:not(.static-film) .gate { display:none; }
.direct-entry:not(.static-film) .entry-poster {
  display:block; position:fixed; z-index:1; inset:0 0 auto; width:100%; height:100svh;
  opacity:1; pointer-events:none; transition:opacity .44s ease;
}
.entry-poster img { display:block; width:100%; height:100%; object-fit:cover; object-position:50% 50%; }
.direct-entry.scene-live:not(.static-film) .entry-poster { opacity:0; }
.direct-entry:not(.static-film) .sea { opacity:1; transition:none; }
.direct-entry:not(.static-film):not(.ready) body { overflow:visible; }
.direct-entry:not(.static-film):not(.ready) main { width:auto; padding:0; margin:0; }
.direct-entry:not(.static-film):not(.ready) main section,.direct-entry:not(.static-film):not(.ready) .story-title { opacity:0; }
.direct-entry:not(.static-film) .opening-titles { display:block; }
.direct-entry:not(.static-film) .entry-controls {
  position:fixed; right:clamp(1.1rem,5vw,5rem); bottom:max(1.4rem,env(safe-area-inset-bottom));
  z-index:5; display:grid; justify-items:end; gap:.25rem; font-family:system-ui,sans-serif;
  transition:opacity .25s ease, visibility .25s ease;
}
.direct-entry.left-entry .entry-controls { opacity:0; visibility:hidden; pointer-events:none; }
.entry-follow {
  display:inline-flex; gap:1.05rem; align-items:center; min-height:46px; padding:.45rem .52rem .45rem .9rem;
  text-decoration:none; border:1px solid #efbb9080; border-radius:2px; background:#151015a0; color:#fff1e2;
  text-transform:uppercase; font-size:.62rem; font-weight:700; letter-spacing:.18em; box-shadow:0 8px 35px #08050750;
}
.entry-follow i {
  display:grid; width:29px; height:29px; place-items:center; font:normal 1.2rem/1 Georgia,serif;
  background:#e7a478; color:#1e1215;
}
.entry-follow:hover,.entry-follow:focus-visible { background:#3b2428; border-color:#ffe1c2; }
.entry-follow:focus-visible,.entry-read:focus-visible { outline:2px solid #ffe0bc; outline-offset:3px; }
.entry-read { display:inline-flex; align-items:center; min-height:32px; color:#efcaaf; text-underline-offset:.24em; font-size:.65rem; }
@media (max-aspect-ratio:4/5) {
  .direct-entry:not(.static-film) .entry-controls { bottom:max(.75rem,env(safe-area-inset-bottom)); }
}
