/* =====================================================================
   VRPro Landing — vrpro.pro
   Tokens mirror @vrpro/ui (design-system/styles.css). Dark-first.
   ===================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

:root {
  --vr-blue-300: #7da4ff;
  --vr-blue-400: #5586f8;
  --vr-blue-500: #3b6ff6;
  --vr-blue-600: #2f5fe0;
  --vr-navy-950: #080d18;
  --vr-navy-900: #0a1120;
  --vr-navy-850: #0f1a2e;
  --vr-navy-800: #152436;
  --vr-navy-700: #1d2c44;
  --vr-slate-100: #dde4f0;
  --vr-slate-300: #aab6cd;
  --vr-slate-400: #8593ad;
  --vr-slate-500: #5b6b86;
  --vr-warning: #f5b53d;
  --vr-bg: var(--vr-navy-900);
  --vr-text: #f1f4fa;
  --vr-text-muted: var(--vr-slate-400);
  --vr-border: rgba(255, 255, 255, 0.09);
  --vr-border-accent: rgba(59, 111, 246, 0.55);
  --vr-accent-soft: rgba(59, 111, 246, 0.13);
  --vr-accent-soft-border: rgba(59, 111, 246, 0.32);
  --vr-radius-md: 8px;
  --vr-radius-lg: 14px;
  --vr-radius-pill: 999px;
  --vr-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --vr-shadow-accent: 0 6px 20px rgba(59, 111, 246, 0.35);
  --vr-font: "Vazirmatn", "Segoe UI", system-ui, -apple-system, sans-serif;
  --scroll-len: 950vh; /* طول کل سفر اسکرولی — بیشتر = ریتم کندتر */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }
html, body { background: var(--vr-bg); }

body {
  font-family: var(--vr-font);
  color: var(--vr-text);
  overflow-x: hidden;
}

.scroll-space { height: var(--scroll-len); }

/* ---------------------------------------------------------------------
   Stage — لایه‌ی ثابت نمایش
--------------------------------------------------------------------- */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#bg { position: absolute; inset: 0; width: 100%; height: 100%; }

.bg-blob {
  position: absolute;
  width: 62vmax; height: 62vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
}
.bg-blob--1 {
  background: radial-gradient(circle, rgba(59, 111, 246, 0.20), transparent 65%);
  top: -22vmax; inset-inline-start: -18vmax;
}
.bg-blob--2 {
  background: radial-gradient(circle, rgba(29, 44, 68, 0.85), transparent 65%);
  bottom: -26vmax; inset-inline-end: -20vmax;
}

/* ---------------------------------------------------------------------
   Scene (SVG) + hero text
--------------------------------------------------------------------- */
.scene-wrap {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(120vw, 96vh, 980px);
  pointer-events: none;
}
#scene { display: block; width: 100%; height: auto; overflow: visible; }

/* مرکز چرخش/مقیاس هر گروه در دستگاه مختصات viewBox — ثابت و قابل پیش‌بینی */
#scene g, #scene ellipse {
  transform-box: view-box;
  will-change: transform, opacity;
}
#roofG { transform-origin: 500px 335px; }
#headsetG { transform-origin: 500px 454px; }
#houseG { transform-origin: 500px 532px; }
#houseWin { transform-origin: 588px 480px; }
#humanG { transform-origin: 500px 555px; }
#logoRig, #glowWrap, #glowPulse, #snapFlash { transform-origin: 500px 392px; }

#glowPulse { animation: glow-pulse 2.6s ease-in-out infinite; }
@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}

.hero-text {
  position: absolute;
  top: 65%; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  will-change: transform, opacity;
}
.hero-text__wordmark {
  font-weight: 900;
  font-size: clamp(44px, 9vw, 84px);
  letter-spacing: -0.5px;
  line-height: 1.05;
}
.hero-text__tagline {
  font-size: clamp(12px, 2.4vw, 18px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--vr-slate-500);
  font-weight: 700;
  margin-top: 6px;
}
.hero-text__sub {
  margin-top: 18px;
  font-size: clamp(15px, 3vw, 21px);
  color: var(--vr-slate-300);
}

/* ---------------------------------------------------------------------
   Scroll hint
--------------------------------------------------------------------- */
.scroll-hint {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--vr-slate-400);
  font-size: 13px;
}
.scroll-hint svg { animation: hint-bob 1.6s ease-in-out infinite; }
@keyframes hint-bob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ---------------------------------------------------------------------
   Textboxes — کارت شیشه‌ای پایین صحنه
--------------------------------------------------------------------- */
.textbox {
  position: absolute;
  bottom: max(4.5vh, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 660px);
  max-height: 62vh;
  overflow-y: auto;
  background: rgba(15, 26, 46, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--vr-border);
  border-radius: var(--vr-radius-lg);
  box-shadow: var(--vr-shadow-md);
  padding: 20px 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.textbox h2 {
  font-size: clamp(19px, 4vw, 26px);
  font-weight: 900;
  margin-bottom: 8px;
}
.textbox h2::after {
  content: "";
  display: block;
  width: 44px; height: 3px;
  border-radius: 2px;
  background: var(--vr-blue-500);
  margin: 10px auto 0;
}
.textbox p {
  font-size: clamp(13.5px, 3vw, 15.5px);
  line-height: 1.9;
  color: var(--vr-text-muted);
  text-align: start;
}
/* در حالت پایانیِ هر صحنه، متن بلند داخل کارت قابل اسکرول است */
.stage .textbox { scrollbar-width: thin; scrollbar-color: var(--vr-slate-500) transparent; }

/* جعبه‌متن صحنه‌ی «We are Pro» کوتاه‌تر است تا روی لوگو نیفتد؛
   متن بلندش داخل خود کارت اسکرول می‌خورد (pointer-events را JS هنگام
   نمایان بودن روشن می‌کند) */
#tb3 { max-height: 42vh; }

/* هدر برند بالای جعبه‌متن — همان فرمت وردمارک لوگو */
.tb-brand {
  font-weight: 900;
  font-size: clamp(26px, 5.5vw, 34px);
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--vr-text);
  margin-bottom: 6px;
}
#pertiesSpan {
  display: inline-block;
  color: var(--vr-slate-300); /* فقط کمی محوتر از Pro */
}
.tb-lead {
  margin-top: 12px;
  font-weight: 700;
  color: var(--vr-text) !important;
}
.tb-list {
  margin: 6px 0 0;
  padding-inline-start: 22px;
  text-align: start;
}
.tb-list li {
  font-size: clamp(13px, 2.8vw, 15px);
  line-height: 1.9;
  color: var(--vr-text-muted);
}
.tb-list li::marker { color: var(--vr-blue-500); }

