/**
 * Theme T&B — design tokens (single source of truth).
 *
 * @package Theme_TB
 * @since 1.0.0
 */

:root {
  /* Brand palette */
  --tb-color-primary: #2563eb;
  --tb-color-primary-dark: #1d4ed8;
  --tb-color-primary-light: #3b82f6;
  --tb-color-secondary: #06b6d4;
  --tb-color-secondary-dark: #0891b2;
  --tb-color-accent: #8b5cf6;
  --tb-color-success: #22c55e;
  --tb-color-warning: #f59e0b;
  --tb-color-danger: #ef4444;
  --tb-color-info: #0ea5e9;

  /* Semantic surfaces */
  --tb-color-bg: #ffffff;
  --tb-color-surface: #f8fafc;
  --tb-color-surface-elevated: #ffffff;
  --tb-color-card: #ffffff;
  --tb-color-border: #e2e8f0;
  --tb-color-border-strong: #cbd5e1;

  /* Text */
  --tb-color-text: #0f172a;
  --tb-color-text-muted: #64748b;
  --tb-color-text-inverse: #ffffff;
  --tb-color-link: var(--tb-color-primary);
  --tb-color-link-hover: var(--tb-color-primary-dark);
  --tb-color-focus: var(--tb-color-primary);
  --tb-color-disabled: #94a3b8;

  /* Typography */
  --tb-font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tb-font-display: "Poppins", var(--tb-font-sans);
  --tb-font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

  --tb-text-xs: 0.75rem;
  --tb-text-sm: 0.875rem;
  --tb-text-base: 1rem;
  --tb-text-lg: 1.125rem;
  --tb-text-xl: 1.25rem;
  --tb-text-2xl: 1.5rem;
  --tb-text-3xl: 1.875rem;
  --tb-text-4xl: 2.25rem;
  --tb-text-5xl: 3rem;

  --tb-leading-tight: 1.25;
  --tb-leading-normal: 1.6;
  --tb-leading-relaxed: 1.75;

  /* Spacing scale */
  --tb-space-xs: 0.5rem;
  --tb-space-sm: 0.75rem;
  --tb-space-md: 1rem;
  --tb-space-lg: 1.5rem;
  --tb-space-xl: 2rem;
  --tb-space-2xl: 3rem;
  --tb-space-3xl: 4rem;

  /* Radius */
  --tb-radius-sm: 0.375rem;
  --tb-radius-md: 0.75rem;
  --tb-radius-lg: 1rem;
  --tb-radius-xl: 1.25rem;
  --tb-radius-pill: 999px;

  /* Shadows */
  --tb-shadow-low: 0 1px 2px rgba(15, 23, 42, 0.06);
  --tb-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --tb-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --tb-shadow-high: 0 16px 40px rgba(15, 23, 42, 0.14);
  --tb-shadow-float: 0 24px 48px rgba(15, 23, 42, 0.16);

  /* Motion */
  --tb-duration-fast: 120ms;
  --tb-duration-normal: 200ms;
  --tb-duration-slow: 320ms;
  --tb-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --tb-transition: var(--tb-duration-normal) var(--tb-ease);

  /* Layout */
  --tb-container-max: 1200px;
  --tb-container-wide: 1440px;
  --tb-gutter: var(--tb-space-md);
  --tb-header-height: 72px;
  --tb-grid-columns: 12;

  /* Breakpoints (for reference in media queries) */
  --tb-bp-xs: 320px;
  --tb-bp-sm: 576px;
  --tb-bp-md: 768px;
  --tb-bp-lg: 992px;
  --tb-bp-xl: 1200px;
  --tb-bp-2xl: 1440px;

  /* Glassmorphism */
  --tb-glass-bg: rgba(255, 255, 255, 0.72);
  --tb-glass-border: rgba(255, 255, 255, 0.4);
  --tb-glass-blur: 12px;

  /* Icon sizes */
  --tb-icon-sm: 16px;
  --tb-icon-md: 20px;
  --tb-icon-lg: 24px;
  --tb-icon-xl: 32px;

  /* Touch targets */
  --tb-touch-min: 44px;
}

[data-theme="dark"],
:root.tb-dark {
  --tb-color-bg: #0f172a;
  --tb-color-surface: #1e293b;
  --tb-color-surface-elevated: #334155;
  --tb-color-card: #1e293b;
  --tb-color-border: #334155;
  --tb-color-border-strong: #475569;
  --tb-color-text: #f1f5f9;
  --tb-color-text-muted: #94a3b8;
  --tb-color-link: #60a5fa;
  --tb-color-link-hover: #93c5fd;
  --tb-glass-bg: rgba(15, 23, 42, 0.78);
  --tb-glass-border: rgba(51, 65, 85, 0.6);
  --tb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --tb-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --tb-duration-fast: 0ms;
    --tb-duration-normal: 0ms;
    --tb-duration-slow: 0ms;
  }
}