/* Halawi India Tour — brand tokens mirror Reel Runner / Halawi Media */
:root {
  --brand-violet: #9b3df5;
  --brand-magenta: #c84fb4;
  --brand-coral: #ea6a5a;
  --brand-gradient: linear-gradient(100deg, #9b3df5 0%, #c84fb4 52%, #ea6a5a 100%);
  --brand-gradient-strong: linear-gradient(100deg, #8b35ec 0%, #b0409e 55%, #c94a3a 100%);
  --brand-violet-text: #c191ff;
  --brand-coral-text: #ff9384;
  --c-bg: #0a0a0c;
  --c-surface: rgba(17, 17, 22, 0.72);
  --c-line: rgba(232, 222, 255, 0.12);
  --c-line-strong: rgba(232, 222, 255, 0.24);
  --c-text: #f6f3fa;
  --c-text-body: #cbc5d4;
  --c-text-muted: #a69fb2;
  --font-display: "Blockjock", "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-accent: "Drawntastic", "Patrick Hand", "Comic Neue", "Segoe Print", cursive;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 16px;
  --radius-lg: 24px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; overflow: hidden; background: var(--c-bg); }
#tour { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: clamp(8px, 1.6vw, 22px);
  padding: calc(clamp(10px, 1.6vw, 22px) + var(--safe-t)) calc(clamp(12px, 2.2vw, 32px) + var(--safe-r)) 0 calc(clamp(12px, 2.2vw, 32px) + var(--safe-l));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-brand { display: block; flex: 0 0 auto; line-height: 0; opacity: .95; transition: opacity .2s; }
.hud-brand:hover { opacity: 1; }
.hud-brand img { height: clamp(22px, 2.6vw, 38px); width: auto; filter: drop-shadow(0 4px 18px rgba(155,61,245,.35)); }
.hud-title {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto;
  pointer-events: none;
}
.hud-app {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 1.4vw, 20px);
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: .02em;
}
.hud-stats { display: flex; gap: clamp(6px, 1.2vw, 14px); margin-left: auto; pointer-events: none; }
.stat {
  display: flex; flex-direction: column; align-items: flex-end; min-width: 3.2em;
  padding: 6px 12px; border-radius: 12px; background: rgba(10,10,12,.42);
  border: 1px solid var(--c-line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stat-label { font-size: clamp(9px, .75vw, 11px); letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-muted); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: clamp(13px, 1.3vw, 18px); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hud-actions { display: flex; gap: 8px; }
.icon-btn {
  width: clamp(40px, 3.2vw, 50px); height: clamp(40px, 3.2vw, 50px); border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; color: var(--c-text);
  background: rgba(10,10,12,.5); border: 1px solid var(--c-line-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .15s var(--ease-out), border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--brand-violet-text); background: rgba(155,61,245,.18); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn .ico-on, .icon-btn .ico-off { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn[aria-pressed="false"] .ico-on { display: none; }
.icon-btn[aria-pressed="true"] .ico-off { display: none; }
body.is-start .hud-stats, body.is-start .hud-actions { opacity: .35; }
body.is-touring .hud-stats, body.is-touring .hud-actions { opacity: 1; }
body.is-paused .hud-actions #btnPauseTop { border-color: var(--brand-violet-text); background: rgba(155,61,245,.22); }

:focus-visible { outline: 3px solid var(--brand-violet-text); outline-offset: 3px; }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; top: 22%; z-index: 8; transform: translate(-50%, -50%) scale(.9);
  font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  font-size: clamp(16px, 2.8vw, 36px); color: var(--c-text); opacity: 0; pointer-events: none;
  text-shadow: 0 6px 30px rgba(200,79,180,.65);
  transition: opacity .35s var(--ease-out), transform .5s var(--ease-out);
  white-space: nowrap; padding: 8px 18px; border-radius: 999px;
  background: rgba(10,10,12,.45); border: 1px solid var(--c-line);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(80px + var(--safe-b)) calc(16px + var(--safe-l));
  background: radial-gradient(120% 90% at 50% 40%, rgba(10,10,12,.15) 0%, rgba(10,10,12,.62) 100%);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s linear .35s;
  overflow: auto; touch-action: pan-y;
}
.screen.is-active { opacity: 1; visibility: visible; transition: opacity .35s var(--ease-out); }

/* Camera-only pause: slim bottom band, no dim, scene fully visible */
.screen--pause {
  inset: auto 0 0 0; top: auto; height: auto; min-height: 0;
  place-items: end center; align-content: end;
  padding: 0 calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  background: transparent;
  overflow: visible; pointer-events: none;
  z-index: 9;
}
.screen--pause.is-active { pointer-events: none; }
.screen--pause .panel { pointer-events: auto; }
.panel {
  position: relative; width: min(560px, 100%); margin: auto;
  padding: clamp(20px, 3.2vw, 42px);
  border-radius: var(--radius-lg); background: var(--c-surface);
  border: 1px solid var(--c-line-strong);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 18px 60px -28px rgba(155,61,245,.6), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  text-align: center; transform: translateY(14px) scale(.98); transition: transform .5s var(--ease-out);
}
.screen.is-active .panel { transform: none; }
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-gradient); opacity: .9;
}
.panel--pause {
  width: min(720px, 100%); margin: 0 auto;
  padding: 10px 14px 12px;
  border-radius: 16px;
  background: rgba(10,10,12,.58);
  box-shadow: 0 12px 36px -18px rgba(0,0,0,.75), 0 8px 28px -20px rgba(155,61,245,.45), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(12px) saturate(1.15); -webkit-backdrop-filter: blur(12px) saturate(1.15);
  text-align: left; transform: translateY(10px);
}
.screen--pause.is-active .panel--pause { transform: none; }
.panel--pause::before { height: 2px; opacity: .75; }
.pause-main {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 14px;
}
.pause-copy { min-width: 0; flex: 1 1 auto; }
.eyebrow { margin: 0 0 4px; font-family: var(--font-accent); font-size: clamp(18px, 1.8vw, 24px); color: var(--brand-coral-text); }
.title {
  margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(36px, 6vw, 72px); letter-spacing: -.01em;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 30px rgba(155,61,245,.35)); padding-bottom: .06em;
}
.title--md { font-size: clamp(32px, 5vw, 56px); }
.title--pause {
  font-size: clamp(18px, 2.2vw, 24px); letter-spacing: .01em;
  filter: drop-shadow(0 4px 14px rgba(155,61,245,.3)); padding-bottom: 0;
}
.lede { margin: 12px auto 0; max-width: 34em; color: var(--c-text-body); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.5; }
.pause-meta { margin: 2px 0 0; font-size: 12px; color: var(--c-text-muted); letter-spacing: .02em; }
.btn-row--pause { margin-top: 0; gap: 8px; justify-content: flex-end; flex: 0 0 auto; }
.btn--compact {
  min-height: 40px; padding: 0 16px; font-size: 14px; min-width: 0;
  gap: 6px;
}
.btn--compact svg { width: 14px; height: 14px; }
.cta--slim {
  margin-top: 8px; padding: 8px 12px; max-width: none; border-radius: 12px;
  gap: 4px 10px;
}
.cta--slim .cta-k { font-size: clamp(14px, 1.3vw, 16px); }
.cta--slim .cta-v { font-size: clamp(12px, 1vw, 13px); }
.panel-body { margin-top: clamp(14px, 2vw, 24px); display: grid; gap: 14px; text-align: left; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.howto li {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,.035); border: 1px solid var(--c-line); font-size: 15px; color: var(--c-text-body);
}
.keys { display: inline-flex; align-items: center; gap: 5px; min-width: 6.5em; flex: 0 0 auto; }
kbd {
  display: inline-block; min-width: 2em; padding: 2px 8px; border-radius: 7px; text-align: center;
  font-family: var(--font-sans); font-weight: 700; font-size: 13px; color: var(--c-text);
  background: linear-gradient(180deg, #24222d, #16151c); border: 1px solid var(--c-line-strong);
  box-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.note-inline { margin: 0; font-size: 14px; line-height: 1.5; color: var(--c-text-muted); padding: 0 4px; }
.panel-foot { margin-top: clamp(16px, 2.2vw, 26px); display: grid; justify-items: center; gap: 12px; }
.note { margin: 0; font-size: 13.5px; color: var(--c-text-muted); }
.accent { font-family: var(--font-accent); font-size: 1.2em; color: var(--brand-coral-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 30px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .02em;
  color: #fff; border: 1px solid transparent; text-decoration: none;
  transition: transform .18s var(--ease-out), box-shadow .25s, filter .2s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn--primary { background: var(--brand-gradient-strong); box-shadow: 0 16px 40px -14px rgba(200,79,180,.85); min-width: 200px; }
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 20px 48px -14px rgba(200,79,180,1); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--ghost { background: rgba(255,255,255,.05); border-color: var(--c-line-strong); color: var(--c-text); min-width: 160px; }
.btn--ghost:hover { border-color: var(--brand-violet-text); }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.panel--pause .btn-row { margin-top: 0; }

/* CTA — Reel Runner over-screen style; only on start + pause */
.cta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  width: 100%; max-width: 420px; margin-top: 4px; padding: 14px 18px; border-radius: 14px; text-decoration: none;
  background: linear-gradient(100deg, rgba(155,61,245,.14), rgba(234,106,90,.12));
  border: 1px solid rgba(193,145,255,.3); transition: border-color .2s, transform .2s var(--ease-out);
}
.cta:hover { border-color: var(--brand-coral-text); transform: translateY(-1px); }
.cta-k { font-family: var(--font-accent); font-size: clamp(16px, 1.6vw, 19px); color: var(--brand-coral-text); }
.cta-v { font-weight: 700; color: var(--c-text); font-size: clamp(13px, 1.1vw, 15px); }
.link-back {
  display: inline-block; margin-top: 4px; padding: 8px 6px; font-size: 14px; font-weight: 500;
  color: var(--c-text-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(193,145,255,.5);
}
.link-back:hover { color: var(--c-text); }

/* ---------- Soft control bar ---------- */
.controls {
  position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); z-index: 6;
  transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  padding: 6px 8px; border-radius: 16px;
  background: rgba(10,10,12,.42); border: 1px solid var(--c-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  max-width: calc(100% - 24px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-out);
}
/* Soft when touring; stay available during camera-only pause (lifted above bottom band) */
body.is-touring .controls {
  opacity: 0.35; pointer-events: auto;
}
body.is-touring.is-paused .controls {
  bottom: calc(96px + var(--safe-b));
  opacity: 0.5;
}
body.is-touring .controls:hover,
body.is-touring .controls:focus-within,
body.is-touring.is-controls-hot .controls {
  opacity: 1;
}
.ctrl-group { display: flex; gap: 3px; align-items: center; }
.ctrl-group + .ctrl-group { padding-left: 5px; margin-left: 2px; border-left: 1px solid var(--c-line); }
.ctrl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 36px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-sans); font-weight: 700; font-size: 11px; letter-spacing: .03em;
  color: var(--c-text); background: rgba(255,255,255,.04); border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .12s;
}
.ctrl-btn svg { width: 15px; height: 15px; fill: currentColor; flex: 0 0 auto; }
.ctrl-btn:hover { background: rgba(155,61,245,.2); border-color: rgba(193,145,255,.35); }
.ctrl-btn:active { transform: scale(.96); }
.ctrl-btn.is-active {
  background: rgba(155,61,245,.28); border-color: rgba(193,145,255,.45); color: #fff;
}
.ctrl-btn[hidden] { display: none !important; }
.ctrl-btn--rec .rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #e85a5a;
  box-shadow: 0 0 0 0 rgba(232,90,90,.5);
}
.ctrl-btn--rec[aria-pressed="true"] {
  background: rgba(232,90,90,.22); border-color: rgba(232,90,90,.5);
}
.ctrl-btn--rec[aria-pressed="true"] .rec-dot {
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,90,90,.55); }
  50% { box-shadow: 0 0 0 6px rgba(232,90,90,0); }
}

