/* ============================================================
   رام‌ها (romha.ir) — Preview Website
   تم لایت هم‌سبک سایت اصلی · CSS3 خالص · فونت وزیرمتن لوکال
   ============================================================ */

/* ---------- فونت وزیرمتن (لوکال، بدون CDN) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("./fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("./fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens (یکسان با سایت اصلی) ---------- */
:root {
  --bg: #f2f4f9;
  --surface: #ffffff;
  --panel: #ffffff;
  --edge: rgba(15, 23, 42, 0.1);
  --ink: #0f1522;
  --ink-soft: #4b5563;
  --ink-muted: #9aa3b2;
  --hover: rgba(15, 23, 42, 0.045);
  --hover-strong: rgba(15, 23, 42, 0.09);
  --dot: rgba(15, 23, 42, 0.06);

  --sky: #0ea5e9;
  --sky-strong: #0284c7;
  --sky-deep: #0369a1;
  --violet: #8b5cf6;
  --violet-strong: #7c3aed;
  --emerald: #10b981;
  --amber: #f59e0b;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 14px 34px rgba(15, 23, 42, 0.14);
  --font-stack: "Vazirmatn", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  --container: 1120px;
  --header-h: 64px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 2;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* پس‌زمینه نقطه‌ای ظریف — مثل سایت اصلی */
.bg-dots {
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--sky-deep);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--violet-strong);
}

h1, h2, h3 {
  line-height: 1.5;
  margin: 0 0 0.5em;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.7rem, 3.2vw + 0.7rem, 2.7rem);
}

h2 {
  font-size: clamp(1.3rem, 2vw + 0.7rem, 1.8rem);
}

h3 {
  font-size: clamp(1.02rem, 1vw + 0.6rem, 1.18rem);
  font-weight: 800;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  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: -100%;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--sky);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

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

::selection {
  background: rgba(56, 189, 248, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sky), var(--sky-strong));
  color: #fff;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.28);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: #fff;
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.38);
  transform: translateY(-1px);
}

.btn-violet {
  background: linear-gradient(135deg, var(--violet), var(--violet-strong));
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.28);
}

.btn-violet:hover,
.btn-violet:focus-visible {
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--hover-strong);
  color: var(--ink);
}

.btn-small {
  padding: 0.48rem 1rem;
  font-size: 0.88rem;
  border-radius: 10px;
}

/* ---------- Header (هم‌سبک TopBar سایت اصلی) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 244, 249, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--edge);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.5rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--hover);
  overflow: hidden;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.brand-text strong {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a:not(.btn) {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.primary-nav a:not(.btn):hover,
.primary-nav a:not(.btn):focus-visible {
  color: var(--sky-deep);
  background: var(--hover);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-toggle:active {
  transform: scale(0.94);
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 46rem;
  max-width: 120%;
  height: 18rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  filter: blur(110px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 880px;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--emerald);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.hero-lead {
  font-size: clamp(1rem, 1vw + 0.7rem, 1.18rem);
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.hero-lead strong {
  color: var(--ink);
  font-weight: 800;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.8rem;
}

/* آمار — هم‌سبک کارت‌های آمار سایت اصلی */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  text-align: start;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  font-size: 1.15rem;
}

.stat-icon.sky { background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.25); }
.stat-icon.violet { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.25); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); }

.stat dt {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.4;
  color: var(--ink);
}

.stat dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ---------- آیکون‌های SVG (سبک Lucide سایت اصلی) ---------- */
.icon {
  flex-shrink: 0;
  vertical-align: middle;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(2.6rem, 6vw, 4.5rem) 0;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--edge);
}

.section-head {
  max-width: 780px;
  margin: 0 auto 2.2rem;
  text-align: center;
}

.section-head p {
  margin-bottom: 0;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
  gap: 1rem;
}

.card {
  padding: 1.4rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.section-alt .card {
  background: var(--bg);
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: var(--shadow-lift);
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.95;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  font-size: 1.25rem;
}

.card-icon.sky { background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.25); }
.card-icon.violet { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.25); }
.card-icon.emerald { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); }
.card-icon.amber { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); }
.card-icon.rose { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.25); }

/* ---------- Feature list (رام کاستوم) ---------- */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.feature {
  padding: 1.5rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: var(--shadow-lift);
}

.feature p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.8rem;
}

.tag {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.section-alt .tag {
  background: var(--bg);
}

/* ---------- Steps (راهنمای دریافت فایل — سبک رام‌ها) ---------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  padding-top: 1.4rem;
}

/* خط نقطه‌چین اتصال مراحل (فقط دسکتاپ) */
.steps::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 12%;
  height: 0;
  border-top: 2px dashed rgba(14, 165, 233, 0.35);
}

.step {
  position: relative;
  padding: 2.1rem 1.4rem 1.6rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: var(--shadow-lift);
}

/* نشان عددی روی لبه بالای کارت — فقط یک عدد فارسی */
.step-num {
  position: absolute;
  top: -1.4rem;
  right: 50%;
  transform: translateX(50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sky), var(--violet));
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  border: 4px solid var(--surface);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.35);
}

.section:not(.section-alt) .step-num {
  border-color: var(--surface);
}

.step .card-icon {
  margin-inline: auto;
}

.step h3 {
  margin-bottom: 0.4em;
}

.step p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

/* ---------- CTA نوار پایانی ---------- */
.cta .hero-actions {
  margin-bottom: 0;
}

.cta {
  padding: clamp(2rem, 5vw, 3.2rem);
  text-align: center;
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(14, 165, 233, 0.12), transparent 60%),
    radial-gradient(600px 200px at 80% 100%, rgba(139, 92, 246, 0.12), transparent 60%),
    var(--panel);
  border: 1px solid var(--edge);
  border-radius: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow-card);
}

.cta h2 {
  margin-bottom: 0.4em;
}

.cta p {
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: 1.6rem;
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
  display: grid;
  gap: 0.7rem;
  margin-inline: auto;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.section-alt .faq-list details {
  background: var(--bg);
}

.faq-list details[open] {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: var(--shadow-card);
}

.faq-list summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: var(--sky-deep);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.faq-list details[open] .faq-icon {
  background: linear-gradient(135deg, var(--sky), var(--violet));
  border-color: transparent;
  color: #fff;
}

.faq-icon .icon-minus {
  display: none;
}

.faq-list details[open] .icon-plus {
  display: none;
}

.faq-list details[open] .icon-minus {
  display: block;
}

.faq-list details p {
  margin: 0.7rem 0 0;
  padding-inline-start: 2.8rem;
  font-size: 0.93rem;
}

/* ---------- CTA نوار پایانی ---------- */
.cta .hero-actions {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 1rem;
  border-top: 1px solid var(--edge);
  background: var(--surface);
  padding: 2.8rem 0 1.4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 0.6rem;
}

.footer-brand .brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.footer-about p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.footer-heading {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.8em;
}

.footer-links ul,
.footer-contact ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-links a,
.footer-contact a {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-contact .icon {
  color: var(--sky-deep);
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--sky-deep);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--edge);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- Reveal on scroll (JS progressive enhancement) ----------
   فقط با کلاس js-reveal روی <html> فعال می‌شود؛ بدون JS محتوا همیشه نمایان است. */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  /* خط اتصال در موبایل عمودی می‌شود */
  .steps::before {
    inset-inline: 50%;
    inset-block: 0;
    border-top: none;
    border-inline-start: 2px dashed rgba(14, 165, 233, 0.35);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: rgba(242, 244, 249, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--edge);
    display: none;
    padding: 0.6rem 0 1rem;
    box-shadow: var(--shadow-card);
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding-inline: 1.25rem;
  }

  .primary-nav a:not(.btn) {
    display: block;
    padding: 0.65rem 0.9rem;
  }

  .primary-nav .btn {
    margin-top: 0.5rem;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  html.js-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}
