/* Shared design tokens. Four semantic font roles - display, text, ui, num - each resolved by a type theme. D (Spectral + Hanken Grotesk) is the default in :root. C
   (Libre Caslon Display / Text + Schibsted Grotesk) is :root[data-type="c"]; A (Space Grotesk + Space Mono, the original pairing) is :root[data-type="a"], kept for
   stages that have not moved onto the roles yet. web/core/type-switch.js sets data-type from ?type=a|c|d before first paint. */

@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../fonts/spacegrotesk-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/spacemono-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/spacemono-700.woff2') format('woff2'); }

@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/spectral-400.woff2') format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/spectral-400italic.woff2') format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/spectral-600.woff2') format('woff2'); }
@font-face { font-family: 'Spectral'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/spectral-700.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../fonts/hankengrotesk-variable.woff2') format('woff2'); }

@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/librecaslontext-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/librecaslontext-400italic.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/librecaslontext-700.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/librecaslondisplay-400.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/schibstedgrotesk-variable.woff2') format('woff2'); }

:root {
  /* theme D (default): Spectral for display/text/num, Hanken Grotesk for ui */
  --font-display: 'Spectral', Georgia, serif;
  --font-text: 'Spectral', Georgia, serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Spectral', Georgia, serif;
  --title-weight: 600;
  --title-size: clamp(28px, 2.55vw, 36px);
  --title-line: 1.02;
  --title-tracking: -0.012em;
  --kicker-tracking: 0.15em;
  --body-size: 17px;
  --body-line: 1.6;
  --caption-weight: 500;
  --num-weight: 600;
  --num-tracking: 0em;
  --num-variant: tabular-nums lining-nums;
  --num-feature: "tnum" 1, "lnum" 1;

  --grot: var(--font-text);
  --mono: var(--font-num);

  /* Paper: warm dark ink on the sepia day, as in the eclipse piece (story pages, panels on light ground). */
  --paper: rgb(236, 228, 212);
  --paper-ink: rgb(58, 47, 36);
  --paper-ink-soft: rgb(106, 92, 74);
  --paper-ink-faint: rgb(138, 124, 104);
  --paper-line: rgba(92, 74, 52, 0.28);

  /* Over the scene: the same warm family turned light, for text over the 3D view and dark scrims. */
  --ink: rgb(240, 233, 220);
  --ink-soft: rgb(205, 194, 176);
  --ink-faint: rgb(160, 148, 128);
  --line: rgba(236, 228, 212, 0.24);
  --scrim: rgba(24, 19, 14, 0.55);

  /* One gold, as in the eclipse piece; amber for highlights cut from it. */
  --gold: rgb(150, 116, 50);
  --amber: color-mix(in srgb, var(--gold) 72%, #ffd08a);
}

/* theme C: Libre Caslon Display / Text, Schibsted Grotesk for ui; Caslon's own proportional
   figures, left un-forced (no tabular-nums cut is loaded for it). */
:root[data-type="c"] {
  --font-display: 'Libre Caslon Display', Georgia, serif;
  --font-text: 'Libre Caslon Text', Georgia, serif;
  --font-ui: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Libre Caslon Text', Georgia, serif;
  --title-weight: 400;
  --title-size: clamp(30px, 2.7vw, 39px);
  --title-line: 0.96;
  --title-tracking: -0.004em;
  --kicker-tracking: 0.14em;
  --body-size: 17px;
  --body-line: 1.6;
  --caption-weight: 400;
  --num-weight: 400;
  --num-tracking: 0em;
  --num-variant: normal;
  --num-feature: normal;
}

/* theme A: the original pairing, Space Grotesk for words and Space Mono for numbers, times and
   dates. Reproduces the look design.css shipped with before the type roles existed. */
:root[data-type="a"] {
  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-text: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Space Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --title-weight: 600;
  --title-size: clamp(27px, 2.45vw, 35px);
  --title-line: 0.96;
  --title-tracking: -0.026em;
  --kicker-tracking: 0.16em;
  --body-size: 16px;
  --body-line: 1.55;
  --caption-weight: 500;
  --num-weight: 700;
  --num-tracking: -0.03em;
  --num-variant: tabular-nums;
  --num-feature: normal;
}

/* Type scale. --font-* gives the face, the --title-*/--kicker-*/--body-*/--caption-*/--num-*
   tokens above give the per-theme weight, size and tracking each role needs. */
.t-title { font-family: var(--font-display); font-weight: var(--title-weight); font-size: var(--title-size); line-height: var(--title-line); letter-spacing: var(--title-tracking); text-wrap: balance; margin: 0; }
.t-subtitle { font-family: var(--font-text); font-weight: 400; font-size: 14px; line-height: 1.5; letter-spacing: 0; text-wrap: balance; }
.t-kicker { font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: var(--kicker-tracking); text-transform: uppercase; }
.t-body { font-family: var(--font-text); font-weight: 400; font-size: var(--body-size); line-height: var(--body-line); }
.t-caption { font-family: var(--font-text); font-weight: var(--caption-weight); font-size: 13px; line-height: 1.4; }
.t-num { font-family: var(--font-num); font-weight: var(--num-weight); letter-spacing: var(--num-tracking); font-variant-numeric: var(--num-variant); font-feature-settings: var(--num-feature); }
.t-num-soft { font-family: var(--font-num); font-weight: 400; font-variant-numeric: var(--num-variant); font-feature-settings: var(--num-feature); }
