/* ==========================================================================
   صفحه‌ی اصلی نسخه‌ی ۷: فصل‌ها (اسلایدهای عمودی)، دسته‌ورق‌ها و ناوبری فصل‌ها
   - هر فصل یک «برگه»ی رنگی با گوشه‌های گرد بالاست که کمی روی فصل قبلی می‌نشیند.
   - بخش‌های فرعی هر فصل داخل یک دسته‌ورق کنار هم‌اند و با سوئیچ بالای آن ورق می‌خورند.
   - اسکرول همان اسکرول آزاد صفحه است (بدون چسبیدن اجباری)؛ پرش دقیق بین فصل‌ها با دکمه‌ها، کیبورد و لینک «بعدی».
   ========================================================================== */
.page-home {
  --chap-pad: clamp(56px, 8vh, 96px);
  --chap-gap: 30px;
  --chap-r: 40px;
  --chap-lap: 40px;
}

/* ---------- برگه‌ی هر فصل ---------- */
.chap { position: relative; isolation: isolate; padding-block: var(--chap-pad) calc(var(--chap-pad) - 16px); }
.chap:not(.chap--hero) {
  margin-top: calc(var(--chap-lap) * -1);
  border-radius: var(--chap-r) var(--chap-r) 0 0;
  background:
    radial-gradient(60% 50% at 100% 0, var(--c100), transparent 70%),
    linear-gradient(180deg, var(--c50) 0, #fff 420px);
  box-shadow: 0 -1px 0 var(--c100), 0 -28px 50px -40px var(--cglow);
}
/* دستگیره‌ی بالای برگه: یعنی این یک اسلاید تازه است */
.chap:not(.chap--hero)::before { content: ""; position: absolute; top: 12px; left: 50%; width: 54px; height: 6px; margin-left: -27px; border-radius: 99px; background: var(--c300); opacity: .7; }
.chap .shead { margin-bottom: var(--chap-gap); }
.chap .shead h2 { font-size: clamp(26px, 3vw, 40px); }
.chap :is(h1, h2)[tabindex="-1"]:focus { outline: none; }
.chap .shead__ico { box-shadow: 0 16px 30px -18px var(--cglow); }
.chap__tags { gap: 8px; }
.chap--last { padding-bottom: calc(var(--chap-pad) + 24px); }
.chap--hero { padding-top: 40px; }
.page-home .hero::before { pointer-events: none; }
.chap--hero h1:focus { outline: none; }

/* روی دسکتاپ هر فصل حداقل یک صفحه است؛ محتوا از بالا شروع می‌شود تا با عوض شدن پنل‌ها سوئیچ زیر نشانگر جابه‌جا نشود */
@media (min-width: 1001px) and (min-height: 700px) {
  .chap { display: flex; flex-direction: column; justify-content: flex-start; min-height: calc(100svh - 96px + var(--chap-lap)); }
  .chap--hero { justify-content: center; min-height: calc(100svh - 96px); }
}
/* اسکرول تا جایی که چیزی زیر داک یا نوارهای پایین نرود (فوکوس کیبورد، پرش به لینک) */
html.has-chapters { scroll-padding-bottom: 100px; scrollbar-gutter: stable; }
/* لینک به ابتدای صفحه (#start، #main) دقیقاً بالای صفحه بنشیند، نه چند پیکسل پایین‌تر */
.page-home #main, .page-home #start { scroll-margin-top: 200px; }
@media (max-width: 1000px) { html.has-chapters { scroll-padding-bottom: calc(150px + env(safe-area-inset-bottom)); } }

/* ---------- لینک «بعدی» پایین هر فصل ---------- */
.chap__foot { display: flex; justify-content: center; margin-top: 34px; transition: opacity .3s var(--ease); }
/* لینک «بعدی» فصل‌های دیگر کم‌رنگ می‌شود تا از پشت نوار بالا دیده نشود */
html.has-chapters .chap:not(.is-cur) > .chap__foot:not(:focus-within) { opacity: 0; pointer-events: none; }
.chap__foot { position: relative; z-index: 1; }
.chap__next { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding-inline: 8px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--c200, var(--line)); color: var(--ink); font-size: 14px; font-weight: 800; box-shadow: 0 14px 30px -20px var(--cglow, rgb(24 22 45 / .4)); transition: transform .3s var(--bounce), box-shadow .3s; }
.chap__next:hover { transform: translateY(-3px); box-shadow: 0 20px 34px -18px var(--cglow, rgb(24 22 45 / .45)); }
.chap__next:active { transform: translateY(1px) scale(.98); }
.chap__next:focus-visible { outline: 3px solid var(--c600, var(--violet-600)); outline-offset: 3px; }
.chap__next-k { display: inline-grid; place-items: center; height: 30px; padding: .1em 10px 0; border-radius: 999px; background: var(--c50, var(--s2)); color: var(--c700, var(--text-2)); font-size: 12px; font-weight: 850; }
.chap__next b { font-weight: 900; }
.chap__next .glyph { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--cs, var(--ink)); color: var(--con, #fff); }
/* فقط فصل جاری، و چند بار؛ با رسیدن به هر فصل دوباره */
.chap.is-cur .chap__next .glyph { animation: chap-bob 2.2s var(--ease) 4; }
.chap--hero .chap__next { --c50: var(--violet-50); --c200: var(--violet-200); --c700: var(--violet-700); --cs: var(--violet-600); --con: #fff; --cglow: var(--violet-glow); }
@keyframes chap-bob { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(5px); } }

/* ---------- شروع (قهرمان): چهار کاشی و نوار اعتبار ---------- */
.page-home .hero__bento { grid-template-rows: minmax(150px, auto) minmax(150px, auto) auto; }
.page-home .hb--photo { grid-column: 1 / 5; grid-row: 1 / 3; }
.page-home .hb--photo img { position: absolute; inset: 0; }
.page-home .hb--rate { grid-column: 5 / 7; grid-row: 1; flex-direction: column; justify-content: center; gap: 8px; padding-block: 12px; text-align: center; }
.page-home .hb--feed { grid-column: 5 / 7; grid-row: 2; }
.page-home .hb--next { grid-column: 1 / -1; grid-row: 3; }
.hero__proof { position: relative; z-index: 1; margin-top: 30px; }
.hero__proof .proof__in { display: grid; grid-template-columns: minmax(0, 1.9fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero__proof .proof__people b { white-space: nowrap; }
.hero__proof.proof { padding-block: 0; }
@media (max-width: 1100px) {
  .hero__proof .proof__in { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__proof .proof__people { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .page-home .hero__bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 230px auto auto; }
  .page-home .hb--photo { grid-column: 1 / -1; grid-row: 1; }
  .page-home .hb--rate { grid-column: 1; grid-row: 2; }
  .page-home .hb--feed { grid-column: 2; grid-row: 2; padding: 34px 12px 12px; }
  .page-home .hb--next { grid-column: 1 / -1; grid-row: 3; }
  .hero__proof .proof__in { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero__proof .proof__item:last-child { grid-column: 1 / -1; }
}

/* ---------- ردیف دسته‌ها (به‌جای کاشی‌های بزرگ) ---------- */
.catrail { display: flex; gap: 10px; overflow-x: auto; margin: -6px -4px 4px; padding: 6px 4px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.catrail__i { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding-inline: 8px 12px; border-radius: 17px; background: #fff; border: 1px solid var(--c100); box-shadow: var(--sh-1); font-size: 13.5px; scroll-snap-align: start; transition: transform .3s var(--bounce), box-shadow .3s, border-color .3s; }
.catrail__i b { font-weight: 850; white-space: nowrap; }
.catrail__i small { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: .1em 7px 0; border-radius: 999px; background: var(--c50); color: var(--c700); font-size: 11.5px; font-weight: 850; white-space: nowrap; }
.catrail__i .ico { flex: none; transition: transform .4s var(--bounce); }
.catrail__i:hover { transform: translateY(-3px); border-color: var(--c200); box-shadow: 0 14px 24px -16px var(--cglow); }
.catrail__i:hover .ico { transform: rotate(-10deg) scale(1.12); }
.catrail__i:focus-visible { outline: 3px solid var(--c600); outline-offset: 2px; }

/* دکمه‌های تازه‌ی این صفحه ظاهر پیش‌فرض مرورگر را ندارند */
.deck__b, .chapnav__step, .chapnav__now { border: 0; background: none; -webkit-appearance: none; appearance: none; }

/* ---------- دسته‌ورق: سوئیچ و ریل پنل‌ها ---------- */
.deck { margin-top: 8px; }
.deck__seg { display: flex; gap: 6px; width: max-content; max-width: 100%; margin-bottom: 18px; padding: 6px; overflow-x: auto; scrollbar-width: none; border-radius: 20px; background: rgb(255 255 255 / .9); border: 1px solid var(--c100, var(--line)); box-shadow: 0 12px 26px -20px var(--cglow, rgb(24 22 45 / .4)); }
.deck__seg::-webkit-scrollbar { display: none; }
.js .deck__seg:empty { min-height: 60px; min-width: 260px; }
.deck__seg[hidden], html:not(.js) .deck__seg { display: none; }
.deck__b { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding-inline: 10px 16px; border-radius: 14px; color: var(--text-2); font-size: 14px; font-weight: 800; white-space: nowrap; transition: background .25s, color .25s, box-shadow .25s, transform .2s; }
.deck__b img { width: 24px; height: 24px; transition: transform .4s var(--bounce); }
.deck__b:hover { background: var(--c50, var(--s2)); color: var(--ink); }
.deck__b:hover img { transform: rotate(-8deg) scale(1.14); }
.deck__b:active { transform: scale(.97); }
.deck__b[aria-pressed="true"] { background: var(--cs, var(--ink)); color: var(--con, #fff); box-shadow: 0 10px 20px -12px var(--cglow, rgb(24 22 45 / .5)); }
.deck__b[aria-pressed="true"] img { transform: scale(1.06); filter: drop-shadow(0 4px 6px rgb(0 0 0 / .18)); }
.deck__b:focus-visible { outline: 3px solid var(--c600, var(--violet-600)); outline-offset: 2px; }
/* پنل‌ها کنار هم؛ فقط پنل فعال دیده می‌شود و ارتفاع ریل همان ارتفاع پنل فعال است */
.deck__panel { min-width: 0; padding: 10px; }
.deck { margin-inline: -10px; }
.deck__seg { margin-inline: 10px; max-width: calc(100% - 20px); }
/* چیدمان افقی از همان اولین نقاشی (کلاس js را boot.js در head می‌گذارد) تا بعد از اسکریپت چیزی جابه‌جا نشود */
.js .deck__track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; align-items: start; overflow: hidden; scroll-snap-type: x mandatory; height: var(--deck-h, auto); }
.js .deck.is-live .deck__track { transition: height .4s var(--ease); }
.js .deck__panel { scroll-snap-align: start; transition: opacity .35s var(--ease); }
/* جای سایه‌ها و گوشه‌های چرخیده تا لبه‌ی ریل آن‌ها را صاف نبرد؛ چیدمان دیده‌شده تغییر نمی‌کند */
.js .deck__panel { padding-block: 28px 52px; }
.js .deck__track { margin-block: -18px -42px; }
.deck .wheel.card--night { box-shadow: 0 30px 50px -36px rgb(24 22 45 / .55); }
.js .deck.is-ready .deck__panel:not(.is-on) { opacity: .35; }
html:not(.js) .deck__panel + .deck__panel { margin-top: 26px; }
.panel__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 16px; }
.panel__head h3 { font-size: clamp(20px, 2vw, 26px); font-weight: 900; line-height: 1.4; }
.panel__head p { margin-top: 4px; color: var(--text-2); font-size: 14px; }

/* ---------- دورهمی‌ها: پنج کارت در دو ردیف؛ روی موبایل یک ردیف کشیدنی ---------- */
.page-home .ev-filter { margin-bottom: 16px; }
.page-home .deal { margin-top: 20px; }
@media (max-width: 760px) {
  .page-home .ev-bento { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; margin-inline: -10px; padding: 4px 10px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .page-home .ev-bento > * { scroll-snap-align: center; }
  .page-home .ev-bento__feature { grid-column: auto; grid-row: auto; }
  .page-home .ev-bento__feature .ev__cover { min-height: 0; height: 190px; flex: none; }
}

/* ---------- بازی: گردونه در دو ستون، تست تمام‌عرض ---------- */
.deck .wheel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "stage head" "stage out" "stage hint"; align-items: center; gap: 14px 30px; padding: 30px 34px; text-align: start; }
.deck .wheel .wh-head { grid-area: head; justify-items: start; }
.deck .wheel .wh-head__row { justify-content: flex-start; }
.deck .wheel .wh-stage { grid-area: stage; justify-self: center; width: min(100%, 360px); }
.deck .wheel .wh-out { grid-area: out; }
.deck .wheel .wh-hint { grid-area: hint; }
.deck .wheel .wh-head h3 { font-size: clamp(22px, 2.2vw, 30px); }
@media (max-width: 760px) {
  .deck .wheel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "out" "hint"; padding: 22px 18px; text-align: center; }
  .deck .wheel .wh-head { justify-items: center; }
  .deck .wheel .wh-head__row { justify-content: center; }
  .deck .wheel .wh-stage { width: min(100%, 290px); }
}

/* ---------- روند کار: سه قدم کنار هم ---------- */
.steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.steps--row::before { top: 52px; bottom: auto; inset-inline: 12%; border-inline-start: 0; border-top: 2.5px dashed var(--c200, var(--line-2)); }
.steps--row .step { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; gap: 14px; padding: 22px; }
.steps--row .step:hover { transform: translateY(-6px); }
.steps--row .step__ico { margin-inline-start: 0; }
@media (max-width: 900px) {
  .steps--row { grid-template-columns: minmax(0, 1fr); }
  .steps--row::before { display: none; }
  .steps--row .step { grid-template-columns: 64px minmax(0, 1fr); align-items: center; }
  .steps--row .step__ui { grid-column: 1 / -1; }
  .steps--row .step:hover { transform: none; }
}

/* ---------- شفافیت: روی موبایل تعهدها دو ستونی و جمع‌وجور ---------- */
@media (max-width: 520px) {
  .page-home .trust__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page-home .trust__facts .fact-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .page-home .trust__facts small { font-size: 11.5px; line-height: 1.8; }
  .page-home .refund__axis { display: none; }
}

/* ---------- لحظه‌ها: تجربه‌ها در سه ستون ---------- */
.page-home .stories { columns: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.page-home .story { margin: 0; }
@media (max-width: 900px) { .page-home .stories { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* ---------- مکان‌ها ---------- */
.deck .plc { grid-template-columns: minmax(0, 1fr); }
.deck .plc-check { position: static; }
.deck .plc-check__list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.deck .plc-tile__type { white-space: nowrap; }
@media (min-width: 561px) { .deck .plc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .deck .plc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .deck .plc-check__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chap .partners { padding: 26px 0 0; }
.deck .moms { padding-inline: 16px; }

/* ---------- اپلیکیشن: نسخه‌ی جمع‌وجور صفحه‌ی اصلی ---------- */
.appx--compact .appx__stage { min-height: 520px; }
@media (max-width: 1100px) { .appx--compact .appx__stage { order: 0; min-height: 440px; } }
@media (max-width: 640px) { .appx--compact .appx__stage { min-height: 400px; } }

/* ---------- داک دسکتاپ در حالت فصل‌ها: دکمه‌ی «بازگشت به بالا» جایش را به «قبلی» و «بعدی» می‌دهد (شکل داک در play.css) ---------- */
@media (max-width: 1239px) { .dock--chap .dock__next-txt { display: none; } }
@media (max-width: 1119px) { .dock--chap .dock__next, .dock--chap .dock__sep { display: none; } }

/* ---------- موبایل: نوار شناور فصل‌ها بالای نوار پایین ---------- */
.chapnav { display: none; }
@media (max-width: 1000px) {
  .chapnav:not([hidden]) { position: fixed; z-index: var(--z-tabbar); left: 50%; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--dk-glass); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); color: #fff; box-shadow: var(--dk-edge), var(--dk-drop); transform: translate(-50%, 160%); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), opacity .25s; }
  html.chap-on .chapnav:not([hidden]) { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
  html.has-chapters .chapnav:not([hidden]):has(:focus-visible) { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
  .chapnav__step { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .14); transition: transform .2s, opacity .2s; }
  .chapnav__step .glyph { width: 20px; height: 20px; }
  .chapnav__step:active:not(:disabled) { transform: scale(.9); }
  .chapnav__step:disabled { opacity: .4; }
  .chapnav__step--go:not(:disabled) { background: var(--dk-go); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2), inset 0 1px 0 rgb(255 255 255 / .38), 0 10px 20px -10px var(--pink-glow); }
  .chapnav__now { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding-inline: 14px 12px; border-radius: 999px; color: #fff; font-size: 13.5px; font-weight: 850; white-space: nowrap; }
  .chapnav__now small { font-size: 11px; font-weight: 750; opacity: .78; }
  .chapnav__now .glyph { width: 16px; height: 16px; opacity: .8; }
  .chapnav :focus-visible { outline: 3px solid var(--sun-300); outline-offset: 2px; }
  .page-home { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .page-home { --chap-pad: 52px; --chap-gap: 22px; --chap-r: 28px; --chap-lap: 28px; }
  body:has(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select):focus) .chapnav { display: none; }
}
@media (max-width: 640px) {
  .deck .agx__strip, .deck .ev-filter .tabs { margin-inline: -10px; padding-inline: 12px; scroll-padding-inline: 12px; }
}
@media (max-width: 600px) {
  .chap .shead { gap: 12px; }
  .chap .shead__ico { width: 54px; height: 54px; }
  .chap .shead__ico .ico { width: 32px; height: 32px; }
  .chap .shead__act { width: 100%; }
  .chap .shead__act .btn { width: 100%; }
  .deck__b { height: 44px; padding-inline: 8px 12px; font-size: 13px; }
  .deck__b img { width: 22px; height: 22px; }
}
/* دکمه‌ی «بالای صفحه» در صفحه‌ی اصلی لازم نیست؛ فهرست بخش‌ها و حلقه‌ی داک کارش را می‌کنند */
html.has-chapters .totop { display: none !important; }

/* ---------- فهرست بخش‌ها (موبایل) ---------- */
.chapsheet { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 40px); margin: auto auto max(12px, env(safe-area-inset-bottom)); padding: 0; border: 0; border-radius: 28px; background: #fff; color: var(--ink); box-shadow: 0 30px 60px -20px rgb(24 22 45 / .5); }
html:has(#chapsheet[open]) { overflow: hidden; }
.chapsheet__head .btn { width: 44px; height: 44px; }
.chapsheet::backdrop { background: rgb(24 22 45 / .45); backdrop-filter: blur(3px); }
.chapsheet[open] { animation: fade-up .35s var(--ease) both; }
.chapsheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px 12px; }
.chapsheet__head b { font-size: 16px; font-weight: 900; }
.chapsheet__list { display: grid; gap: 4px; padding: 6px 10px 14px; }
.chapsheet__list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border-radius: 16px; font-size: 15px; font-weight: 800; transition: background .2s; }
.chapsheet__list a:hover { background: var(--s2); }
.chapsheet__list a[aria-current] { background: var(--violet-50); color: var(--violet-700); }
.chapsheet__list a > .glyph { width: 16px; height: 16px; margin-inline-start: auto; opacity: .45; }
.chapsheet__n { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding-top: .1em; border-radius: 10px; background: var(--s2); font-size: 12.5px; font-weight: 850; }
.chapsheet__list a[aria-current] .chapsheet__n { background: var(--violet-600); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .chap.is-cur .chap__next .glyph { animation: none; }
  .js .deck.is-live .deck__track { transition: none; }
}
@media print { .chapnav, .chap__foot, .deck__seg { display: none !important; } .js .deck__track { display: block; height: auto; overflow: visible; } }
