/* ============================================================
   باهم‌فیلم — صفحهٔ معرفی سه‌بعدی (/about)
   سینمایی، تیره، RTL — هم‌خوان با تم کلی سایت
   ============================================================ */

:root {
  --bf-void:     #04030c;
  --bf-ink:      #070512;
  --bf-panel:    rgba(19, 13, 40, 0.52);
  --bf-panel-2:  rgba(30, 19, 60, 0.66);
  --bf-line:     rgba(170, 150, 255, 0.16);
  --bf-line-2:   rgba(170, 150, 255, 0.38);
  --bf-warm:     #ff5f6d;
  --bf-warm-2:   #ffb26b;
  --bf-cool:     #5ad2ff;
  --bf-cool-2:   #8b6bff;
  --bf-text:     #f2eeff;
  --bf-text-2:   #b3aad0;
  --bf-text-3:   #6f6790;
  --bf-ease:     cubic-bezier(.22, .68, .28, 1);
  --bf-nav-h:    64px;
}

*, *::before, *::after { box-sizing: border-box; }

/* تضمینِ «صفحه فیکس است»: هیچ عنصر تزئینیِ بیرون‌کشیده‌ای (هالهٔ متن،
   درخشش دکمه‌ها، ذرات) نباید بتواند صفحه را افقی بکشد. overflow-x روی خودِ
   html به viewport سرایت می‌کند، پس کشش افقی برای همیشه غیرممکن می‌شود؛
   روی body از clip استفاده می‌کنیم چون برخلاف hidden یک scroll-container
   نمی‌سازد و اسکرول عمودی را دست نمی‌زند. */
html.bf-html { background: var(--bf-void); overflow-x: hidden; }

body.intro-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", system-ui, sans-serif;
  color: var(--bf-text);
  background:
    radial-gradient(1200px 700px at 18% 8%,  rgba(96, 62, 190, 0.30), transparent 62%),
    radial-gradient(900px 620px at 88% 92%,  rgba(196, 48, 82, 0.22),  transparent 60%),
    radial-gradient(700px 500px at 60% 40%,  rgba(30, 120, 190, 0.14),  transparent 65%),
    var(--bf-void);
  direction: rtl;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── لایه‌های سه‌بعدی ──────────────────────────────────────────── */
#bf-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s var(--bf-ease);
}
.bf-ready #bf-canvas { opacity: 1; }

.bf-grain {
  /* نه ‎-50%‎: این لایه mix-blend-mode دارد و روی بوم سه‌بعدیِ در حال حرکت
     ترکیب می‌شود. ‎-50%‎ یعنی چهار برابر سطح صفحه هر فریم blend می‌شد و همین
     یکی از سنگین‌ترین دلایق تیکه‌تیکه شدن بود. ‎-6%‎ فقط به اندازهٔ همان
     جابه‌جایی ‎±3%‎ انیمیشن است و ظاهر عوض نمی‌شود. */
  position: fixed; inset: -6%;
  z-index: 1; pointer-events: none;
  opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  animation: bfGrain 5s steps(6) infinite;
}
@keyframes bfGrain {
  0%,100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

.bf-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 100% 78% at 50% 46%, transparent 42%, rgba(4, 3, 12, .55) 82%, rgba(4, 3, 12, .9) 100%),
    linear-gradient(180deg, rgba(4, 3, 12, .72) 0%, transparent 16%, transparent 84%, rgba(4, 3, 12, .78) 100%);
}

/* ── لودینگ ────────────────────────────────────────────────────── */
.bf-loader {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
  background: var(--bf-void);
  transition: opacity .8s var(--bf-ease), visibility .8s;
}
.bf-loader.done { opacity: 0; visibility: hidden; }

.bf-loader-core { position: relative; display: grid; place-items: center; width: 190px; height: 190px; }
.bf-loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--bf-cool); border-left-color: rgba(139, 107, 255, .55);
  animation: bfSpin 1.5s linear infinite;
}
.bf-loader-ring-2 { inset: 22px; border-top-color: var(--bf-warm); border-left-color: rgba(255, 95, 109, .4); animation-duration: 2.4s; animation-direction: reverse; }
@keyframes bfSpin { to { transform: rotate(360deg); } }

