/* ==========================================================================
   Design Tokens
   Single source of truth for the visual language of the store.
   Every other stylesheet should reference these custom properties instead
   of hardcoding raw values.
   ========================================================================== */

:root {
  /* -------------------------------------------------------------------- */
  /* Color — brand                                                        */
  /* -------------------------------------------------------------------- */
  --color-primary: #1D4ED8;
  --color-primary-rgb: 29, 78, 216;
  --color-secondary: #D95000;
  --color-secondary-rgb: 217, 80, 0;
  --color-accent: #D95000;
  --color-accent-rgb: 217, 80, 0;

  /* Color — surface & text */
  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-text: #2D3436;
  --color-text-muted: #6B7280;
  --color-border: #DFE7EE;

  /* Color — feedback */
  --color-success: #16A34A;
  --color-success-text: #15803D; /* darker: the base success green is only 3.3:1 on white,
    which meets the 3:1 non-text (icon/badge) minimum but fails the 4.5:1 body-text
    minimum — this variant is for anywhere the color sits on actual text. */
  --color-danger: #DC2626;

  /* Color — derived states (hover/active), computed once here so nothing
     downstream needs color-mix fallbacks scattered around */
  --color-secondary-hover: #FF6A00;
  --color-primary-hover: #1E3A8A;
  --color-danger-hover: #B91C1C;

  /* -------------------------------------------------------------------- */
  /* Typography                                                           */
  /* -------------------------------------------------------------------- */
  --font-display: 'Poppins', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Type scale — 1.25 (major third) ratio, base 16px */
  --fs-xs: 0.75rem;    /* 12px — captions, badges */
  --fs-sm: 0.875rem;   /* 14px — secondary text */
  --fs-base: 1rem;     /* 16px — body */
  --fs-md: 1.125rem;   /* 18px — lead text */
  --fs-lg: 1.375rem;   /* 22px — card titles */
  --fs-xl: 1.75rem;    /* 28px — section titles */
  --fs-2xl: 2.25rem;   /* 36px — page titles */
  --fs-3xl: 3rem;      /* 48px — hero headline */

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

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

  /* -------------------------------------------------------------------- */
  /* Spacing scale — 4px base unit                                        */
  /* -------------------------------------------------------------------- */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-9: 6rem;     /* 96px */

  /* -------------------------------------------------------------------- */
  /* Layout                                                                */
  /* -------------------------------------------------------------------- */
  --container-max: 1280px;
  --container-padding: var(--space-5);
  --header-height: 76px;

  /* -------------------------------------------------------------------- */
  /* Radius                                                                */
  /* -------------------------------------------------------------------- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-full: 999px;

  /* -------------------------------------------------------------------- */
  /* Shadow — soft, layered, premium                                      */
  /* -------------------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(10, 23, 38, 0.05), 0 4px 12px rgba(10, 23, 38, 0.035);
  --shadow-md: 0 10px 28px rgba(10, 23, 38, 0.08), 0 2px 8px rgba(10, 23, 38, 0.04);
  --shadow-lg: 0 22px 54px rgba(10, 23, 38, 0.14), 0 6px 18px rgba(10, 23, 38, 0.06);
  --shadow-focus: 0 0 0 4px rgba(29, 78, 216, 0.18);

  /* Glassmorphism surface */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: 16px;

  /* -------------------------------------------------------------------- */
  /* Motion                                                                */
  /* -------------------------------------------------------------------- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* -------------------------------------------------------------------- */
  /* Z-index scale — named layers to prevent stacking-context guesswork   */
  /* -------------------------------------------------------------------- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* -------------------------------------------------------------------- */
/* Dark mode — token overrides only, components never branch on theme   */
/* -------------------------------------------------------------------- */
[data-theme="dark"] {
  --color-bg: #0B1220;
  --color-surface: #131C2E;
  --color-text: #E2E8F0;
  --color-text-muted: #94A3B8;
  --color-border: #253347;

  --color-success-text: #22C55E; /* the light-mode darker green (#15803D) drops to 3.4:1
    on dark surfaces — this lighter green keeps text-success readable here instead. */

  --glass-bg: rgba(19, 28, 46, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}
