/* ==========================================================================
   Karriere G.U.T. Merseburg — Design Tokens
   --------------------------------------------------------------------------
   Single source of truth for the visual identity.

   Two tiers:
     1. Primitives — raw brand values. Stable, don't consume directly.
     2. Semantic   — meaningful aliases (--color-bg, --color-accent, …).

   LIGHT-COMMITTED. There is no dark theme and no theme toggle (see
   .planned/project-brief.md). Contrast comes from hard-inverted sections
   (hero, video, footer) via the `.inverse` scope further down — not from a
   colour-scheme switch.

   Phase 0 ist abgeschlossen: Variante B „Achse" mit **Schibsted Grotesk** als
   Display-Schrift und **Inter** im Fließtext ist gelockt und steht vollständig
   in dieser Datei + components.css. Begründung und die verworfenen Optionen:
   .planned/design-direction.md.

   Der Design-Playground unter `/playground` kann Alternativen weiterhin
   überlagern (Schriftvergleich, die verworfene Raster-Variante) — die dafür
   nötigen @font-face-Blöcke und Overrides liegen in playground*.css und
   erreichen die echten Seiten nicht.
   ========================================================================== */

@layer reset, tokens, base, components, utilities;

@layer tokens {
  :root {
    /* ----------------------------------------------------------------
       1. PRIMITIVES
       ---------------------------------------------------------------- */

    /* Brand red. `--gut-red` is the identity colour straight off the logo.
       It only reaches 4.03:1 on white — fine for marks, rules, borders and
       large type (WCAG non-text / large-text thresholds), NOT for small
       white-on-red labels. `--gut-red-ink` is the AA-safe sibling used
       wherever small text is involved. See design-direction.md. */
    --gut-red:       #f91c1f;
    --gut-red-ink:   #d40f12;  /* 5.4:1 on white  — fills with small labels */
    --gut-red-deep:  #ab0a0d;  /* hover / pressed                          */
    --gut-red-tint:  #fdecec;  /* faint wash for chips, hover rows          */
    --gut-red-light: #ff6062;  /* 4.7:1 auf #2b2c36 — roter Text im Inversen */

    /* Charcoal + cool grey ramp (from gut-merseburg.de) */
    --ink-950: #17181e;
    --ink-900: #2b2c36;  /* brand charcoal */
    --ink-800: #3b414e;
    --ink-700: #4e5663;
    /* Phase 8, Kontrastdurchgang: von #6b748b auf #666f85 abgedunkelt. Auf
       Weiß war der alte Wert mit 4,67:1 in Ordnung, auf `--color-bg-subtle`
       (#f2f4f5 — u. a. die Ansprechpartner-Karte der Stellenseite) aber nur
       4,23:1 und damit unter AA. Der Unterschied ist mit bloßem Auge kaum zu
       sehen (Δ ≈ 2 % Helligkeit), räumt aber beide Fälle ab: 5,0:1 auf Weiß,
       4,6:1 auf der getönten Fläche. */
    --ink-500: #666f85;
    /* Phase 8: Rahmen von Bedienelementen. `--ink-400` erreicht auf Weiß nur
       2,3:1 und verfehlt damit die 3:1, die WCAG 1.4.11 für die Kontur eines
       Bedienelements verlangt — betroffen waren der Ghost-Button und,
       wichtiger, die Eingabefelder des Bewerbungsformulars.

       #858e99 schafft 3,3:1 auf Weiß **und** 3,0:1 auf der getönten Fläche
       (#f2f4f5) — letzteres, weil die Funnel-Optionen im Hover genau dort
       landen. Bewusst nicht dunkler: der Rahmen soll eine Haarlinie bleiben,
       die das Feld begrenzt, keine Kante, die es einrahmt. */
    --ink-450: #858e99;
    --ink-400: #a4abb3;
    --ink-300: #d3d8db;
    --ink-200: #e4e8ea;
    --ink-100: #f2f4f5;

    --white: #ffffff;
    --black: #000000;

    /* Spacing — hybrid 4-then-doubling scale */
    --space-0:  0;
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.5rem;
    --space-6:  2rem;
    --space-7:  3rem;
    --space-8:  4rem;
    --space-9:  6rem;
    --space-10: 8rem;
    --space-11: 12rem;
    --space-12: 16rem;

    /* Section rhythm — one knob for the whole vertical cadence. */
    --section-space:    clamp(3.5rem, 6.5vw, 6rem);
    --section-space-lg: clamp(4.5rem, 9vw, 8rem);
    --section-head-gap: var(--space-7);

    /* Fluid type scale. Deliberately *restrained* at the top end — the
       client asked for professional and quiet, no poster typography. The
       display size caps at 52px, not the 60px the template shipped. */
    --text-xs:      clamp(0.75rem,  0.72rem + 0.15vw, 0.8125rem);  /* 12 → 13 */
    --text-sm:      clamp(0.8125rem, 0.79rem + 0.15vw, 0.875rem);  /* 13 → 14 */
    --text-base:    clamp(1rem,     0.97rem + 0.15vw, 1.0625rem);  /* 16 → 17 */
    --text-lg:      clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem); /* 17 → 19 */
    --text-xl:      clamp(1.1875rem, 1.11rem + 0.38vw, 1.375rem);  /* 19 → 22 */
    --text-2xl:     clamp(1.375rem, 1.24rem + 0.66vw, 1.75rem);    /* 22 → 28 */
    --text-3xl:     clamp(1.625rem, 1.36rem + 1.3vw, 2.375rem);    /* 26 → 38 */
    --text-4xl:     clamp(1.875rem, 1.5rem + 1.85vw, 2.9375rem);   /* 30 → 47 */
    --text-display: clamp(2.125rem, 1.62rem + 2.5vw, 3.25rem);     /* 34 → 52 */

    /* Line heights */
    --leading-tight:   1.1;
    --leading-snug:    1.22;
    --leading-normal:  1.6;
    --leading-relaxed: 1.75;

    /* Letter spacing */
    --tracking-tighter: -0.028em;
    --tracking-tight:   -0.015em;
    --tracking-normal:  0;
    --tracking-wide:    0.06em;
    --tracking-caps:    0.11em;

    /* Weights (both faces are variable, 100–900) */
    --font-light:    300;
    --font-normal:   400;
    --font-medium:   500;
    --font-semibold: 600;
    --font-bold:     700;

    /* Font families.
       --font-sans    Fließtext
       --font-display Überschriften + UI-Labels
       Beide selbst gehostet, kein CDN. Die in Phase 0 verglichenen
       Alternativen (Archivo, Instrument Sans, Jost) leben nur noch im
       Playground. */
    --font-schibsted: "Schibsted Grotesk Variable", "Helvetica Neue", Arial, sans-serif;
    --font-inter:     "Inter Variable", -apple-system, BlinkMacSystemFont,
                      "Segoe UI", Arial, sans-serif;

    --font-sans:    var(--font-inter);
    --font-display: var(--font-schibsted);
    --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                    "Liberation Mono", monospace;

    /* Stimme der Display-Ebene. Schibsted ist eine Groteske — im Displaysatz
       will sie Gewicht und negatives Tracking. */
    --display-weight:   600;
    --display-tracking: -0.022em;

    /* Eyebrow: roter Punkt statt Strich (Variante „Achse"). */
    --eyebrow-weight:      600;
    --eyebrow-tracking:    0.13em;
    --eyebrow-gap:         var(--space-3);
    --eyebrow-mark-w:      0.5rem;
    --eyebrow-mark-h:      0.5rem;
    --eyebrow-mark-radius: 9999px;

    /* Buttons: Pillenform, ruhiges Versal-Label. */
    --btn-weight:   600;
    --btn-tracking: 0.05em;
    --btn-pad-y:    0.875rem;
    --btn-pad-x:    1.625rem;

    /* Radii. `--radius-ui` / `--radius-card` sind die zwei Knöpfe, die die
       gesamte Ecken-Sprache bestimmen; Komponenten lesen nur die. */
    --radius-none: 0;
    --radius-sm:   0.125rem;
    --radius-md:   0.375rem;
    --radius-lg:   0.625rem;
    --radius-xl:   1rem;
    --radius-full: 9999px;

    --radius-ui:    var(--radius-full);  /* Buttons, Chips, Inputs  */
    --radius-card:  0.875rem;            /* Karten, Medienrahmen    */

    /* Elevation — used sparingly; this is a material, not glossy, look. */
    --shadow-sm: 0 1px 2px 0 rgb(23 24 30 / 0.06);
    --shadow-md: 0 2px 6px -1px rgb(23 24 30 / 0.08), 0 1px 2px -1px rgb(23 24 30 / 0.05);
    --shadow-lg: 0 12px 28px -8px rgb(23 24 30 / 0.16), 0 4px 8px -4px rgb(23 24 30 / 0.06);

    /* Motion. `--ease-signature` + `--duration-normal` tragen die
       Bewegungs-Persönlichkeit: weich und eher langsam, kein Schnappen. */
    --duration-fast:   120ms;
    --duration-normal: 260ms;
    --duration-slow:   420ms;
    --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
    --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --ease-signature:  cubic-bezier(0.22, 1, 0.36, 1);

    /* Layout */
    --container-narrow:  38rem;
    --container-default: 68rem;
    --container-wide:    82rem;
    --container-gutter:  clamp(1.25rem, 4vw, 2.5rem);

    /* Header height — hero offsets and scroll-margins read this. */
    --header-h: 4.75rem;

    /* ----------------------------------------------------------------
       2. SEMANTIC — the only tier components should consume
       ---------------------------------------------------------------- */

    /* Surfaces */
    --color-bg:        var(--white);
    --color-bg-subtle: var(--ink-100);
    --color-bg-muted:  var(--ink-200);
    --color-bg-inset:  var(--white);
    --color-bg-inverse: var(--ink-900);

    /* Text */
    --color-text:        var(--ink-900);
    --color-text-muted:  var(--ink-700);
    --color-text-subtle: var(--ink-500);

    /* Borders */
    --color-border:        var(--ink-300);
    --color-border-strong: var(--ink-450);
    --color-rule:          var(--ink-300);  /* hairlines between rows */

    /* Accent */
    --color-accent:        var(--gut-red);      /* marks, rules, non-text */
    --color-accent-ink:    var(--gut-red-ink);  /* anything with small text */
    --color-accent-hover:  var(--gut-red-deep);
    --color-accent-fg:     var(--white);
    --color-accent-tint:   var(--gut-red-tint);

    /* Feedback */
    --color-focus-ring:   var(--gut-red);
    --color-selection-bg: var(--ink-900);
    --color-selection-fg: var(--white);
  }

  /* ----------------------------------------------------------------
     3. INVERSE SCOPE — hard-inverted sections
        Put `.inverse` on a section and every semantic token flips. This
        replaces the dark-mode block the template shipped: same mechanism,
        but opt-in per section instead of per user preference.
     ---------------------------------------------------------------- */

  .inverse {
    --color-bg:        var(--ink-900);
    --color-bg-subtle: var(--ink-800);
    --color-bg-muted:  var(--ink-800);
    --color-bg-inset:  var(--ink-800);
    --color-bg-inverse: var(--white);

    --color-text:        var(--white);
    --color-text-muted:  var(--ink-300);
    --color-text-subtle: var(--ink-400);

    --color-border:        rgb(255 255 255 / 0.16);
    /* Phase 8: von 0.28 auf 0.38 angehoben. Bei 28 % ergab sich auf Charcoal
       2,5:1 — dieselbe 1.4.11-Lücke wie im Hellen, nur andersherum. 38 %
       liefert 3,3:1 und bleibt eine Haarlinie, keine Kante. */
    --color-border-strong: rgb(255 255 255 / 0.38);
    --color-rule:          rgb(255 255 255 / 0.14);

    /* Roter Text auf Charcoal — nachgemessen in Phase 8.
       Der hier vorher stehende Kommentar behauptete „#f91c1f auf #2b2c36
       ≈ 4.6:1". Das stimmt nicht: es sind **3,44:1**, also unter AA für
       normalen Text. Aufgefallen ist es nicht, weil derzeit keine einzige
       `--color-accent-ink`-Fläche in einer `.inverse`-Sektion liegt (dort
       stehen nur `.eyebrow`-Zeilen, und die sind weiß). Ein falscher Wert im
       Token bleibt trotzdem eine Falle für die nächste Komponente.

       `--gut-red-light` erreicht 4,7:1 auf `--ink-900` bei gleichem Farbton
       — sichtbar heller, aber unverkennbar dasselbe Rot. Auf `--ink-800`
       (`--color-bg-subtle` im Inversen) sind es 3,5:1: für Großtext und
       nicht-textliche Elemente in Ordnung, für kleinen Fließtext nicht — eine
       Fläche, die beides zugleich erfüllt, gäbe es nur als blasses Rosa.

       Der Akzent-Button braucht das nicht: `.inverse .btn--accent` ist weiß
       auf Charcoal (siehe components.css) — Rot bleibt Interpunktion, nie
       Fläche. */
    --color-accent-ink:  var(--gut-red-light);
    --color-accent-tint: rgb(249 28 31 / 0.14);

    --color-focus-ring:   var(--white);
    --color-selection-bg: var(--white);
    --color-selection-fg: var(--ink-900);

    background-color: var(--color-bg);
    color: var(--color-text);
  }

  /* ----------------------------------------------------------------
     4. WEB FONTS — selbst gehostet, kein CDN (DSGVO)
        Schibsted Grotesk — SIL OFL 1.1, siehe LICENSE-SchibstedGrotesk.txt
        Inter             — SIL OFL 1.1, siehe LICENSE-Inter.txt
        Die in Phase 0 verglichenen Alternativen (Archivo, Instrument Sans,
        Jost) sind hier bewusst nicht deklariert — ihre @font-face-Blöcke
        liegen in playground.css und laden nur unter /playground.
     ---------------------------------------------------------------- */

  @font-face {
    font-family: "Schibsted Grotesk Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/SchibstedGrotesk-Variable-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: "Schibsted Grotesk Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/SchibstedGrotesk-Variable-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, 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: "Inter Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/Inter-Variable-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 Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/Inter-Variable-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, 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;
  }
}