/* حروف پرنده‌ی وردمارک */
.fly-word {
  position: absolute;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--vr-text);
  opacity: 0;
  pointer-events: none;
  transform-origin: top left;
  will-change: transform, opacity;
  z-index: 20;
}

/* ---------------------------------------------------------------------
   Topbar — در صحنه‌ی آخر شکل می‌گیرد
--------------------------------------------------------------------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 3vw, 28px);
  background: rgba(10, 17, 32, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--vr-border);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 30;
}
.topbar__logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--vr-text);
}
.topbar__logo svg {
  height: 40px; width: auto;
  filter: drop-shadow(0 0 10px rgba(59, 111, 246, 0.45));
  animation: bar-glow 2.6s ease-in-out infinite;
}
@keyframes bar-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(59, 111, 246, 0.30)); }
  50% { filter: drop-shadow(0 0 14px rgba(59, 111, 246, 0.65)); }
}
.topbar__wordmark { font-weight: 900; font-size: 20px; letter-spacing: -0.4px; }

.topbar__nav { display: flex; gap: 10px; }

/* ---------------------------------------------------------------------
   Buttons + badges (مطابق vr-btn / vr-badge)
--------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--vr-accent-soft-border);
  border-radius: var(--vr-radius-md);
  background: var(--vr-accent-soft);
  color: var(--vr-blue-300);
  font-family: var(--vr-font);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  user-select: none;
}
.btn--primary {
  background: var(--vr-blue-500);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--vr-shadow-accent);
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--vr-border);
  color: var(--vr-slate-300);
}
.btn--soon { cursor: default; opacity: 0.92; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  background: rgba(245, 181, 61, 0.18);
  color: #ffc34f;
}
.badge--onprimary { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ---------------------------------------------------------------------
   Language toggle
--------------------------------------------------------------------- */
.lang-toggle {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 40;
  min-width: 44px; min-height: 38px;
  padding: 6px 14px;
  border-radius: var(--vr-radius-pill);
  border: 1px solid var(--vr-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--vr-slate-300);
  font-family: var(--vr-font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.3s;
}
.lang-toggle:hover { background: rgba(255, 255, 255, 0.12); color: var(--vr-text); }
.lang-toggle:focus-visible { outline: 2px solid var(--vr-blue-500); outline-offset: 2px; }
.lang-toggle--bar { position: static; z-index: auto; }

/* وقتی تاپ‌بار ظاهر شد، سوییچ شناور مخفی می‌شود (نسخه‌ی داخل تاپ‌بار جایگزین است) */
.stage.at-end .lang-toggle:not(.lang-toggle--bar) { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------------
   Finale
--------------------------------------------------------------------- */
.finale {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  width: min(92vw, 640px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.finale__title {
  font-size: clamp(20px, 4.6vw, 30px);
  font-weight: 900;
  margin-bottom: 22px;
}
.finale__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.finale__footer {
  margin-top: 34px;
  font-size: 12.5px;
  color: var(--vr-slate-500);
}

/* در حالت پایانی، دکمه‌های finale فعال‌پذیر شوند (فقط از نظر رویداد؛ خودشان «به‌زودی»اند) */
.stage.at-end .finale, .stage.at-end .topbar { pointer-events: auto; }

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */
@media (max-width: 720px) {
  .topbar__nav { display: none; } /* موبایل: دکمه‌ها در finale هستند */
  .scene-wrap { top: 40%; width: min(132vw, 88vh); }
  .hero-text { top: 63%; }
}

/* ---------------------------------------------------------------------
   Reduced motion — نسخه‌ی ایستا بدون اسکرول‌جکینگ
--------------------------------------------------------------------- */
body.reduced .scroll-space { display: none; }
body.reduced .stage { position: static; height: auto; min-height: 100vh; }
body.reduced #bg, body.reduced .scroll-hint { display: none; }
body.reduced .scene-wrap {
  position: relative; top: auto; left: auto; transform: none;
  margin: 90px auto 0; width: min(92vw, 560px);
}
body.reduced .hero-text { position: static; transform: none; margin-top: 12px; }
body.reduced #houseG, body.reduced #humanG, body.reduced .fly-word { display: none; }
body.reduced #pertiesSpan { opacity: 1; }
body.reduced #glowWrap { opacity: 1 !important; }
body.reduced #glowPulse, body.reduced .scroll-hint svg,
body.reduced .topbar__logo svg { animation: none; }
body.reduced .textbox {
  position: static; transform: none; opacity: 1; pointer-events: auto;
  margin: 18px auto;
}
body.reduced .finale {
  position: static; transform: none; opacity: 1; pointer-events: auto;
  margin: 30px auto 50px;
}
body.reduced .topbar { position: sticky; top: 0; opacity: 1; pointer-events: auto; }
