/* صفحهٔ «درباره من»
   تولیدشده از about-me.html — سیستم طراحی: design-system/nariman-yadollahi/MASTER.md */

/* ══ FIXED SIDE SCROLL TRACK ════════════════════════════════════════
   inset-inline-end در RTL = سمت چپ، یعنی همان جای قبلی، ولی حالا
   منطقی است و اگر روزی صفحه LTR شود خودش جابه‌جا می‌شود.
   ═══════════════════════════════════════════════════════════════════ */
.side-track {
  position: fixed;
  inset-inline-end: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 180px;
  z-index: 200;
}
.side-track-bg {
  position: absolute; inset: 0;
  background: var(--color-off);
  opacity: .25;
}
.side-track-fill {
  position: absolute;
  top: 0; inset-inline-start: 0;
  width: 1px;
  height: 0%;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
  transition: height .08s linear;
}
.side-dots {
  position: absolute;
  top: 0; inset-inline-start: 50%;
  transform: translateX(50%);
  height: 100%;
}
.side-dot {
  position: absolute;
  inset-inline-start: 50%;
  transform: translate(50%, -50%) scale(1);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-off);
  transition: background .4s, box-shadow .4s, transform .4s;
}
/* نشانهٔ فعال: رنگ + هاله + بزرگ‌نمایی.
   اتکای صرف به رنگ معیار WCAG 1.4.1 را رد می‌کند. */
.side-dot.on {
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  transform: translate(50%, -50%) scale(1.5);
}

/* ══ HERO ════════════════════════════════════════════════════════════ */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

/* در RTL ویژگی inline-end سمت چپ فیزیکی است — همان جای اصلی تصویر */
.hero-img-block {
  position: absolute;
  inset-inline-end: 0; top: 0;
  width: 44%;
  height: 100%;
  background: var(--color-surface-3);
  overflow: hidden;
  z-index: 0;
}
.hero-img-block img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: .75;
}
.hero-img-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-border-strong);
  font-size: var(--text-small);
  text-align: center;
  padding: var(--space-md);
}

.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-content {
  /* تصویر سمت چپ فیزیکی است؛ محتوا از آن فاصله می‌گیرد */
  margin-inline-end: 42%;
  padding-inline-start: 52px;
  padding-block: 80px;
  background: var(--color-bg);
}
.hero-hl {
  font-size: var(--text-hero);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
}
.hero-hl em { font-style: normal; color: var(--color-accent); }
.hero-sub {
  font-size: 1.0625rem;
  color: var(--color-fg-muted);
  max-width: 68ch;
  margin-bottom: var(--space-lg);
  line-height: var(--leading-body);
}
.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  padding-top: 36px;
  border-top: 1px solid var(--color-border);
}
.stat { font-size: var(--text-small); color: var(--color-fg-subtle); }
.stat b {
  display: block;
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--color-fg);
  margin-bottom: 2px;
  line-height: 1.2;
}

/* ══ PAIN ════════════════════════════════════════════════════════════ */
.pain { padding: var(--space-2xl) 0; border-bottom: 1px solid var(--color-border); }
/* ══ STORY ═══════════════════════════════════════════════════════════ */
.story { padding: var(--space-2xl) 0; border-bottom: 1px solid var(--color-border); }
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--space-xl);
  align-items: center;
}
.story-img-ph, .story-img-block {
  width: 100%;
  aspect-ratio: 3/4;        /* CLS را صفر نگه می‌دارد */
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-border-strong);
  font-size: var(--text-small);
  text-align: center;
  padding: 20px;
}
.story-img-block img { width: 100%; height: 100%; object-fit: cover; }
.story-body p {
  font-size: 1rem;
  color: var(--color-fg-muted);
  margin-bottom: 22px;
  line-height: var(--leading-body);
}
.story-body p:last-child { margin-bottom: 0; }
.story-body strong { color: var(--color-fg); font-weight: bold; }

/* ══ WHY ══════════════════════════════════════════════════════════════ */
.why {
  padding: 110px 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.why::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, var(--color-accent-faint) 0%, transparent 70%);
  pointer-events: none;
}
.why-q {
  font-size: var(--text-h1);
  font-weight: var(--weight-display);
  line-height: 1.75;
  max-width: 680px;
  margin: 0 auto var(--space-md);
  position: relative;
}
.why-q span { color: var(--color-accent); }
.why-body {
  font-size: 1rem;
  color: var(--color-fg-muted);
  max-width: 68ch;
  margin: 0 auto;
  line-height: var(--leading-body);
  position: relative;
}

