/* =========================================================================
   مساري للقدرات — Landing Page
   Design system mirrored from the iOS app (design.md)
   ========================================================================= */

/* ----------------------------- Fonts ----------------------------------- */
@font-face {
  font-family: "Tajawal";
  src: url("../assets/fonts/Tajawal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("../assets/fonts/Tajawal-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("../assets/fonts/Tajawal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("../assets/fonts/Tajawal-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ----------------------------- Tokens ---------------------------------- */
:root {
  /* Brand */
  --pulse: #22c55e;
  --pulse-700: #15803d;
  --pulse-50: #ecfdf5;
  --spark: #ff8a4c;
  --spark-700: #c25719;
  --spark-50: #fff4ed;

  /* Ink ramp */
  --ink-900: #0f1115;
  --ink-800: #1c1f26;
  --ink-700: #2e323b;
  --ink-500: #6c7280;
  --ink-400: #9aa0ab;
  --ink-300: #c3c7cf;
  --ink-200: #e2e4e9;
  --ink-100: #eef0f3;
  --ink-50: #f5f6f8;

  /* Surfaces */
  --surface-0: #fafaf7;
  --surface-1: #ffffff;
  --surface-2: #f2f1ec;
  --surface-3: #e8e7e1;

  /* Zones */
  --zone-ari: #22c55e;   --zone-ari-2: #15803d;   --zone-ari-bg: #ecfdf5;
  --zone-alg: #3b5ccc;   --zone-alg-2: #1e3a8a;   --zone-alg-bg: #f0f4ff;
  --zone-geo: #ff8a4c;   --zone-geo-2: #c25719;   --zone-geo-bg: #fff4ed;
  --zone-dat: #a855f7;   --zone-dat-2: #6b21a8;   --zone-dat-bg: #faf5ff;

  /* State */
  --streak: #f59e0b;

  /* Radii */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-pill: 999px;

  /* Shadows (two-part stacks per design.md) */
  --elev-1: 0 1px 0 rgba(15,17,21,.04), 0 8px 24px -8px rgba(15,17,21,.08);
  --elev-2: 0 1px 0 rgba(15,17,21,.05), 0 12px 28px -10px rgba(15,17,21,.12);
  --elev-3: 0 1px 0 rgba(15,17,21,.06), 0 22px 44px -18px rgba(15,17,21,.18);

  /* Motion */
  --ease-out: cubic-bezier(.32,.72,0,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --maxw: 1120px;

  --font-ar: "Tajawal", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", "Tajawal", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* ----------------------------- Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ar);
  font-weight: 500;
  color: var(--ink-900);
  background: var(--surface-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* number / latin runs inside arabic */
.mono { font-family: var(--font-mono); font-weight: 700; font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.en { font-family: var(--font-display); direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ----------------------------- Layout ---------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
section { padding-block: clamp(56px, 9vw, 104px); }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pulse-700);
}

/* ----------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-ar); font-weight: 700; font-size: 17px;
  padding: 0 26px; height: 56px; border-radius: var(--r-lg);
  border: none; cursor: pointer; transition: transform .12s var(--ease-out), filter .12s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(.96); filter: brightness(.96); }
.btn-ink { background: var(--ink-800); color: #fff; box-shadow: 0 4px 0 var(--ink-900); }
.btn-pulse { background: var(--pulse); color: #fff; box-shadow: 0 4px 0 var(--pulse-700); }
.btn-spark { background: var(--spark); color: #fff; box-shadow: 0 4px 0 var(--spark-700); }
.btn-outline { background: transparent; color: var(--ink-900); box-shadow: inset 0 0 0 2px var(--ink-200); }
.btn-sm { height: 44px; font-size: 15px; padding: 0 20px; border-radius: var(--r-md); }

/* App Store badge button */
.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink-900); color: #fff;
  padding: 12px 22px; border-radius: var(--r-md);
  transition: transform .12s var(--ease-out), filter .12s var(--ease-out);
}
a.store-badge:active { transform: scale(.96); }
span.store-badge { cursor: default; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .sb-top { display: block; font-size: 11px; color: var(--ink-300); line-height: 1.1; }
.store-badge .sb-main { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.store-soon {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--pulse-50); color: var(--pulse-700);
  font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: var(--r-pill);
}
.store-soon .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pulse); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }

/* ----------------------------- Header ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,247,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(15,17,21,.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--elev-1); }
.brand .name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-weight: 700; font-size: 15px; color: var(--ink-700); transition: color .15s; }
.nav-links a:hover { color: var(--ink-900); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; }

/* ----------------------------- Hero ------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 520px at 85% -10%, var(--pulse-50) 0%, rgba(236,253,245,0) 60%),
    radial-gradient(900px 460px at 0% 0%, var(--spark-50) 0%, rgba(255,244,237,0) 55%);
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  padding-block: clamp(40px, 7vw, 84px);
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-top: 18px;
}
.hero h1 .accent { color: var(--pulse-700); }
.hero-sub {
  margin-top: 20px; font-size: clamp(17px, 2.2vw, 21px);
  color: var(--ink-500); max-width: 30ch; font-weight: 500;
}
.hero-actions { margin-top: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }

/* app screenshot carousel */
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-carousel {
  direction: ltr;
  position: relative;
  width: min(480px, 100%);
  height: 640px;
  touch-action: pan-y;
}
.carousel-stack { position: absolute; inset: 0 56px 54px; }
.carousel-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(286px, 68vw);
  aspect-ratio: 1290 / 2796;
  margin: 0;
  overflow: hidden;
  border: .5px solid rgba(15,17,21,.28);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  box-shadow: var(--elev-3);
  transform-origin: center;
  transition: transform .55s var(--ease-out), opacity .4s var(--ease-out);
  will-change: transform, opacity;
}
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide[data-depth="0"] {
  z-index: 5;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.carousel-slide[data-depth="1"] {
  z-index: 4;
  opacity: .68;
  transform: translate(calc(-50% + 38px), calc(-50% + 12px)) scale(.96);
}
.carousel-slide[data-depth="2"] {
  z-index: 3;
  opacity: .34;
  transform: translate(calc(-50% + 70px), calc(-50% + 24px)) scale(.91);
}
.carousel-slide[data-depth="hidden"] {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + 86px), calc(-50% + 30px)) scale(.88);
}
.carousel-arrow {
  position: absolute;
  top: calc(50% - 28px);
  z-index: 10;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ink-200);
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--ink-700);
  box-shadow: var(--elev-1);
  cursor: pointer;
  transition: transform .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out);
}
.carousel-arrow:hover { background: var(--surface-1); color: var(--ink-900); transform: scale(1.06); }
.carousel-arrow:active { transform: scale(.94); }
.carousel-arrow:focus-visible, .carousel-dots button:focus-visible { outline: 3px solid rgba(34,197,94,.35); outline-offset: 3px; }
.carousel-arrow svg { width: 23px; height: 23px; }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-dots {
  position: absolute;
  inset-inline: 0;
  bottom: 4px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ink-300);
  cursor: pointer;
  transition: width .28s var(--ease-out), background .28s var(--ease-out);
}
.carousel-dots button[aria-current="true"] { width: 34px; background: var(--pulse-700); }

