:root {
  /* Primitive palette — Selsela v1 */
  --green-deep: #003c32;
  --green-near-black: #071a17;
  --ivory: #f3ebdd;
  --copper: #b87345;
  --stone: #d5cec2;
  --citron: #d4ff3a;
  --white-soft: #fffdf8;
  --danger: #8b2e1f;
  --warning: #9a6b16;
  --success: #1f6b4a;
  --info: #245c72;

  /* Semantic */
  --color-ink: var(--green-near-black);
  --color-green: var(--green-deep);
  --color-ivory: var(--ivory);
  --color-copper: var(--copper);
  --color-stone: var(--stone);
  --color-citron: var(--citron);
  --color-surface: #f7f1e6;
  --color-surface-elevated: var(--white-soft);
  --color-muted: #5d7069;
  --color-border: color-mix(in srgb, var(--green-near-black) 14%, transparent);
  --color-border-strong: color-mix(in srgb, var(--green-near-black) 22%, transparent);
  --color-focus: var(--citron);
  --color-status-extracted: #245c72;
  --color-status-suggested: #9a6b16;
  --color-status-confirmed: #1f6b4a;
  --color-status-approved: #003c32;
  --color-status-low: #8b2e1f;
  --color-status-missing: #6b7280;
  --color-status-conflict: #9a3412;

  /* Typography — IBM Plex Sans Arabic (Arabic + Latin) */
  --font-display: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-accent: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-editorial: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --text-sm: clamp(0.82rem, 0.8rem + 0.15vw, 0.9rem);
  --text-md: clamp(0.95rem, 0.92rem + 0.2vw, 1.05rem);
  --text-lg: clamp(1.1rem, 1.05rem + 0.35vw, 1.3rem);
  --text-xl: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.45rem + 1.2vw, 2.5rem);
  --text-3xl: clamp(2.2rem, 1.8rem + 1.8vw, 3.5rem);
  --text-display: clamp(2.6rem, 2rem + 2.8vw, 4.85rem);

  --leading-tight: 1.15;
  --leading-ar-tight: 1.28;
  --leading-body: 1.6;
  --leading-ar-body: 1.75;

  /* Spacing 4px scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 0.4rem;
  --radius-md: 0.7rem;
  --radius-lg: 1.1rem;
  --radius-xl: 1.35rem;

  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--green-near-black) 8%, transparent);
  --shadow-md: 0 10px 28px color-mix(in srgb, var(--green-near-black) 10%, transparent);
  --shadow-lg: 0 28px 80px color-mix(in srgb, var(--green-near-black) 15%, transparent);

  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 280ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);

  --z-nav: 40;
  --z-drawer: 50;
  --z-modal: 60;
  --z-toast: 70;

  --width-content: 1180px;
  --width-narrow: 720px;
}

[data-theme="dark"] {
  --color-ink: #f3ebdd;
  --color-green: #9fb8aa;
  --color-ivory: #0c1f1b;
  --color-surface: #071a17;
  --color-surface-elevated: #0f2a24;
  --color-muted: #a7b7b0;
  --color-border: color-mix(in srgb, #f3ebdd 14%, transparent);
  --color-border-strong: color-mix(in srgb, #f3ebdd 24%, transparent);
  --color-copper: #d09264;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
    --motion-slow: 0ms;
  }
}
