:root{
  --red:#e63232;
  --steel:#96c6ee;
  --ink:#0e1b2b;
  --white:#f4f6f8;
  --fade:520ms;
  --scene1:url('assets/scenes/00/shot-01.webp');
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  background:#000;color:var(--white);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  font-weight:300;overflow:hidden;
}

/* screens */
.screen{position:fixed;inset:0;display:none;align-items:center;justify-content:center}
.screen.active{display:flex}
#game.active{display:block}

/* ---- MENU (city background + zoom-in) ---- */
.menu-bg{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;
  transform:scale(1.05);transition:transform 1200ms ease-in,opacity 700ms ease;will-change:transform}
.menu-vignette{position:fixed;inset:0;pointer-events:none;
  background:radial-gradient(120% 90% at 50% 42%,rgba(0,0,0,.25) 0%,rgba(0,0,0,.55) 55%,rgba(0,0,0,.82) 100%)}
.menu-inner{position:relative;text-align:center;padding:2rem;animation:rise var(--fade) ease both;transition:opacity 600ms ease}
#menu.zooming .menu-bg{transform:scale(1.7)}
#menu.zooming .menu-inner{opacity:0}
#menu.zooming .menu-vignette{opacity:0;transition:opacity 800ms ease}
#menu.fading{opacity:0;transition:opacity 500ms ease}

.title{font-size:clamp(3.5rem,11.5vw,7.4rem);font-weight:200;letter-spacing:.1em;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:.1em;line-height:1.02;
  text-shadow:0 2px 30px rgba(0,0,0,.7)}
.title .l1{display:inline-block;border-bottom:3px solid var(--red);padding-bottom:.08em}
.title .l2{display:inline-block;border-bottom:3px solid var(--red);padding-bottom:.08em}
.title.small{font-size:clamp(1.8rem,5vw,3rem);border-bottom:none}
.subtitle{margin-top:1.2rem;letter-spacing:.3em;font-size:1rem;font-weight:700;color:#e3e9ef;text-transform:uppercase;text-shadow:0 2px 12px rgba(0,0,0,.85)}
.menu-buttons{margin-top:2.6rem;display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.btn{background:var(--red);color:#fff;border:none;padding:1.05em 3em;font-size:1.1rem;
  letter-spacing:.22em;font-weight:500;cursor:pointer;transition:transform .15s}
.btn:hover{transform:translateY(-2px)}
.disclaimer{position:fixed;left:0;right:0;bottom:2.4vh;margin:0;padding:0 1.4rem;text-align:center;
  font-size:.85rem;color:#d8dee5;letter-spacing:.05em;line-height:1.5;text-shadow:0 1px 10px rgba(0,0,0,.95)}
.to-be-continued{margin:1.4rem 0 2.2rem;color:#aab2bc;letter-spacing:.04em}

/* ---- STAGE ---- */
#stage{position:fixed;inset:0;background:#000;overflow:hidden}
#shot-img{width:100%;height:100%;object-fit:cover;opacity:0;transform:scale(1.04);
  transition:opacity var(--fade) ease, transform 6s ease-out}
#shot-img.show{opacity:1;transform:scale(1)}
#game.arriving #shot-img{animation:stepIn 1100ms ease-out both}
#scrim{display:none}

/* ---- TEXT ENCART + NAV ---- */
#textwrap{position:fixed;left:0;right:0;bottom:5.5vh;z-index:5;
  display:flex;flex-direction:row;align-items:flex-end;justify-content:center;gap:16px;
  opacity:0;transition:opacity var(--fade) ease}
#textwrap.show{opacity:1}
#textbox{position:relative;width:min(94vw,560px);padding:18px 24px;color:var(--ink);
  background:rgba(64,96,142,.9);   /* 90% opacity blue */
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  border-left:3px solid var(--red);
  clip-path:polygon(0 0,calc(100% - 22px) 0,100% 22px,100% 100%,0 100%);   /* chamfered top-right (ME) */
  box-shadow:0 22px 55px rgba(0,0,0,.55)}
#textbox::before{content:"";position:absolute;top:0;left:0;width:56%;height:3px;background:var(--red)}   /* red top rule */
#textbox::after{content:"";position:absolute;top:0;right:0;width:22px;height:22px;background:var(--red);
  clip-path:polygon(100% 0,0 0,100% 100%)}                                  /* red chamfer accent */
