/* ZQuran Showcase: stage, type, scene basics, overlays.
   Fonts are bundled in assets/fonts so the page works offline from file://. */

@font-face { font-family: "Inter Tight"; src: url("../assets/fonts/InterTight-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-style: normal; font-display: block; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-style: italic; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: block; }
@font-face { font-family: "Amiri Quran"; src: url("../assets/fonts/AmiriQuran.ttf") format("truetype"); font-display: block; }

:root {
  --ink: #f3ecdc;          /* warm off-white text */
  --ink-dim: rgba(243, 236, 220, 0.56);
  --gold: #d9b26a;
  --gold-soft: rgba(217, 178, 106, 0.5);
  --night: #04060a;
  --display: "Inter Tight", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --arabic: "Amiri Quran", "Geeza Pro", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: var(--ink); font-family: var(--display); -webkit-font-smoothing: antialiased; user-select: none; }
body.nocursor, body.nocursor * { cursor: none !important; }

/* The 1920×1080 stage, centred and scaled by engine.js */
#viewport { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; background: #000; }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px; margin: -540px 0 0 -960px;
  overflow: hidden; background: var(--night);
  transform-origin: 50% 50%;
}

#bg { position: absolute; inset: 0; }
#gl { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
#fx { position: absolute; inset: 0; pointer-events: none; }  /* 2D canvas overlays for bespoke moments */
#scenes { position: absolute; inset: 0; }

/* Film grain and vignette sit over everything on the stage */
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
#grain {
  position: absolute; inset: -60px; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-22px, 14px); } 40% { transform: translate(18px, -26px); }
  60% { transform: translate(-12px, 30px); } 80% { transform: translate(26px, 8px); } 100% { transform: translate(0, 0); }
}

/* Scenes: every scene fills the stage; its pieces start hidden (set in deck.js) */
.scene { position: absolute; inset: 0; pointer-events: none; }
.scene > * { position: absolute; }