/* ----------------------------- Section heads --------------------------- */
.shead { text-align: center; max-width: 640px; margin-inline: auto; margin-bottom: 56px; }
.shead h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.015em; margin-top: 14px; }
.shead p { margin-top: 16px; color: var(--ink-500); font-size: 18px; }

/* ----------------------------- Features grid --------------------------- */
.features { background: var(--surface-0); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface-1); border-radius: var(--r-xl);
  padding: 28px; box-shadow: var(--elev-1);
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--elev-2); }
.card .badge {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  margin-bottom: 18px;
}
.card .badge svg { width: 26px; height: 26px; }
.card h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.card p { margin-top: 10px; color: var(--ink-500); font-size: 15.5px; }
.badge-pulse { background: var(--pulse-50); color: var(--pulse-700); }
.badge-spark { background: var(--spark-50); color: var(--spark-700); }
.badge-alg { background: var(--zone-alg-bg); color: var(--zone-alg); }
.badge-dat { background: var(--zone-dat-bg); color: var(--zone-dat-2); }
.badge-streak { background: #fffbeb; color: #92400e; }
.badge-ink { background: var(--ink-50); color: var(--ink-700); }

/* ----------------------------- FAQ ------------------------------------- */
.faq-list { max-width: 760px; margin-inline: auto; display: grid; gap: 14px; }
.faq details {
  background: var(--surface-1);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-1);
  padding: 20px 26px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 24px; font-weight: 700; color: var(--pulse-700);
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 14px 0 0; color: var(--ink-500); line-height: 1.85; }

/* ----------------------------- Download CTA ---------------------------- */
.cta-band { background: var(--surface-1); }
.cta-inner {
  text-align: center;
  background: radial-gradient(700px 320px at 50% -20%, var(--pulse-50), transparent 70%);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-2xl);
  padding: clamp(40px, 6vw, 72px);
}
.cta-inner img { width: 96px; margin-inline: auto; margin-bottom: 20px; }
.cta-inner h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.02em; }
.cta-inner p { margin-top: 14px; color: var(--ink-500); font-size: 18px; }
.cta-inner .hero-actions { justify-content: center; }