.bf-loader-mark {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px;
  animation: bfPulse 2.2s var(--bf-ease) infinite;
}
.bf-loader-mark span { color: var(--bf-warm); }
@keyframes bfPulse { 0%, 100% { opacity: .55; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.02); } }

.bf-loader-track { width: min(260px, 62vw); height: 2px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.bf-loader-track i { display: block; height: 100%; width: 4%; border-radius: 99px; background: linear-gradient(90deg, var(--bf-cool-2), var(--bf-warm)); transition: width .35s var(--bf-ease); }
.bf-loader-text { margin: 0; font-size: .78rem; color: var(--bf-text-3); letter-spacing: .5px; }

/* ── نوار بالا ─────────────────────────────────────────────────── */
.bf-nav {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 30;
  height: var(--bf-nav-h);
  /* سه ستونِ برابر: لوگو همیشه دقیقاً وسط می‌ماند. با space-between و
     دکمه‌های نامتقارن (در موبایل هر دو آیکونی می‌شوند) لوگو از مرکز می‌رفت. */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; padding: 0 clamp(14px, 3.5vw, 34px);
  opacity: 0; transform: translateY(-14px);
  transition: opacity .9s var(--bf-ease) .3s, transform .9s var(--bf-ease) .3s;
}
.bf-nav > *:first-child { justify-self: start; }
.bf-nav > *:last-child  { justify-self: end; }
.bf-ready .bf-nav { opacity: 1; transform: none; }

.bf-back, .bf-sound, .bf-nav-brand {
  display: inline-flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--bf-line);
  background: rgba(10, 7, 24, .5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--bf-text-2); font-family: inherit; font-size: .84rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: color .25s var(--bf-ease), border-color .25s var(--bf-ease), background .25s var(--bf-ease), transform .25s var(--bf-ease);
}
.bf-back:hover, .bf-sound:hover, .bf-nav-brand:hover { color: var(--bf-text); border-color: var(--bf-line-2); background: rgba(24, 16, 48, .7); transform: translateY(-1px); }
.bf-back svg { width: 17px; height: 17px; }
.bf-sound { font-size: .76rem; }
.bf-ico-motion { width: 15px; height: 15px; }
.bf-sound[aria-pressed="true"] .bf-ico-motion { animation: bfSpin 5s linear infinite; }
.bf-sound[aria-pressed="true"] { color: var(--bf-text); border-color: var(--bf-line-2); }

.bf-nav-brand { font-weight: 800; letter-spacing: -.3px; color: var(--bf-text); }
.bf-nav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bf-warm);
  box-shadow: 0 0 0 0 rgba(255, 95, 109, .6);
  animation: bfPing 2.4s var(--bf-ease) infinite;
}
@keyframes bfPing {
  0%   { box-shadow: 0 0 0 0 rgba(255, 95, 109, .55); }
  70%  { box-shadow: 0 0 0 11px rgba(255, 95, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 95, 109, 0); }
}

