/* ==========================================================================
   Design-Tokens – todo.simon.graphics
   Alle Farben, Abstände, Radien, Schatten und Bewegungen zentral hier.
   ========================================================================== */

/* ---------- Schriften (selbst gehostet, variable Fonts) ---------- */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* Typografie */
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-md: 0.9375rem;  /* 15 */
  --fs-lg: 1.0625rem;  /* 17 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.875rem;  /* 30 */
  --lh-tight: 1.25;
  --lh-normal: 1.5;

  /* Abstände (4er-Raster) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 48px;

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

  /* Bewegung */
  --dur-1: 150ms;
  --dur-2: 220ms;
  --dur-3: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  /* Feder: leichtes Überschwingen */
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);

  /* Layout */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
  --tabbar-h: 64px;
  --column-w: 300px;
  --touch: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Palette für Boards, Labels und Kunden-Vorschläge */
  --c-violet: #6e56cf;
  --c-blue: #0b84e3;
  --c-teal: #12a594;
  --c-green: #30a46c;
  --c-amber: #e2a336;
  --c-orange: #f76b15;
  --c-red: #e5484d;
  --c-pink: #d6409f;
  --c-slate: #80838d;

  /* ---------- Hellmodus (Standard) ---------- */
  --bg: #f7f7f5;
  --bg-elevated: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --surface-3: #ebebe7;
  --sunken: #efefec;
  --border: #e6e6e1;
  --border-strong: #d6d6d0;
  --text: #1c1c1f;
  --text-2: #55555d;
  --text-3: #6b6b73;  /* ≥ 4,5:1 auf allen Flächen (WCAG AA), vorher #85858d */
  --text-on-accent: #ffffff;

  --accent: #5b5bd6;
  --accent-hover: #4d4dc4;
  /* Gefüllte Flächen mit weißer Schrift (Primärknopf, FAB, Zähler) */
  --accent-solid: #5b5bd6;
  --accent-solid-hover: #4d4dc4;
  --accent-soft: rgb(91 91 214 / 0.1);
  --accent-ring: rgb(91 91 214 / 0.45);

  /* Als Schrift auf den *-soft-Flächen lesbar (≥ 4,5:1) */
  --success: #166e48;
  --success-soft: rgb(43 154 102 / 0.12);
  --warning: #8f5e00;
  --warning-soft: rgb(226 163 54 / 0.18);
  --danger: #c4303a;
  --danger-solid: #c4303a;
  --danger-solid-hover: #ad2832;
  --danger-soft: rgb(229 72 77 / 0.12);

  --shadow-1: 0 1px 1px rgb(20 20 30 / 0.04), 0 1px 2px rgb(20 20 30 / 0.06);
  --shadow-2: 0 1px 2px rgb(20 20 30 / 0.05), 0 4px 12px -2px rgb(20 20 30 / 0.08);
  --shadow-3: 0 2px 6px rgb(20 20 30 / 0.06), 0 16px 40px -8px rgb(20 20 30 / 0.18);
  --shadow-lift: 0 8px 16px -4px rgb(20 20 30 / 0.12), 0 24px 48px -12px rgb(20 20 30 / 0.28);
  --scrim: rgb(16 16 20 / 0.32);

  --skeleton: #ebebe7;
  --skeleton-shine: rgb(255 255 255 / 0.6);
}

/* ---------- Dunkelmodus: automatisch nach System ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --bg-elevated: #151517;
    --surface: #1b1b1e;
    --surface-2: #232327;
    --surface-3: #2b2b30;
    --sunken: #161618;
    --border: #29292e;
    --border-strong: #37373d;
    --text: #ededef;
    --text-2: #a5a5ad;
    --text-3: #8e8e97;

    --accent: #9393f5;
    --accent-hover: #a5a5f7;
    --accent-solid: #5f5fdc;
    --accent-solid-hover: #6b6be3;
    --accent-soft: rgb(128 128 240 / 0.16);
    --accent-ring: rgb(128 128 240 / 0.55);

    --success: #3dd68c;
    --success-soft: rgb(61 214 140 / 0.14);
    --warning: #f5c35b;
    --warning-soft: rgb(245 195 91 / 0.15);
    --danger: #ff6369;
    --danger-solid: #c8363e;
    --danger-solid-hover: #b22d35;
    --danger-soft: rgb(255 99 105 / 0.15);

    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 1px 2px rgb(0 0 0 / 0.35), 0 6px 16px -4px rgb(0 0 0 / 0.45);
    --shadow-3: 0 4px 10px rgb(0 0 0 / 0.4), 0 20px 48px -8px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 10px 20px -4px rgb(0 0 0 / 0.5), 0 28px 56px -12px rgb(0 0 0 / 0.7);
    --scrim: rgb(0 0 0 / 0.55);

    --skeleton: #222226;
    --skeleton-shine: rgb(255 255 255 / 0.05);
  }
}

/* ---------- Dunkelmodus: manuell ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --bg-elevated: #151517;
  --surface: #1b1b1e;
  --surface-2: #232327;
  --surface-3: #2b2b30;
  --sunken: #161618;
  --border: #29292e;
  --border-strong: #37373d;
  --text: #ededef;
  --text-2: #a5a5ad;
  --text-3: #8e8e97;

  --accent: #9393f5;
  --accent-hover: #a5a5f7;
  --accent-solid: #5f5fdc;
  --accent-solid-hover: #6b6be3;
  --accent-soft: rgb(128 128 240 / 0.16);
  --accent-ring: rgb(128 128 240 / 0.55);

  --success: #3dd68c;
  --success-soft: rgb(61 214 140 / 0.14);
  --warning: #f5c35b;
  --warning-soft: rgb(245 195 91 / 0.15);
  --danger: #ff6369;
  --danger-solid: #c8363e;
  --danger-solid-hover: #b22d35;
  --danger-soft: rgb(255 99 105 / 0.15);

  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 1px 2px rgb(0 0 0 / 0.35), 0 6px 16px -4px rgb(0 0 0 / 0.45);
  --shadow-3: 0 4px 10px rgb(0 0 0 / 0.4), 0 20px 48px -8px rgb(0 0 0 / 0.6);
  --shadow-lift: 0 10px 20px -4px rgb(0 0 0 / 0.5), 0 28px 56px -12px rgb(0 0 0 / 0.7);
  --scrim: rgb(0 0 0 / 0.55);

  --skeleton: #222226;
  --skeleton-shine: rgb(255 255 255 / 0.05);
}
:root[data-theme="light"] {
  color-scheme: light;
}

/* Reduzierte Bewegung: nur kurze Überblendungen */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 1ms;
    --dur-2: 120ms;
    --dur-3: 160ms;
    --ease-spring: linear;
  }
}
