:root {
  --bg: #06080E;
  --red: #EA443E;
  --red-hot: #FF5A4E;
  --white: #F8FAFC;
  --soft: #DCE3EE;
  --muted: #94A3B8;
  --dim: #4B5568;
  --display: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --body: Raleway, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--white);
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; touch-action: none; cursor: default; }
#app.idle { cursor: none; }
#app.scrubbing { cursor: grabbing; }
#particles, #sky, #overlay { position: absolute; left: 0; top: 0; display: block; }
#overlay, #sky { pointer-events: none; }
#sky { mix-blend-mode: screen; }
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 50% 50%, rgba(6, 8, 14, 0) 55%, rgba(3, 4, 8, 0.72) 100%);
}

/* ── the 1920×1080 composition stage (scaled to fit) */
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; pointer-events: none;
}
.scene { position: absolute; inset: 0; }
.scene > * { position: absolute; }

/* ── kinetic typography */
.cap { color: var(--white); font-family: var(--display); white-space: normal; }
.cap .w { display: inline-block; will-change: transform, opacity, filter; }
.cap .em { color: var(--red-hot); }
.headline { font-size: 68px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.14; }
.headline.light { font-weight: 300; color: var(--soft); }
.headline.xl { font-size: 92px; }
.headline.md { font-size: 54px; }
.statement { font-size: 40px; font-weight: 400; line-height: 1.32; letter-spacing: -0.01em; color: var(--soft); }
.statement.sm { font-size: 32px; }
.label {
  font-family: var(--body); font-size: 15px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted);
}
.label.wide { letter-spacing: 0.55em; font-size: 16px; color: var(--soft); }
.label.red { color: var(--red-hot); }
.body { font-family: var(--body); font-size: 21px; font-weight: 500; line-height: 1.55; color: var(--muted); }

