/* ==========================================================================
   Learnify — Private Tutor Website (v2: modern)
   معماری: Tokens → Base → Layout → Components → Sections → Media Queries
   رویکرد: Mobile First (استایل پایه برای موبایل، media queryها با min-width)
   ========================================================================== */

/* ---------- ۰. فونت ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* برای بوردر گرادیانی چرخان در Hero */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- ۱. Design Tokens ---------- */
:root {
  /* رنگ‌ها */
  --navy: #17324d;
  --navy-deep: #0d1f33;
  --purple: #7256d8;
  --purple-dark: #5b43b8;
  --sky: #48b5e8;
  --bg: #f7f8fc;
  --tint: #eceffb;
  --surface: #ffffff;
  --text: #263746;
  --muted: #566879;
  --line: #e1e5f1;
  --grad: linear-gradient(135deg, #8266e6 0%, #6246cc 60%, #4d3aa8 100%);
  --grad-accent: linear-gradient(135deg, var(--purple), var(--sky));

  /* تایپوگرافی روان — clamp(حداقل موبایل، شیب بر حسب vw، حداکثر دسکتاپ) */
  --fs-h1: clamp(1.625rem, 1.083rem + 2.708vw, 3.25rem);       /* ۲۶ → ۵۲ */
  --fs-h2: clamp(1.3125rem, 1rem + 1.5625vw, 2.25rem);         /* ۲۱ → ۳۶ */
  --fs-h3: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);            /* ۱۸ → ۲۴ */
  --fs-body: clamp(0.9375rem, 0.875rem + 0.3125vw, 1.125rem);  /* ۱۵ → ۱۸ */
  --fs-desc: clamp(0.875rem, 0.833rem + 0.2083vw, 1rem);       /* ۱۴ → ۱۶ */
  --fs-small: clamp(0.8125rem, 0.792rem + 0.104vw, 0.875rem);  /* ۱۳ → ۱۴ */

  --lh-title: 1.4;
  --lh-body: 1.9;

  /* فاصله‌ها */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --section-y: clamp(3.5rem, 2rem + 6vw, 7rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --gap: clamp(1rem, 0.7rem + 1.2vw, 1.5rem);

  /* ابعاد و جلوه */
  --container: 80rem; /* ۱۲۸۰px */
  --measure: 62ch;
  --radius: 1.5rem;
  --radius-sm: 0.875rem;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.9) inset, 0 1px 2px rgb(23 50 77 / 0.05), 0 18px 40px -22px rgb(23 50 77 / 0.28);
  --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.9) inset, 0 4px 8px rgb(23 50 77 / 0.06), 0 28px 48px -22px rgb(23 50 77 / 0.4);
  --ring: 0 0 0 4px rgb(114 86 216 / 0.28);
  --header-h: 4rem;
}

/* ---------- ۲. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 2rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  accent-color: var(--purple);
}

::selection { background: var(--purple); color: #fff; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }

h1, h2, h3 {
  line-height: var(--lh-title);
  color: var(--navy);
  font-weight: 800;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--fs-h1); line-height: 1.3; font-weight: 900; }
h2 { font-size: var(--fs-h2); font-weight: 900; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); line-height: 1.5; font-weight: 800; }

p { overflow-wrap: anywhere; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -5rem; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

/* نوار پیشرفت اسکرول (فقط مرورگرهای دارای scroll-driven animations) */
.scroll-progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-progress {
      display: block; position: fixed; inset-block-start: 0; inset-inline: 0; height: 3px; z-index: 80;
      background: var(--grad-accent); transform-origin: right center; transform: scaleX(0);
      animation: progress linear both; animation-timeline: scroll(root);
    }
    @keyframes progress { to { transform: scaleX(1); } }
  }
}

/* ---------- ۳. Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container)); /* Fluid + سقف max-width */
  margin-inline: auto;
}