/* ══ CREDS ════════════════════════════════════════════════════════════ */
.creds { padding: 90px 0; border-bottom: 1px solid var(--color-border); }
.creds h2 { font-size: var(--text-h3); font-weight: bold; margin-bottom: 30px; }
/* ══ METHOD (SCROLL PATH) ════════════════════════════════════════════ */
.method { padding: var(--space-2xl) 0; border-bottom: 1px solid var(--color-border); }
.method-top { margin-bottom: 70px; }
.method-top h2 { font-size: var(--text-h2); font-weight: bold; }

.path-scene { position: relative; }
.path-svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 140px;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.m-steps { position: relative; z-index: 2; }
.m-step {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  min-height: 160px;
  margin-bottom: var(--space-lg);
  opacity: 0;
  transform: translateY(16px);     /* MASTER §۷: ۸ تا ۱۶px، بیشتر شبیه slide می‌شود */
  transition: opacity .4s ease-out, transform .4s ease-out;
}
.m-step.vis { opacity: 1; transform: translateY(0); }

.m-text { padding: 0 30px; }
.m-text h3 { font-size: var(--text-h3); font-weight: bold; margin-bottom: 10px; color: var(--color-fg); }
.m-text p  { font-size: 0.9375rem; color: var(--color-fg-muted); line-height: 1.85; }

.m-dot-cell { display: flex; align-items: center; justify-content: center; }
.m-dot-ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-off);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .24s ease-out, box-shadow .24s ease-out, transform .24s ease-out;
}
.m-dot-ring.lit {
  border-color: var(--color-accent);
  box-shadow: 0 0 14px rgba(1,184,254,.7);
  transform: scale(1.2);           /* نشانهٔ غیررنگی */
}
.m-dot-core {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-off);
  transition: background .24s ease-out;
}
.m-dot-ring.lit .m-dot-core { background: var(--color-accent); }

/* گام فرد: متن راست — گام زوج: متن چپ (شبکهٔ RTL) */
.m-step:nth-child(odd)  .m-text     { order: 0; text-align: right; }
.m-step:nth-child(odd)  .m-dot-cell { order: 1; }
.m-step:nth-child(odd)  .m-empty    { order: 2; }
.m-step:nth-child(even) .m-empty    { order: 0; }
.m-step:nth-child(even) .m-dot-cell { order: 1; }
.m-step:nth-child(even) .m-text     { order: 2; text-align: left; }

/* ══ CTA ══════════════════════════════════════════════════════════════ */
.cta-sec { padding: 120px 0 var(--space-3xl); text-align: center; }
.cta-hl {
  font-size: var(--text-h1);
  font-weight: var(--weight-display);
  line-height: 1.65;
  margin: 0 auto var(--space-lg);
  max-width: 580px;
}
.cta-hl span { color: var(--color-accent); }
/* ══ RESPONSIVE ══════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .wrap { padding: 0 20px; }
  .hero-img-block { display: none; }
  .hero-content { margin-inline-end: 0; padding-inline-start: 0; }
  .cards { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; }
  .story-img-ph, .story-img-block { aspect-ratio: 16/9; }
  .path-svg { display: none; }
  /* در تک‌ستونی min-height باعث فاصلهٔ افتادهٔ زیاد می‌شود */
  .m-step { grid-template-columns: 1fr; min-height: auto; margin-bottom: var(--space-xl); }
  .m-step:nth-child(even) .m-text { text-align: right; }
  .m-text { padding: 0; }
  .m-dot-cell, .m-empty { display: none; }

  /* ریل عمودی به نوار پیشرفت افقی بالای صفحه تبدیل می‌شود — MASTER §۹ */
  .side-track {
    inset-inline: 0;
    top: 0;
    transform: none;
    width: 100%;
    height: 2px;
  }
  .side-track-fill { width: 0%; height: 2px; transition: width .08s linear; }
  .side-dots { display: none; }
}

/* ══ REDUCED MOTION ══════════════════════════════════════════════════
   وضعیت نهایی و خوانا رندر می‌شود؛ هیچ چیز پنهان نمی‌ماند. MASTER §۷
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .m-step { opacity: 1 !important; transform: none !important; }
  .cta-btn:hover { transform: none; }
}

/* ══ REAL IMAGE BLOCKS ═══════════════════════════════════════════════ */
.story-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;                 /* CLS را صفر نگه می‌دارد */
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface-3);
}
.story-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
