/* HE11CATS tokens v2 — single source of truth.
   Kontrasty (WCAG 2.1 AA) liczone dla --bg-0 #080507:
   text-primary 17.9:1 · secondary 11.1:1 · muted 6.6:1 · accent 6.3:1
   biały na accent-solid 4.78:1 · text-inverse na accent 6.05:1 */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg-0: #080507;
  --surface-1: #0f0a0d;
  --surface-2: #151014;
  --surface-3: #1c151a;
  --surface-raised: #221a1f;
  --surface-overlay: rgba(8, 5, 7, .72);

  /* borders */
  --border-subtle: rgba(255, 255, 255, .05);
  --border-default: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);
  --border-accent: rgba(255, 77, 109, .38);

  /* text */
  --text-primary: #f5eff2;
  --text-secondary: #c7bdc2;
  --text-muted: #9b9096;
  --text-disabled: #6f646a;
  --text-inverse: #1a070c;

  /* accent */
  --accent: #ff4d6d;
  --accent-hover: #ff6683;
  --accent-active: #c72444;
  --accent-solid: #d92b4b;
  --accent-solid-hover: #c72444;
  --accent-soft: rgba(255, 77, 109, .12);
  --accent-ring: rgba(255, 77, 109, .38);
  --accent-glow: 0 0 0 1px var(--accent-ring), 0 0 24px rgba(255, 77, 109, .22);

  /* status */
  --success: #3ddc97;
  --success-soft: rgba(61, 220, 151, .12);
  --warning: #ffb020;
  --warning-soft: rgba(255, 176, 32, .12);
  --danger: #ff5c78;
  --danger-soft: rgba(255, 92, 120, .12);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .12);

  /* typography */
  --font-sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 32px;
  --fs-4xl: 40px;
  --fs-5xl: 48px;
  --fs-6xl: 64px;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;

  --tracking-tight: -.02em;
  --tracking-normal: 0;
  --tracking-wide: .06em;
  --tracking-caps: .08em;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .62);
  --shadow-pop: 0 40px 120px rgba(0, 0, 0, .65);

  /* motion */
  --duration-1: 120ms;
  --duration-2: 200ms;
  --duration-3: 320ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);

  /* z-index */
  --z-base: 0;
  --z-dropdown: 30;
  --z-sticky: 40;
  --z-drawer: 60;
  --z-modal: 70;
  --z-toast: 90;

  /* controls */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --control-touch: 44px;

  /* layout */
  --container: 1160px;
  --container-narrow: 920px;
  --header-h: 64px;

  /* legacy aliases — do usunięcia po migracji */
  --bg-1: var(--surface-1);
  --bg-2: var(--surface-2);
  --bg-3: var(--surface-3);
  --line: var(--border-subtle);
  --line-strong: var(--border-default);
  --text: var(--text-primary);
  --text-dim: var(--text-secondary);
  --text-mute: var(--text-muted);
  --ok: var(--success);
  --warn: var(--warning);
  --bad: var(--danger);
  --r-sm: var(--radius-sm);
  --r-md: var(--radius-md);
  --r-lg: var(--radius-lg);
  --shadow-card: var(--shadow-md);
}

.tabular,
.sb-time,
.mono,
.table td,
.kpi-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