/* Type */
.kicker { font-family: var(--mono); font-size: 22px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.headline { font-family: var(--display); font-weight: 600; font-size: 112px; line-height: 0.98; letter-spacing: -0.035em; }
.headline em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.big { font-family: var(--display); font-weight: 200; font-size: 260px; line-height: 0.9; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.line { font-family: var(--serif); font-style: italic; font-size: 48px; color: var(--ink-dim); }
.source { font-family: var(--mono); font-size: 15px; letter-spacing: 0.08em; color: rgba(243,236,220,0.38); }
.label { font-family: var(--mono); font-size: 18px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.arabic { font-family: var(--arabic); direction: rtl; }
.tag-test { font-family: var(--mono); font-size: 18px; letter-spacing: 0.3em; color: #000; background: var(--gold); padding: 6px 14px; }

.display { font-family: var(--display); font-weight: 600; font-size: 230px; line-height: 0.9; letter-spacing: -0.055em; }
.center { text-align: center; }
.pin { color: var(--gold); white-space: nowrap; }

/* The phone: each screenshot already has the device's rounded corners (transparent PNG). */
.phone { width: 400px; height: 883px; }
.phone::before { content: ""; position: absolute; inset: 9px; border-radius: 58px; box-shadow: 0 50px 110px rgba(0,0,0,0.7); }
.headline.sh { font-size: 100px; width: 900px !important; }
.phone .scr { position: absolute; inset: 0; width: 100%; height: 100%; }
.glow { position: absolute; left: 146px; top: 203px; width: 64px; height: 50px; border-radius: 9px;
  border: 3px solid #e9c47a; background: rgba(233,196,122,0.12); box-shadow: 0 0 34px 12px rgba(233,196,122,0.6), inset 0 0 12px rgba(233,196,122,0.5); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 16px 5px rgba(233,196,122,0.4), inset 0 0 6px rgba(233,196,122,0.3); } }
/* A finger on the screen: a soft ring that presses in (tutorials). */
.tap { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.95); background: rgba(255,255,255,0.28); box-shadow: 0 0 0 10px rgba(255,255,255,0.12), 0 8px 30px rgba(0,0,0,0.35); }
.wtile { box-shadow: 0 30px 70px rgba(0,0,0,0.55); border-radius: 30px; object-fit: cover; }
.wtile.round { border-radius: 24%; }

/* Helpers from engine.js */
.dk-w { display: inline-block; white-space: nowrap; }
.dk-c { display: inline-block; will-change: transform, opacity; }
.dk-ghost { visibility: hidden; }

/* ---------- Overlays (outside the stage, not scaled) ---------- */
.ui { font-family: var(--display); }
#flash, #black, #white { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
#flash, #black { background: #000; }
#white { background: #fff; }

#pageno {
  position: fixed; right: 22px; bottom: 16px; font-family: var(--mono); font-size: 13px;
  color: rgba(255,255,255,0.32); letter-spacing: 0.1em; pointer-events: none;
}
#jumpbox {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 40px; font-family: var(--mono); font-size: 22px;
  background: rgba(0,0,0,0.75); border: 1px solid var(--gold-soft); color: var(--ink);
  padding: 10px 16px; border-radius: 6px; display: none;
}
#progress { position: fixed; left: 0; bottom: 0; height: 3px; width: 0; background: var(--gold); display: none; transition: width 0.4s ease; }

#keytester {
  position: fixed; right: 22px; bottom: 40px; width: 300px; display: none;
  background: rgba(8,10,14,0.88); border: 1px solid rgba(255,255,255,0.14); border-radius: 8px;
  font-family: var(--mono); font-size: 14px; padding: 12px 14px; color: var(--ink);
}
#keytester h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.2em; color: var(--gold); font-weight: 500; }
#keytester .row { display: flex; justify-content: space-between; padding: 3px 0; border-top: 1px solid rgba(255,255,255,0.06); }
#keytester .row b { font-weight: 500; }
#keytester .row span { color: var(--ink-dim); }
#keytester .row.nm span { color: #e88; }

.overlay {
  position: fixed; inset: 0; display: none; background: rgba(4,6,10,0.94);
  color: var(--ink); overflow: auto; z-index: 20; cursor: default;
}
.overlay.on { display: block; }
#help .inner { max-width: 980px; margin: 60px auto; padding: 0 30px; }
#help h2, #overview h2 { font-family: var(--mono); font-weight: 500; font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin: 0 0 24px; }
#help table { width: 100%; border-collapse: collapse; font-size: 19px; }
#help td { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
#help td:first-child { font-family: var(--mono); font-size: 16px; color: var(--gold); white-space: nowrap; width: 42%; }
#help p { color: var(--ink-dim); font-size: 16px; line-height: 1.5; }

#overview .inner { padding: 40px 48px 80px; }
#overview .group { margin: 0 0 34px; }
#overview .ghead { display: flex; gap: 16px; align-items: baseline; margin: 0 0 12px; }
#overview .ghead b { font-family: var(--mono); color: var(--gold); font-weight: 500; font-size: 15px; }
#overview .ghead span { font-size: 22px; font-weight: 500; }
#overview .ghead i { font-family: var(--mono); font-style: normal; font-size: 13px; color: var(--ink-dim); }
#overview .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
#overview .tile { position: relative; aspect-ratio: 16 / 9; background: #0b0e14; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; cursor: pointer; }
#overview .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
#overview .tile .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 9px; font-family: var(--mono); font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); }
#overview .tile .empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 12px; font-size: 15px; }
#overview .tile .empty small { display: block; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
#overview .tile.cur { border-color: var(--ink-dim); }
#overview .tile.sel { outline: 3px solid var(--gold); outline-offset: 2px; }
#overview .tile .n { position: absolute; left: 8px; top: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }

#loader { position: fixed; inset: 0; display: grid; place-items: center; background: #000; z-index: 30; }
#loader i { width: 120px; height: 1px; background: rgba(255,255,255,0.12); position: relative; overflow: hidden; }
#loader i::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--gold); animation: load 1.2s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Embedded copies (presenter) and thumbnail mode: no chrome */
body.embedded #pageno, body.embedded #progress, body.embedded #keytester, body.embedded #jumpbox,
body.thumb #pageno, body.thumb #progress, body.thumb #keytester, body.thumb #jumpbox, body.thumb #grain { display: none !important; }
body.thumb #grain, body.embedded #grain { animation: none; }
