/* =========================================================
   tokens.css — Single Source of Truth (Design System v1.0)
   قالب الحفر الإنشائية — يُستورد قبل أي ملف CSS آخر
   ========================================================= */

:root {
  /* ============================ */
  /* COLORS                       */
  /* ============================ */
  --color-bg: #0F0F0F;
  --color-bg-deep: #000000;
  --color-surface: #1A1A1A;
  --color-surface-hover: #222222;

  --color-primary: #C9A227;
  --color-primary-light: #D4AF37;
  --color-primary-hover: #E5C158;
  --color-primary-active: #A88A1F;
  --color-primary-10: rgba(201, 162, 39, 0.10);
  --color-primary-30: rgba(201, 162, 39, 0.30);

  --color-text: #FFFFFF;
  --color-text-muted: #D9D9D9;
  --color-text-subtle: #8A8A8A;
  --color-border: #8A8A8A;
  --color-border-subtle: rgba(255, 255, 255, 0.08);

  --color-overlay: rgba(0, 0, 0, 0.65);
  --color-overlay-gradient: linear-gradient(180deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.85) 100%);

  --color-success: #2E7D32;
  --color-warning: #ED6C02;
  --color-error: #C62828;
  --color-info: #0288D1;

  /* ============================ */
  /* TYPOGRAPHY                   */
  /* ============================ */
  --font-arabic: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-latin: 'Inter', 'Poppins', system-ui, sans-serif;
  --font-display: 'Cairo', 'Tajawal', sans-serif;

  --fs-display: clamp(2.5rem, 5vw, 4rem);
  --fs-h1: clamp(2rem, 4vw, 3rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.25rem);
  --fs-h3: clamp(1.375rem, 2.5vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 2vw, 1.375rem);
  --fs-h5: 1.125rem;
  --fs-body-lg: 1.125rem;
  --fs-body: 1rem;
  --fs-body-sm: 0.875rem;
  --fs-caption: 0.75rem;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.15;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  --ls-tight: -0.5px;
  --ls-normal: 0;
  --ls-wide: 1.5px;

  /* ============================ */
  /* SPACING (4pt grid)           */
  /* ============================ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Section padding */
  --section-py-compact: clamp(2.5rem, 6vw, 4rem);
  --section-py-default: clamp(4rem, 8vw, 6rem);
  --section-py-spacious: clamp(5rem, 10vw, 8rem);
  --section-py-hero: clamp(6rem, 12vw, 10rem);

  /* ============================ */
  /* LAYOUT                       */
  /* ============================ */
  --container-max: 1280px;
  --container-padding: clamp(1rem, 3vw, 1.5rem);
  --content-max: 680px;

  /* ============================ */
  /* RADIUS                       */
  /* ============================ */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --radius-full: 50%;

  /* ============================ */
  /* SHADOWS                      */
  /* ============================ */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 24px rgba(201, 162, 39, 0.25);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* ============================ */
  /* MOTION                       */
  /* ============================ */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-elegant: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
  --duration-slower: 1000ms;

  /* ============================ */
  /* Z-INDEX                      */
  /* ============================ */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 1000;
  --z-overlay: 5000;
  --z-modal: 9000;
  --z-tooltip: 9999;

  /* ============================ */
  /* BREAKPOINTS (للاستخدام في JS) */
  /* ============================ */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1536px;
}

/* ============================ */
/* RESET & BASE                 */
/* ============================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-arabic);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[dir="ltr"] body { font-family: var(--font-latin); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
}

p { margin: 0 0 var(--space-4); color: var(--color-text-muted); }

a { color: var(--color-primary); text-decoration: none; transition: color var(--duration-base) var(--ease-out); }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; display: block; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
