/**
 * JamAI Design Token Authority — resources/ui/tokens.css
 * Single source of truth for all semantic colors, dimensions, and typography.
 * Governed by contracts/ui.md and docs/UI_SYSTEM.md.
 */

:root {
  /* Surfaces & Canvas */
  --jam-canvas: #090a0f;
  --jam-surface: #11131a;
  --jam-surface-elevated: #181b24;
  --jam-surface-hover: #202430;
  --jam-surface-active: #272c3b;

  /* Text & Foreground */
  --jam-text: #f0f2f5;
  --jam-text-secondary: #9aa0a6;
  --jam-text-muted: #5f6368;
  --jam-text-inverse: #090a0f;

  /* Accent, Brand & Actions */
  --jam-accent: #3b82f6;
  --jam-accent-hover: #2563eb;
  --jam-accent-subtle: rgba(59, 130, 246, 0.12);
  --jam-focus-ring: #60a5fa;

  /* Status Colors */
  --jam-success: #10b981;
  --jam-success-subtle: rgba(16, 185, 129, 0.12);
  --jam-warning: #f59e0b;
  --jam-warning-subtle: rgba(245, 158, 11, 0.12);
  --jam-danger: #ef4444;
  --jam-danger-subtle: rgba(239, 68, 68, 0.12);
  --jam-info: #06b6d4;
  --jam-info-subtle: rgba(6, 182, 212, 0.12);

  /* Resource Pressure Bands (governed by contracts/resource-budget.md) */
  --jam-res-normal: #10b981;
  --jam-res-pressure: #f59e0b;
  --jam-res-high: #f97316;
  --jam-res-hard: #ef4444;

  /* Borders & Dividers */
  --jam-border: #232733;
  --jam-border-subtle: #191c26;
  --jam-border-focus: #3b82f6;

  /* Typography */
  --jam-font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --jam-font-arabic: "GE SS Two", "Segoe UI", "Tahoma", sans-serif;
  --jam-font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, Monaco, monospace;

  --jam-font-size-xs: 0.75rem;    /* 12px */
  --jam-font-size-sm: 0.875rem;   /* 14px */
  --jam-font-size-base: 1.0rem;   /* 16px */
  --jam-font-size-lg: 1.125rem;   /* 18px */
  --jam-font-size-xl: 1.25rem;    /* 20px */
  --jam-font-size-2xl: 1.5rem;    /* 24px */

  --jam-line-height-tight: 1.25;
  --jam-line-height-normal: 1.5;
  --jam-line-height-relaxed: 1.75;

  /* Spacing Scale */
  --jam-space-1: 0.25rem;  /* 4px */
  --jam-space-2: 0.5rem;   /* 8px */
  --jam-space-3: 0.75rem;  /* 12px */
  --jam-space-4: 1.0rem;   /* 16px */
  --jam-space-5: 1.25rem;  /* 20px */
  --jam-space-6: 1.5rem;   /* 24px */
  --jam-space-8: 2.0rem;   /* 32px */
  --jam-space-12: 3.0rem;  /* 48px */

  /* Border Radius */
  --jam-radius-sm: 4px;
  --jam-radius-md: 6px;
  --jam-radius-lg: 8px;
  --jam-radius-pill: 9999px;

  /* Motion & Transitions */
  --jam-transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --jam-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Elevation (restrained, no heavy drop-shadows) */
  --jam-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --jam-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --jam-backdrop: rgba(0, 0, 0, 0.7);

  /* Layout / Breakpoints */
  --jam-max-width: 1200px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  :root {
    --jam-transition-fast: 0ms !important;
    --jam-transition-normal: 0ms !important;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* RTL layout support */
[dir="rtl"] {
  font-family: var(--jam-font-arabic);
}
