/* ==========================================================================
   SpellTo — Design Tokens (gemeinsames AssistUK-System, vgl. GazeTo/ScanTo)
   ========================================================================== */
:root {
  /* Primär (AssistUK-Blau) */
  --color-primary:        #4b698c;
  --color-primary-light:  #6388ad;
  --color-primary-dark:   #3a5a7c;
  --color-primary-bg:     #eef2f7;

  --color-secondary:      #ce0f0a;
  --color-secondary-dark: #a50c08;

  /* Neutral */
  --color-bg:             #fafafa;
  --color-surface:        #ffffff;
  --color-surface-alt:    #f5f5f5;
  --color-border:         #e0e0e0;
  --color-border-strong:  #bdbdbd;

  --color-text:           #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted:     #595959;   /* a11y (WCAG 1.4.3): 6,7:1 auf #fafafa (war #6a6a6a = 5,2:1) */
  --color-text-inverse:   #ffffff;

  /* Feedback */
  --color-success:  #16a34a;
  --color-warning:  #d97706;
  --color-error:    #dc2626;
  --color-info:     #2563eb;

  /* Modul-Akzente (Home-Kacheln) */
  --color-mod-tafel:     #4b698c;
  --color-mod-ueben:     #10b981;
  --color-mod-assistenz: #f59e0b;
  --color-mod-tele:      #8b5cf6;
  --color-mod-lernen:    #06b6d4;
  --color-mod-editor:    #ec4899;

  /* Blick-/Farb-Palette (Element-Index 0..5) — identisch zu SpellToLayouts.PALETTE.
     Diese Werte bleiben für FÜLLFLÄCHEN (mit textOn()-Kontrasttext). */
  --bb-c0: #D22C29; --bb-c1: #E57A25; --bb-c2: #FCF869;
  --bb-c3: #13947C; --bb-c4: #0A8CA5; --bb-c5: #D9186C;
  /* a11y (WCAG 1.4.11, UI-Komponente ≥3:1): kräftigere Varianten NUR für Ränder/
     Legenden-Punkte/Farbnamen — Gelb #FCF869 (1,1:1) und Orange #E57A25 (2,8:1)
     sind als 1px/Rahmen sonst unsichtbar. Identitätsfarbe bleibt erkennbar. */
  --bb-c0-bd: #D22C29;  /* 5,1:1 — ok */
  --bb-c1-bd: #C25E10;  /* 4,1:1 (war #E57A25 = 2,8:1) */
  --bb-c2-bd: #9a7a00;  /* 3,9:1 (war #FCF869 = 1,1:1) */
  --bb-c3-bd: #13947C;  /* 3,6:1 — ok */
  --bb-c4-bd: #0A8CA5;  /* 3,8:1 — ok */
  --bb-c5-bd: #D9186C;  /* 4,7:1 — ok */

  /* Typografie */
  --font-headline: 'Oswald', 'Merriweather', Georgia, serif;
  --font-serif:    'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'DM Mono', 'Fira Code', 'Consolas', monospace;

  --text-xs: 0.875rem; --text-sm: 1rem; --text-base: 1.125rem; --text-lg: 1.25rem;
  --text-xl: 1.5rem; --text-2xl: 1.875rem; --text-3xl: 2.25rem; --text-4xl: 2.75rem; --text-5xl: 3.5rem;

  --font-normal: 400; --font-medium: 500; --font-bold: 700; --font-black: 800;
  --leading-tight: 1.25; --leading-normal: 1.6; --leading-loose: 1.8;

  /* Spacing (8px-Raster) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  /* Radii */
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;

  /* Schatten */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

  /* Transitions */
  --transition-fast: 150ms ease; --transition-base: 250ms ease; --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Fokus-Ring (WCAG 2.4.7 / 2.4.11): konsistenter, deutlich sichtbarer Ring.
     --focus-ring = farbiger Kern; --focus-halo = heller Außenkontrast, damit der
     Ring auf JEDEM Hintergrund (auch farbigen Zellrändern) ≥3:1 absetzt. */
  --focus-ring:  #1d4ed8;          /* kräftiges Blau, 6,3:1 auf #fafafa */
  --focus-halo:  #ffffff;
  --focus-width: 3px;
  --focus-offset: 2px;
}

/* ── Hochkontrast-Thema (Kontrast-Knopf) ── */
:root[data-theme="kontrast"] {
  --color-bg:             #000000;
  --color-surface:        #0c0c0c;
  --color-surface-alt:    #161616;
  --color-border:         #ffffff;
  --color-border-strong:  #ffffff;
  --color-text:           #ffffff;
  --color-text-secondary: #f0f0f0;
  --color-text-muted:     #d4d4d4;
  --color-text-inverse:   #000000;
  --color-primary:        #ffd400;
  --color-primary-light:  #ffe24d;
  --color-primary-dark:   #e6be00;
  --color-primary-bg:     #1a1a00;
  --shadow-md: 0 0 0 2px #ffffff;
  --shadow-lg: 0 0 0 2px #ffffff;
  --shadow-xl: 0 0 0 3px #ffffff;
  /* a11y: Fokus-Ring im Hochkontrast-Thema hell auf schwarz (≈14:1) */
  --focus-ring:  #ffd400;
  --focus-halo:  #000000;
  --focus-width: 4px;
  /* Rand-/Legenden-Farben im Kontrast-Thema kräftig halten (auf Schwarz alle ≥7:1) */
  --bb-c0-bd: #ff6b6b; --bb-c1-bd: #ffae42; --bb-c2-bd: #ffe24d;
  --bb-c3-bd: #4fd1c5; --bb-c4-bd: #4dd0e1; --bb-c5-bd: #ff6fae;
}

/* ── Reduzierte Bewegung ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