:where(a, button):focus-visible {
  outline: 2px solid var(--bf-cool);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ── ریل فصل‌ها ────────────────────────────────────────────────── */
.bf-rail {
  position: fixed; inset-inline-start: clamp(12px, 2.4vw, 26px);
  top: 50%; transform: translateY(-50%);
  z-index: 30;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 8px;
  border-radius: 999px;
  border: 1px solid var(--bf-line);
  background: rgba(10, 7, 24, .42);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .9s var(--bf-ease) .5s;
}
.bf-ready .bf-rail { opacity: 1; }
.bf-rail button {
  position: relative;
  width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 50%;
}
.bf-rail button i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  transition: all .35s var(--bf-ease);
}
.bf-rail button:hover i { background: rgba(255, 255, 255, .5); }
.bf-rail button[aria-current="true"] i {
  width: 9px; height: 9px; background: var(--bf-warm);
  box-shadow: 0 0 12px rgba(255, 95, 109, .8);
}
.bf-rail button[aria-current="true"]::after {
  content: attr(data-name);
  position: absolute; inset-inline-start: 42px; top: 50%;
  transform: translateY(-50%) translateX(8px);
  padding: 5px 11px; border-radius: 8px;
  background: rgba(12, 8, 28, .92);
  border: 1px solid var(--bf-line);
  color: var(--bf-text); font-family: inherit; font-size: .74rem; font-weight: 600;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .3s var(--bf-ease), transform .3s var(--bf-ease);
}
.bf-rail button:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ── برچسب‌های لنگر‌شده به سه‌بعدی ─────────────────────────────── */
.bf-labels { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.bf-label {
  /* مبدأ در گوشهٔ بالا-چپ است تا مختصاتِ پروجکت‌شده (که فیزیکی‌اند و با RTL
     قاطی نمی‌شوند) درست جا بنشینند. */
  position: absolute; top: 0; left: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--bf-line);
  background: rgba(9, 6, 22, .6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .74rem; font-weight: 600; color: var(--bf-text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .5s var(--bf-ease);
  will-change: transform, opacity;
}
.bf-label i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.bf-label-a { color: var(--bf-warm-2); }
.bf-label-b { color: var(--bf-cool); }
.bf-label-dist {
  color: var(--bf-text);
  border-style: dashed;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
.bf-label-dist::before {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--bf-line-2));
}

/* ── اسکرول و فصل‌ها ───────────────────────────────────────────── */
.bf-scroll { position: relative; z-index: 10; }

.bf-chapter {
  position: relative;
  min-height: 118vh;
  display: flex; align-items: center;
  padding: calc(var(--bf-nav-h) + 24px) clamp(16px, 5vw, 70px) 12vh;
  pointer-events: none;
}
.bf-chapter > * { pointer-events: auto; }
.bf-chapter:nth-of-type(even) { justify-content: flex-start; }
.bf-chapter:nth-of-type(odd)  { justify-content: flex-end; }

/* انیمیشن ورود پنل‌ها */
.bf-anim {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(6px);
  transition: opacity .9s var(--bf-ease), transform .9s var(--bf-ease), filter .9s var(--bf-ease);
}
.bf-chapter.is-live .bf-anim { opacity: 1; transform: none; filter: none; }
.bf-chapter.is-live .bf-anim:nth-child(2) { transition-delay: .06s; }
.bf-chapter.is-live .bf-anim:nth-child(3) { transition-delay: .12s; }
.bf-chapter.is-live .bf-anim:nth-child(4) { transition-delay: .18s; }
.bf-chapter.is-live .bf-anim:nth-child(5) { transition-delay: .24s; }

/* ── قهرمان ───────────────────────────────────────────────────── */
.bf-ch-hero { min-height: 100vh; justify-content: center !important; text-align: center; }
.bf-hero-inner {
  position: relative;
  max-width: 820px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 40px 30px 46px;
}
/* هالهٔ تیره پشت متن، تا عنوان روی کره کاملاً خوانا بماند */
.bf-hero-inner::before {
  content: "";
  position: absolute; inset: -12% -18%;
  z-index: -1;
  background: radial-gradient(ellipse 62% 58% at 50% 46%, rgba(4, 3, 12, .92) 0%, rgba(4, 3, 12, .72) 45%, rgba(4, 3, 12, 0) 74%);
  pointer-events: none;
}

.bf-kicker {
  margin: 0;
  font-size: .8rem; font-weight: 600; letter-spacing: 3px;
  color: var(--bf-text-2);
  padding: 7px 18px; border-radius: 999px;
  border: 1px solid var(--bf-line);
  background: rgba(255, 255, 255, .03);
  text-transform: none;
}
.bf-kicker::before { content: "✦ "; color: var(--bf-warm); }

.bf-title {
  margin: 0;
  font-size: clamp(3.4rem, 15vw, 9rem);
  font-weight: 900; line-height: .92; letter-spacing: -3px;
  background: linear-gradient(180deg, #fff 0%, #cdbfff 58%, #6b4bd6 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 46px rgba(139, 107, 255, .45));
}
.bf-title-a { display: block; }
.bf-title-b {
  display: block;
  background: linear-gradient(180deg, #ffd9a8 0%, var(--bf-warm) 60%, #b81e46 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 12px 46px rgba(255, 95, 109, .38));
}
.bf-lead {
  margin: 0; max-width: 620px;
  font-size: clamp(1rem, 2.3vw, 1.24rem); line-height: 2; font-weight: 400;
  color: var(--bf-text-2);
}

.bf-hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 6px; }
.bf-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--bf-line);
  background: rgba(16, 10, 34, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .8rem; font-weight: 600; color: var(--bf-text);
}
.bf-badge svg { width: 15px; height: 15px; color: var(--bf-cool); flex: none; }
.bf-badge:nth-child(2n) svg { color: var(--bf-warm); }
.bf-badge:nth-child(3n) svg { color: #ffd479; }

.bf-scroll-hint {
  margin-top: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .76rem; color: var(--bf-text-3);
}
.bf-mouse {
  width: 22px; height: 36px; border-radius: 12px;
  border: 1px solid var(--bf-line-2);
  display: grid; justify-items: center; padding-top: 7px;
}
.bf-mouse i { width: 3px; height: 7px; border-radius: 99px; background: var(--bf-warm); animation: bfWheel 1.9s var(--bf-ease) infinite; }
@keyframes bfWheel { 0% { opacity: 0; transform: translateY(-4px); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }

/* ── پنل شیشه‌ای فصل‌ها ────────────────────────────────────────── */
.bf-panel {
  position: relative;
  width: min(520px, 100%);
  padding: clamp(24px, 3.4vw, 38px);
  border-radius: 26px;
  border: 1px solid var(--bf-line);
  background: linear-gradient(155deg, var(--bf-panel-2), var(--bf-panel));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
  overflow: hidden;
}
.bf-panel::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
}
.bf-panel::after {
  content: ""; position: absolute; inset-block-start: -60%; inset-inline-start: -30%;
  width: 70%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  transform: rotate(18deg);
  animation: bfSweep 7s var(--bf-ease) infinite;
  pointer-events: none;
}
@keyframes bfSweep { 0%, 62% { transform: translateX(-160%) rotate(18deg); } 100% { transform: translateX(320%) rotate(18deg); } }

.bf-num {
  margin: 0 0 12px;
  font-size: .74rem; font-weight: 700; letter-spacing: 2.4px;
  color: var(--bf-warm);
  display: flex; align-items: center; gap: 10px;
}
.bf-num::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--bf-line-2), transparent); }

