/* =========================================================
   ASTRO-AI — base tokens, layout, header, buttons, footer
   ========================================================= */
:root {
  --bg: #04060f;
  --bg-soft: #060a16;
  --bg-deep: #02040b;
  --panel: rgba(11, 17, 36, .72);
  --panel-solid: #080d1c;
  --text: #eef2ff;
  --muted: #9aa8c7;
  --muted-2: #6f7e9f;
  --line: rgba(126, 156, 255, .14);
  --line-strong: rgba(142, 170, 255, .28);
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --pink: #e879f9;
  --grad: linear-gradient(105deg, #e879f9 0%, #a855f7 28%, #6366f1 56%, #38bdf8 82%, #22d3ee 100%);
  --grad-btn: linear-gradient(100deg, #7c3aed 0%, #4f46e5 42%, #2563eb 74%, #0ea5e9 100%);
  --grad-silver: linear-gradient(180deg, #ffffff 8%, #e7eefc 44%, #b3c2df 72%, #8ea0c4 100%);
  --container: 1240px;
  --container-wide: 1340px;
  --gutter: clamp(18px, 4vw, 34px);
  --radius: 22px;
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 76px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(139, 92, 246, .45); color: #fff; }

:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #03050c; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4c1d95, #1e3a8a);
  border-radius: 99px;
  border: 2px solid #03050c;
}

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

.container {
  width: min(var(--container), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}
.container-wide {
  width: min(var(--container-wide), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gradient-text {
  background: linear-gradient(100deg, #c084fc 0%, #a78bfa 26%, #818cf8 48%, #38bdf8 74%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.skip-link {
  position: fixed;
  top: 8px; right: 50%;
  transform: translate(50%, -160%);
  z-index: 999;
  background: #6d28d9;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  transition: transform .25s;
}
.skip-link:focus { transform: translate(50%, 0); }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 300;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(56, 189, 248, .8);
}

/* ---------- buttons ---------- */
.btn {
  --btn-h: 50px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--btn-h);
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s, background-color .35s, color .35s;
}
.btn .icon { width: 18px; height: 18px; stroke-width: 1.9; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: #fff;
  background: var(--grad-btn);
  border-color: rgba(196, 181, 253, .35);
  box-shadow:
    0 14px 34px -14px rgba(79, 70, 229, .95),
    0 4px 14px -6px rgba(37, 99, 235, .7),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 55%);
  opacity: .8;
  z-index: -1;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -30%; bottom: -30%;
  width: 38%;
  left: -60%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-18deg);
  transition: left .65s var(--ease);
  z-index: -1;
}
.btn-primary:hover::after { left: 120%; }
.btn-primary:hover {
  box-shadow:
    0 20px 44px -16px rgba(99, 102, 241, 1),
    0 6px 20px -6px rgba(37, 99, 235, .8),
    inset 0 1px 0 rgba(255, 255, 255, .3);
  filter: saturate(1.08);
}

.btn-ghost {
  color: #e6ecff;
  background: rgba(8, 13, 29, .5);
  border-color: rgba(142, 170, 255, .28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover {
  border-color: rgba(167, 139, 250, .6);
  background: rgba(17, 24, 48, .6);
  box-shadow: 0 12px 34px -18px rgba(124, 58, 237, .9);
}
.play-dot {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, .35), rgba(34, 211, 238, .25));
  border: 1px solid rgba(196, 181, 253, .45);
  color: #fff;
  margin-right: -6px;
}
.play-dot .icon { width: 12px; height: 12px; margin-left: 1px; fill: currentColor; stroke-width: 1; }

.btn-outline {
  color: #e4eaff;
  border-color: rgba(148, 121, 255, .45);
  background: rgba(13, 18, 38, .35);
}
.btn-outline:hover {
  border-color: rgba(192, 132, 252, .8);
  background: rgba(109, 40, 217, .18);
  box-shadow: 0 12px 36px -20px rgba(139, 92, 246, .9);
}

.btn-sm {
  --btn-h: 40px;
  padding: 0 19px;
  font-size: 12.5px;
}
.btn-sm .icon { width: 15px; height: 15px; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding-block: 18px;
  transition: padding .35s var(--ease), background .35s, border-color .35s, box-shadow .35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding-block: 10px;
  background: rgba(4, 6, 15, .78);
  border-bottom-color: var(--line);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, .9);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  direction: ltr;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  flex: none;
}
.brand-logo {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, .5)) drop-shadow(0 0 26px rgba(34, 211, 238, .18));
  transition: transform .5s var(--ease);
}
.brand:hover .brand-logo { transform: translateY(-2px) scale(1.04); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-inline: auto;
}
.nav-link {
  position: relative;
  padding: 6px 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: #b9c4dc;
  white-space: nowrap;
  transition: color .3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  right: 0; left: 0; bottom: -3px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity .3s, transform .35s var(--ease);
  box-shadow: 0 0 12px rgba(56, 189, 248, .7);
}
.nav-link:hover, .nav-link.is-active { color: #fff; }
.nav-link:hover::after { opacity: .55; transform: scaleX(1); }
.nav-link.is-active::after { opacity: 1; transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  direction: rtl;
}
.header-cta { --btn-h: 40px; padding: 0 20px; font-size: 12.5px; }

.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(9, 14, 30, .6);
  color: #dbe4ff;
  place-items: center;
  backdrop-filter: blur(10px);
}
.menu-toggle .icon { width: 22px; height: 22px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.mobile-nav {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 14px; right: 14px;
  z-index: 240;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(7, 11, 24, .98);
  border: 1px solid rgba(126, 156, 255, .22);
  box-shadow: 0 40px 80px -30px #000;
  backdrop-filter: blur(24px);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  color: #c9d3e9;
  transition: background .2s, color .2s;
}
.mobile-nav a:hover { background: rgba(126, 156, 255, .1); color: #fff; }
.mobile-nav .mobile-cta {
  margin-top: 10px;
  justify-content: center;
  color: #fff;
  padding: 0 20px;
}
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 230;
  background: rgba(2, 4, 10, .6);
  backdrop-filter: blur(6px);
}
.mobile-backdrop[hidden] { display: none; }

/* ---------- reveal ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .85s var(--ease),
    transform .85s var(--ease);
  transition-delay: var(--d, 0s);
}
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(30, 27, 75, .35), transparent 60%),
    linear-gradient(180deg, #04060f, #02040b);
  border-top: 1px solid var(--line);
  padding: 68px 0 26px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px; right: 12%; left: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .7), rgba(34, 211, 238, .7), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr .68fr .68fr 1.15fr;
  gap: clamp(22px, 3.6vw, 48px);
  direction: ltr;
}
.footer-brand {
  direction: ltr;
  text-align: left;
}
.footer-brand .brand-logo { height: 54px; width: auto; }
.footer-brand p {
  direction: rtl;
  text-align: left;
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 2.1;
  color: #8997b8;
  max-width: 300px;
}
.socials {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}
.socials a {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(126, 156, 255, .2);
  background: rgba(10, 15, 32, .6);
  color: #a8b6d6;
  transition: .3s;
}
.socials a:hover {
  color: #fff;
  border-color: rgba(167, 139, 250, .6);
  background: rgba(91, 33, 182, .25);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -14px rgba(139, 92, 246, .9);
}
.socials .icon { width: 17px; height: 17px; }

.footer-col, .footer-news { direction: rtl; text-align: right; }
.footer-col h3, .footer-news h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #eef2ff;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 12.5px;
  color: #93a0be;
  padding: 5px 0;
  transition: color .25s, transform .25s;
}
.footer-col a:hover { color: #fff; transform: translateX(-4px); }

.footer-news p {
  font-size: 12px;
  line-height: 2;
  color: #8e9cbb;
  margin-bottom: 14px;
}
.news-form {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 13px;
  border: 1px solid rgba(126, 156, 255, .22);
  background: rgba(6, 10, 22, .8);
  transition: border-color .3s, box-shadow .3s;
}
.news-form:focus-within {
  border-color: rgba(167, 139, 250, .65);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .14);
}
.news-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  color: #e7edff;
  text-align: right;
}
.news-form input::placeholder { color: #667493; }
.news-form button {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px; height: 38px;
  border-radius: 9px;
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .9);
  transition: transform .3s var(--ease), filter .3s;
}
.news-form button:hover { transform: scale(1.05); filter: brightness(1.12); }
.news-form button .icon { width: 17px; height: 17px; }
.news-message {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #7dd3fc;
  transition: color .2s;
}
.news-message.is-error { color: #fb7185; }

.footer-bottom {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(126, 156, 255, .1);
  font-size: 11.5px;
  color: #7483a3;
}
.legal-links { display: flex; align-items: center; gap: 12px; }
.legal-links a { transition: color .25s; }
.legal-links a:hover { color: #dbe4ff; }
.legal-links span { width: 1px; height: 12px; background: rgba(126, 156, 255, .25); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(8, 13, 28, .96);
  border: 1px solid rgba(34, 211, 238, .35);
  color: #dff8ff;
  font-size: 12.5px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9), 0 0 30px -8px rgba(34, 211, 238, .35);
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s var(--ease), opacity .3s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast .icon { width: 17px; height: 17px; color: #67e8f9; }

/* ---------- motion ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(.6deg); }
}
@keyframes pulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .primary-nav { gap: 20px; }
  .nav-link { font-size: 12.5px; }
  .header-inner { gap: 20px; }
}
@media (max-width: 1020px) {
  .primary-nav { display: none; }
  .menu-toggle { display: grid; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-news { grid-column: 1 / -1; }
  .footer-brand p { max-width: none; }
}
@media (max-width: 640px) {
  .header-cta { display: none; }
  .brand-logo { height: 36px; }
  .footer-grid { gap: 30px 22px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; margin-top: 36px; }
}
@media (max-width: 420px) {
  .brand-logo { height: 33px; }
}
