/* tokens.css — generated by scripts/type-build.mjs from src/type/metrics.json and
   src/type/config.json. Edit those and run `npm run type`, not this file. */

:root {
  /* Font metrics (em ratios, OS/2 typo values). */
  --a: 0.9766;
  --d: 0.2578;
  --x: 0.5273;
  --a-mono: 1.02;
  --d-mono: 0.3;
  --mono-scale: 0.9588;          /* x-height of body over x-height of mono */
  --a-note: 0.735;
  --d-note: 0.265;
  --note-scale: 1.2379;          /* x-height of body over x-height of the note face */
  --sn-width: 14rem;
  --sn-gap: 2rem;
  --left-share: 0.25;
  --note-size: 0.8rem;
  --note-weight: 450;

  --avg-advance: 0.4662;         /* measured on real prose at weight 550 */

  /* Tunable. The ?type panel edits these live; paste its JSON into config.json to keep them. */
  --base: 100%;
  --body-weight: 550;
  --h1-weight: 700;
  --h2-weight: 600;
  --rho: 1.45;
  --rho-narrow: 1.45;
  --chars: 73;
  --h1-n: 3;
  --h1-lambda: 0.9;
  --h2-n: 1;
  --h2-lambda: 0.92;
  --h3-n: 1;
  --h3-lambda: 1.05;

  /* Tone: how far text sits from the page colour, as a share of full contrast.
     Starts at --tone-start for h1 and drops by --tone-step per level (see the
     --step-* values). Light and dark are tuned separately. */
  --tone-start-light: 0.9;
  --tone-step-light: 0.05;
  --tone-start-dark: 0.9;
  --tone-step-dark: 0.1;
  --tone-start: var(--tone-start-light);
  --tone-step: var(--tone-step-light);
  --step-h1: 0;
  --step-subtitle: 1;
  --step-h2: 1;
  --step-h3: 2;
  --step-date: 2;
  --step-body: 3;

  /* Derived. */
  --measure: calc(var(--chars) * var(--avg-advance) * 1rem);
  --beta: calc(0.5rlh + (var(--a) - var(--d)) / 2 * 1rem);   /* body baseline within a line */
}