.bf-h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  font-weight: 800; line-height: 1.55; letter-spacing: -.6px;
  color: var(--bf-text);
}
.bf-h2 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--bf-warm-2), var(--bf-warm));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bf-text {
  margin: 0 0 20px;
  font-size: clamp(.9rem, 1.9vw, 1rem); line-height: 2.1; color: var(--bf-text-2);
}

.bf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-chips span {
  padding: 6px 13px; border-radius: 9px;
  border: 1px solid var(--bf-line);
  background: rgba(255, 255, 255, .035);
  font-size: .76rem; font-weight: 600; color: var(--bf-text-2);
}

/* آمار */
.bf-stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; padding: 0; }
.bf-stats li {
  padding: 14px 12px; border-radius: 15px; text-align: center;
  border: 1px solid var(--bf-line);
  background: rgba(255, 255, 255, .03);
}
.bf-stats b {
  display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(180deg, #fff, var(--bf-cool));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.bf-stats span { display: block; margin-top: 4px; font-size: .68rem; line-height: 1.7; color: var(--bf-text-3); }

/* نوارِ همگام‌سازی (ویجت داخل پنل فصل ۲) */
.bf-sync-ui { margin-bottom: 18px; }
.bf-sync-bar {
  position: relative; height: 6px; border-radius: 99px; overflow: visible;
  background: rgba(255, 255, 255, .07);
}
.bf-sync-fill {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: 34%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--bf-cool-2), var(--bf-warm));
  box-shadow: 0 0 16px rgba(255, 95, 109, .55);
  animation: bfSyncFill 6s var(--bf-ease) infinite;
}
@keyframes bfSyncFill { 0% { width: 8%; } 55% { width: 68%; } 100% { width: 92%; } }
.bf-sync-head {
  position: absolute; top: 50%; inset-inline-start: 34%;
  width: 15px; height: 15px; border-radius: 4px;
  transform: translate(50%, -50%) rotate(45deg);
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, .85);
  animation: bfSyncFill 6s var(--bf-ease) infinite;
}
.bf-sync-people { display: flex; justify-content: space-between; margin-top: 12px; }
.bf-sync-people i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bf-cool);
  box-shadow: 0 0 10px var(--bf-cool);
  animation: bfBeat 2.2s var(--bf-ease) infinite;
  animation-delay: var(--d);
}
@keyframes bfBeat { 0%, 100% { transform: scale(1); opacity: .55; } 40% { transform: scale(1.5); opacity: 1; } }