.hud{position:absolute;width:13px;height:13px;border:2px solid rgba(255,255,255,.6);pointer-events:none}
.hud.bl{left:9px;bottom:9px;border-top:none;border-right:none}
.hud.br{right:9px;bottom:9px;border-top:none;border-left:none}
.scan{position:absolute;left:0;top:0;width:100%;height:2px;pointer-events:none;opacity:0;
  background:linear-gradient(90deg,transparent,rgba(230,50,50,.95),transparent)}
#textwrap.show .scan{animation:scan 850ms ease-out}                          /* one red sweep per beat */

#blocks>:first-child{margin-top:0}
/* NARRATION — neutral world-voice */
.nar{font-size:clamp(.92rem,1.6vw,1.2rem);line-height:1.6;font-weight:400;color:#f4f6f8;text-shadow:0 1px 3px rgba(0,0,0,.55);text-wrap:pretty}
/* DIALOGUE — red speaker name, then the line: NOAH: "..."; inline flow so wrapped lines
   return to the LEFT margin (under the speaker name), not indented under the quote */
.dlg{margin-top:.6rem;display:block;font-size:clamp(.94rem,1.65vw,1.24rem);line-height:1.55;text-shadow:0 1px 3px rgba(0,0,0,.55);text-wrap:pretty}
.who{color:#ff5a5a;font-weight:700;font-size:.95em;letter-spacing:.04em;margin-right:.4em}
.who::after{content:":"}
.line{color:#fff}
/* THOUGHT — Faith's interior voice: cool italic, red-washed block */
.tho{margin-top:.6rem;font-style:italic;color:#eaf3fd;font-size:clamp(.96rem,1.65vw,1.24rem);line-height:1.5;text-wrap:pretty;
  padding:6px 12px;border-left:3px solid var(--red);background:rgba(230,50,50,.12);text-shadow:0 1px 3px rgba(0,0,0,.6)}
/* CHOICES — the A/B/C branch */
#choices{display:none;flex-direction:column;gap:8px;margin-top:6px}
.choice-prompt{color:#ff8a8a;font-style:italic;margin-bottom:8px;font-size:clamp(.85rem,1.4vw,1.05rem)}
.choice{display:block;text-align:left;width:100%;cursor:pointer;color:#f4f6f8;font-family:inherit;
  font-size:clamp(.86rem,1.45vw,1.08rem);line-height:1.4;
  background:rgba(255,255,255,.06);border:1px solid rgba(150,198,238,.35);border-left:3px solid var(--red);
  padding:10px 14px;transition:background .15s,border-color .15s,transform .15s;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.choice:hover{background:rgba(230,50,50,.22);border-color:var(--red);transform:translateX(3px)}
#narration:empty,#thought:empty{display:none}
.pd{visibility:hidden}
.cr{display:none;width:0;overflow:visible;color:var(--red);animation:blink .8s steps(1) infinite}

#nav{display:flex;flex-direction:column;gap:12px;align-items:center;align-self:flex-end}
.navarrow{width:56px;height:40px;color:#fff;font-size:1.4rem;line-height:1;cursor:pointer;border:none;
  background:var(--red);
  clip-path:polygon(14% 0,100% 0,86% 100%,0 100%);                          /* slanted = kinetic */
  display:flex;align-items:center;justify-content:center;transition:transform .15s,background .15s,box-shadow .15s}
.navarrow:hover{background:#ff5252;transform:translateY(-3px);box-shadow:0 6px 20px rgba(230,50,50,.55)}
.navarrow.hidden{opacity:0;pointer-events:none}
#next-btn.ready{animation:pulse 1.8s ease-in-out infinite}
/* back arrow: discrete, not red */
#back-btn{background:rgba(28,38,54,.42);color:rgba(238,242,246,.65)}
#back-btn:hover{background:rgba(28,38,54,.7);color:#fff;box-shadow:none;transform:translateY(-2px)}

/* ---- LEFT layout variant: encart pinned left, vertically centered ---- */
body[data-layout="left"] #textwrap{left:4vw;right:auto;top:0;bottom:0;justify-content:center;align-items:flex-start}
body[data-layout="left"] #textbox{width:min(42vw,470px)}
body[data-layout="left"] #nav{align-self:flex-start}

/* ---- progress / sound ---- */
#progress{position:fixed;top:2.2vh;left:0;right:0;display:flex;gap:8px;justify-content:center;z-index:6}
#progress .dot{width:26px;height:3px;background:rgba(255,255,255,.32);transition:background .3s}
#progress .dot.on{background:var(--red)}
.sound{position:fixed;z-index:7;width:44px;height:44px;border-radius:50%;
  background:rgba(10,12,15,.5);border:1px solid #5a626c;color:#e7ebef;cursor:pointer;
  display:flex;align-items:center;justify-content:center;opacity:.8;transition:opacity .2s,border-color .15s}
.sound:hover{border-color:var(--red);opacity:1}
.sound .slash{display:none}
.sound.muted .slash{display:block}
#sound-toggle{right:2vw;bottom:3vh}                  /* music (note icon) */
#sound-toggle.muted .note{opacity:.4}
#vo-toggle{right:2vw;bottom:calc(3vh + 54px)}        /* voices (speaker icon), just above the music icon */
#vo-toggle.muted .wave{display:none}

#fade{position:fixed;inset:0;background:#000;opacity:0;pointer-events:none;z-index:30;transition:opacity .6s ease}
#fade.on{opacity:1}

@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes blink{0%,50%{opacity:1}51%,100%{opacity:0}}
@keyframes stepIn{from{transform:scale(1.5);opacity:.2}to{transform:scale(1);opacity:1}}
@keyframes scan{0%{opacity:.9;top:0}85%{opacity:.5}100%{opacity:0;top:calc(100% - 2px)}}

/* ---- SCENE / SHOT LABEL (top-left HUD: spot which shot to replace) ---- */
#scene-label{
  position:fixed; top:14px; left:16px; z-index:40; pointer-events:none;
  font-family:"SFMono-Regular",ui-monospace,Menlo,Consolas,monospace;
  line-height:1.25; text-shadow:0 1px 6px rgba(0,0,0,.92);
  opacity:0; transition:opacity 400ms ease;
}
#game.active #scene-label{opacity:1; pointer-events:auto; cursor:pointer}   /* clickable -> dev scene-jump menu */

/* ---- in-game swipe/tilt hint (mobile, shown on the first scene) ---- */
#swipe-hint{
  position:fixed; left:50%; top:38%; transform:translate(-50%,-50%); z-index:9;
  display:none; opacity:0; pointer-events:none; transition:opacity .45s ease;
  padding:11px 20px; border-radius:999px; white-space:nowrap;
  background:rgba(12,16,22,.74); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  border:1px solid rgba(150,198,238,.45); box-shadow:0 8px 28px rgba(0,0,0,.55);
  color:#eaf1f8; font-size:.95rem; letter-spacing:.04em; text-shadow:0 1px 6px rgba(0,0,0,.8);
  animation:pulse 2s ease-in-out infinite;
}
#swipe-hint .sw{ color:var(--steel); font-size:1.15em; margin-right:.35em; }
#swipe-hint.show{ opacity:1; }
@media (orientation: portrait){ #swipe-hint{ display:block; } }

/* ---- DEV scene-jump drawer (remove for release) ---- */
#scene-nav-backdrop{position:fixed;inset:0;z-index:44;background:rgba(0,0,0,.45);
  opacity:0;pointer-events:none;transition:opacity .25s ease}
#scene-nav-backdrop.on{opacity:1;pointer-events:auto}
#scene-nav{position:fixed;top:0;left:0;bottom:0;z-index:45;width:min(50%,460px);
  background:rgba(12,16,22,.97);border-right:2px solid var(--red);
  transform:translateX(-100%);transition:transform .28s ease;
  overflow-y:auto;padding:18px 0;
  font-family:"SFMono-Regular",ui-monospace,Menlo,Consolas,monospace}
#scene-nav.open{transform:translateX(0)}
#scene-nav .sn-head{padding:6px 18px 12px;color:rgba(244,246,248,.5);font-size:.62rem;letter-spacing:.18em;text-transform:uppercase}
.sn-item{display:block;width:100%;text-align:left;background:none;border:none;border-left:3px solid transparent;
  cursor:pointer;padding:10px 18px;font-family:inherit}
.sn-item:hover,.sn-item.cur{background:rgba(230,50,50,.14);border-left-color:var(--red)}
.sn-item .sn-id{display:block;font-size:.82rem;font-weight:600;letter-spacing:.12em;color:var(--steel);text-transform:uppercase}
.sn-item .sn-title{display:block;font-size:.64rem;letter-spacing:.06em;margin-top:2px;color:rgba(244,246,248,.55);text-transform:uppercase}
#scene-label .sl-id{
  display:block; font-size:.82rem; font-weight:600; letter-spacing:.14em;
  color:var(--steel); text-transform:uppercase;
}
#scene-label .sl-title{
  display:block; font-size:.64rem; letter-spacing:.07em; margin-top:2px;
  color:rgba(244,246,248,.55); text-transform:uppercase;
}

/* ============ MOBILE / PORTRAIT ============ */
/* image fills the top ~64% of the screen; the text encart owns the bottom ~36%
   as its own band so it never eats into the picture. Next/back arrows sit just
   ABOVE the encart; the sound icon moves to the top-right. */
@media (orientation: portrait){
  #stage{ inset:0 0 auto 0; height:64vh; background:#000; }
  #shot-img{ width:100%; height:100%; object-fit:cover; }

  #textwrap{ left:0; right:0; top:auto; bottom:0; height:36vh;
             display:block; gap:0; padding:0; }

  #textbox{ position:absolute; left:0; right:0; bottom:0; top:48px;
            width:auto; max-width:none; margin:0; padding:16px 18px 18px;
            overflow-y:auto; clip-path:none;
            background:rgba(64,96,142,.94); box-shadow:0 -10px 30px rgba(0,0,0,.5); }
  #textbox::after{ display:none; }                 /* drop the desktop chamfer accent */

  /* nav arrows in the 48px band just above the encart */
  #back-btn, #next-btn{ position:absolute; top:4px; width:54px; height:40px; z-index:8; }
  #next-btn{ right:14px; }
  #back-btn{ left:14px; }

  /* sound icon top-right, voices icon just below it */
  #sound-toggle{ top:34px; right:14px; bottom:auto; }   /* aligned with the scene label, below the progress dashes */
  #vo-toggle{ top:86px; right:14px; bottom:auto; }

  /* bigger, comfortable reading on phones */
  .nar{ font-size:1.06rem; line-height:1.5; }
  .dlg{ font-size:1.06rem; line-height:1.45; }
  .tho{ font-size:1.04rem; }
  .line{ font-size:1.02em; }
  .choice{ font-size:1rem; padding:12px 14px; }
  .choice-prompt{ font-size:1rem; }

  /* scene label dropped below the progress dots so they don't overlap */
  #scene-label{ top:34px; left:12px; }

  /* mobile-only menu hint: teach the swipe-to-pan + tap-to-continue gestures */
  .mobile-hint{ display:flex; }

  /* keep the title lines ("MIRROR'S EDGE" / "REBORN") each on ONE line on phones */
  .title{ font-size:clamp(2.3rem,9.8vw,3.9rem); letter-spacing:.03em; }
  .title .l1, .title .l2{ white-space:nowrap; }
}

/* mobile menu hint — hidden by default (desktop), shown only in portrait above */
.mobile-hint{
  display:none; align-items:center; justify-content:center; gap:.5em; flex-wrap:wrap;
  margin-top:1.6rem; font-size:.8rem; letter-spacing:.04em; color:#cfd9e6;
  text-shadow:0 1px 8px rgba(0,0,0,.9); animation:pulse 2.4s ease-in-out infinite;
}
.mobile-hint .sw{ font-size:1.15em; color:var(--steel); }
.mobile-hint .ar{ color:var(--red); font-weight:700; }
