/* Cine: standard narrator-frame cinematic player. Game palette comes in as CSS vars on .cine. */
.cine{--c-ink:#0b0f12;--c-text:#efe7d6;--c-mute:#a9b3ad;--c-accent:#d9a441;--c-tint:#0f2a2c;
  --c-display:Georgia,serif;--c-body:Georgia,serif;--c-ui:system-ui,sans-serif;--bar:clamp(28px,7vh,64px);
  position:fixed;inset:0;z-index:9999;background:#000;color:var(--c-text);overflow:hidden;
  font-family:var(--c-body);-webkit-user-select:none;user-select:none;contain:strict}
.cine *{box-sizing:border-box}
.cine-stage{position:absolute;inset:0;overflow:hidden;isolation:isolate;z-index:0}

/* shots and layers */
.cine-shot{position:absolute;inset:0;opacity:0;overflow:hidden}
.cine-shot.on{opacity:1}
.cine-layer{position:absolute;inset:-5%;background-size:cover;background-position:center;will-change:transform}
.cine-layer>i{position:absolute;inset:0;background:inherit;display:block}
.cine-layer.near>i{animation:cine-breathe 7s ease-in-out infinite alternate}
.cine-layer.mid>i{animation:cine-breathe 9s ease-in-out -3s infinite alternate}
@keyframes cine-breathe{to{transform:scale(1.008) translateY(-.25%)}}
.cine-shot.portrait .cine-layer.blur{filter:blur(28px) brightness(.45) saturate(.8);inset:-12%}
.cine-shot.portrait .cine-layer.card{inset:auto;left:50%;top:50%;width:min(52vh,70vw);aspect-ratio:1;
  transform:translate(-50%,-50%);box-shadow:0 30px 80px #000c,0 0 0 1px #fff2;background-size:cover}

/* idle fx */
.cine-fx{position:absolute;inset:0;pointer-events:none;width:100%;height:100%}
.cine-glow{position:absolute;width:var(--r,22vmin);height:var(--r,22vmin);margin:calc(var(--r,22vmin)/-2) 0 0 calc(var(--r,22vmin)/-2);
  border-radius:50%;background:radial-gradient(circle,rgba(255,190,90,.38),rgba(255,160,60,.12) 40%,transparent 70%);
  mix-blend-mode:screen;animation:cine-flicker 3.1s infinite;pointer-events:none}
@keyframes cine-flicker{0%,100%{opacity:.85}12%{opacity:.6}15%{opacity:.95}42%{opacity:.75}47%{opacity:1}70%{opacity:.8}}
.cine-rays{position:absolute;inset:-20%;pointer-events:none;mix-blend-mode:screen;opacity:.5;
  background:repeating-linear-gradient(var(--a,105deg),transparent 0 6%,rgba(255,225,170,.10) 8%,transparent 11% 17%);
  -webkit-mask:radial-gradient(ellipse at var(--o,70% 0%),#000 0,transparent 65%);mask:radial-gradient(ellipse at var(--o,70% 0%),#000 0,transparent 65%);
  animation:cine-rays 14s ease-in-out infinite alternate}
@keyframes cine-rays{to{transform:translateX(3%) rotate(1.5deg);opacity:.32}}
.cine-grain{position:absolute;inset:-50%;pointer-events:none;opacity:.10;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:cine-grain .9s steps(6) infinite}
@keyframes cine-grain{0%{transform:translate(0,0)}20%{transform:translate(-4%,3%)}40%{transform:translate(3%,-2%)}60%{transform:translate(-2%,-4%)}80%{transform:translate(4%,2%)}}
.cine-vig{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 45%,transparent 45%,rgba(0,0,0,.65) 100%)}
.cine-scan{position:absolute;inset:0;pointer-events:none;opacity:.25;background:repeating-linear-gradient(transparent 0 2px,#000 3px 4px)}

/* in-shot cards (place/time, chapter titles, overlays) */
.cine-card{position:absolute;z-index:2;left:6vw;top:calc(var(--bar) + 5vh);max-width:min(60vw,640px);opacity:0;
  transition:opacity .9s,transform .9s;transform:translateY(8px);text-shadow:0 2px 14px #000}
.cine-card.on{opacity:1;transform:none}
.cine-card::before{content:"";position:absolute;inset:-70% -40%;z-index:-1;background:radial-gradient(ellipse,rgba(0,0,0,.5),transparent 68%);pointer-events:none}
.cine-card b{display:block;font:500 clamp(22px,3.4vw,46px)/1.05 var(--c-display);letter-spacing:.01em}
.cine-card small{display:block;margin-top:.6em;font:500 clamp(11px,1.1vw,14px)/1.3 var(--c-ui);letter-spacing:.28em;text-transform:uppercase;color:var(--c-accent)}
.cine-card.cc-center{left:50%;top:50%;transform:translate(-50%,-46%);text-align:center}
.cine-card.cc-center.on{transform:translate(-50%,-50%)}
.cine-card.cc-stamp b{font:700 clamp(40px,8vw,120px)/1 var(--c-ui);letter-spacing:.04em;color:var(--c-accent);font-variant-numeric:tabular-nums}
.cine-card.cc-mono b{font:700 clamp(18px,2.6vw,34px)/1.1 "Courier Prime",ui-monospace,monospace;text-transform:uppercase;letter-spacing:.06em;color:#cfe9c8}
.cine-end .fin{font:500 clamp(10px,1vw,12px)/1 var(--c-ui);letter-spacing:.4em;text-transform:uppercase;color:var(--c-mute);text-align:center;margin-bottom:10px}
.cine-card.cc-right{left:auto;right:6vw;text-align:right}

/* standard narrator frame */
.cine-bar{position:absolute;left:0;right:0;height:var(--bar);background:#000;z-index:5;display:flex;align-items:center;padding:0 clamp(12px,3vw,40px);
  font:500 clamp(9px,.95vw,12px)/1 var(--c-ui);letter-spacing:.3em;text-transform:uppercase;color:var(--c-mute)}
.cine-bar.top{top:0;justify-content:space-between}
.cine-bar.bot{bottom:0;justify-content:flex-end;gap:6px}
.cine-bar.top::after,.cine-bar.bot::before{content:"";position:absolute;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,var(--c-accent),transparent);opacity:.45}
.cine-bar.top::after{bottom:0}.cine-bar.bot::before{top:0}
.cine-bar .lbl{color:var(--c-accent)}
.cine-btn{all:unset;cursor:pointer;padding:8px 12px;border-radius:3px;color:var(--c-text);font:500 clamp(10px,.95vw,12px)/1 var(--c-ui);letter-spacing:.2em;text-transform:uppercase;opacity:.75}
.cine-btn:hover,.cine-btn:focus-visible{opacity:1;background:#ffffff14;outline:1px solid var(--c-accent)}

.cine-subs{position:absolute;left:50%;bottom:calc(var(--bar) + 3.2vh);transform:translateX(-50%);width:min(92vw,980px);z-index:4;
  text-align:center;font:400 clamp(17px,1.85vw,27px)/1.42 var(--c-body);text-wrap:balance;text-shadow:0 1px 3px #000,0 0 22px #000c}
.cine-subs::before{content:"";position:absolute;inset:-60% -30% -40%;z-index:-1;background:radial-gradient(ellipse at 50% 60%,rgba(0,0,0,.72),rgba(0,0,0,.35) 45%,transparent 72%)}
.cine-subs span{opacity:.45;transition:opacity .25s}
.cine-subs span.on{opacity:1}
.cine-tag{position:absolute;left:clamp(12px,3vw,40px);bottom:calc(var(--bar) + 2.6vh);z-index:4;display:flex;align-items:center;gap:10px;opacity:0;
  transition:opacity .8s;font:500 clamp(9px,.9vw,11px)/1 var(--c-ui);letter-spacing:.3em;text-transform:uppercase;color:var(--c-accent)}
.cine-tag.on{opacity:.9}
.cine-tag i{display:inline-flex;gap:2px;align-items:flex-end;height:12px}
.cine-tag i b{width:2px;background:var(--c-accent);height:30%;animation:cine-eq .9s ease-in-out infinite alternate}
.cine-tag i b:nth-child(2){animation-delay:-.3s}.cine-tag i b:nth-child(3){animation-delay:-.6s}
.cine.paused .cine-tag i b{animation-play-state:paused}
@keyframes cine-eq{to{height:100%}}

/* opening sting + end */
.cine-sting{position:absolute;inset:0;z-index:6;background:#000;display:grid;place-content:center;text-align:center;transition:opacity 1.1s}
.cine-sting.out{opacity:0;pointer-events:none}
.cine-sting .rule{width:0;height:1px;margin:18px auto;background:var(--c-accent);transition:width 1.2s cubic-bezier(.2,.7,.2,1)}
.cine-sting.go .rule{width:min(46vw,420px)}
.cine-sting .game{font:500 clamp(10px,1vw,13px)/1 var(--c-ui);letter-spacing:.45em;text-transform:uppercase;color:var(--c-mute);opacity:0;transition:opacity 1s .2s}
.cine-sting .lbl{font:500 clamp(30px,5vw,68px)/1.05 var(--c-display);opacity:0;transform:translateY(6px);transition:opacity 1.1s .55s,transform 1.4s .55s}
.cine-sting .sub{font:italic 400 clamp(15px,1.6vw,22px)/1.3 var(--c-body);color:var(--c-accent);margin-top:10px;opacity:0;transition:opacity 1s .95s}
.cine-sting.go .game,.cine-sting.go .lbl,.cine-sting.go .sub{opacity:1;transform:none}
.cine-end{position:absolute;inset:0;z-index:6;background:#000;display:grid;place-content:center;gap:14px;opacity:0;pointer-events:none;transition:opacity 1.4s}
.cine-end.on{opacity:1;pointer-events:auto}
.cine-start{position:absolute;inset:0;z-index:7;display:grid;place-content:center;background:#000c}

/* ---------- style directions (A is default) ---------- */
/* B: motion comic. Shots become inked panels on paper, captions in boxes. */
.cine.th-comic{background:#ece2c8}
.cine.th-comic .cine-stage{inset:calc(var(--bar) + 2.4vh) 3.5vw;outline:6px solid #111;box-shadow:12px 12px 0 #0004;transform:rotate(-.35deg)}
.cine.th-comic .cine-grain{opacity:.0}
.cine.th-comic .cine-stage::after{content:"";position:absolute;inset:0;pointer-events:none;mix-blend-mode:multiply;opacity:.35;
  background-image:radial-gradient(#0008 1px,transparent 1.4px);background-size:5px 5px}
.cine.th-comic .cine-subs{font:700 clamp(13px,1.2vw,17px)/1.45 "Courier Prime",ui-monospace,monospace;text-transform:uppercase;color:#111;background:#f6eed5;
  border:3px solid #111;padding:10px 16px;width:min(70vw,720px);text-shadow:none;box-shadow:5px 5px 0 #111;left:auto;right:6vw;transform:none;text-align:left}
.cine.th-comic .cine-subs::before{display:none}
.cine.th-comic .cine-subs span{opacity:0}.cine.th-comic .cine-subs span.on{opacity:1}
.cine.th-comic .cine-card b{font-family:"Courier Prime",monospace;text-transform:uppercase;background:var(--c-accent);color:#111;display:inline-block;padding:6px 12px;border:3px solid #111;text-shadow:none}
/* C: duotone title-card theatre. Flattened two-ink plates, big type, hard cuts. */
.cine.th-duo .cine-layer{filter:grayscale(1) contrast(1.25) brightness(1.12)}
.cine.th-duo .cine-shot::after{content:"";position:absolute;inset:0;z-index:1;background:var(--c-tint);mix-blend-mode:color;opacity:.9;pointer-events:none}
.cine.th-duo .cine-shot::before{content:"";position:absolute;inset:0;z-index:1;background:radial-gradient(ellipse at 60% 30%,var(--c-accent),transparent 60%);mix-blend-mode:soft-light;opacity:.7;pointer-events:none}
.cine.th-duo .cine-subs{font:500 clamp(18px,2vw,30px)/1.3 var(--c-display);text-transform:none;letter-spacing:.01em}
.cine.th-duo .cine-card b{font-size:clamp(34px,6vw,92px);letter-spacing:-.01em}

/* reduced motion: no per-layer parallax, no particles, no flicker; one slow Ken Burns per shot */
.cine.still .cine-layer>i,.cine.still .cine-glow,.cine.still .cine-rays,.cine.still .cine-grain{animation:none}
.cine.still canvas.cine-fx{display:none}
@media (max-width:640px){.cine{--bar:clamp(22px,5.5vh,44px)}.cine-bar.top .game{display:none}.cine-card{left:5vw;max-width:88vw}}

/* ---------- narrator styles (one standard frame, three voices) ---------- */
/* inner: the investigator thinking in first person. Left-aligned italic, accent rule, nameplate above */
.cine.nv-inner .cine-subs{left:clamp(16px,6vw,96px);transform:none;width:min(72vw,760px);text-align:left;font-style:italic;text-wrap:pretty}
.cine.nv-inner .cine-subs::before{inset:-40% -20% -40% -10%}
.cine.nv-inner .cine-tag{left:clamp(16px,6vw,96px);top:auto;bottom:calc(var(--bar) + 3.2vh + clamp(52px,10vh,84px));font-size:clamp(10px,1vw,13px)}
.cine.nv-inner .cine-tag i{display:none}
.cine.nv-inner .cine-tag::before{content:"";width:22px;height:1px;background:var(--c-accent)}
/* archive: the case file reads itself. Typewriter strip on file paper, words type on as spoken */
.cine.nv-archive .cine-subs{font:400 clamp(14px,1.35vw,19px)/1.6 "Courier Prime",ui-monospace,monospace;text-align:left;color:#1d1b16;
  background:rgba(238,228,203,.94);text-shadow:none;padding:30px 20px 14px;width:min(80vw,840px);border-top:3px solid #8a2b22;box-shadow:0 12px 34px #000a}
.cine.nv-archive .cine-subs:empty{display:none}
.cine.nv-archive .cine-subs::before{content:"CASE FILE \00B7  27 ARMENIAN ST \00B7  ARCHIVE COPY";position:absolute;inset:8px auto auto 20px;z-index:0;background:none;
  font:700 10px/1 var(--c-ui);letter-spacing:.3em;color:#8a2b22}
.cine.nv-archive .cine-subs span{opacity:0;transition:opacity .08s}
.cine.nv-archive .cine-subs span.on{opacity:1}
.cine.nv-archive .cine-tag i b{width:6px;height:6px!important;border-radius:50%;background:#c0392b;animation:cine-rec 1s steps(2) infinite}
@keyframes cine-rec{50%{opacity:.2}}

/* shield: synchronous black cover behind the player; fades out once when the sequence (or chain) ends */
.cine.cine-shield{z-index:9998;transition:opacity .8s ease}
.cine.cine-shield.out{opacity:0;pointer-events:none}
.cine.chained .cine-end>*{display:none}

/* Portrait phones (Farid 10/11/2026): one frame serves both orientations. The 16:9 plate sits centred in a 4:3 window,
   which keeps the middle three-quarters of the picture, so faces never sit on the screen edge. Place/time cards use the
   black space above the window and subtitles the black space below it, never the picture's edges. */
@media (orientation:portrait){
  .cine{--win:min(75vw,56vh);--wy:calc(50% - 4vh)}
  .cine-stage{inset:auto 0;top:calc(var(--wy) - var(--win)/2);height:var(--win)}
  .cine-card,.cine-card.cc-right{left:7vw;right:7vw;max-width:none;top:auto;bottom:calc(100% - var(--wy) + var(--win)/2 + 22px);text-align:left}
  .cine-card::before{display:none}
  .cine-card.cc-center{left:50%;right:auto;bottom:auto;top:var(--wy);text-align:center;width:86vw}
  .cine-tag,.cine.nv-inner .cine-tag{left:7vw;bottom:auto;top:calc(var(--wy) + var(--win)/2 + 20px)}
  .cine-subs,.cine.nv-inner .cine-subs,.cine.nv-archive .cine-subs{left:7vw;right:7vw;width:auto;transform:none;bottom:auto;
    top:calc(var(--wy) + var(--win)/2 + 46px);font-size:clamp(17px,4.6vw,22px)}
  .cine-subs::before{display:none}
  .cine-shot.portrait .cine-layer.card{width:auto;height:86%}
}

/* Subtitles (Farid 10/11/2026): no black gradient behind text; a simple outline keeps every line readable on any
   picture. Same for place/time cards and the narrator tag bottom-left, which is now fully opaque. */
.cine{--c-outline:-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000,0 -1px 0 #000,0 1px 0 #000,-1px 0 0 #000,1px 0 0 #000,0 0 4px rgba(0,0,0,.8)}
.cine-subs::before,.cine.nv-inner .cine-subs::before,.cine-card::before{display:none!important}
.cine-subs,.cine-card,.cine-tag{text-shadow:var(--c-outline)}
.cine-subs span{opacity:.6}.cine-subs span.on{opacity:1}
.cine-tag.on{opacity:1}
.cine-tag{font-weight:600}

/* 11/11/2026 fade flicker on iPad: keep each shot on its own compositing layer for the whole fade */
.cine-shot{will-change:opacity;transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}
.cine-layer,.cine-layer>i{backface-visibility:hidden;-webkit-backface-visibility:hidden}
.cine-tap{margin-top:34px;font:500 clamp(11px,1.1vw,14px)/1 var(--c-ui);letter-spacing:.32em;text-transform:uppercase;color:var(--c-accent);animation:cineTap 1.6s ease-in-out infinite alternate}
@keyframes cineTap{from{opacity:.35}to{opacity:1}}

/* 14/11/2026 (Farid: aligned and centred on Mac, iPad, iPhone).
   1. A page scrollbar on Mac narrowed the fixed player by its width, so everything sat about 7 px left of centre: lock page scroll while a player is up.
   2. The app runs edge to edge (viewport-fit=cover): bars, subtitles, tag, cards and buttons now stay clear of the notch,
      Dynamic Island and home indicator. Side insets are applied symmetrically so centred items stay on the screen centre.
   3. Portrait: place/time cards and the narrator tag are centred like the picture window and subtitles. */
html:has(body>.cine){overflow:hidden}
.cine{--st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px);--sx:max(env(safe-area-inset-left,0px),env(safe-area-inset-right,0px))}
.cine-bar.top{height:calc(var(--bar) + var(--st));padding-top:var(--st)}
.cine-bar.bot{height:calc(var(--bar) + var(--sb));padding-bottom:var(--sb)}
.cine-bar{padding-left:max(clamp(12px,3vw,40px),calc(var(--sx) + 8px));padding-right:max(clamp(12px,3vw,40px),calc(var(--sx) + 8px))}
.cine-subs{bottom:calc(var(--bar) + var(--sb) + 3.2vh);width:min(calc(100vw - 2 * var(--sx) - 32px),980px)}
.cine-tag{left:max(clamp(12px,3vw,40px),calc(var(--sx) + 12px));bottom:calc(var(--bar) + var(--sb) + 2.6vh)}
.cine.nv-inner .cine-subs{left:max(clamp(16px,6vw,96px),calc(var(--sx) + 16px));width:min(calc(100vw - 2 * var(--sx) - 32px),72vw,760px)}
.cine.nv-inner .cine-tag{left:max(clamp(16px,6vw,96px),calc(var(--sx) + 16px));bottom:calc(var(--bar) + var(--sb) + 3.2vh + clamp(52px,10vh,84px))}
.cine-card{left:max(6vw,calc(var(--sx) + 16px));top:calc(var(--bar) + var(--st) + 5vh)}
.cine-card.cc-right{left:auto;right:max(6vw,calc(var(--sx) + 16px))}
.cine-card.cc-center{left:50%;top:50%}
@media (orientation:portrait){
  .cine-card,.cine-card.cc-right{left:7vw;right:7vw;top:auto;text-align:center}
  .cine-card.cc-center{left:50%;right:auto;top:var(--wy)}
  .cine-tag,.cine.nv-inner .cine-tag{left:7vw;right:7vw;justify-content:center;bottom:auto}
  .cine-subs,.cine.nv-inner .cine-subs,.cine.nv-archive .cine-subs{left:7vw;right:7vw;width:auto;bottom:auto}
  .cine.nv-inner .cine-subs{text-align:center}
  .cine-bar.bot{justify-content:center}
}
@media (max-width:640px){.cine-bar.top{justify-content:center}}
