/* tokens.css – Schriften, Designvariablen, Farben, Dark Mode
   Selbst gehostete Schriften (DSGVO), keine Google Fonts.
   Kontrastziel: Fließtext sehr hoch, UI-Elemente mindestens WCAG-AA-nah. */

/* ---- Schriften ---- */
/* Inter (Fließtext) */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../assets/fonts/inter-latin.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: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../assets/fonts/inter-latin-ext.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;
}
/* Libre Baskerville (Headlines, editorial) */
@font-face {
  font-family: 'Libre Baskerville'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/libre-baskerville-regular-latin.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: 'Libre Baskerville'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/libre-baskerville-regular-latin-ext.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: 'Libre Baskerville'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/libre-baskerville-italic-latin.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;
}
/* JetBrains Mono (Akzente, Code) */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-400.ttf) format('truetype');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-500.ttf) format('truetype');
}

:root {
  /* Farben (hell) */
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #e8efe9;
  --text: #1a1a18;          /* auf --bg ~ 15:1 (AAA) */
  --text-muted: #45423c;    /* auf --bg ~ 8.5:1 (AAA) */
  --accent: #a33d32;        /* Rost: Marken-/Flaechenfarbe */
  --accent-text: #862f28;   /* dunkleres Rost fuer kleinen Text/Links: ~ 7:1 (AAA) */
  --accent-ink: #ffffff;    /* Text auf Rost-Flaeche: ~ 6.3:1 */
  --accent-2: #1b3b52;      /* Navy (Sprache/Vertrauen): ~ 10:1 (AAA) */
  --accent-2-ink: #ffffff;
  --accent-3: #4b735f;      /* Sage fuer positive Nachweise */
  --border: #dce4dd;
  --border-strong: #b9c6bc;
  --focus: #1b3b52;

  /* Schriften */
  --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, 'Liberation Mono', monospace;

  /* Schriftgrößen */
  --fs-300: 0.875rem;
  --fs-400: 1.0625rem;      /* 17px Basis fuer komfortables Lesen */
  --fs-500: 1.25rem;
  --fs-600: 1.55rem;
  --fs-700: 2.05rem;
  --fs-800: 2.75rem;

  /* Abstände, Radien, Schatten */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --radius: 8px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.06), 0 10px 30px rgba(26, 26, 24, 0.08);
  --container: 72rem;
  --measure: 36rem;         /* Lesebreite ~ 66 Zeichen */
}

:root[data-text-size="large"] { font-size: 112.5%; }
:root[data-text-size="xlarge"] { font-size: 125%; }

@media (max-width: 44rem) {
  :root {
    --fs-600: 1.35rem;
    --fs-700: 1.7rem;
    --fs-800: 2rem;
    --space-6: 4rem;
  }
}

/* Dark-Tokens, einmal definiert, ueber zwei Selektoren angewandt:
   - System-Dunkel, sofern der Nutzer nicht explizit Hell erzwingt
   - Nutzer waehlt aktiv Dunkel */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171b19;          /* warmes Fast-Schwarz, kein reines #000 */
    --surface: #202622;
    --surface-2: #26312a;
    --text: #f1efe9;        /* auf --bg ~ 14:1 (AAA) */
    --text-muted: #c6c1b5;  /* auf --bg ~ 9:1 (AAA) */
    --accent: #e58a72;
    --accent-text: #f0a98f; /* helleres Rost fuer Text auf Dunkel: ~ 7:1 */
    --accent-ink: #1b1916;
    --accent-2: #a8c2de;
    --accent-2-ink: #1b1916;
    --accent-3: #9ac6a9;
    --border: #334137;
    --border-strong: #4d6154;
    --focus: #f0a98f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #171b19;
  --surface: #202622;
  --surface-2: #26312a;
  --text: #f1efe9;
  --text-muted: #c6c1b5;
  --accent: #e58a72;
  --accent-text: #f0a98f;
  --accent-ink: #1b1916;
  --accent-2: #a8c2de;
  --accent-2-ink: #1b1916;
  --accent-3: #9ac6a9;
  --border: #334137;
  --border-strong: #4d6154;
  --focus: #f0a98f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.4);
}
