/* Signal tokens. Ink values are identical to /styles/base.css; everything else is new. */

/* Metric-matched fallbacks: until the webfonts arrive, local Georgia / Courier New are scaled to the same
   advance widths and line metrics, so the swap barely moves a line. Measured in Chrome (canvas measureText
   over a mixed sample): Instrument Serif 0.945 vs Georgia 1.259 per char (italic 0.990 vs 1.278); ascent
   0.99, descent 0.31. Plex Mono advance 0.600 = Courier New; ascent 1.03, descent 0.28. The overrides are
   divided by size-adjust, which scales them again. Re-measure if a family or its fallback changes. */
@font-face { font-family: 'Instrument Serif Fallback'; src: local('Georgia');
  size-adjust: 75.05%; ascent-override: 131.9%; descent-override: 41.3%; line-gap-override: 0%; }
@font-face { font-family: 'Instrument Serif Fallback'; font-style: italic; src: local('Georgia Italic'), local('Georgia-Italic');
  size-adjust: 77.45%; ascent-override: 127.8%; descent-override: 40%; line-gap-override: 0%; }
@font-face { font-family: 'IBM Plex Mono Fallback'; src: local('Courier New'), local('CourierNewPSMT'), local('Liberation Mono');
  size-adjust: 100%; ascent-override: 103%; descent-override: 28%; line-gap-override: 0%; }

@layer tokens {
  :root {
    color-scheme: dark;

    /* Inks (the only three colours the frame paints with) */
    --black: oklch(0.08 0 0);
    --white: oklch(0.95 0.015 70);
    --accent: oklch(0.56 0.24 27);
    --accent-text: oklch(0.61 0.23 27);   /* the same red, lifted to 4.9:1 on --black for text under 24px */

    /* Derived inks: tints of cream over black, never new hues */
    --ink: var(--white);
    --ink-2: color-mix(in oklch, var(--white) 68%, var(--black));
    --ink-3: color-mix(in oklch, var(--white) 58%, var(--black));       /* 4.9:1 on --black: AA at 11px */
    --hair: color-mix(in oklch, var(--white) 16%, transparent);
    --hair-strong: color-mix(in oklch, var(--white) 38%, transparent);
    --paper: var(--white);
    --paper-ink: var(--black);

    /* Families */
    --serif: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    --mono: 'IBM Plex Mono', 'IBM Plex Mono Fallback', Consolas, monospace;

    /* Type scale: serif for reading and display, mono for labels and data */
    --fs-label: 0.6875rem;                                   /* 11px mono, caps, +0.14em */
    --fs-mono: 0.8125rem;                                    /* 13px mono, data and glosses */
    --fs-body: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem); /* serif body */
    --fs-lede: clamp(1.5rem, 1.1rem + 1.6vw, 2.625rem);      /* serif lede, often italic */
    --fs-h3: clamp(1.875rem, 1.5rem + 1vw, 2.5rem);          /* tile names, clauses */
    --fs-h2: clamp(2.75rem, 1.6rem + 4.5vw, 6rem);           /* section titles */
    --fs-plate: clamp(3.75rem, 1.5rem + 9vw, 11rem);         /* specimen name on a plate */
    --fs-display: clamp(4.5rem, 27vw, 26rem);                /* one word per page, max */
    --track-label: 0.14em;

    /* Space and grid */
    --gutter: clamp(16px, 4vw, 64px);
    --col-gap: clamp(12px, 1.6vw, 24px);
    --section: clamp(4rem, 9vw, 9rem);
    --page-max: 1680px;
    --rail-h: 3.25rem;

    /* Motion */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur: 0.45s;

    /* Skin hook: the frame's default. A specimen overrides it on its own element. */
    --skin-accent: var(--accent);
  }
}
