/* Load AFTER existing space.css/film-v3.css. This adds no floating paper card. */
.paper-print{display:none!important}
#film-paper-ink{position:fixed;left:0;top:0;width:600px;height:800px;transform-origin:0 0;z-index:5;pointer-events:none;mix-blend-mode:multiply}
#film-paper-ink[hidden]{display:none!important}
#film-paper-ink .paper-flow{width:600px;height:800px;max-width:none}
/* Desktop retains the original full-viewport cover framing throughout. */
body.film-paper-active .chapter:not(.paper-chapter) .chapter-copy{display:none!important}
body.film-paper-active .masthead{opacity:.78}
.world-vignette{opacity:calc(1 - var(--paper-focus,0))}
/* Portrait framing is an absolute-time uniform transform of the FULL native video plane. */
@media(max-width:760px) and (orientation:portrait){
 #film-paper-ink .pf-b{font-size:28px}
 #film-paper-ink .pf-h{font-size:32px}
}
/* v6 · the film is never a player: no native controls, play glyph, PiP or tap target. */
#scene-video{pointer-events:none}
#scene-video::-webkit-media-controls,#scene-video::-webkit-media-controls-panel,#scene-video::-webkit-media-controls-start-playback-button,#scene-video::-webkit-media-controls-overlay-play-button{display:none!important;-webkit-appearance:none;opacity:0}