.noscript { position: absolute; inset: 0; display: grid; place-items: center; z-index: 20; background: var(--c-bg); }
.noscript a { color: var(--brand-violet-text); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .ctrl-btn span { display: none; }
  .ctrl-btn { padding: 0 9px; min-height: 34px; }
  .ctrl-group--speed .ctrl-btn { font-size: 10px; padding: 0 7px; }
}
@media (max-width: 560px) {
  .hud { gap: 6px; }
  .hud-brand img { height: 20px; }
  .stat { padding: 4px 8px; }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 12px; }
  .howto li { font-size: 13px; padding: 8px 10px; }
  .keys { min-width: 5.5em; }
  .controls { bottom: calc(12px + var(--safe-b)); gap: 3px; padding: 5px 6px; }
  .ctrl-group--speed .ctrl-btn:nth-child(n+5) { display: none; } /* hide 3×/4× on very narrow — still reachable via + key */
}
@media (max-height: 520px) {
  .controls { bottom: calc(8px + var(--safe-b)); }
  body.is-touring.is-paused .controls { bottom: calc(78px + var(--safe-b)); }
  .panel { padding: 16px 18px; }
  .panel--pause { padding: 8px 12px; }
  .title { font-size: clamp(28px, 8vh, 48px); }
  .panel--start { width: min(860px, 100%); }
}
@media (max-width: 560px) {
  .panel--pause { padding: 8px 10px 10px; }
  .btn--compact { min-height: 36px; padding: 0 12px; font-size: 13px; }
  body.is-touring.is-paused .controls { bottom: calc(108px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
