/* =========================================================================
   tokens.css — Design tokens. Single source of truth for the whole site.
   Dark mode only (per project brief: desktop 1440p, current Chrome).
   ========================================================================= */

:root {
  /* ---- Surfaces & text ------------------------------------------------ */
  /* Warm black of "Labortisch" (Plan 34/E5); navy #070a11 … #1a2333 until then. */
  --c-bg-0: #0f0d0a;   /* Tusche: page background */
  --c-bg-1: #171411;   /* section surfaces, canvas background */
  --c-bg-2: #1e1b18;   /* Kohle: cards, boxes, the bar */
  --c-bg-3: #2b2723;   /* hover, active controls */
  --c-bg-film: #080706; /* the stage of a film, one step darker than the page (CA-D85) */
  --c-line: #2b2723;   /* grid, borders */
  --c-line-2: #3a3530; /* one step stronger: frames, hover borders (Root-D137) */

  /* Running text is --c-text-1 on every page; the brighter --c-text-0 is for
     headings, emphasis, formulas (Root-D137) and chapter text (Root-D141).
     Contrast on --c-bg-2, the lightest box: 15,3 / 10,3 / 6,4 : 1 — so
     text-2 is never running text (7 : 1, kontrast.mjs). */
  --c-text-0: #f3f2ed; /* Blatt: headings, emphasis, formulas */
  --c-text-1: #cbc8c1; /* running text (chapters: text-0) */
  --c-text-2: #a39d96; /* Asche: labels, footnotes, axis ticks */

  /* ---- The mark ------------------------------------------------------ *
   * The dot in "raiqu.net" and the ring of the tab symbol: one Kaugummi
   * on every page, whatever colour the area gives --c-z (Root-D138).     */
  --c-mark: #fb99b0;

  /* ---- Mathematical colour coding ------------------------------------ *
   * These have FIXED meaning across every page. Never use them for decor.
   * Retuned for the warm black in Plan 34/E5, same meaning.            */
  --c-z:    #5ccbd6;   /* preimage / z-plane / domain grid                */
  --c-w:    #f5cf6e;   /* image / w-plane / function values               */
  --c-butter: #f8e59b; /* the terminal knob on every page; the shell's --c-w (Root-D184) */
  --c-path: #ef7f9f;   /* integration path, chain, contour                */
  --c-sing: #f2685c;   /* singularity, pole                               */
  --c-zero: #5ccf9d;   /* zero                                            */
  --c-vec:  #b394f5;   /* derivative, tangent, contribution vector        */
  --c-warn: #f2a462;   /* warning / "something breaks here"               */

  /* Dimmed variants for fills and inactive states.

     EINE REGEL, KEIN VORRAT: jede Rollenfarbe hat ihre Variante bei 16 %
     Deckkraft, mit exakt denselben RGB-Werten. Das ist der Grund, warum alle
     sieben hier stehen, obwohl nicht alle sieben gerade jemanden haben:
     wer eine Rollenfarbe umdefiniert, definiert ihre -dim mit — und wer eine
     Flaeche in einer Rollenfarbe tont, nimmt die -dim statt sich eine eigene
     Deckkraft auszudenken. `brand.css` macht es genau so (--c-z, --c-w und
     beide -dim), das eingemottete Numerik machte es fuer alle sieben.

     Benutzt sind derzeit drei: --c-warn-dim (components.css, Warnkasten und
     Beweisskizzen-Banner), --c-z-dim und --c-w-dim (site.css, Verlaeufe und
     Rahmen auf der Startseite). Die uebrigen vier sind der Rest des Satzes und
     werden NICHT gestrichen — ein halber Satz waere die schlechtere Ordnung,
     und der naechste, der eine Pol-Flaeche tont, wuerde sich sonst eine
     abweichende Deckkraft ausdenken.
     (Plan 2/E18 hat das geprueft; die Notiz "benutzt wird genau eine" im
     Etappenplan stammt aus der Zeit vor dem Startseiten-Umbau.)

     Denkbar waere color-mix(in srgb, var(--c-z) 16%, transparent) statt der
     ausgeschriebenen Werte — dann koennen Farbe und -dim nie auseinanderlaufen.
     Bewusst nicht gemacht: der Gewinn ist null Pixel, und jede Ebene, die
     Rollenfarben umdefiniert, muesste darauf geprueft werden. */
  --c-z-dim:    rgba(92, 203, 214, 0.16);
  --c-w-dim:    rgba(245, 207, 110, 0.16);
  --c-path-dim: rgba(239, 127, 159, 0.16);
  --c-sing-dim: rgba(242, 104, 92, 0.16);
  --c-zero-dim: rgba(92, 207, 157, 0.16);
  --c-vec-dim:  rgba(179, 148, 245, 0.16);
  --c-warn-dim: rgba(242, 164, 98, 0.16);

  /* ---- Text links ------------------------------------------------------
     One behaviour on every page, in the colour of the area (Root-D137): the
     underline at 40 % of --c-link, on hover full and the text one step
     lighter. An area layer sets both names, nothing else. */
  --c-link: var(--c-z);
  --c-link-hover: #a3e0e7;

  /* ---- Typography ----------------------------------------------------- */
  /* Self-hosted in assets/vendor/fonts.css (Root-D6). Display and body are
     one family since Plan 34/E5; --f-mess only for measured values. */
  --f-display: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body:    'Host Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'Azeret Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-mess:    'Pixelify Sans', 'Azeret Mono', ui-monospace, monospace;

  --fs-hero:  clamp(3rem, 6.2vw, 5.75rem);
  --fs-h1:    clamp(2.25rem, 3.6vw, 3.4rem);
  --fs-h2:    clamp(1.6rem, 2.1vw, 2.15rem);
  --fs-h3:    1.35rem;   /* one h3 everywhere (Root-D136) */
  --fs-body:  1.0625rem;   /* 17px */
  --fs-small: 0.9375rem;   /* 15px */
  --fs-micro: 0.8125rem;   /* 13px */

  --lh-tight: 1.14;
  --lh-body: 1.68;

  /* Prose column width: the longest line lands at 76–82 characters
     (Root-D141). 58ch did that in Inter; Host Grotesk is narrow for its
     "0", so 58ch gave 87 — 55ch is back at 82 on K01 (Plan 34/E5). */
  --measure: 55ch;

  /* ---- Spacing (8px base) --------------------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --sp-9: 7rem;
  --box-pad-x: 28px;   /* a maths box's side padding; box width = measure + 2 x this (Root-D183) */

  /* ---- Radii, borders, elevation -------------------------------------- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-btn: 12px;   /* a button (Root-D183) */
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, 0.75);
  --shadow-3: 0 28px 70px -28px rgba(0, 0, 0, 0.9);
  --inset-hair: inset 0 1px 0 rgba(255, 255, 255, 0.035);

  /* ---- Motion ---------------------------------------------------------- */
  --dur-1: 140ms;
  --dur-2: 240ms;
  --dur-3: 420ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Layout ----------------------------------------------------------
     One column for every page (Root-D136), 1180 on every screen
     (Root-D141): growing it with the window left the text a third of its
     column wide on 2560. Text stands on the centre axis of that column
     (Root-D143, --achse-text below the :root block); stages may break out
     into the wider frame (chapter acts, the map sheet), symmetric around
     the same axis. */
  --page-max: 1180px;
  --page-wide: 1800px;
  --page-pad: clamp(1.25rem, 4vw, 3.5rem);
  --topbar-h: 68px;   /* room the floating bar takes: 12 px air + 56 px bar (Root-D184) */
  /* what sticks at the top: the bar, and signed in from 980 px the small bar "Für dich" under it
     (Plan 54/E10, base.css). Sticky parts and jump targets of the pages count from here. */
  --kopf-h: var(--topbar-h);
}

/* The middle span of the centre axis (Plan 23/E9c): the measure plus a
   box's inner padding on each side. Registered as a length, so the measure is
   counted once, in the body font where base.css sets it, and inherited as
   pixels — unregistered, every small caption or heading that reads it would
   count ch in its own font and stand off the axis. Read by .achse in
   base.css and by sheets that centre without it (lab.css, karte.css). */
@property --achse-text { syntax: '<length>'; inherits: true; initial-value: 0px; }

/* Users who ask for less motion get less motion. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 0ms;
    --dur-2: 0ms;
    --dur-3: 0ms;
  }
}