/* چت */
.bf-chat { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.bf-msg {
  max-width: 84%;
  padding: 10px 15px; border-radius: 16px;
  font-size: .84rem; line-height: 1.8; font-weight: 500;
  border: 1px solid var(--bf-line);
  background: rgba(255, 255, 255, .045);
  animation: bfMsgIn .6s var(--bf-ease) both;
}
.bf-msg span { display: inline-block; margin-inline-start: 8px; font-size: .64rem; color: var(--bf-text-3); }
.bf-msg-in { align-self: flex-start; border-end-start-radius: 5px; animation-delay: .1s; }
.bf-msg-out {
  align-self: flex-end; border-end-end-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 95, 109, .22), rgba(139, 107, 255, .18));
  border-color: rgba(255, 95, 109, .3);
  animation-delay: .35s;
}
@keyframes bfMsgIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* زیرنویس */
.bf-subscreen {
  margin-bottom: 18px; padding: 18px 16px 14px;
  border-radius: 16px; border: 1px solid var(--bf-line);
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .55));
}
.bf-sub-line {
  min-height: 3.2em;
  display: grid; place-items: center; text-align: center;
  font-size: clamp(.88rem, 2vw, 1.02rem); font-weight: 600; line-height: 1.9;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
}
.bf-sub-line::after { content: "▍"; color: var(--bf-warm); margin-inline-start: 3px; animation: bfCaret 1s steps(1) infinite; }
.bf-sub-line.done::after { content: ""; }
@keyframes bfCaret { 50% { opacity: 0; } }
.bf-sub-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bf-sub-bar i {
  display: block; height: 100%; width: 18%;
  background: linear-gradient(90deg, #fff, var(--bf-warm));
  box-shadow: 0 0 12px rgba(255, 255, 255, .6);
}

/* قفل اتاق */
.bf-lock { display: flex; align-items: center; gap: 18px; }
.bf-lock-shield {
  width: 62px; height: 62px; flex: none; display: grid; place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(90, 210, 255, .3);
  background: radial-gradient(circle at 50% 30%, rgba(90, 210, 255, .22), rgba(90, 210, 255, .04));
  color: var(--bf-cool);
  animation: bfFloat 4.5s var(--bf-ease) infinite;
}
.bf-lock-shield svg { width: 30px; height: 30px; }
@keyframes bfFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.bf-lock-timer { display: flex; flex-direction: column; gap: 2px; }
.bf-lock-timer > span {
  font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -1px;
  color: #fff; font-variant-numeric: tabular-nums;
}
.bf-lock-timer small { font-size: .7rem; color: var(--bf-text-3); }

/* ── فصل پایانی ────────────────────────────────────────────────── */
.bf-ch-final { min-height: 112vh; justify-content: center !important; text-align: center; }
.bf-final-inner {
  position: relative;
  max-width: 760px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 46px 30px 40px;
}
.bf-final-inner::before {
  content: "";
  position: absolute; inset: -10% -16%;
  z-index: -1;
  background: radial-gradient(ellipse 60% 56% at 50% 48%, rgba(4, 3, 12, .9) 0%, rgba(4, 3, 12, .68) 48%, rgba(4, 3, 12, 0) 76%);
  pointer-events: none;
}
.bf-final-title {
  margin: 0;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem);
  font-weight: 900; line-height: 1.45; letter-spacing: -1.2px;
  background: linear-gradient(180deg, #fff, #b9a6ff 70%, #7a55e8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bf-cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.bf-cta {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 30px; border-radius: 16px;
  border: 1px solid var(--bf-line-2);
  background: rgba(20, 13, 44, .6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--bf-text); font-family: inherit; font-size: .96rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform .3s var(--bf-ease), box-shadow .3s var(--bf-ease), border-color .3s var(--bf-ease);
}
.bf-cta svg { width: 19px; height: 19px; }
.bf-cta:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .4); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.bf-cta-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ff6b6b, #e0445f 55%, #b3264b);
  box-shadow: 0 12px 34px rgba(226, 68, 95, .4);
}
.bf-cta-primary:hover { box-shadow: 0 20px 46px rgba(226, 68, 95, .55); }
.bf-cta-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: bfShine 3.4s var(--bf-ease) infinite;
}
@keyframes bfShine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.bf-cta-ghost { background: rgba(255, 255, 255, .04); border-style: dashed; }
.bf-final-note { margin: 14px 0 0; font-size: .78rem; color: var(--bf-text-3); }
.bf-final-note a { color: var(--bf-warm); font-weight: 700; text-decoration: none; }