/* generic positioned stage text (scene-managed) */
.t { color: var(--white); font-family: var(--display); }
.t.k { font-family: var(--body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3em; font-size: 14px; color: var(--muted); }
.t.k.red { color: var(--red-hot); }
.t.title { font-size: 54px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.t.lede { font-family: var(--body); font-size: 24px; font-weight: 500; color: var(--soft); line-height: 1.45; }
.t.small { font-family: var(--body); font-size: 16px; font-weight: 500; color: var(--muted); line-height: 1.45; }
.t.num { font-size: 72px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.t.mid { font-size: 30px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.t.it { font-family: var(--body); font-style: italic; font-weight: 500; font-size: 22px; color: var(--muted); }
.t sup.v { font-size: 0.4em; color: var(--muted); vertical-align: top; margin-left: 0.15em; }
.rule { display: block; width: 44px; height: 2px; background: var(--red); margin-bottom: 18px; }

/* ── gallery */
.case {
  width: 500px; height: 280px; padding: 26px 30px 24px;
  pointer-events: auto; cursor: default;
  border-top: 1px solid rgba(220, 227, 238, 0.18);
  background: linear-gradient(180deg, rgba(220, 227, 238, 0.045), rgba(220, 227, 238, 0) 70%);
  transition: background 0.4s ease, border-color 0.4s ease;
  display: flex; flex-direction: column;
}
.case.open { cursor: pointer; border-top-color: rgba(234, 68, 62, 0.75); }
.case.open:hover { background: linear-gradient(180deg, rgba(234, 68, 62, 0.12), rgba(234, 68, 62, 0) 75%); }
.case .logo { height: 44px; display: flex; align-items: center; margin-bottom: 18px; }
.case .logo img { max-height: 40px; max-width: 220px; filter: brightness(0) invert(1); opacity: 0.92; }
.case .logo .wm { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.02em; color: var(--white); }
.case h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.3; letter-spacing: -0.01em; color: var(--white); }
.case .meta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.case .path { font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red-hot); }
.case .go { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.case.open .go::after { content: ' →'; color: var(--red-hot); }
.case.pending .go { color: #6B778C; font-size: 12px; letter-spacing: 0.04em; }
.case.pending h3 { color: var(--soft); }

/* ── TAQA */
.bubble {
  font-family: var(--display); font-size: 44px; font-weight: 600; color: var(--white);
  padding: 22px 34px; border-radius: 28px 28px 28px 6px;
  border: 1px solid rgba(220, 227, 238, 0.35);
  background: rgba(220, 227, 238, 0.05);
  white-space: nowrap;
}
.status {
  font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--soft); display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 10px currentColor; }
.status[data-k="completed"] i { background: #8FD3A8; color: #8FD3A8; }
.status[data-k="planned"] i { background: var(--red-hot); color: var(--red-hot); }
.status[data-k="illustrative"] i { background: var(--soft); color: var(--soft); }
.status[data-k="published"] i { background: #8FD3A8; color: #8FD3A8; }
.status[data-k="project"] i { background: transparent; border: 1px solid #8FD3A8; color: #8FD3A8; }
.status[data-k="chiefos"] i { background: #8FD3A8; color: #8FD3A8; }
.status[data-k="reconstructed"] i, .status[data-k="concept"] i { background: transparent; border: 1px dashed var(--muted); color: transparent; }
.status[data-k="reference"] i, .status[data-k="staging"] i { background: transparent; border: 1px solid #8FD3A8; color: #8FD3A8; }
.status[data-k="approach"] i { background: var(--red-hot); color: var(--red-hot); }
.status[data-k="future"] i { background: transparent; border: 1px solid var(--muted); color: transparent; }
.chip { font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.footnote { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--dim); letter-spacing: 0.04em; }

/* ── presenter UI */
#ui { position: absolute; inset: 0; pointer-events: none; font-family: var(--body); }
#ui > * { pointer-events: auto; }
.ui-fade { opacity: 0; transition: opacity 0.6s ease; }
#app.awake .ui-fade, .ui-fade:hover, .ui-fade:focus-within { opacity: 1; }
.progress { position: absolute; left: 24px; right: 24px; bottom: 18px; height: 14px; display: flex; gap: 6px; align-items: center; pointer-events: none !important; }
.progress .seg { position: relative; height: 2px; background: rgba(148, 163, 184, 0.18); border-radius: 2px; overflow: hidden; }
.progress .seg i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); width: 0; }
.where { position: absolute; left: 26px; bottom: 40px; font-size: 11px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); pointer-events: none !important; }
.where b { color: var(--red-hot); font-weight: 700; margin-right: 10px; }
.btns { position: absolute; right: 20px; bottom: 34px; display: flex; gap: 6px; }
.btn {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  transition: color 0.3s, background 0.3s;
}
.btn:hover, .btn.on { color: var(--white); background: rgba(220, 227, 238, 0.07); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.back {
  position: absolute; left: 22px; top: 20px; appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--soft); font: 600 12px var(--body); letter-spacing: 0.26em; text-transform: uppercase; padding: 10px 12px;
  display: none; align-items: center; gap: 10px;
}
.back.show { display: flex; }
.back:hover { color: var(--white); }
.back span { color: var(--red-hot); font-size: 16px; letter-spacing: 0; }
.hint { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); font-size: 11px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); pointer-events: none !important; transition: opacity 1.2s ease; display: flex; gap: 14px; align-items: center; }
.hint kbd { font: inherit; border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 4px; padding: 3px 7px; letter-spacing: 0; }
.hint.gone { opacity: 0; }

.nav-panel {
  position: absolute; right: 20px; bottom: 84px; width: 340px; max-height: calc(100% - 120px); overflow: auto;
  background: rgba(10, 13, 21, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 14px; padding: 10px;
  opacity: 0; transform: translateY(8px); pointer-events: none !important; transition: opacity 0.3s, transform 0.3s;
}
.nav-panel.show { opacity: 1; transform: none; pointer-events: auto !important; }
.nav-panel h4 { margin: 8px 12px 6px; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.nav-panel button {
  appearance: none; width: 100%; text-align: left; border: 0; background: transparent; color: var(--soft);
  font: 600 14px var(--display); padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 12px; align-items: baseline;
}
.nav-panel button small { font: 700 10px var(--body); letter-spacing: 0.2em; color: var(--muted); width: 22px; }
.nav-panel button:hover { background: rgba(220, 227, 238, 0.06); }
.nav-panel button.cur { color: var(--white); }
.nav-panel button.cur small { color: var(--red-hot); }
.nav-panel button.sub { padding-left: 46px; font-size: 13px; color: var(--muted); }
.nav-panel button[disabled] { opacity: 0.4; cursor: default; }

#loader { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; z-index: 10; transition: opacity 0.9s ease;
  background: radial-gradient(ellipse 60% 50% at 50% 45%, #0e1220, var(--bg) 70%); }
#loader .mark { position: relative; width: 168px; overflow: hidden; animation: loaderBreathe 2.6s ease-in-out infinite; }
#loader .mark img { width: 100%; display: block; }
#loader .mark .sheen { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%); mix-blend-mode: overlay; transform: translateX(-120%); animation: loaderSheen 2.2s ease-in-out infinite; }
#loader .bar { width: 260px; height: 2px; background: rgba(148, 163, 184, 0.18); overflow: hidden; border-radius: 2px; margin-top: 10px; }
#loader .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--red-hot)); box-shadow: 0 0 12px var(--red); transition: width 0.25s ease-out; }
#loader .meta { width: 260px; display: flex; justify-content: space-between; font: 600 11px var(--body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
#loader .pct { color: var(--soft); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
#loader .tip { margin-top: 26px; font: 500 12px var(--body); letter-spacing: 0.16em; color: var(--dim); }
#loader.done { opacity: 0; pointer-events: none; }
@keyframes loaderBreathe { 0%, 100% { opacity: 0.75; transform: scale(0.985); } 50% { opacity: 1; transform: scale(1); } }
@keyframes loaderSheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
#fatal { position: fixed; inset: 0; display: grid; place-content: center; color: var(--muted); font: 500 16px var(--body); text-align: center; padding: 24px; }

/* ── scene-specific stage elements */
.cap.resp::before { content: ''; display: block; width: 44px; height: 2px; background: var(--red); margin-bottom: 18px; }
.engine { width: 380px; text-align: center; }
.engine .t.mid { margin-bottom: 14px; }
.engine .metric { font-family: var(--body); font-size: 15px; font-weight: 500; color: var(--muted); margin: 4px 0; }
.engine .metric .ev { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--white); letter-spacing: -0.01em; margin-right: 6px; }
.engine .metric.products { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--white); letter-spacing: 0.08em; }
.engine .metric.products i { color: var(--red-hot); font-style: normal; margin: 0 12px; }
.engine .t.small { margin-top: 16px; font-size: 15px; }
.city { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.city b { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--white); }
.city span { font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.city.origin b { color: var(--red-hot); }
.amb { text-align: center; white-space: nowrap; }
.t.title.spaced { letter-spacing: 0.16em; font-weight: 800; font-size: 50px; }
.amb .t.it { margin-top: 8px; }
.pw { width: 272px; text-align: center; }
.pwname { font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.2; color: var(--white); }
.pwdesc { margin-top: 10px; font-size: 15px; }
.core { width: 150px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--soft); }
.node-label { width: 250px; text-align: center; font-size: 10.5px; letter-spacing: 0.2em; line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(3, 360px); row-gap: 56px; }
.stat .t.num { margin-bottom: 12px; white-space: nowrap; }
.stat .t.num small { font-size: 0.4em; font-weight: 700; color: var(--muted); margin-right: 0.15em; letter-spacing: 0; }
.stat .t.small { max-width: 300px; font-size: 17px; }
.secondary { width: 1150px; font-size: 16px; }
.secondary i { color: var(--red-hot); font-style: normal; margin: 0 14px; }
.app { width: 250px; text-align: center; }
.app .pwname { font-size: 20px; }
.app .chip { margin-top: 10px; }


/* ── welcome / choice (scene 0) */
.prompt { font: 600 14px var(--body); letter-spacing: 0.4em; color: var(--soft); white-space: nowrap; }
.choice {
  width: 820px; height: 640px; padding: 300px 70px 60px; text-align: center; cursor: pointer;
  border: 1px solid rgba(220, 227, 238, 0.14); border-radius: 28px;
  background: radial-gradient(ellipse at 50% 30%, rgba(220, 227, 238, 0.05), rgba(220, 227, 238, 0) 70%);
  transition: border-color 0.35s ease, background 0.35s ease;
}
.choice:hover, .choice.on { border-color: rgba(234, 68, 62, 0.7); background: radial-gradient(ellipse at 50% 30%, rgba(234, 68, 62, 0.12), rgba(234, 68, 62, 0) 70%); }
.choice.disabled { cursor: default; opacity: 0.55; }
.choice.disabled:hover { border-color: rgba(220, 227, 238, 0.14); background: none; }
.choice-title { font: 700 60px var(--display); letter-spacing: -0.025em; color: var(--white); }
.choice-desc { margin-top: 18px; font: 500 22px var(--body); color: var(--muted); line-height: 1.5; }
.choice .pace { margin-top: 40px; display: flex; gap: 14px; justify-content: center; }
.choice .pill {
  font: 600 15px var(--body); letter-spacing: 0.06em; color: var(--soft); padding: 12px 22px; border-radius: 999px;
  border: 1px solid rgba(220, 227, 238, 0.25); transition: all 0.3s;
}
.choice .pill:hover, .choice .pill.on { border-color: var(--red); color: var(--white); background: rgba(234, 68, 62, 0.18); }
.choice.disabled .pill { pointer-events: none; }
.choice-note { margin-top: 18px; font: 500 14px var(--body); color: var(--dim); }
.choice-hint { font: 600 12px var(--body); letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.narr-state { position: absolute; left: 26px; bottom: 58px; font: 600 10px var(--body); letter-spacing: 0.26em; text-transform: uppercase; color: var(--red-hot); pointer-events: none !important; }
.stat-label { width: 330px; text-align: center; font-size: 17px; }
.stat-label b { color: var(--soft); font-weight: 700; }
.scene-taqa .secondary { width: auto; white-space: nowrap; }

/* ── "your turn" key */
.next-key {
  position: absolute; right: 26px; top: 50%; width: 52px; height: 52px; margin-top: -26px;
  display: grid; place-items: center; cursor: pointer; appearance: none;
  border-radius: 12px; border: 1px solid rgba(234, 68, 62, 0.75); background: rgba(234, 68, 62, 0.08);
  color: var(--white); font: 600 22px var(--display);
  opacity: 0; transform: translateX(8px); pointer-events: none !important;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.next-key.show { opacity: 1; transform: none; pointer-events: auto !important; animation: nextGlow 2.2s ease-in-out infinite; }
.next-key span { transform: translateY(-1px); }
.next-key:hover { background: rgba(234, 68, 62, 0.22); }
@keyframes nextGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 68, 62, 0), 0 0 14px rgba(234, 68, 62, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(234, 68, 62, 0.08), 0 0 28px rgba(234, 68, 62, 0.55); }
}
@media (pointer: coarse) { .next-key { right: 14px; } }

/* ── gallery tap hint */
.tap-hand { width: 46px; height: 54px; pointer-events: none; filter: drop-shadow(0 0 10px rgba(234, 68, 62, 0.55)); }
.tap-hand svg { width: 100%; height: 100%; fill: rgba(248, 250, 252, 0.92); stroke: var(--red); stroke-width: 1.6; }
.tap-ripple { width: 90px; height: 90px; border-radius: 50%; border: 2px solid var(--red-hot); pointer-events: none; }
.case.pulse { border-top-color: var(--red-hot); box-shadow: 0 -1px 0 var(--red-hot), 0 0 40px rgba(234, 68, 62, 0.18);
  background: linear-gradient(180deg, rgba(234, 68, 62, 0.14), rgba(234, 68, 62, 0) 75%); }

.case .logo img.mark { filter: none; opacity: 1; height: 38px; width: auto; max-width: 60px; margin-right: 14px; }

/* ── finale */
.cap.spaced { letter-spacing: 0.16em; font-weight: 800; }
.cap.it { font-family: var(--body); font-style: italic; font-weight: 500; font-size: 22px; color: var(--muted); }
.cap.pw { font-size: 23px; font-weight: 700; color: var(--white); line-height: 1.2; }
.fin-p { border-radius: 50%; overflow: hidden; position: absolute;
  background: radial-gradient(circle at 50% 35%, #2a3142, #10141f 70%);
  border: 1px solid rgba(234, 68, 62, 0.55); box-shadow: 0 0 40px rgba(234, 68, 62, 0.18); }
.fin-p img { position: absolute; max-width: none; }
.fin-pn { text-align: center; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.fin-pn b { font: 700 13px var(--display); color: var(--white); }
.fin-pn span { font: 600 9.5px var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.fin-pg { width: 440px; }
.fin-pg .logos { margin-top: 18px; display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.fin-pg .logos img { height: 40px; width: auto; max-width: 150px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.88; }
.fin-hub b { font: 700 15px var(--display); color: var(--white); white-space: nowrap; }
.fin-mapnote { width: 720px; text-align: center; font: 600 13px var(--body); letter-spacing: 0.06em; color: var(--soft); line-height: 1.8; }
.fin-mapnote span { color: var(--red-hot); text-transform: uppercase; letter-spacing: 0.2em; font-size: 11px; }
.fin-mapnote em { color: var(--muted); font-style: normal; }
.fin-logo { width: 640px; height: auto; }

/* ── portrait gate (phones) */
#rotate-gate { position: fixed; inset: 0; z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px; text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, #0e1220, var(--bg) 75%); touch-action: none; }
body.portrait-gate #rotate-gate { display: flex; }
body.portrait-gate #app { visibility: hidden; }
.rg-phone { width: 46px; height: 82px; border: 2px solid var(--soft); border-radius: 10px; position: relative; margin-bottom: 18px; animation: rgTurn 2.6s ease-in-out infinite; box-shadow: 0 0 24px rgba(234, 68, 62, 0.25); }
.rg-phone i { position: absolute; left: 50%; bottom: 6px; width: 10px; height: 2px; margin-left: -5px; border-radius: 2px; background: var(--soft); }
.rg-phone::after { content: ''; position: absolute; inset: 8px 5px 14px; border-radius: 3px; background: linear-gradient(135deg, rgba(234, 68, 62, 0.5), rgba(234, 68, 62, 0.1)); }
.rg-title { font: 700 24px var(--display); color: var(--white); letter-spacing: -0.01em; }
.rg-line { font: 500 15px var(--body); color: var(--muted); line-height: 1.6; }
@keyframes rgTurn { 0%, 15% { transform: rotate(0deg); } 45%, 70% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }

.fin-card { width: 330px; text-align: center; }
.fin-card b { display: block; font: 700 21px var(--display); color: var(--white); letter-spacing: -0.01em; }
.fin-card span { display: block; margin-top: 4px; font: 700 10.5px var(--body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--red-hot); }
.fin-card em { display: block; margin-top: 10px; font: 600 15px var(--display); font-style: normal; color: var(--soft); line-height: 1.35; }
.fin-card p { margin: 8px 0 0; font: 500 12.5px var(--body); color: var(--muted); line-height: 1.5; }
