/* kar.re 2 – Design-Tokens (7.2, 7.3). Dunkel ist Standard; hell per Systemeinstellung
   (nur wenn nicht ausdrücklich dunkel gewählt) oder data-theme="hell". Keine Wichtigkeits-Überschreibungen (kein important). */

:root {
  color-scheme: dark;

  /* Flächen und Linien */
  --bg: #0e0f11;
  --surface-1: #16181b;
  --surface-2: #1d2024;
  --surface-3: #262a2f;
  --border: #2b3036;
  --border-strong: #3a4049;

  /* Text */
  --text: #f2f3f5;
  --text-2: #a7adb5;
  --text-3: #8a919b;

  /* Marke und Status */
  --brand: #ff7a00;
  --brand-ink: #1a0e00;
  --brand-soft: rgba(255, 122, 0, .14);
  --ok: #3cc878;
  --ok-soft: rgba(60, 200, 120, .14);
  --warn: #ffb400;
  --warn-soft: rgba(255, 180, 0, .14);
  --danger: #ff5a5a;
  --danger-soft: rgba(255, 90, 90, .14);
  --ki: #7aa2ff;                 /* alles KI-Erzeugte */
  --ki-soft: rgba(122, 162, 255, .14);
  --focus: #8ab4ff;              /* Fokusring, ≠ Akzent */

  /* Formen */
  --radius-l: 12px;
  --radius-m: 8px;
  --radius-s: 6px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);

  /* Schrift (7.3) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-0: clamp(.85rem, .8rem + .2vw, .95rem);
  --fs-1: 1rem;
  --fs-2: clamp(1.15rem, 1rem + .6vw, 1.35rem);
  --fs-3: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  --fs-4: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
  --lh: 1.5;

  /* Maße (7.4) */
  --topbar-h: 56px;
  --tabbar-h: 56px;
  --tap: 44px;
  --gutter: 16px;
  --container: 1280px;
  --container-schmal: 480px;
  --ki-panel: 380px;
  --dauer: 150ms;
  --ease: cubic-bezier(.2, 0, 0, 1);

  /* Abstände */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
}

/* Hell per Systemeinstellung – außer wenn ausdrücklich dunkel gewählt */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dunkel"]) {
    color-scheme: light;
    --bg: #f6f6f4;
    --surface-1: #ffffff;
    --surface-2: #f0f0ee;
    --surface-3: #e6e6e3;
    --border: #dcdcd8;
    --border-strong: #c4c4bf;
    --text: #17191c;
    --text-2: #52575e;
    --text-3: #5f656d;
    --brand: #a64d00;
    --brand-ink: #ffffff;
    --brand-soft: rgba(224, 106, 0, .12);
    --ok: #187a42;
    --ok-soft: rgba(31, 157, 85, .12);
    --warn: #8a5a00;
    --warn-soft: rgba(185, 122, 0, .12);
    --danger: #b3261e;
    --danger-soft: rgba(212, 56, 58, .12);
    --ki: #3b63d6;
    --ki-soft: rgba(59, 99, 214, .12);
    --focus: #2f6fed;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .12);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .14);
  }
}

/* Hell ausdrücklich gewählt */
:root[data-theme="hell"] {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface-1: #ffffff;
  --surface-2: #f0f0ee;
  --surface-3: #e6e6e3;
  --border: #dcdcd8;
  --border-strong: #c4c4bf;
  --text: #17191c;
  --text-2: #52575e;
  --text-3: #5f656d;
  --brand: #a64d00;
  --brand-ink: #ffffff;
  --brand-soft: rgba(224, 106, 0, .12);
  --ok: #187a42;
  --ok-soft: rgba(31, 157, 85, .12);
  --warn: #8a5a00;
  --warn-soft: rgba(185, 122, 0, .12);
  --danger: #b3261e;
  --danger-soft: rgba(212, 56, 58, .12);
  --ki: #3b63d6;
  --ki-soft: rgba(59, 99, 214, .12);
  --focus: #2f6fed;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .14);
}

@media (min-width: 600px) {
  :root { --gutter: 24px; }
}

@media (min-width: 1200px) {
  :root { --gutter: 32px; }
}

/* reduced-motion (7.4): alle Übergänge und Animationen laufen über --dauer → praktisch aus */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dauer: .01ms;
  }
}
