/* پالت طلایی همان اپ موبایل: Gold_App_Mobile/mobile/src/theme/colors.ts */
:root {
  color-scheme: light dark;
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-alt: #f5f2ec;
  --border: #e7e2d8;
  --line: #cfc7b6;
  --text: #1f1d1a;
  --muted: #6e6a62;
  --accent: #c9a227;
  --accent-deep: #856818;
  --accent-soft: #f5ebc9;
  --on-accent: #1f1d1a;

  --radius-md: 14px;
  --radius-lg: 20px;
  --gutter: clamp(16px, 4vw, 40px);
  --gap: 24px;
  --node: 64px;
  --rail-ms: 1100ms;
  --dash: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0e;
    --surface: #17171a;
    --surface-alt: #1e1e22;
    --border: #2a2a2f;
    --line: #47464c;
    --text: #f5f2ec;
    --muted: #9a968e;
    --accent: #e3c15e;
    --accent-deep: #d4af37;
    --accent-soft: rgba(212, 175, 55, 0.14);
  }
}

@font-face {
  font-family: Vazirmatn;
  src: url("fonts/Vazirmatn_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/Vazirmatn_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/Vazirmatn_800ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
}

/* گرید ۱۲ ستونه‌ی مشترک همه‌ی بخش‌ها */
.container {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

/* ---------- قهرمان ---------- */
.hero {
  padding-block: clamp(40px, 8vw, 104px);
}

.hero .grid {
  align-items: center;
}

.hero__copy {
  grid-column: 1 / span 7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand img {
  border-radius: 11px;
}

h1 {
  margin-top: 24px;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.35;
  text-wrap: balance;
}

.lead {
  margin-top: 20px;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 18px);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.tags li {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

.hero__art {
  grid-column: 8 / span 5;
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  justify-self: center;
  padding: 13%; /* گوشه‌های تصویر داخل دایره‌ی خط‌چین بمانند */
}

.hero__art img {
  width: 100%;
  height: 100%;
  border-radius: 22%;
}

.orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin 48s linear infinite;
}

.orbit circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
  vector-effect: non-scaling-stroke;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- مراحل ---------- */
.steps {
  padding-block: clamp(56px, 8vw, 96px);
  background: var(--surface-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(32px, 5vw, 56px);
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.5;
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
}

.step {
  position: relative;
  grid-column: span 3;
  min-width: 0;
}

.step__node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transition:
    background-color 300ms ease,
    color 300ms ease,
    box-shadow 300ms ease;
}

.step__node svg,
.btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step__body {
  margin-top: 20px;
}

.step__count {
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

h3 {
  margin-top: 2px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
}

.step__body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

/* خط‌چین بین هر مرحله و مرحله‌ی بعد؛ روی آخرین مرحله نیست */
.step__rail {
  position: absolute;
  top: calc(var(--node) / 2 - 1px);
  inset-inline-start: calc(var(--node) + 8px);
  width: calc(100% + var(--gap) - var(--node) - 16px);
  height: 2px;
}

.rail {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to left, var(--rail-color) 0 8px, transparent 8px);
  background-size: var(--dash) 100%;
  background-repeat: repeat-x;
  background-position: right;
}

.rail--base {
  --rail-color: var(--line);
}

.rail--fill {
  --rail-color: var(--accent);
}

.rail__spark {
  display: none;
}

/* حالت متحرک فقط وقتی JavaScript فعال است و کاربر کاهش حرکت را نخواسته */
.is-animated .step__node {
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--line);
}

.is-animated .step.is-active .step__node {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  animation: node-pop 520ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.is-animated .step.is-active .step__node::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: node-ring 900ms ease-out forwards;
}

.is-animated .rail--fill {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 350ms ease;
}

.is-animated .step.is-linked .rail--fill {
  clip-path: inset(0);
  transition: clip-path var(--rail-ms) linear;
  animation: march-x 700ms linear infinite;
}

.is-animated .rail__spark {
  display: block;
  position: absolute;
  top: 50%;
  inset-inline-start: 0;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-inline-start: -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 0 16px var(--accent);
  opacity: 0;
}

.is-animated .step.is-linked .rail__spark {
  animation: spark-x var(--rail-ms) linear forwards;
}

@keyframes node-pop {
  0% {
    transform: scale(0.82);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes node-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes march-x {
  to {
    background-position-x: calc(100% - var(--dash));
  }
}

@keyframes march-y {
  to {
    background-position-y: var(--dash);
  }
}

@keyframes spark-x {
  0% {
    inset-inline-start: 0;
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    inset-inline-start: 100%;
    opacity: 0;
  }
}

@keyframes spark-y {
  0% {
    top: 0;
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ---------- فوتر ---------- */
.cta {
  padding-block: clamp(48px, 7vw, 80px) calc(clamp(48px, 7vw, 80px) + env(safe-area-inset-bottom));
}

.cta .grid {
  align-items: center;
}

.cta__copy {
  grid-column: 1 / span 6;
}

.cta__copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.cta__actions {
  grid-column: 7 / span 6;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 3px;
}

.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn svg {
  flex: none;
}

.btn__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.5;
}

.btn__text strong {
  font-size: 16px;
  font-weight: 700;
}

.btn__text small {
  font-size: 13px;
  opacity: 0.8;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
}

/* ---------- تبلت و موبایل: همه چیز زیر هم ---------- */
@media (max-width: 900px) {
  :root {
    --gap: 20px;
    --node: 56px;
  }

  .hero__copy,
  .hero__art,
  .cta__copy,
  .cta__actions,
  .step {
    grid-column: 1 / -1;
  }

  .hero__art {
    max-width: 300px;
  }

  /* هر مرحله یک ردیف: دایره در ستون باریک، متن کنارش */
  .timeline {
    row-gap: 32px;
  }

  .step {
    display: grid;
    grid-template-columns: var(--node) minmax(0, 1fr);
    column-gap: 16px;
  }

  .step__body {
    margin-top: 0;
  }

  .step__rail {
    top: calc(var(--node) + 8px);
    bottom: -24px;
    inset-inline-start: calc(var(--node) / 2 - 1px);
    width: 2px;
    height: auto;
  }

  .rail {
    background-image: linear-gradient(to bottom, var(--rail-color) 0 8px, transparent 8px);
    background-size: 100% var(--dash);
    background-repeat: repeat-y;
    background-position: top;
  }

  .is-animated .rail--fill {
    clip-path: inset(0 0 100% 0);
  }

  .is-animated .step.is-linked .rail--fill {
    animation-name: march-y;
  }

  .is-animated .rail__spark {
    inset-inline-start: 50%;
    top: 0;
    margin-top: -6px;
  }

  .is-animated .step.is-linked .rail__spark {
    animation-name: spark-y;
  }
}

@media (max-width: 640px) {
  .cta__actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit {
    animation: none;
  }

  .btn {
    transition: none;
  }
}
