/**
 * Calcoryn design tokens.
 *
 * Single source of truth for brand colors, typography, spacing, radii,
 * shadows and motion. Every component file must consume these custom
 * properties instead of hard-coded values so the brand can be adjusted
 * in one place as Calcoryn grows past 100+ tool pages.
 */

:root {
  /* Brand colors */
  --color-primary-dark: #0f172a;
  --color-primary-blue: #2563eb;
  --color-primary-blue-hover: #1d4ed8;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --color-success: #059669;
  --color-border: #e2e8f0;

  /* Semantic aliases (used by components; keep brand colors above canonical) */
  --color-link: var(--color-primary-blue);
  --color-link-hover: var(--color-primary-blue-hover);
  --color-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.45);
  --color-danger: #dc2626;

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-family-numeric: var(--font-family-base);

  --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.5rem; /* 40px */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-base: 1.5;
  --line-height-relaxed: 1.7;

  /* 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-8: 3rem; /* 48px */
  --space-10: 4rem; /* 64px */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Shadows (subtle, never decorative-heavy) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);

  /* Layout */
  --container-max-width: 1120px;
  --touch-target-min: 44px;

  /* Motion */
  --motion-duration-fast: 120ms;
  --motion-duration-base: 200ms;
  --motion-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect the user's motion preference across every component. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration-fast: 0ms;
    --motion-duration-base: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
