/* =============================================================
 * SUNSHINE — Design Tokens
 * Mirrors DESIGN.md §3 (color) §4 (type) §5 (space) §6 (radius)
 * §7 (shadow) §15 (breakpoints). DO NOT introduce magic numbers
 * elsewhere. New tokens must be added here and documented in
 * DESIGN.md first.
 * ============================================================= */

:root {
  /* --- Color (DESIGN.md §3) --- */
  --color-primary:          #2A5D84;
  --color-primary-soft:     oklch(0.42 0.075 240 / 0.08);
  --color-primary-hover:    oklch(0.36 0.08 240);
  --color-primary-active:   oklch(0.30 0.08 240);
  --color-accent:           #D7B161;
  --color-accent-soft:      oklch(0.76 0.12 85 / 0.12);
  --color-accent-hover:     oklch(0.70 0.13 85);

  --color-surface:          #ffffff;
  --color-surface-raised:   #F9F9FB;
  --color-surface-muted:    #efefef;
  --color-surface-dark:     #111518;

  --color-text:             #51565a;
  --color-text-muted:       #8a8f93;
  --color-text-disabled:    #b5b9bc;
  --color-text-on-primary:  #ffffff;
  --color-text-on-dark:     #efefef;
  --color-text-on-accent:   #ffffff;

  --color-border:           oklch(0.85 0.005 250);
  --color-border-strong:    oklch(0.72 0.005 250);
  --color-border-on-dark:   oklch(0.30 0.01 250);

  /* Semantic: status */
  --color-status-pending-bg:    oklch(0.94 0.03 85);
  --color-status-pending-fg:    #5a4a2a;
  --color-status-verified-bg:   oklch(0.94 0.04 150);
  --color-status-verified-fg:   #1f4a30;
  --color-status-custom-bg:     var(--color-primary-soft);
  --color-status-custom-fg:     var(--color-primary);
  --color-status-certified-bg:  oklch(0.94 0.05 230);
  --color-status-certified-fg:  #1a3a55;

  /* --- Typography (DESIGN.md §4) --- */
  --font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "Roboto Mono", Consolas, "SF Mono", Menlo, monospace;
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);

  --fs-display: clamp(2.2rem, 5vw, 3.6rem);
  --fs-headline: clamp(1.6rem, 3.5vw, 2.4rem);
  --fs-title: clamp(1.2rem, 2vw, 1.5rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.75rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.1;
  --lh-headline: 1.2;
  --lh-title: 1.3;
  --lh-body: 1.7;
  --lh-meta: 1.5;

  --ls-display: -0.02em;
  --ls-eyebrow: 0.05em;

  --measure-body: 70ch;
  --measure-prose: 75ch;

  /* --- Spacing (DESIGN.md §5) --- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  --container-max: 1280px;
  --container-narrow: 880px;
  --container-prose: 680px;
  --container-padding: clamp(16px, 4vw, 32px);

  /* --- Radius (DESIGN.md §6) --- */
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* --- Shadows / borders (DESIGN.md §7) --- */
  --shadow-none: none;
  --border-1: 1px solid var(--color-border);
  --border-1-strong: 1px solid var(--color-border-strong);
  --border-1-on-dark: 1px solid var(--color-border-on-dark);
  --border-1-primary: 1px solid var(--color-primary);

  /* Brand-permitted panel shadow for large modules only (DESIGN.md §7) */
  --shadow-panel: 0 1px 2px oklch(0.07 0.005 250 / 0.06), 0 8px 24px oklch(0.07 0.005 250 / 0.04);
  --shadow-hover-lift: 0 1px 3px oklch(0.07 0.005 250 / 0.10), 0 12px 32px oklch(0.07 0.005 250 / 0.08);

  /* --- Breakpoints (DESIGN.md §15) --- */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* --- Motion (DESIGN.md §8) --- */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;

  /* --- z-index scale (semantic, no magic 999) --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* RTL-aware overrides (Arabic). Logical properties used throughout. */
[dir="rtl"] {
  --color-primary-soft: oklch(0.42 0.075 240 / 0.10);
}

/* Dark surface overrides — apply via .surface-dark or footer */
.surface-dark,
.site-footer {
  --color-text: var(--color-text-on-dark);
  --color-text-muted: oklch(0.65 0.01 250);
  --color-border: var(--color-border-on-dark);
  --color-surface-raised: oklch(0.13 0.005 250);
}
