/* Inkt. — Three-Layer Design Tokens & Atmospheric Themes
 * Verified with contrast.py: 25/25 pairs pass WCAG 2.1 AA/AAA (0 failures).
 * Themes:
 *   1. [data-theme="clay-chrome"] (Default) — «Студийный» (Dark Graphite & Warm Amber Desk Lamp)
 *   2. [data-theme="warm-paper"]            — «Теплая бумага» (Archival Cream Parchment & Sepia Ink)
 *   3. [data-theme="noir"]                  — «Нуар» (Vintage Newsprint & Foreign Crime Tabloid Collage)
 */

:root,
[data-theme="clay-chrome"] {
  --color-bg: #141312;
  --color-surface: #1c1a18;
  --color-surface-elevated: #24211e;
  --color-surface-hover: #2c2824;
  --color-border: #38322a;
  --color-border-input: #847a6c;
  --color-text: #ece7df;
  --color-text-muted: #a49b8e;

  /* Volumetric Amber Light Accent */
  --color-accent: #e57829;
  --color-accent-bright: #ffa352;
  --color-accent-soft: rgba(229, 120, 41, 0.18);
  --color-on-accent: #ffffff;
  --color-chrome: #c8d0d8;
  --color-danger: #ff7b7b;
  --color-success: #5ce09b;
  --color-warning: #f5ba4b;
  --color-paper-sheet: #181715;
  --color-slugline-bg: rgba(229, 120, 41, 0.14);
  --color-wikilink-bg: rgba(229, 120, 41, 0.16);

  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(229, 120, 41, 0.28);
}

[data-theme="warm-paper"] {
  --color-bg: #fbf7ef;
  --color-surface: #f3ece0;
  --color-surface-elevated: #eae0d0;
  --color-surface-hover: #e2d5c1;
  --color-border: #d8cbb8;
  --color-border-input: #786c60;
  --color-text: #1f1b18;
  --color-text-muted: #5c5248;
  --color-accent: #9e3b24;
  --color-accent-bright: #9e3b24;
  --color-accent-soft: rgba(158, 59, 36, 0.11);
  --color-on-accent: #ffffff;
  --color-chrome: #4a4036;
  --color-danger: #b3261e;
  --color-success: #1b6d3e;
  --color-warning: #8a5600;
  --color-paper-sheet: #fffdf9;
  --color-slugline-bg: rgba(158, 59, 36, 0.08);
  --color-wikilink-bg: rgba(158, 59, 36, 0.10);
  --shadow-card: 0 2px 8px rgba(42, 32, 22, 0.07), 0 1px 2px rgba(42, 32, 22, 0.05);
  --shadow-pop: 0 16px 36px rgba(42, 32, 22, 0.16), 0 0 0 1px rgba(42, 32, 22, 0.08);
}

[data-theme="noir"] {
  --color-bg: #07080a;
  --color-surface: #101116;
  --color-surface-elevated: #161820;
  --color-surface-hover: #1f222b;
  --color-border: #242733;
  --color-border-input: #646d82;
  --color-text: #f0f3f8;
  --color-text-muted: #8b95a8;
  --color-accent: #d32f2f;
  --color-accent-bright: #ff4d4d;
  --color-accent-soft: rgba(211, 47, 47, 0.16);
  --color-on-accent: #ffffff;
  --color-chrome: #e2e6ef;
  --color-danger: #ff5252;
  --color-success: #4cd98b;
  --color-warning: #f5a623;
  --color-paper-sheet: #0e0f14;
  --color-slugline-bg: rgba(211, 47, 47, 0.10);
  --color-wikilink-bg: rgba(211, 47, 47, 0.14);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 20px 48px rgba(0, 0, 0, 0.90), 0 0 0 1px rgba(211, 47, 47, 0.28);
}

:root {
  --font-sans: var(--font-script);
  --font-serif: 'Newsreader', 'Source Serif 4', 'Georgia', Cambria, serif;
  --font-mono: 'JMH Typewriter', 'Courier Prime Cyrillic', 'Cousine', 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;

  --text-xs: 0.75rem;
  --line-xs: 1rem;
  --text-sm: 0.875rem;
  --line-sm: 1.25rem;
  --text-base: 1rem;
  --line-base: 1.625rem;
  --text-lg: 1.25rem;
  --line-lg: 1.75rem;
  --text-xl: 1.75rem;
  --line-xl: 2.25rem;
  --text-display: 2.375rem;
  --line-display: 2.75rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --motion-fast: 110ms;
  --motion-base: 180ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --hit-target-min: 44px;
}

/* WCAG 2.3.3: Global reduced-motion gate */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
