/* ==============================================
   Modern Landing — Styles
   ============================================== */

:root {
  --bg: #070b14;
  --bg-2: #0d1426;
  --surface: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e9edf7;
  --muted: #94a3b8;
  --brand-1: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #ec4899;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* خلفية متدرجة */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(99, 102, 241, 0.28), transparent 60%),
    radial-gradient(800px 600px at 5% 10%, rgba(34, 211, 238, 0.20), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(236, 72, 153, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 55%, var(--bg));
}

/* شبكة خفيفة */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
}

body.is-loading { overflow: hidden; }

/* ============ Preloader ============ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.preloader__inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(320px, 78vw);
  text-align: center;
}

.preloader__title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.dots i {
  font-style: normal;
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.spinner {
  width: 64px;
  height: 64px;
  position: relative;
}
.spinner span {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}
.spinner span:nth-child(2) {
  inset: 8px;
  border-top-color: var(--brand-2);
  animation-duration: 0.85s;
  animation-direction: reverse;
}
.spinner span:nth-child(3) {
  inset: 16px;
  border-top-color: var(--brand-3);
  animation-duration: 1.4s;
}
.spinner span:nth-child(4) {
  inset: 24px;
  border-top-color: rgba(255, 255, 255, 0.5);
  animation-duration: 1s;
  animation-direction: reverse;
}

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

.progress {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3));
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.8);
}

.preloader__percent {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ Navigation ============ */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 5vw, 56px);
  transition: background 0.35s var(--ease), backdrop-filter 0.35s, padding 0.35s;
}

.nav.is-stuck {
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-block: 12px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.7);
}

.nav__links {
  display: flex;
  gap: 8px;
}

.nav__links a {
  padding: 8px 16px;
  border-radius: 99px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  transition: color 0.25s, background 0.25s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.nav__toggle span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 130px clamp(18px, 5vw, 56px) 70px;
  position: relative;
  overflow: hidden; /* keeps the glow from creating horizontal scroll */
}

.hero__glow {
  position: absolute;
  width: min(460px, 90vw);
  height: min(460px, 90vw);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  filter: blur(90px);
  background: conic-gradient(from 0deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-1));
  opacity: 0.3;
  animation: spin 18s linear infinite;
  pointer-events: none;
}

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

.hero__content {
  position: relative;
  max-width: 780px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero__title {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.grad {
  background: linear-gradient(100deg, var(--brand-2), var(--brand-1) 45%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__text {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.btn {
  --btn-bg: transparent;
  padding: 13px 28px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s;
}

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

.btn--primary {
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 12px 30px -12px rgba(99, 102, 241, 0.9);
}
.btn--primary:hover { box-shadow: 0 18px 40px -12px rgba(99, 102, 241, 1); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); }

/* أرقام */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 5vw, 48px);
  margin: 30px 0 0;
}

.stat dt {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============ Sections ============ */
.section {
  padding: clamp(60px, 10vw, 110px) clamp(18px, 5vw, 56px);
  max-width: 1100px;
  margin-inline: auto;
  text-align: center;
}

.section__title {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section__sub {
  margin: 0 0 44px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  padding: 30px 26px;
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition: transform 0.35s var(--ease), border-color 0.35s, background 0.35s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(255, 255, 255, 0.07);
}

.card__icon {
  font-size: 1.9rem;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(34, 211, 238, 0.22));
  border: 1px solid var(--border);
}

.card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ============ Panel / CTA ============ */
.panel,
.cta {
  padding: clamp(30px, 6vw, 54px);
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.cta {
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(99, 102, 241, 0.3), transparent 70%),
    var(--surface);
}

.panel h2,
.cta h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; }
.panel p,
.cta p { margin: 0 auto 20px; color: var(--muted); max-width: 60ch; }

.panel pre {
  margin: 0;
  padding: 16px 20px;
  text-align: start;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  direction: ltr;
}
.panel code,
.cta code {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: #7dd3fc;
}

.footer {
  padding: 30px clamp(18px, 5vw, 56px);
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer p { margin: 0; }

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

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

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: 68px 14px auto;
    flex-direction: column;
    padding: 16px;
    background: rgba(10, 15, 28, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav__links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__toggle { display: flex; }
  .hero { padding-top: 110px; }
  .stats { gap: 22px; }
}

/* ============ A11y ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
}