/* ----------------------------- Footer ---------------------------------- */
.site-footer { background: var(--ink-900); color: var(--ink-300); padding-block: 56px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand .brand .name { color: #fff; }
.footer-brand p { margin-top: 16px; color: var(--ink-400); font-size: 15px; max-width: 34ch; }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; color: #fff; text-transform: none; margin-bottom: 16px; letter-spacing: 0; }
.footer-col a { display: block; padding: 7px 0; color: var(--ink-300); font-size: 15px; font-weight: 500; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink-400); font-size: 14px;
}

/* ----------------------------- Legal pages ----------------------------- */
.legal { background: var(--surface-0); }
.legal-wrap { max-width: 760px; margin-inline: auto; padding-block: 56px; }
.legal-wrap .back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-500); font-weight: 700; font-size: 15px; margin-bottom: 28px; }
.legal-wrap h1 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.02em; }
.legal-meta { margin-top: 10px; color: var(--ink-400); font-size: 14px; font-weight: 600; }
.legal-body { margin-top: 36px; }
.legal-body h2 { font-size: 22px; margin-top: 40px; margin-bottom: 12px; letter-spacing: -.01em; }
.legal-body h3 { font-size: 18px; font-weight: 700; margin-top: 24px; margin-bottom: 8px; font-family: var(--font-display); }
.legal-body p { color: var(--ink-700); margin-bottom: 14px; font-size: 16.5px; }
.legal-body ul { margin-bottom: 16px; display: grid; gap: 8px; }
.legal-body li { position: relative; padding-inline-start: 24px; color: var(--ink-700); font-size: 16.5px; }
.legal-body li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--pulse); }
.legal-body a { color: var(--pulse-700); font-weight: 700; }
.legal-body strong { color: var(--ink-900); }
.legal-card { background: var(--surface-1); border-radius: var(--r-lg); box-shadow: var(--elev-1); padding: 22px 24px; margin: 20px 0; }

/* ----------------------------- Calculator ------------------------------ */
.calc-card {
  margin-top: 36px;
  background: var(--surface-1);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-xl);
  box-shadow: var(--elev-2);
  padding: clamp(24px, 4vw, 40px);
}
.calc-title { font-size: 18px; margin-bottom: 16px; }
.calc-title + .calc-grid, .calc-presets + .calc-grid { margin-bottom: 26px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.calc-field { display: grid; gap: 8px; }
.calc-field label { font-weight: 700; font-size: 14px; color: var(--ink-700); }
.calc-field input {
  height: 54px; width: 100%;
  border: 2px solid var(--ink-200); border-radius: var(--r-md);
  background: var(--surface-1); padding-inline: 14px;
  font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--ink-900);
  direction: ltr; text-align: center;
  transition: border-color .15s var(--ease-out);
}
.calc-field input:focus { outline: none; border-color: var(--pulse); }
.calc-presets { display: grid; gap: 10px; margin-bottom: 16px; }
.preset-btn {
  border: 2px solid var(--ink-200); border-radius: var(--r-md);
  background: var(--surface-1); color: var(--ink-700);
  font-family: var(--font-ar); font-weight: 700; font-size: 14px;
  padding: 12px 16px; cursor: pointer; text-align: start;
  transition: border-color .15s var(--ease-out), background .15s var(--ease-out);
}
.preset-btn[aria-pressed="true"] { border-color: var(--pulse); background: var(--pulse-50); color: var(--pulse-700); }
.calc-warning { color: var(--spark-700); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.calc-result {
  margin-top: 10px; padding: 24px;
  background: var(--pulse-50); border-radius: var(--r-lg);
  display: grid; gap: 6px; justify-items: center; text-align: center;
}
.calc-result-label { font-weight: 700; font-size: 15px; color: var(--pulse-700); }
.calc-result .num { font-family: var(--font-mono); font-size: 46px; font-weight: 700; color: var(--pulse-700); line-height: 1; direction: ltr; }
.calc-note { margin-top: 14px; color: var(--ink-400); font-size: 13.5px; }
.calc-cta {
  margin-top: 48px; text-align: center;
  background: radial-gradient(600px 280px at 50% -20%, var(--pulse-50), transparent 70%);
  border: 1px solid var(--ink-100); border-radius: var(--r-2xl);
  padding: clamp(32px, 5vw, 52px);
  display: grid; gap: 12px; justify-items: center;
}
.calc-cta img { width: 80px; }
.calc-cta h2 { font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -.015em; }
.calc-cta p { color: var(--ink-500); max-width: 44ch; }
.calc-cta .store-badge { margin-top: 8px; }

/* ----------------------------- Responsive ------------------------------ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .hero-sub { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-carousel { height: 620px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta .btn-sm { height: 40px; font-size: 14px; padding: 0 16px; }
}
@media (max-width: 560px) {
  .hero-carousel { height: 570px; }
  .carousel-stack { inset-inline: 34px; bottom: 48px; }
  .carousel-slide { width: min(240px, 68vw); }
  .carousel-slide[data-depth="1"] { transform: translate(calc(-50% + 24px), calc(-50% + 10px)) scale(.96); }
  .carousel-slide[data-depth="2"] { transform: translate(calc(-50% + 44px), calc(-50% + 20px)) scale(.91); }
  .carousel-arrow { top: calc(50% - 24px); width: 40px; height: 40px; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  section { padding-block: 56px; }
}

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