/* Progressive enhancement: without JS or with reduced motion the full static story remains. */
.cinema-stage{display:none}
.has-cinema{scroll-behavior:auto;--band:9 14 25;--cold:#060a13}
.has-cinema article{position:relative;isolation:isolate}
.has-cinema .cinema-stage{display:block;position:sticky;top:0;height:100vh;height:100lvh;margin-bottom:-100vh;margin-bottom:-100lvh;z-index:-1;overflow:hidden;overflow:clip;pointer-events:none;background:var(--cold)}

/* Film layers. Only opacity and transform change, so scrolling stays on the compositor. */
.film-layer{position:absolute;inset:0;opacity:0;overflow:hidden;overflow:clip;will-change:opacity;background:var(--cold)}
.film-01{opacity:1}
.film-frame,.film-pan{position:absolute;top:0;height:100%}
.film-base,.film-dim,.window-light,.box-temperature,.box-amber,.iris,.halo{position:absolute;inset:0}
.film-base,.window-light{background-position:center;background-size:cover;background-repeat:no-repeat}
.film-pan{left:0;aspect-ratio:1280/853;min-width:100%;will-change:transform}
.film-frame{right:0;-webkit-mask-image:linear-gradient(to right,transparent,#000 14%);mask-image:linear-gradient(to right,transparent,#000 14%)}
.iris,.halo{opacity:0;pointer-events:none}
.iris{opacity:1}

/* 01: only the phone in the dark, then its light spreads. */
.film-01 .film-frame{--x:78.7%;--y:87%;aspect-ratio:2/3}
.film-01 .film-base{background-image:url("assets/01-0214-1280.webp")}
.iris-tight-phone{background:radial-gradient(circle at var(--x) var(--y),transparent 6svh,var(--cold) 26svh)}
.iris-wide-phone{background:radial-gradient(circle at var(--x) var(--y),transparent 20svh,rgb(6 10 19/.92) 80svh)}
.phone-halo{background:radial-gradient(circle at var(--x) var(--y),#6d9ccc66 0,transparent 34svh);transform-origin:var(--x) var(--y)}
.film-read{position:absolute;left:var(--x);top:calc(var(--y) - 15svh);transform:translateX(-50%);font-size:clamp(24px,3vw,32px);letter-spacing:.42em;margin-right:-.42em;color:#dfeafa;opacity:0;white-space:nowrap}

/* 02: the camera leaves the phone while the windows light one by one. */
.film-02 .film-base,.window-light{background-image:url("assets/02-waiting-1280.webp")}
.film-02 .film-dim{background:#060b16;opacity:.8}
.window-light{opacity:0}
.window-a{-webkit-mask-image:radial-gradient(ellipse 11% 20% at 79% 30%,#000 30%,transparent);mask-image:radial-gradient(ellipse 11% 20% at 79% 30%,#000 30%,transparent)}
.window-b{-webkit-mask-image:radial-gradient(ellipse 13% 24% at 57% 28%,#000 30%,transparent);mask-image:radial-gradient(ellipse 13% 24% at 57% 28%,#000 30%,transparent)}
.window-c{-webkit-mask-image:radial-gradient(ellipse 18% 20% at 17% 24%,#000 30%,transparent);mask-image:radial-gradient(ellipse 18% 20% at 17% 24%,#000 30%,transparent)}

/* 03: blue room to amber light around the box. */
.film-03 .film-pan{transform-origin:57% 62%}
.film-03 .film-base{background-image:url("assets/03-tarot-box-1280.webp")}
.box-temperature{background:#0e1c38;opacity:.68}
.box-amber{background:radial-gradient(ellipse 34% 52% at 58% 62%,#e2a64e70,transparent);opacity:0}

/* 04: the card comes out of the dark. */
.film-04{background:#070c16}
.film-card-art{position:absolute;top:8svh;right:13%;height:49svh;max-height:550px;aspect-ratio:2/3;background:url("assets/04-hanged-man-1280.webp") center/103.5% 102.3% no-repeat;opacity:0;will-change:opacity,transform}
.card-halo{background:radial-gradient(ellipse 34% 52% at calc(87% - 16.3svh) 32.5svh,#c49c4f42,transparent);transform-origin:75% 32%}

/* 05: the lamp comes on first, then the reception opens around it. */
.film-05{background:#0a0d14}
.film-05 .film-frame{--x:92%;--y:29.5%;left:50%;right:auto;transform:translateX(-50%);aspect-ratio:941/1672;-webkit-mask-image:none;mask-image:none}
.film-05 .film-base{background-image:url("assets/05-portrait-1280.webp");transform-origin:var(--x) var(--y)}
.iris-tight-lamp{background:radial-gradient(circle at var(--x) var(--y),transparent 5svh,#070b14 30svh)}
.iris-wide-lamp{background:radial-gradient(circle at var(--x) var(--y),transparent 24svh,rgb(7 11 20/.96) 95svh)}
.lamp-halo{background:radial-gradient(circle at var(--x) var(--y),#ffbf6250 0,transparent 30svh)}
@media(min-aspect-ratio:3/5){
 .film-05 .film-frame{--x:94.3%;--y:29%;left:auto;right:0;transform:none;aspect-ratio:1;-webkit-mask-image:linear-gradient(to right,transparent,#000 14%);mask-image:linear-gradient(to right,transparent,#000 14%)}
 .film-05 .film-base{background-image:url("assets/05-reception-1280.webp")}
}

/* Holds use CSS sticky: no pin spacer, no jump on phones. */
.has-cinema .hero-hold{height:190svh}
.has-cinema .hero{position:sticky;top:0;height:100svh;min-height:0;max-height:none;background:transparent;border-color:transparent}
.has-cinema .hero-art{opacity:0}
.has-cinema .hero-copy,.has-cinema .read-cue{z-index:1}
.has-cinema .hero-copy{will-change:opacity,transform}
.has-cinema .turning-hold{height:calc(75svh + 230px);margin-top:70px}
.has-cinema .turning-point{position:sticky;top:62svh;z-index:0;width:calc(100% - 60px);max-width:850px;margin:0 auto;border-color:transparent}
.has-cinema .turning-point::before{content:"";position:absolute;z-index:-1;inset:-70px calc(50% - 50vw);background:linear-gradient(to bottom,transparent,rgb(7 12 22/.9) 70px,rgb(7 12 22/.9) calc(100% - 70px),transparent)}

/* Text sits on a soft band: the picture fades behind it, with no box edge.
   Bands use z-index -1 in the article context, so every band stays under every line of text. */
.has-cinema .chapter,.has-cinema .chapter-question,.has-cinema .chapter-learning,.has-cinema .chapter-light{background:transparent}
.has-cinema .chapter-light{--band:17 15 15}
.has-cinema .prose{position:relative;width:570px;max-width:calc(100% - 56px);padding:30px;margin-left:7vw;margin-right:auto}
.has-cinema .prose::before{content:"";position:absolute;z-index:-1;inset:-110px -190px -110px -7vw;background:rgb(var(--band)/.9);-webkit-mask-image:linear-gradient(to bottom,transparent,#000 100px,#000 calc(100% - 100px),transparent),linear-gradient(to right,#000 70%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(to bottom,transparent,#000 100px,#000 calc(100% - 100px),transparent),linear-gradient(to right,#000 70%,transparent);mask-composite:intersect}
.has-cinema .chapter-question .prose:last-child{padding-bottom:30px}

/* The figures become scroll distance; the stage shows the picture. Their alt text stays. */
.has-cinema .scene,.has-cinema .card-scene{position:relative;width:100%;max-width:none;margin:0;transform:none;opacity:1}
.has-cinema .scene-offset{height:125svh}
.has-cinema .scene-wide{height:115svh}
.has-cinema .card-scene{height:105svh}
.has-cinema .scene-reception{height:135svh}
.has-cinema .scene img,.has-cinema .card-scene img{position:absolute;inset:0;width:100%;height:100%;opacity:0}
.has-cinema .card-scene figcaption{position:absolute;opacity:0}
.has-cinema .signature{position:relative;width:max-content;margin:60px 0 0 calc(7vw + 30px);padding:0}
.has-cinema .signature::before{content:"";position:absolute;z-index:-1;inset:-70px -110px;background:radial-gradient(closest-side,rgb(var(--band)/.88) 55%,transparent)}
.has-cinema .invitation,.has-cinema .footer{position:relative;z-index:2}
.has-cinema .invitation{border-top:0}
.has-cinema .invitation::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:130px;background:linear-gradient(to bottom,transparent,#25211d);pointer-events:none}
.has-cinema .footer{max-width:none;background:#0c1422;padding-left:max(30px,calc((100vw - 790px)/2));padding-right:max(30px,calc((100vw - 790px)/2))}

@media(max-width:899px){
 .film-read{font-size:24px}
 .film-card-art{top:8svh;right:auto;left:50%;height:45svh;max-height:430px;margin-left:calc(min(30svh,286.7px)/-2)}
 .card-halo{background:radial-gradient(ellipse 60% 34% at 50% 30svh,#c49c4f42,transparent);transform-origin:50% 30%}
 .has-cinema .prose{width:calc(100% - 44px);max-width:540px;padding:24px 0;margin-left:auto;margin-right:auto}
 .has-cinema .prose::before{inset:-90px calc(50% - 50vw);background:linear-gradient(to bottom,transparent,rgb(var(--band)/.9) 90px,rgb(var(--band)/.9) calc(100% - 90px),transparent);-webkit-mask-image:none;mask-image:none}
 .has-cinema .turning-hold{height:calc(70svh + 180px)}
 .has-cinema .turning-point{width:calc(100% - 32px);padding:24px 0}
 .has-cinema .signature{margin:50px auto 0}
}
@media(max-width:374px){
 .has-cinema .prose{width:calc(100% - 36px)}
}

/* Constrained devices: scene changes still follow the scroll; layered light is dropped. */
.motion-lite .window-light,.motion-lite .halo,.motion-lite .box-amber{display:none}
.motion-lite .film-pan,.motion-lite .film-card-art,.motion-lite .film-layer{will-change:auto}
@media(prefers-reduced-motion:reduce){.cinema-stage{display:none!important}}
