/* ============================================================
   Leaster CD v1 — kanonische Design-Tokens (Stand 2026-10-20)

   Quelle der Wahrheit für alle Leaster-Oberflächen (leaster.it, cv,
   check, qr). Dienste kopieren diese Datei unverändert und legen
   die Schriften aus docs/brand/fonts/web/ unter /fonts/ ab.
   Regeln und Begründungen: docs/brand/DESIGN_SYSTEM.md

   Verfahren (unverändert aus leaster.it):
   - Farben via `light-dark()` → folgen `color-scheme`.
   - `:root[data-theme]` setzt `color-scheme` → ein manueller Toggle
     steuert dieselbe Quelle wie die Systempräferenz.
   ============================================================ */

/* Mona Sans als vier statische Schnitte: die variable Datei (v2.0.27) rendert in
   Chromium mit falschen Laufweiten nach t/f. Breite = font-stretch, Stärke = font-weight;
   nur diese vier Kombinationen verwenden (siehe Tokens wdth und wght). */
@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/MonaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/MonaSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-stretch: 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/MonaSansSemiExpanded-Bold.woff2") format("woff2");
  font-weight: 700;
  font-stretch: 112.5%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/MonaSansExpanded-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-stretch: 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/fonts/MartianMono-VF.woff2") format("woff2-variations"),
       url("/fonts/MartianMono-VF.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* ---- Markenpalette (themenunabhängig, für Zeichen, Keil, Print) ---- */
  --c-blue:      #1797be;  /* Marke: Fläche, Keil, Zeichen — NICHT für Text auf Weiß (3,4:1) */
  --c-ink:       #1773b0;  /* Tiefblau: Text auf Farbe, Buttons hell (Weiß 5,1:1) */
  --c-teal:      #01a79d;  /* Teal-Keil, Akzent */
  --c-turquoise: #3ec0c1;  /* Teal auf dunkel */
  --c-navy:      #1f4e69;  /* Wortmarke und Text auf hell */
  --c-night:     #10222e;  /* Grund dunkel, Favicon, OG */
  --c-sky:       #2db4d8;  /* Blau auf dunkel */
  --c-snow:      #f1f7f9;  /* Wortmarke auf dunkel */

  /* ---- Flächen & Text ---- */
  --bg:         light-dark(#f6fafb, #10222e);
  --bg-subtle:  light-dark(#eef5f7, #152c3a);
  --surface:    light-dark(#ffffff, #1b3543);
  --tint:       light-dark(#ebf5f8, #133140);   /* Bühnenfläche für Keil-Abschnitte */
  --border:     light-dark(#d6e6ea, #2c4a5a);
  --text:       light-dark(#1f4e69, oklch(0.945 0.010 230));
  --text-muted: light-dark(oklch(0.475 0.022 245), oklch(0.735 0.018 235));

  /* ---- Marke im UI ---- */
  --brand:      light-dark(#1797be, #2db4d8);   /* Zeichen, Linien, große Schrift ≥ 24 px */
  --brand-ink:  light-dark(#1773b0, #6fd0c6);   /* Links, Labels, Text in Markenfarbe */
  --accent:     light-dark(#01a79d, #3ec0c1);
  --action:     light-dark(#1773b0, #2db4d8);   /* primärer Button */
  --on-action:  light-dark(#ffffff, #08222b);   /* 5,1:1 hell · 6,8:1 dunkel */
  --keil:       #1797be;                        /* Keil + Bildmarke: in beiden Themes gleich */
  --keil-2:     #01a79d;

  /* ---- Status (getrennt von der Marke, nie als Deko) ---- */
  --ok:   light-dark(#0b7d55, #3fcf8e);
  --warn: light-dark(#a86200, #f0b04a);
  --crit: light-dark(#c2362b, #ff7b6e);

  /* ---- Typografie ---- */
  --font-sans: "Mona Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wdth-display: 125%;     /* h1, h2, Keil-Titel  → Expanded ExtraBold */
  --wdth-sub:     112.5%;   /* h3, Listentitel, Buttons → SemiExpanded Bold */
  --wght-display: 800;
  --wght-sub:     700;
  --wght-strong:  600;      /* Hervorhebung, Feldlabels → SemiBold (normal breit) */

  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);  /* Mono-Labels */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.15rem, 1.07rem + 0.40vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.30rem + 1.00vw, 2.1rem);
  --step-3:  clamp(1.9rem, 1.50rem + 2.00vw, 3.1rem);
  --step-4:  clamp(2.3rem, 1.60rem + 3.40vw, 4.4rem);

  --lh-display: 0.98;
  --lh-head:    1.08;
  --lh-body:    1.6;
  --track-display: -0.02em;
  --track-label:    0.08em;   /* Mono-Labels, Versalien */
  --track-caps:     0.05em;   /* Wortmarke, Sub-Marken */
  --measure: 62ch;

  /* ---- Raum & Raster ---- */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4.5rem; --s-9: 7rem;
  --space:  clamp(1rem, 0.7rem + 1.4vw, 1.6rem);
  --gutter: clamp(16px, 2.5vw, 28px);
  --maxw:   72rem;

  /* ---- Form ---- */
  --radius: 0;            /* Leaster ist eckig */
  --radius-dot: 999px;    /* einzige Rundung: Status-Punkte */
  --hairline: 1px solid var(--border);
  --rule: 2px solid var(--text);

  /* ---- Keil ---- */
  --keil-s: 2.5rem;
  --keil-m: clamp(4.5rem, 14vw, 10rem);
  --keil-l: clamp(7rem, 26vw, 18rem);
  --keil-ratio: 0.44;     /* Kantenlänge Teal-Keil relativ zum Keil */

  /* ---- Bewegung & Fokus ---- */
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 120ms;  --dur-2: 200ms;  --dur-3: 320ms;
  --focus: 2px solid var(--action);
  --focus-offset: 2px;
  --shadow-pop: 0 12px 32px -12px oklch(0.2 0.02 245 / 0.35);  /* nur Menüs/Overlays */
}

/* Manueller Toggle übersteuert die Systempräferenz */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }
