/* ============================================================================
   Portal marketing site — design system.
   Colors come from brand.js (--brand, --brand-dark, --brand-soft, --accent).
   RTL-first: use logical properties only (margin-inline, inset-inline, start/end).
   ============================================================================ */

:root {
  /* brand tokens are injected by brand.js; these are safe fallbacks (aivan indigo) */
  --brand: #4F46E5;
  --brand-dark: #4338CA;
  --brand-soft: #EEF2FF;
  --accent: #6366F1;

  --ink: #0F172A;
  --ink-2: #1E293B;
  --muted: #64748B;
  --bg: #F8FAFC;
  --bg-2: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-brand: 0 14px 34px color-mix(in srgb, var(--brand) 22%, transparent);

  --maxw: 1120px;
  --gap: clamp(16px, 3vw, 28px);

  --font-fa: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-en: 'InterVariable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }
html[lang="fa"] { font-family: var(--font-fa); }
html[lang="en"] { font-family: var(--font-en); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.01em; margin: 0; }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-bg { background: var(--card); border-block: 1px solid var(--border); }

/* ---- shared bits ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand-dark);
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.section-head { max-width: 680px; margin-inline: auto; text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 17px; margin: 12px 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 13px 24px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 15px;
  border: 1.5px solid transparent; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--brand-dark); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-lg { padding: 16px 30px; font-size: 16px; }
/* arrow points to the reading-end; flip the glyph in LTR */
.btn .arrow { transition: transform .15s; }
html[dir="ltr"] .btn .arrow { transform: scaleX(-1); }
.btn:hover .arrow { transform: translateX(-3px); }
html[dir="ltr"] .btn:hover .arrow { transform: scaleX(-1) translateX(-3px); }

/* ============================== HEADER ============================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; }
.brand-mark { color: var(--brand); width: 36px; height: 36px; flex: none; }
.brand-mark svg { width: 36px; height: 36px; }
/* Canonical Aivan lockup (mark + wordmark) — matches Studio/Support exactly. */
.brand-logo { height: 30px; width: auto; flex: none; }
.site-footer .brand-logo { height: 28px; }
.nav-links { display: flex; gap: 6px; margin-inline-start: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-links + .nav-actions { margin-inline-start: 0; }
.lang-btn {
  cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
  background: transparent; border: 1.5px solid var(--border); color: var(--ink-2);
  padding: 8px 12px; border-radius: 10px; min-width: 44px; transition: border-color .2s, color .2s;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ============================== HERO ============================== */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset-block-start: -240px; inset-inline-end: -160px;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 18%, transparent), transparent 65%);
  pointer-events: none;
}
/* second, cooler accent glow on the reading-start side for depth */
.hero::after {
  content: ""; position: absolute; inset-block-end: -260px; inset-inline-start: -180px;
  width: 540px; height: 540px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 66%);
  pointer-events: none;
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 56px); align-items: center;
  padding-block: clamp(48px, 7vw, 92px);
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; }
.hero .sub { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); margin: 18px 0 28px; max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; }
.trust span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.trust svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.hero-art { width: 100%; }
.hero-art svg { width: 100%; height: auto; filter: drop-shadow(var(--shadow-md)); }

/* ============================== PILLARS ============================== */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.pcard {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.pcard .pic {
  width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 18px;
}
.pcard .pic svg { width: 28px; height: 28px; }
.pcard h3 { font-size: 20px; font-weight: 800; }
.pcard .pdesc { color: var(--muted); font-size: 15px; margin: 8px 0 16px; }
.pcard ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.pcard li { position: relative; padding-inline-start: 26px; font-size: 14.5px; color: var(--ink-2); }
.pcard li::before {
  content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 6px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--brand-soft);
}
.pcard li::after {
  content: ""; position: absolute; inset-inline-start: 5.5px; inset-block-start: 9px;
  width: 4px; height: 8px; border: solid var(--brand); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ============================== FEATURE ROWS ============================== */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature + .feature { margin-top: clamp(48px, 7vw, 88px); }
.feature.flip .feature-art { order: -1; }
.feature .kicker { color: var(--brand-dark); font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.feature h3 { font-size: clamp(23px, 2.6vw, 32px); font-weight: 800; margin-top: 8px; }
.feature .lead { color: var(--muted); font-size: 17px; margin: 14px 0 20px; }
.feature ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feature li { position: relative; padding-inline-start: 32px; color: var(--ink-2); font-size: 15.5px; }
.feature li::before {
  content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 3px;
  width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft);
}
.feature li::after {
  content: ""; position: absolute; inset-inline-start: 8px; inset-block-start: 7px;
  width: 5px; height: 10px; border: solid var(--brand); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.feature-art {
  background: linear-gradient(160deg, var(--brand-soft), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.feature-art svg { width: 100%; height: auto; }

/* ============================== WHY ============================== */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.why-item { text-align: center; padding: 8px; }
.why-item .wic {
  width: 56px; height: 56px; margin-inline: auto; margin-bottom: 14px; border-radius: 16px;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center;
}
.why-item .wic svg { width: 28px; height: 28px; }
.why-item h3 { font-size: 17px; font-weight: 800; }
.why-item p { color: var(--muted); font-size: 14.5px; margin: 7px 0 0; }

/* ============================== DEMO ============================== */
.demo-card {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: center;
  background: linear-gradient(140deg, var(--brand-soft), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(28px, 4vw, 48px);
}
.demo-card h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
.demo-card .sub { color: var(--muted); font-size: 17px; margin: 14px 0 26px; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.demo-link { color: var(--brand-dark); font-weight: 700; font-size: 15px; }
.demo-link:hover { text-decoration: underline; }
.demo-art svg { width: 100%; height: auto; filter: drop-shadow(var(--shadow-md)); }

/* ============================== VIDEO ============================== */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, var(--accent));
  display: grid; place-items: center; max-width: 920px; margin-inline: auto;
}
.video-frame::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 360px at 50% 30%, rgba(255,255,255,.18), transparent 70%);
}
.video-play {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.5); color: #fff;
  padding: 14px 26px; border-radius: var(--radius-pill); font-weight: 700; font-size: 16px; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .2s, transform .15s;
}
.video-play:hover { background: rgba(255,255,255,.26); transform: scale(1.03); }
.video-play .pbtn { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--brand-dark); display: grid; place-items: center; }
.video-play .pbtn svg { width: 18px; height: 18px; }
.video-cap { text-align: center; color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ============================== CTA ============================== */
.cta-band {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff;
  border-radius: var(--radius); padding: clamp(36px, 6vw, 64px); text-align: center; box-shadow: var(--shadow-brand);
}
.cta-band h2 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; max-width: 18em; margin-inline: auto; }
.cta-band p { opacity: .92; font-size: 17px; margin: 14px auto 28px; max-width: 34em; }
.cta-band .btn-primary { background: #fff; color: var(--brand-dark); box-shadow: none; }
.cta-band .btn-primary:hover { background: #f1f5f9; }
.cta-contact { margin-top: 22px; font-size: 15px; opacity: .95; }
.cta-contact a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ============================== FOOTER ============================== */
.site-footer { background: var(--card); border-top: 1px solid var(--border); padding-block: 48px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--gap); }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: 14.5px; max-width: 30em; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--ink-2); font-size: 14.5px; padding: 5px 0; }
.footer-col a:hover { color: var(--brand-dark); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center;
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px;
}

/* ============================== RESPONSIVE ============================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 460px; margin-inline: auto; }
  .pillars { grid-template-columns: 1fr; }
  .feature, .demo-card { grid-template-columns: 1fr; }
  .feature.flip .feature-art { order: 0; }
  .feature-art, .demo-art { order: -1; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .nav-links { display: none; }
}
@media (max-width: 520px) {
  .why-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta .btn, .demo-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