/* ── نوار پیشرفت پایین ────────────────────────────────────────── */
.bf-progress {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 30;
  height: 2px; background: rgba(255, 255, 255, .06);
  opacity: 0; transition: opacity .6s var(--bf-ease) .4s;
}
.bf-ready .bf-progress { opacity: 1; }
.bf-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--bf-cool), var(--bf-warm));
  box-shadow: 0 0 12px rgba(255, 95, 109, .7);
}

/* ── حالت بدون WebGL (متن + CSS) ───────────────────────────────── */
body.bf-fallback #bf-canvas { display: none; }
body.bf-fallback { background-attachment: fixed; }
body.bf-fallback .bf-scroll-hint .bf-mouse { display: none; }
body.bf-fallback .bf-rail { opacity: .9; }

@keyframes bfScan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.bf-fallback .bf-loader-core::after {
  content: ""; position: absolute; inset: -10%; border-radius: 50%;
  background: linear-gradient(180deg, transparent, rgba(139, 107, 255, .18), transparent);
  animation: bfScan 2.4s var(--bf-ease) infinite;
}

/* ── واکنش‌گرایی ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --bf-nav-h: 56px; }
  .bf-chapter {
    min-height: 104vh;
    align-items: flex-end;
    justify-content: center !important;
    padding-bottom: 14vh;
  }
  .bf-ch-hero, .bf-ch-final { align-items: center; }
  .bf-panel { width: 100%; }
  .bf-rail { inset-inline-start: 50%; top: auto; bottom: 12px; transform: translateX(50%); flex-direction: row; }
  .bf-rail button[aria-current="true"]::after { display: none; }
  .bf-stats { grid-template-columns: 1fr 1fr; }
  .bf-stats li:last-child { grid-column: 1 / -1; }
  .bf-sound-label { display: none; }
  .bf-sound { padding: 0 12px; }
  .bf-labels { display: none; }
  .bf-title { letter-spacing: -1.5px; }
  /* هالهٔ پشت متن را جمع‌تر می‌کنیم تا به لبهٔ صفحه نرسد */
  .bf-hero-inner::before, .bf-final-inner::before { inset: -7% -9%; }
}
@media (max-width: 420px) {
  .bf-hero-badges { gap: 6px; }
  .bf-badge { font-size: .72rem; padding: 6px 11px; }
  .bf-back span { display: none; }
  .bf-back { padding: 0 12px; }
}

/* ── احترام به prefers-reduced-motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .bf-anim { opacity: 1; transform: none; filter: none; }
  .bf-panel::after, .bf-grain, .bf-cta-primary::after { display: none; }
  .bf-sub-line::after { content: ""; }
}