.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--tint); }
.section--navy {
  color: #dbe6f2;
  background:
    radial-gradient(50% 60% at 100% 0%, rgb(114 86 216 / 0.5), transparent 70%),
    radial-gradient(45% 55% at 0% 100%, rgb(72 181 232 / 0.28), transparent 70%),
    var(--navy);
}
.section--navy h2 { color: #fff; }

.section-head { margin-bottom: clamp(1.75rem, 1rem + 2.5vw, 3rem); }
.section-head h2 { position: relative; padding-bottom: 0.9rem; }
.section-head h2::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
  width: 3.5rem; height: 0.3rem; border-radius: 1rem; background: var(--grad-accent);
}
.section-head p { margin-top: var(--space-3); max-width: var(--measure); color: var(--muted); font-size: var(--fs-desc); }
.section--navy .section-head p { color: #b9cade; }

/* ---------- ۴. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.5rem 1.6rem;
  border: 1.5px solid transparent; border-radius: 99rem;
  font: inherit; font-size: var(--fs-desc); font-weight: 800; line-height: 1.4; text-align: center;
  cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 12px 24px -12px rgb(98 70 204 / 0.9), 0 1px 0 rgb(255 255 255 / 0.25) inset; }
.btn--accent { background: linear-gradient(135deg, #7fd0f5, var(--sky)); color: var(--navy-deep); box-shadow: 0 12px 28px -12px rgb(72 181 232 / 0.8); }
.btn--outline { border-color: var(--purple); color: var(--purple-dark); background: transparent; }
.btn--outline-light { border-color: rgb(255 255 255 / 0.4); color: #fff; background: rgb(255 255 255 / 0.06); backdrop-filter: blur(8px); }
.btn--soft { background: #ebe7fb; color: var(--purple-dark); }
.btn--lg { min-height: 3.5rem; font-size: var(--fs-body); }

.link { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--purple-dark); font-weight: 800; font-size: var(--fs-desc); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips li {
  padding: 0.15rem 0.9rem; border-radius: 99rem; background: #ebe7fb; color: var(--purple-dark);
  font-size: var(--fs-small); font-weight: 700;
}

.social { display: flex; gap: var(--space-3); }
.social a {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: 50%; background: var(--tint); color: var(--navy); transition: background-color 0.2s, color 0.2s;
}
.social--light a { background: rgb(255 255 255 / 0.1); color: #fff; }

.avatar { flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 2px #cfc6f5; }
.stars { display: inline-flex; gap: 0.15rem; color: #f2b134; }
.stars .icon { width: 1.1rem; height: 1.1rem; }

/* شیشه‌ای */
.chip {
  position: absolute; display: flex; align-items: center; gap: 0.6rem;
  max-width: calc(100% - 1.5rem); padding: 0.45rem 1rem 0.45rem 0.6rem; margin: 0;
  border-radius: 99rem; color: #fff; font-size: var(--fs-small); font-weight: 700; line-height: 1.5;
  background: rgb(13 31 51 / 0.55); border: 1px solid rgb(255 255 255 / 0.25);
  backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.5);
}
.chip--top { top: 0.75rem; inset-inline-start: 0.75rem; }
.chip--bottom { bottom: 0.75rem; inset-inline-end: 0.75rem; padding-inline-start: 1rem; }
.chip .icon { color: #7fd0f5; stroke-width: 2.6; }
.avatars { display: flex; }
.avatars img { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.avatars img + img { margin-inline-start: -0.65rem; }

/* ---------- ۵. Header (شناور) ---------- */
.site-header {
  position: sticky; top: 0.75rem; z-index: 50;
  width: min(100% - 2 * var(--gutter), var(--container)); margin: 0.75rem auto calc(-1 * (var(--header-h) + 0.75rem));
  border-radius: 1.25rem; background: rgb(255 255 255 / 0.94);
  border: 1px solid rgb(255 255 255 / 0.7);
  box-shadow: 0 14px 40px -18px rgb(13 31 51 / 0.55);
  backdrop-filter: blur(16px) saturate(1.5);
}
.site-header .container { width: 100%; padding-inline: var(--space-3) var(--space-4); }
.header__bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--space-4); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--navy); }
.brand__mark { width: 2.4rem; height: 2.4rem; padding: 0.4rem; border-radius: 0.8rem; color: #fff; background: var(--grad); stroke-width: 2.2; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.6875rem; color: var(--muted); }
.brand--light { color: #fff; }
.brand--light .brand__tag { color: #aebfd3; }

/* منوی همبرگری بدون جاوااسکریپت */
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; cursor: pointer;
  border-radius: 0.9rem; color: var(--navy); background: var(--tint);
}
.nav-btn .icon--close { display: none; }
.nav-toggle:checked ~ .nav-btn .icon--open { display: none; }
.nav-toggle:checked ~ .nav-btn .icon--close { display: block; }
.nav-toggle:focus-visible ~ .nav-btn { outline: 3px solid var(--sky); outline-offset: 2px; }

.nav {
  display: none; position: absolute; inset-inline: 0; top: calc(100% + 0.5rem);
  max-height: calc(100dvh - var(--header-h) - 2rem); overflow-y: auto;
  background: rgb(255 255 255 / 0.97); border-radius: 1.25rem; padding: var(--space-3) var(--space-4) var(--space-4);
  box-shadow: 0 24px 50px -20px rgb(13 31 51 / 0.55);
}
.nav-toggle:checked ~ .nav { display: block; }
.nav__list { display: flex; flex-direction: column; }
.nav__list a:not(.btn) { display: block; padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: var(--fs-body); }
.nav__list a[aria-current="page"] { color: var(--purple); }
.nav__cta { margin-top: var(--space-4); }
.nav__cta .btn { width: 100%; }

/* ---------- ۶. Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip; color: #e4edf6;
  background:
    radial-gradient(60% 55% at 90% 5%, rgb(114 86 216 / 0.62), transparent 70%),
    radial-gradient(45% 50% at 5% 90%, rgb(72 181 232 / 0.34), transparent 70%),
    var(--navy-deep);
  padding-block: calc(var(--header-h) + 3.5rem) var(--space-6);
}
/* کاغذ شطرنجی دفتر ریاضی */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1px) 0 0 / 2.25rem 2.25rem,
    linear-gradient(90deg, rgb(255 255 255 / 0.06) 1px, transparent 1px) 0 0 / 2.25rem 2.25rem;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 75%);
}
.hero__inner { display: flex; flex-direction: column; gap: var(--space-6); } /* موبایل: اول متن بعد تصویر */
.hero__content { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.hero__title { color: #fff; max-width: 20em; }
.hero__tagline { font-size: var(--fs-h3); font-weight: 700; line-height: 1.6; color: #9fdcf7; max-width: 32em; text-wrap: balance; }
.hero__lead { max-width: var(--measure); color: #c3d3e4; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); width: 100%; }
.hero__actions .btn { flex: 1 1 12rem; }

.hero__media { position: relative; isolation: isolate; min-width: 0; align-self: stretch; }
.hero__media::before { /* حاشیه گرادیانی چرخان */
  content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: calc(1.75rem + 3px);
  background: conic-gradient(from var(--angle), var(--purple), var(--sky), rgb(114 86 216 / 0) 35%, var(--purple) 70%, var(--sky));
}
.hero__media > img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 38% center;
  border-radius: 1.75rem; background: var(--navy);
}

/* پیش‌فرض بدون Flex-wrap سخت؛ آزمایش flex-grow / flex-shrink / flex-basis:
   هر آیتم می‌تواند تا ۱۰rem کوچک شود (basis)، رشد کند (grow ۱) و در ردیف تنگ جمع شود (shrink ۱) */
.hero__stats {
  display: flex; flex-wrap: wrap; gap: var(--space-4) var(--gap);
  margin-top: var(--space-6); padding: var(--space-5);
  border-radius: var(--radius); background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.12); backdrop-filter: blur(12px);
}
.hero__stats li { flex: 1 1 10rem; min-width: 0; display: flex; flex-direction: column; }
.hero__stats strong {
  font-size: var(--fs-h1); line-height: 1.25; font-weight: 900;
  background: linear-gradient(180deg, #fff 30%, #9fdcf7); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__stats span { font-size: var(--fs-desc); color: #b9cade; }

/* یک سکانس ورود برای Hero */
@media (prefers-reduced-motion: no-preference) {
  .hero__content > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero__content > :nth-child(2) { animation-delay: 0.1s; }
  .hero__content > :nth-child(3) { animation-delay: 0.2s; }
  .hero__content > :nth-child(4) { animation-delay: 0.3s; }
  .hero__media { animation: rise 1.1s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero__media::before { animation: spin 9s linear infinite; }
  @keyframes rise { from { opacity: 0; translate: 0 1.5rem; } }
  @keyframes spin { to { --angle: 360deg; } }
}

/* ---------- ۷. Course card + Container Query ---------- */
.course-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.course-slot--featured { grid-column: 1 / -1; }
.course-slot { min-width: 0; container: course / inline-size; }

/* حالت پایه = فضای باریک: تصویر بالا، اطلاعات زیر آن، دکمه تمام‌عرض */
.course-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.3s, box-shadow 0.3s;
}
.course-card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: scale 0.6s; }
.course-card__body { display: flex; flex-direction: column; flex: 1; gap: var(--space-3); padding: var(--space-5); min-width: 0; }
.course-card__title { font-size: var(--fs-h3); }
.course-card__sub { color: var(--purple-dark); font-weight: 800; font-size: var(--fs-small); margin-top: calc(-1 * var(--space-2)); }
.course-card__meta { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--fs-desc); }
.course-card__meta > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px dashed var(--line); }
.course-card__meta dt { color: var(--muted); }
.course-card__meta dd { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.course-card__cta { width: 100%; margin-top: auto; }
.course-card__img { clip-path: inset(0); } /* برای زوم داخل کادر */

/* فضای عریض: تصویر کنار اطلاعات، دکمه پایین کارت */
@container course (min-width: 36rem) {
  .course-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .course-card__img { height: 100%; aspect-ratio: auto; min-height: 17rem; }
  .course-card__body { padding: var(--space-6); }
  .course-card__cta { width: auto; align-self: flex-start; margin-top: auto; }
}

/* ---------- ۸. Tutor card + Container Query ---------- */
.tutor-slot { min-width: 0; container: tutor / inline-size; }

/* پایه = فضای باریک (مثلاً سایدبار) */
.tutor-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  padding: var(--space-5); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tutor-card__media { position: relative; isolation: isolate; width: min(100%, 8rem); flex: none; }
.tutor-card__photo { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 50%; border: 4px solid #ebe7fb; }
.tutor-card__badge { display: none; }
.tutor-card__body { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); min-width: 0; }
.tutor-card__role { color: var(--purple-dark); font-weight: 800; font-size: var(--fs-desc); }
.tutor-card__bio { color: var(--muted); font-size: var(--fs-desc); max-width: var(--measure); }
.tutor-card__facts { display: grid; gap: var(--space-3); width: 100%; text-align: start; font-size: var(--fs-desc); }
.tutor-card__facts dt { color: var(--muted); font-size: var(--fs-small); }
.tutor-card__facts dd { font-weight: 700; }
.tutor-card .chips { justify-content: center; }

/* فضای متوسط: عکس کنار متن */
@container tutor (min-width: 34rem) {
  .tutor-card { flex-direction: row; align-items: flex-start; text-align: start; gap: var(--space-6); padding: var(--space-6); }
  .tutor-card__media { width: 12rem; }
  .tutor-card__photo { border: 0; border-radius: 1.25rem; }
  .tutor-card__media::before { /* سایه رنگی پشت عکس */
    content: ""; position: absolute; z-index: -1; inset-block: 1rem -1rem; inset-inline: -1rem 1rem;
    border-radius: 1.25rem; background: var(--grad-accent); opacity: 0.28;
  }
  .tutor-card__badge {
    display: block; position: absolute; bottom: 0.6rem; inset-inline: 0.6rem; padding: 0.35rem 0.75rem; border-radius: 0.9rem;
    background: rgb(13 31 51 / 0.6); backdrop-filter: blur(12px); border: 1px solid rgb(255 255 255 / 0.25);
    color: #fff; font-size: var(--fs-small); text-align: center;
  }
  .tutor-card__body { align-items: flex-start; flex: 1; }
  .tutor-card .chips { justify-content: flex-start; }
  .tutor-card__facts { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}
/* فضای عریض */
@container tutor (min-width: 60rem) {
  .tutor-card__media { width: 19rem; }
  .tutor-card__bio { font-size: var(--fs-body); }
}

/* ---------- ۹. Method (Grid) ---------- */
.steps { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.step {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.step::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--grad-accent); }
.step__num {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--grad-accent); color: #fff; font-weight: 900; margin-bottom: var(--space-2);
  box-shadow: 0 8px 18px -8px rgb(114 86 216 / 0.8);
}
.step p { color: var(--muted); font-size: var(--fs-desc); }

/* ---------- ۱۰. Results ---------- */
.stats {
  display: grid; gap: var(--gap); margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
}
.stats li {
  display: flex; flex-direction: column; min-width: 0; padding: var(--space-5); border-radius: var(--radius);
  background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.12); backdrop-filter: blur(10px);
}
.stats strong {
  font-size: var(--fs-h1); line-height: 1.3; font-weight: 900;
  background: linear-gradient(180deg, #fff 30%, #9fdcf7); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats span { font-size: var(--fs-desc); color: #b9cade; }

.quotes { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.quote {
  display: flex; flex-direction: column; gap: var(--space-4); min-width: 0;
  padding: var(--space-5); background: var(--surface); color: var(--text); border-radius: var(--radius);
  box-shadow: 0 24px 50px -28px rgb(0 0 0 / 0.6);
}
.quote blockquote { flex: 1; font-size: var(--fs-body); overflow-wrap: anywhere; }
.quote figcaption { display: flex; align-items: center; gap: var(--space-3); font-weight: 800; color: var(--navy); }
.quote small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-small); }

/* ---------- ۱۱. Packages ---------- */
.packages { display: grid; gap: var(--gap); align-items: stretch; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.package {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.package--popular {
  border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-accent) border-box;
  box-shadow: 0 30px 60px -30px rgb(114 86 216 / 0.7);
}
.package__badge {
  position: absolute; top: 0; inset-inline-start: 50%; translate: 50% -50%;
  padding: 0.1rem 1rem; border-radius: 99rem; background: var(--grad); color: #fff; font-size: var(--fs-small); font-weight: 800; white-space: nowrap;
}
[dir="rtl"] .package__badge { translate: 50% -50%; }
.package__sessions { color: var(--muted); font-size: var(--fs-desc); margin-top: calc(-1 * var(--space-2)); }
.package__price { font-size: var(--fs-h2); font-weight: 900; color: var(--navy); line-height: 1.3; }
.package__price small { font-size: var(--fs-desc); font-weight: 500; color: var(--muted); }
.ticks { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; font-size: var(--fs-desc); }
.ticks li { position: relative; padding-inline-start: 1.7rem; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.55em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: #ebe7fb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b43b8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.package .btn { width: 100%; }

/* ---------- ۱۲. Booking ---------- */
.booking { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
.form { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form__grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-weight: 800; font-size: var(--fs-desc); color: var(--navy); padding: 0; }
.field input[type="text"], .field input[type="tel"], .field input[type="time"], .field select, .field textarea {
  width: 100%; min-height: 3.25rem; padding: 0.6rem 1.1rem;
  font: inherit; font-size: 1rem; /* ≥۱۶px تا iOS زوم نکند */ color: var(--text);
  background: var(--bg); border: 1.5px solid transparent; border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--line) inset; transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 7rem; line-height: 1.8; field-sizing: content; max-height: 16rem; }
.field select {
  appearance: none; padding-inline-end: 2.75rem;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566879' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 1rem center / 1.2rem;
}
.field input::placeholder, .field textarea::placeholder { color: #7a8794; }
.field :is(input, select, textarea):focus { outline: none; background-color: #fff; border-color: var(--purple); box-shadow: var(--ring); }
.field :is(input, select, textarea):user-invalid { border-color: #d64545; box-shadow: 0 0 0 4px rgb(214 69 69 / 0.15); }

.seg { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.seg legend { width: 100%; margin-bottom: var(--space-2); }
.seg label { flex: 1 1 8rem; position: relative; font-weight: 700; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: grid; place-items: center; min-height: 3.25rem; border-radius: var(--radius-sm);
  background: var(--bg); box-shadow: 0 0 0 1px var(--line) inset; color: var(--text); cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg input:checked + span { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -12px rgb(98 70 204 / 0.9); }
.seg input:focus-visible + span { box-shadow: var(--ring); }

.form__submit { width: 100%; margin-top: var(--space-5); }

.booking__side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.contact { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact__list { display: flex; flex-direction: column; gap: var(--space-4); }
.contact__list li { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.contact__list .icon { width: 2.6rem; height: 2.6rem; padding: 0.65rem; border-radius: 0.9rem; background: #ebe7fb; color: var(--purple-dark); }
.contact__list span { display: flex; flex-direction: column; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.contact__list small { color: var(--muted); font-weight: 400; font-size: var(--fs-small); }

.photo-card { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); isolation: isolate; }
.photo-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 65%; }
.photo-card figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 2.5rem var(--space-5) var(--space-4);
  background: linear-gradient(transparent, rgb(13 31 51 / 0.85)); color: #fff; font-size: var(--fs-desc); font-weight: 600;
}

/* ---------- ۱۳. Articles ---------- */
.article-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.article {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform 0.3s, box-shadow 0.3s;
}
.article__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: scale 0.6s; clip-path: inset(0); }
.article__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-3); padding: var(--space-5); min-width: 0; }
.article__cat { align-self: flex-start; padding: 0 0.8rem; border-radius: 99rem; background: #ebe7fb; color: var(--purple-dark); font-weight: 800; font-size: var(--fs-small); }
.article__desc { color: var(--muted); font-size: var(--fs-desc); }
.article__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); }

/* ---------- ۱۴. FAQ ---------- */
.faq-wrap { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
.faq { display: flex; flex-direction: column; gap: var(--space-3); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 3.5rem; padding: 0.6rem var(--space-5); cursor: pointer; list-style: none; font-weight: 800; color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--purple); transition: rotate 0.25s; }
.faq details[open] summary .icon { rotate: 45deg; }
.faq details[open] { border-color: #cfc6f5; }
.faq details p { padding: 0 var(--space-5) var(--space-5); color: var(--muted); font-size: var(--fs-desc); max-width: var(--measure); }
#faq { padding-bottom: calc(var(--section-y) + 2.5rem); }

/* ---------- ۱۵. Footer ---------- */
.site-footer {
  position: relative; margin-top: -2.5rem; border-radius: 2rem 2rem 0 0;
  background:
    radial-gradient(40% 80% at 100% 0%, rgb(114 86 216 / 0.35), transparent 70%),
    var(--navy-deep);
  color: #b9cade; padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}
.footer__grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
.footer__about { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.footer__about p { font-size: var(--fs-desc); max-width: 36ch; }
.footer__col h3 { color: #fff; font-size: var(--fs-body); margin-bottom: var(--space-3); }
.footer__col ul:not(.social) { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--fs-desc); }
.footer__col ul:not(.social) a { display: inline-block; padding-block: 0.15rem; }
.footer__col .social { margin-top: var(--space-4); }
.footer__copy {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-align: center;
  margin-top: var(--space-7); padding-block: var(--space-5); border-top: 1px solid rgb(255 255 255 / 0.12); font-size: var(--fs-small);
}
.footer__credit bdi { color: #fff; font-weight: 800; letter-spacing: 0.01em; }

/* ==========================================================================
   Media Queries (Mobile First) — breakpointها بر اساس نیاز طراحی:
   600  → ستون دوم برای فرم/فوتر/مراحل
   900  → چیدمان دو ستونی Hero، فرم رزرو، مراحل افقی
   1120 → منوی افقی (با عرض واقعی آیتم‌های منو تعیین شد)
   1200 → دسکتاپ: فوتر چهار ستونی
   ========================================================================== */
@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form { padding: var(--space-6); }
  .form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--full { grid-column: 1 / -1; }
  .form__submit { width: auto; min-width: 14rem; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__actions .btn { flex: 0 1 auto; }
  .hero__media > img { aspect-ratio: 16 / 10; }
}

@media (min-width: 680px) {
  .course-slot--wide { grid-column: span 2; }
}

@media (min-width: 900px) {
  .hero__inner { flex-direction: row; align-items: center; gap: var(--space-7); }
  .hero__content { flex: 1 1 52%; }
  .hero__media { flex: 1 1 48%; align-self: center; }
  .hero__media > img { aspect-ratio: 5 / 4.4; }
  .chip--top { top: 1.25rem; inset-inline-start: -1.25rem; }
  .chip--bottom { bottom: 1.5rem; inset-inline-end: -1.25rem; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* کارت‌های روش تدریس: افقی */
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: calc(var(--space-5) + 1.375rem); inset-inline-end: calc(-1 * var(--gap)); width: var(--gap); border-top: 2px dashed #b9b1e6;
  }
  .booking { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
  .faq-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--space-7); align-items: start; }
  .faq-wrap .section-head { position: sticky; top: calc(var(--header-h) + 3rem); margin-bottom: 0; }
  .package--popular { translate: 0 -0.75rem; }
}

@media (min-width: 1120px) {
  :root { --header-h: 4.5rem; }
  .nav-btn { display: none; }
  .nav { display: block; position: static; flex: 1; max-height: none; overflow: visible; padding: 0; background: none; border-radius: 0; box-shadow: none; }
  .nav__list { flex-direction: row; align-items: center; gap: 0.15rem; }
  .nav__list a:not(.btn) { padding: 0.45rem 0.8rem; border: 0; border-radius: 99rem; font-size: 0.9375rem; white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
  .nav__list a[aria-current="page"] { background: #ebe7fb; }
  .nav__cta { margin: 0; margin-inline-start: auto; }
  .nav__cta .btn { width: auto; min-height: 2.9rem; }
}

@media (min-width: 1200px) {
  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--space-7); }
}

/* ---------- حالت افقی (Landscape) روی گوشی‌های کم‌ارتفاع ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .site-header { position: relative; top: 0; }
  .hero { padding-block-start: calc(var(--header-h) + 1.5rem); }
  .hero__media > img { aspect-ratio: 16 / 9; max-height: 14rem; }
  .nav { max-height: 65dvh; }
}

/* ---------- Hover: فقط دستگاه‌هایی که واقعاً hover دارند ---------- */
@media (hover: hover) {
  .btn--primary:hover { box-shadow: 0 16px 30px -10px rgb(98 70 204 / 1), 0 1px 0 rgb(255 255 255 / 0.25) inset; transform: translateY(-2px); }
  .btn--accent:hover { transform: translateY(-2px); }
  .btn--outline:hover, .btn--soft:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
  .btn--outline-light:hover { background: rgb(255 255 255 / 0.16); border-color: #fff; }
  .nav__list a:not(.btn):hover { color: var(--purple); background: var(--tint); }
  .course-card:hover, .article:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
  .course-card:hover .course-card__img, .article:hover .article__img { scale: 1.06; }
  .social a:hover { background: var(--purple); color: #fff; }
  .footer__col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
  .link:hover { text-decoration: underline; text-underline-offset: 4px; }
  .faq summary:hover { color: var(--purple); }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .course-card:hover, .article:hover { transform: none; }
  .course-card:hover .course-card__img, .article:hover .article__img { scale: 1; }
}
