/* Design tokens — Youssef's palette/spacing + Layla's type scale.
   Every other CSS file references var(--token) only, never a literal hex/px value. */

:root {
  /* ---- Colors — Backgrounds ---- */
  --bg-base:        #0A0A0C;
  --bg-raised:       #16171C;
  --bg-raised-2:     #1D1E24;
  --bg-overlay:      rgba(10, 10, 12, 0.85);

  /* ---- Colors — Text ---- */
  --text-primary:    #F4F3EF;
  --text-secondary:  #C7C6C0;
  --text-muted:      #8B8B92;
  --text-on-accent:  #120803;

  /* ---- Colors — Accent (ONE color, used with intent) ---- */
  --accent:          #FF6A3D;
  --accent-deep:     #D6531F;
  --accent-soft:     rgba(255, 106, 61, 0.14);
  --accent-soft-2:   rgba(255, 106, 61, 0.06);
  --accent-glow:     rgba(255, 106, 61, 0.45);

  /* ---- Colors — Structure ---- */
  --border-subtle:   rgba(244, 243, 239, 0.08);
  --border-strong:   rgba(244, 243, 239, 0.18);
  --shadow-color:    rgba(0, 0, 0, 0.5);

  /* ---- Colors — Semantic (CTA-specific, not a second site accent) ---- */
  --whatsapp-green:       #25D366;
  --whatsapp-green-deep:  #1EBE5A;
  --whatsapp-glow:        rgba(37, 211, 102, 0.45);

  /* ---- Spacing scale — base unit 4px ---- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-7:  3rem;
  --space-8:  4rem;
  --space-9:  6rem;
  --space-10: 8rem;
  --space-11: 10rem;

  /* ---- Motion timing ----
     Mobile-first: the values below are the phone/base case (most visitors).
     Desktop gets the more elaborate distances/durations via the
     (min-width: 1024px) override further down — enhancement, not the default. */
  --ease-ambient: cubic-bezier(0.45, 0, 0.15, 1);
  --ease-tactile: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);   /* reveals — mask/curtain/text-in */
  --ease-in-out-motion: cubic-bezier(0.65, 0, 0.35, 1); /* movement — parallax, drags */
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-onload: 480ms;    /* hero on-load text/CTA settle (mobile) */
  --stagger-hero: 90ms;        /* gap between hero on-load elements (mobile) */

  /* Scroll-reveal distance/duration — mobile default: short travel, quick settle */
  --reveal-distance: 16px;
  --reveal-duration: 480ms;
  --reveal-stagger: 70ms;

  /* Parallax travel factor for the hero background — 0 disables it outright on mobile */
  --parallax-factor: 0;

  /* Preloader curtain — mobile default totals ~830ms (fill + hold + wipe) */
  --intro-fill: 340ms;
  --intro-hold: 110ms;
  --intro-wipe: 380ms;
  --preload-origin: left;

  /* ---- Motion — hover elevation + glow (Hero CTA / Contact CTAs / Showcase tiles only) ---- */
  --lift-btn: -2px;
  --lift-tile: -4px;
  --shadow-glow-amber:    0 16px 32px -12px var(--accent-glow);
  --shadow-glow-whatsapp: 0 16px 32px -12px var(--whatsapp-glow);

  /* ---- Motion — RTL-safe "forward" nudge (Services item hover), flipped under [dir="rtl"] ---- */
  --nudge-forward: 4px;

  /* ---- Font families (Latin/default) ---- */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* ---- Font families (Arabic) ---- */
  --font-display-ar: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  --font-body-ar: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;

  --font-display-active: var(--font-display);
  --font-body-active: var(--font-body);

  /* ---- Type scale ---- */
  --fs-h1: 3.5rem;
  --lh-h1: 1.1;
  --ls-h1: -0.02em;
  --fw-h1: 700;

  --fs-h2: 2.625rem;
  --lh-h2: 1.15;
  --ls-h2: -0.01em;
  --fw-h2: 600;

  --fs-h3: 1.75rem;
  --lh-h3: 1.25;
  --ls-h3: -0.005em;
  --fw-h3: 600;

  --fs-body: 1.125rem;
  --lh-body: 1.6;
  --ls-body: 0em;
  --fw-body: 400;

  --fs-small: 0.875rem;
  --lh-small: 1.5;
  --ls-small: 0.01em;
  --fw-small: 400;

  --fs-button: 1rem;
  --lh-button: 1;
  --ls-button: 0.02em;
  --fw-button: 600;
}

/* Mobile scale-down (headlines only) */
@media (max-width: 640px) {
  :root {
    --fs-h1: 2.5rem;
    --fs-h2: 2rem;
    --fs-h3: 1.5rem;
  }
}

/* Desktop motion enhancement — larger screens get the fuller choreography
   (longer travel, longer settle, a touch of parallax). Mobile above stays
   the fast/short default; this only adds on top of it. */
@media (min-width: 1024px) {
  :root {
    --duration-onload: 640ms;
    --stagger-hero: 100ms;
    --reveal-distance: 40px;
    --reveal-duration: 700ms;
    --reveal-stagger: 90ms;
    --parallax-factor: 0.06;
    --intro-fill: 400ms;
    --intro-hold: 140ms;
    --intro-wipe: 440ms;
  }
}

/* Arabic override — triggered by <html lang="ar" dir="rtl">.
   Paired with [lang="ar"], not [dir="rtl"] alone, so a future RTL-but-not-Arabic
   language wouldn't silently inherit Arabic font sizing (per Layla's spec). */
html[lang="ar"] {
  --font-display-active: var(--font-display-ar);
  --font-body-active: var(--font-body-ar);

  --fs-h1: 3.85rem;
  --lh-h1: 1.25;
  --fs-h2: 2.9rem;
  --lh-h2: 1.3;
  --fs-h3: 1.95rem;
  --lh-h3: 1.4;
  --fs-body: 1.25rem;
  --lh-body: 1.85;
  --fs-small: 0.975rem;
  --lh-small: 1.7;
  --fs-button: 1.1rem;

  --ls-h1: normal;
  --ls-h2: normal;
  --ls-h3: normal;
  --ls-body: normal;
  --ls-small: normal;
  --ls-button: normal;
}

@media (max-width: 640px) {
  html[lang="ar"] {
    --fs-h1: 2.75rem;
    --fs-h2: 2.2rem;
    --fs-h3: 1.65rem;
  }
}

/* RTL flip for the Services hover nudge — dir is toggled on <html> by i18n.js.
   Kept as a signed custom property (not a hardcoded translateX) so the same
   transform rule reads as "toward the reader" in both directions. */
html[dir="rtl"] {
  --nudge-forward: -4px;
  --preload-origin: right;
}
