/* Import ui-lib tokens globally */
/**
 * Design Tokens - SourceHut-inspired minimal palette
 * Three-tier system: Primitives → Semantic → Component
 */
:root {
  /* ========================================
     Layer 1: Color Primitives
     ======================================== */

  /* Grayscale (dominant palette) - Reduced to 7 essential shades */
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-900: #212529;
  --black: #000000;

  /* Action Colors (pastel palette for soft, calm aesthetic) */

  /* Pastel Blue - Primary */
  --blue-100: #e8f4ff;
  --blue-200: #d1e9ff;
  --blue-300: #b3ddff;
  --blue-400: #95d1ff;
  --blue-500: #a3d5ff;  /* Light mode primary pastel */
  --blue-600: #6fa3d9;  /* Dark mode primary pastel */
  --blue-700: #5a8fc7;
  --blue-800: #4a7ab3;
  --blue-900: #3a6599;

  /* Pastel Red - Danger */
  --red-100: #ffe8eb;
  --red-200: #ffd1d7;
  --red-300: #ffbac3;
  --red-400: #ffa3af;
  --red-500: #ffb8c1;  /* Light mode danger pastel */
  --red-600: #d9848f;  /* Dark mode danger pastel */
  --red-700: #c7707b;
  --red-800: #b35c67;
  --red-900: #994853;

  /* Pastel Green - Success */
  --green-100: #e8f8ec;
  --green-200: #d1f1d9;
  --green-300: #baeac6;
  --green-400: #a3e3b3;
  --green-500: #b8e6c3;  /* Light mode success pastel */
  --green-600: #85c494;  /* Dark mode success pastel */
  --green-700: #6fb07e;
  --green-800: #5a9c68;
  --green-900: #458852;

  /* Pastel Yellow - Warning */
  --yellow-100: #fffceb;
  --yellow-200: #fff9d7;
  --yellow-300: #fff6c3;
  --yellow-400: #fff3af;
  --yellow-500: #fff5b8;  /* Light mode warning pastel */
  --yellow-600: #d9c785;  /* Dark mode warning pastel */
  --yellow-700: #c7b371;
  --yellow-800: #b39f5d;
  --yellow-900: #998b49;

  /* ========================================
     Layer 2: Semantic Tokens
     ======================================== */

  /* Enable native dark mode support */
  color-scheme: light dark;

  /* Backgrounds */
  --color-background: light-dark(var(--white), var(--gray-900));
  --color-surface: light-dark(var(--gray-100), #262626);

  /* Text */
  --color-text: light-dark(var(--gray-900), var(--gray-100));
  --color-text-muted: light-dark(var(--gray-600), var(--gray-600));

  /* Borders */
  --color-border: light-dark(var(--gray-300), var(--gray-700));

  /* Actions (pastel colors for semantic meaning) */
  --color-primary: light-dark(var(--blue-500), var(--blue-600));
  --color-danger: light-dark(var(--red-500), var(--red-600));
  --color-success: light-dark(var(--green-500), var(--green-600));
  --color-warning: light-dark(var(--yellow-500), var(--yellow-600));
  --color-focus: light-dark(var(--blue-500), var(--blue-600));

  /* ========================================
     Typography
     ======================================== */

  /* System font stacks - no web fonts for minimal footprint */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;

  /* Type scale based on browser defaults (1rem = 16px) */
  --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 */

  /* Line heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ========================================
     Spacing System (rem-based) - Simplified to 6 essential values
     ======================================== */

  --space-0: 0;
  --space-2: 0.5rem;    /* 8px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */

  /* ========================================
     Radii (minimal - flat aesthetic) - Unified to single value
     ======================================== */

  --radius: 2px;

  /* ========================================
     Shadows (subtle - avoid depth) - Unified to single minimal shadow
     ======================================== */

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

  /* ========================================
     Animation
     ======================================== */

  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;

  --ease-out: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}
/* ========================================
   Manual Theme Override Support
   ======================================== */
[data-theme="light"] {
  color-scheme: light;
}
[data-theme="dark"] {
  color-scheme: dark;
}
/* ========================================
   Reduced Motion Preferences
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ========================================
   Base Document Styles
   ======================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Note: Removed :not(:defined) rule that was hiding components in Storybook */
