/**
 * Design Tokens - Magneto SPA
 * Single source of truth for colors, spacing, typography, shadows, etc.
 * Uses CSS custom properties for theming support
 */
:root {
  /* ─── Color Primitives (Transformia brand, from transformia.ai) ─── */
  --color-ink: #0A0A0F;
  --color-ink-soft: #0B1430;
  --color-ink-muted: #14234F;

  --color-blue: #4E95D9;
  --color-blue-light: #9CC4EF;
  --color-blue-deep: #001E6E;
  --color-blue-soft: rgba(78, 149, 217, 0.16);
  --color-blue-border: rgba(78, 149, 217, 0.40);

  /* Secondary accent, published in docs/08-design-system.md for sparing use. */
  --color-sand: #F7B57E;
  --color-sand-deep: #B5784A;


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

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


  /* ─── 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-blue);
  --color-brand-hover: var(--color-blue-light);
  --color-brand-soft: var(--color-blue-soft);
  --color-brand-border: var(--color-blue-border);

  --color-focus: var(--color-blue);
  --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-soft: var(--color-blue-soft);

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

  /* ─── 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-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */

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

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

  --tracking-wide: 0.02em;
  --tracking-overline: 0.1em;

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

  /* ─── Shadows ─── */
  --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);

  /* ─── 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-modal-backdrop: 400;
  --z-tooltip: 700;

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

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

/* ─── Light Theme Overrides ─── */
:root[data-theme="light"] {
  --color-bg-primary: #f5f5f0;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #e9e9e3;
  --color-bg-card: #ffffff;
  --color-bg-hover: #e2e2db;

  --color-text-primary: #0a0a0f;
  --color-text-secondary: rgba(10, 10, 15, 0.72);
  --color-text-muted: rgba(10, 10, 15, 0.55);
  --color-text-inverse: #ffffff;

  --color-border: rgba(0, 30, 110, 0.10);
  --color-border-strong: rgba(0, 30, 110, 0.20);

  --color-brand: var(--color-blue-deep);
  --color-brand-hover: #0a2c8a;
  --color-brand-soft: rgba(0, 30, 110, 0.08);
  --color-brand-border: rgba(0, 30, 110, 0.30);

  --color-focus: var(--color-blue-deep);
  --color-error-soft: rgba(239, 68, 68, 0.08);
  --color-warning-soft: rgba(245, 158, 11, 0.10);
  --color-success-soft: rgba(0, 30, 110, 0.08);

  --shadow-lg: 0 10px 15px -3px rgba(10, 10, 15, 0.10);
  --shadow-xl: 0 20px 25px -5px rgba(10, 10, 15, 0.12);
  --shadow-pop: 0 4px 18px -6px rgba(10, 10, 15, 0.15);
}

/* The wordmark asset is the dark-blue "positive" logo: shown as-is on the light theme, flattened to
   white on the dark one. */
.brand-signature {
  filter: brightness(0) invert(1);
}

[data-theme="light"] .brand-signature {
  filter: none;
}

