/* Design tokens of Baptiste Dupuis's identity. Source of truth for values;
   the rules explaining them live in ../regles/. */

/* SIL OFL 1.1: the licence file must travel with the font file (fonts/OFL-SchibstedGrotesk.txt). */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/SchibstedGrotesk-VF.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Neutrals (regles/03-couleurs.md §1) */
  --bg: #FFFFFF;
  --surface: #F4F4F2;
  --ink: #111111;
  --muted: #6B6B6B;
  --line: #E3E3E0;
  --dot: #CFCFCA; /* dot texture of the grid (regles/04 §2) */

  /* Dark palette (regles/03-couleurs.md §5), measured on --bg-dark: ink 16.8:1, muted 7.5:1.
     Applied by :root[data-theme="dark"] below; the page decides when (system or visitor's choice). */
  --bg-dark: #111111;
  --surface-dark: #1B1B1A;
  --ink-dark: #F2F2EF;
  --muted-dark: #A3A39E;
  --line-dark: #2A2A28;
  --dot-dark: #3A3A37;

  /* Personal colour, reserved to Baptiste's own identity (regles/03-couleurs.md §2) */
  --perso: #2B50E6;
  /* Cobalt as text (key words, links): 6.2:1 on white; on --bg-dark it needs --perso-text-dark (4.5:1). */
  --perso-text: var(--perso);
  --perso-text-dark: #5573EB;

  /* Shape and grid (regles/04-registre-et-grille.md) */
  --radius: 4px;
  --grid-columns: 12;
  --grid-gutter: 24px;
  --grid-max: 1132px;

  /* Typography (regles/05-typographie.md) */
  --f-text: "Schibsted Grotesk", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, monospace; /* provisional, mono family not chosen */
  --track-display: -0.04em;
  --leading-display: 1.04;
  --leading-text: 1.55;
  color-scheme: light;
}

/* Cobalt stays #2B50E6 in dark: 3.05:1 on --bg-dark, enough for strokes and shapes only.
   Cobalt text on dark would need #5573EB (regles/03 §5). */
:root[data-theme="dark"] {
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --ink: var(--ink-dark);
  --muted: var(--muted-dark);
  --line: var(--line-dark);
  --dot: var(--dot-dark);
  --perso-text: var(--perso-text-dark);
  color-scheme: dark;
}