/* Readable flow path for unavailable media, reduced motion, phone landscape or oversized text. */
body.is-flow .paper-map{background:none;background-image:none;box-shadow:none;border:0;padding:0;color:var(--ivory)}
body.is-flow .paper-map:before{display:none}
body.is-flow .paper-map h2,body.is-flow .step-detail,body.is-flow .step-note{color:var(--ivory)}
body.is-flow .paper-title,body.is-flow .step-number{color:var(--tan)}
body.is-flow #film-paper-ink{display:none!important}
body.is-flow .chapter{padding-right:max(6%,calc(env(safe-area-inset-right) + 16px));padding-left:max(6%,calc(env(safe-area-inset-left) + 16px))}
@media(prefers-reduced-motion:reduce){#film-paper-ink{display:none!important}}

/* Quiet physical return: leave only the film and the header. */
body.quiet-return .chapter-copy{opacity:0!important;visibility:hidden!important;pointer-events:none!important}

/* v6 · paper steps: the printed sheet carries the ink; a compact caption names the step so it reads on a phone. */
body:not(.is-flow) .paper-chapter{align-items:flex-end;justify-content:flex-start;padding:0 4% calc(92px + env(safe-area-inset-bottom))}
body:not(.is-flow) .paper-chapter .chapter-copy,body:not(.is-flow) .paper-chapter.active .chapter-copy{width:min(320px,26vw);max-width:none;max-height:none;transform:none;overflow:visible}
body:not(.is-flow) .paper-map{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:14px;padding:12px 16px 14px;background:#002717e0;background-image:none;color:var(--ivory);border:1px solid #d0925f59;border-radius:2px;box-shadow:0 10px 30px #00110a59}
body:not(.is-flow) .paper-map:before,body:not(.is-flow) .paper-marks{display:none}
body:not(.is-flow) .paper-title{grid-column:1;grid-row:1;margin:0 0 6px;font:13px/1.4 Naskh,serif;letter-spacing:0;color:#eae9e3b3}
body:not(.is-flow) .paper-title:after{background:#eae9e329}
body:not(.is-flow) .step-number{grid-column:2;grid-row:1;margin:0 0 6px;font:13px/1.4 Arial,sans-serif;letter-spacing:1px;color:var(--tan);gap:3px}
body:not(.is-flow) .step-number small{font-size:11px;color:#eae9e399}
body:not(.is-flow) .paper-map h2{grid-column:1/-1;font-size:21px;line-height:1.35;margin:0 0 4px;color:var(--ivory)}
body:not(.is-flow) .step-detail{grid-column:1/-1;font-size:15px;line-height:1.55;color:#eae9e3d9}
body:not(.is-flow) .step-note{grid-column:1/-1;font-size:13px;line-height:1.5;margin-top:8px;padding-top:8px;border-top-color:#eae9e333;color:#eae9e3cc}
@media(max-width:760px){
 body:not(.is-flow) .paper-chapter{padding:0 6% calc(84px + env(safe-area-inset-bottom))}
 body:not(.is-flow) .paper-chapter .chapter-copy,body:not(.is-flow) .paper-chapter.active .chapter-copy{width:100%;max-width:420px}
 body:not(.is-flow) .paper-map{padding:10px 14px 12px}
 body:not(.is-flow) .paper-map h2{font-size:18px}
 body:not(.is-flow) .step-detail{font-size:14px}
}

.partner-logo-window{height:40px;width:100%;overflow:hidden;display:flex;justify-content:center}.partner-logo-window img{width:90px!important;max-width:none!important;height:90px!important;transform:translateY(-24px)}
@media(max-width:760px){.partner-logo-window{height:28px}.partner-logo-window img{width:68px!important;height:68px!important;transform:translateY(-18px)}}
@media(max-height:480px) and (min-width:650px){.partner-logo-window{height:26px}.partner-logo-window img{width:62px!important;height:62px!important;transform:translateY(-17px)}}
@media(max-height:480px) and (min-width:650px){#film-paper-ink .pf-b{font-size:28px}#film-paper-ink .pf-h{font-size:32px}}

/* v5 paper ink: shaped Arabic outlines; the pen-edge displacement filter is skipped on phones/touch to protect frame rate. */
@media(max-width:760px),(pointer:coarse){#film-paper-ink svg g[filter]{filter:none}#film-paper-ink .pf-grain{display:none}}

/* prologue: same placement, typography and entrance as the film chapters (copy bottom-right, translateY 16px → 0).
   The copy box has a fixed height so the layout guard never trips; lines stack in the same spot and fade by time. */
.prologue .chapter-copy{position:relative;height:clamp(150px,24vh,236px);max-height:none;overflow:visible;transform:none!important}
.prologue .kicker{position:absolute;left:0;right:0;bottom:100%;margin:0 0 16px}
@media(max-width:760px){.prologue .chapter-copy{height:clamp(120px,22vh,190px)}.prologue-logo img{width:min(64vw,360px)}}
.prologue .line{position:absolute;left:0;right:0;bottom:0;margin:0;opacity:0;transform:translateY(16px);transition:opacity .5s,transform .7s;pointer-events:none}
.prologue .line.on{opacity:1;transform:none}
body.is-flow .prologue .chapter-copy{height:auto}body.is-flow .prologue .kicker{position:static}body.is-flow .prologue .line{position:static;opacity:1;transform:none;margin:0 0 .5em}
.prologue-logo{position:fixed;inset:0;z-index:14;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transition:opacity 1s ease}
.prologue-logo img{width:min(46vw,520px);height:auto;filter:drop-shadow(0 6px 40px rgba(0,0,0,.65))}
.masthead img{transition:opacity 1s ease}body.pro-logo .prologue-logo{opacity:1}body.pro-logo .masthead img{opacity:0}
body.is-flow .prologue-logo{display:none}
/* chapter 16: upcoming Riyadh events list */
.coming{list-style:none;margin:14px 0 10px;padding:0}.coming li{position:relative;padding-inline-start:18px;margin:0 0 8px;font-size:17px;line-height:1.6;color:#eae9e3ed}.coming li::before{content:'';position:absolute;inset-inline-start:0;top:.62em;width:8px;height:8px;border-radius:50%;background:var(--tan)}.coming b{color:var(--ivory);font-weight:600}
.footnote a{color:#eae9e3d9;text-decoration:none;border-bottom:1px solid #d0925f99}
@media(max-width:760px){.coming li{font-size:14px;line-height:1.5;margin-bottom:6px}.coming{margin:10px 0 8px}}

/* ===================== touches kept from v5 =====================
   Nothing here changes the film or its length: grain, word entrances, counting stats, time-of-day tint,
   pointer depth, closing pulse and chapter rail. */

/* 1 · v7: no grain or other filter over the picture — the 4K frame is shown as it is. */
.world-grain{display:none}

.chapter-copy{transition:transform .7s,opacity .6s}

/* 3 · headlines enter word by word inside the same windows (prologue lines stagger when their line turns on) */
.chapter-copy .w{display:inline-block;opacity:0;transform:translateY(.4em);transition:opacity .45s ease,transform .7s cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--i,0)*70ms)}
.chapter.active:not(.prologue) .w,.prologue .line.on .w{opacity:1;transform:none}
.chapter:not(.active) .w,.prologue .line:not(.on) .w{transition-delay:0ms;transition-duration:.25s}
body.is-flow .w{opacity:1!important;transform:none!important;transition:none!important}
.big-stat{font-variant-numeric:tabular-nums}

/* 4 · the interface follows the film's time of day: cool white in the night, sand after the dawn, neutral ivory inside */
body{--copy:var(--ivory)}
body.tod-night{--copy:#eef3fa}
body.tod-dawn{--copy:#f4e4cf}
body.tod-day{--copy:var(--ivory)}
.chapter-copy h1,.chapter-copy h2{color:var(--copy);transition:color 1.8s ease}
body:not(.is-flow) .paper-map h2{color:var(--ivory)}

/* 5 · pointer depth (desktop): the copy layer sits a few px in front of the picture */
@media(pointer:fine){body:not(.film-paper-active) .chapter.active{translate:calc(var(--px,0)*-5px) calc(var(--py,0)*-4px)}}

/* 6 · the closing: the contact call breathes (desktop) */
body.closing .call-link,body.closing .header-contact{animation:breathe 3.4s ease-in-out infinite}
@keyframes breathe{0%,100%{box-shadow:0 0 0 0 #d0925f00}50%{box-shadow:0 0 0 6px #d0925f22,0 0 28px 4px #d0925f55}}
@media(prefers-reduced-motion:reduce){body.closing .call-link,body.closing .header-contact{animation:none}}

/* 7 · chapter rail: one hairline per scene on the side opposite the copy; the current one drawn out; click to jump */
.rail{position:fixed;left:max(14px,2.2%);top:50%;z-index:16;transform:translateY(-50%);display:flex;flex-direction:column;gap:9px;margin:0;padding:0;transition:opacity .5s}
.rail button{display:block;width:22px;height:10px;padding:0;border:0;background:none;cursor:pointer;position:relative}
.rail button:before{content:'';position:absolute;left:0;top:4px;width:6px;height:2px;border-radius:1px;background:#eae9e366;transition:width .5s cubic-bezier(.2,.7,.2,1),background .5s}
.rail button:hover:before{background:#eae9e3bb}
.rail button.on:before{width:22px;background:var(--tan)}
body.film-paper-active .rail,body.is-flow .rail,body.quiet-return .rail,body.in-prologue .rail{opacity:0;pointer-events:none}
@media(max-width:760px),(max-height:480px){.rail{display:none}}

/* ===================== v6 · scroll is the only control ===================== */
/* Safe areas (iPhone notch / home indicator) added on top of the existing offsets. */
.masthead{margin:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px)}
.experience-controls{right:auto;justify-content:flex-start;gap:14px;margin:0 0 env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.experience-controls .study-label{position:static;white-space:nowrap}
@media(max-width:760px){.experience-controls{gap:8px}.experience-controls .study-label{font-size:11px}.experience-controls .restart{width:30px;height:30px;font-size:19px}}
.restart{color:var(--ivory);opacity:0;visibility:hidden;transition:opacity .4s,visibility .4s}
body.can-restart .restart{opacity:1;visibility:visible}

/* Quiet cue, bottom right: «مرّر للأسفل» with a wheel, «اسحب للأعلى» on touch; softens after the first move, gone at the end. */
.scroll-cue{position:fixed;z-index:19;right:max(4%,calc(env(safe-area-inset-right,0px) + 16px));bottom:calc(34px + env(safe-area-inset-bottom,0px));margin:0;display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.2;color:#eae9e3d9;text-shadow:0 1px 12px #00130bb3;pointer-events:none;opacity:.9;transition:opacity .9s ease,visibility .9s}
.scroll-cue i{font-style:normal;font-family:Arial,sans-serif;color:var(--tan);animation:cue-nudge 2.6s ease-in-out infinite}
@keyframes cue-nudge{0%,100%{transform:translateY(-2px)}50%{transform:translateY(3px)}}
.scroll-cue .cue-touch{display:none}
@media(hover:none) and (pointer:coarse){.scroll-cue .cue-touch{display:inline}.scroll-cue .cue-wheel{display:none}}
.scroll-cue.is-quiet{opacity:.42}.scroll-cue.is-quiet i{animation:none}
.scroll-cue.is-gone{opacity:0;visibility:hidden}
@media(max-width:760px){.scroll-cue{right:max(6%,calc(env(safe-area-inset-right,0px) + 16px));bottom:calc(30px + env(safe-area-inset-bottom,0px));font-size:13px}}
@media(max-height:650px){.scroll-cue{bottom:calc(22px + env(safe-area-inset-bottom,0px))}}
@media(prefers-reduced-motion:reduce){.scroll-cue i{animation:none}}

/* Media failure note: readable, clear of the home indicator, then steps aside so it never covers the copy. */
.fallback-note{margin-bottom:env(safe-area-inset-bottom,0px);color:var(--ivory);border:1px solid #d0925f66;animation:note-out .8s ease 9s forwards}
@keyframes note-out{to{opacity:0;visibility:hidden}}

/* Touch: no glow or drop-shadow filters over the moving picture. */
@media(pointer:coarse){
 .prologue-logo img{filter:none}
 body.closing .call-link,body.closing .header-contact{animation:none}
}

/* ===================== v7 · the whole 16:9 frame, never cropped or stretched ===================== */
/* Full scene: the frame is contained inside the world; any spare band (16:10, ultrawide) is brand green, not black. */
.world{background:var(--green)}
#scene-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:50% 50%;background:transparent}
/* Light, local readability instead of a veil: darker only where copy sits (bottom, and the right side in RTL). */
.world-vignette{background:linear-gradient(180deg,#00100a59 0,#00100a00 16%,#00100a00 52%,#00140c99 100%),linear-gradient(270deg,#00160d66 0,#00160d00 46%)}
.body-copy,.coming li,.source-link,.footnote{text-shadow:0 1px 14px #00130b99}

/* Portrait screens (phones, tablets upright): a cinematic stage — the complete 16:9 frame, full width, high in the
   view — and the copy readable beneath it on brand green. Decided by layout (aspect), never by user agent. */
@media(max-aspect-ratio:3/4){
 :root{--stage-top:calc(env(safe-area-inset-top,0px) + clamp(60px,12svh,120px));--stage-h:56.25vw;--stage-bottom:calc(var(--stage-top) + var(--stage-h))}
 #scene-video{inset:auto 0 auto 0;top:var(--stage-top);height:var(--stage-h)}
 body:not(.is-flow) .world:after{opacity:0}
 .world-vignette{inset:auto 0 auto 0;top:var(--stage-bottom);height:1px;background:#d0925f4d;opacity:calc(1 - var(--paper-focus,0))}
 .prologue-logo{inset:auto 0 auto 0;top:var(--stage-top);height:var(--stage-h)}
 .body-copy,.coming li,.source-link,.footnote{text-shadow:none}
 body:not(.is-flow) .chapter:not(.paper-chapter){align-items:flex-start;padding-top:calc(var(--stage-bottom) + 22px);padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
 body:not(.is-flow) .chapter:not(.paper-chapter) .chapter-copy{max-height:none}
 body:not(.is-flow) .chapter.prologue{padding-top:calc(var(--stage-bottom) + 52px)}
 body:not(.is-flow) .chapter.is-tall{align-items:flex-end;padding-top:calc(env(safe-area-inset-top,0px) + 60px)}
 body:not(.is-flow) .chapter.is-tall .chapter-copy{padding-top:30px;background:linear-gradient(180deg,#003b2300,#003b23f0 30px)}
 body:not(.is-flow) .partner-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
