/**
 * Design Tokens - Magneto SPA
 * Single source of truth for colors, spacing, typography, shadows, etc.
 * Uses CSS custom properties for theming support
 */
:root {
  /* ─── Color Primitives (Taidy design system) ─── */
  --color-ink: #1E1E16;
  --color-ink-soft: #29261B;
  --color-ink-muted: #3F3C3C;

  --color-green: #8CBE9E;
  --color-green-deep: #4F8D65;
  --color-green-soft: rgba(140, 190, 158, 0.14);
  --color-green-border: rgba(140, 190, 158, 0.35);

  --color-clay: #D38277;
  --color-clay-deep: #B85F53;
  --color-clay-soft: rgba(211, 130, 119, 0.14);

  --color-fg: #ffffff;
  --color-fg-muted: rgba(255, 255, 255, 0.55);
  --color-fg-soft: rgba(255, 255, 255, 0.72);
  --color-fg-faint: rgba(255, 255, 255, 0.18);

  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-strong: rgba(255, 255, 255, 0.20);

  --color-white: #ffffff;
  --color-black: #000000;

  /* ─── Semantic Colors ─── */
  --color-bg-primary: var(--color-ink);
  --color-bg-secondary: var(--color-ink-soft);
  --color-bg-tertiary: var(--color-ink-muted);
  --color-bg-card: var(--color-ink-soft);
  --color-bg-hover: var(--color-ink-muted);

  --color-text-primary: var(--color-fg);
  --color-text-secondary: var(--color-fg-soft);
  --color-text-muted: var(--color-fg-muted);
  --color-text-inverse: var(--color-ink);

  --color-brand: var(--color-green);
  --color-brand-hover: var(--color-green-deep);
  --color-brand-soft: var(--color-green-soft);
  --color-brand-border: var(--color-green-border);

  --color-focus: var(--color-green);
  --color-error: #ef4444;
  --color-error-soft: rgba(239, 68, 68, 0.12);
  --color-warning: #f59e0b;
  --color-warning-soft: rgba(245, 158, 11, 0.12);
  --color-success: var(--color-green);
  --color-success-soft: var(--color-green-soft);

  /* ─── Spacing Scale ─── */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ─── Typography Scale ─── */
  --font-sans: "Prompt", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "DM Mono", "JetBrains Mono", "Fira Code", monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */

  --leading-tight: 1.1;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semi: 600;
  --font-bold: 700;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-overline: 0.1em;

  /* ─── Border Radius ─── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;
  --radius-highlight: 16px;

  /* ─── Shadows ─── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 4px 18px -6px rgba(0, 0, 0, 0.45);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);

  /* ─── Transitions ─── */
  --transition-fast: 120ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);

  /* ─── Z-Index Scale ─── */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* ─── Layout ─── */
  --header-height: 64px;
  --header-height-mobile: 56px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --max-content-width: 1180px;
  --container-padding: 24px;
  --container-padding-mobile: 16px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}
