/* ============================================================
   DOUBLOON STUDIO · TOKENS
   The one file that names a color or a font. Every other stylesheet
   in site/css/ uses these custom properties and nothing else, so the
   whole look changes from here.

   Palette: provisional, sampled from the coin stills of the film
   (struck coin on the bench, forge behind it). See STATUS.md for the
   sample boxes and the contrast ratios.
   ============================================================ */

/* ---------- fonts (self-hosted, Latin subset) ---------- */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/sourceserif4-regular.v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Quill face: Mrs Saint Delafield (OFL 1.1), the owner's pick of
   2026-10-08. Cut to Latin basic and renamed "Doubloon Quill" inside the
   file, because the license reserves the original name for unmodified
   copies. Swap the file name here and nowhere else. */
@font-face {
  font-family: "Doubloon Quill";
  src: url("../fonts/quill-mrssaintdelafield.v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Fallbacks sized to match, so text does not jump when the real face
   arrives. Numbers come from the font files' own metrics. */
@font-face {
  font-family: "Body Fallback";
  src: local("Georgia");
  size-adjust: 107.6%;
  ascent-override: 96.3%;
  descent-override: 31.1%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Quill Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 59.7%;
  ascent-override: 151.8%;
  descent-override: 103.7%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  /* ---------- named colors (what they are) ---------- */
  --ink-deep-teal: #0d2a2f;   /* shadowed forge wall */
  --ink-teal-raised: #0e3035; /* the same wall, one step lighter */
  --ember: #cb844d;           /* forge flame, saturated orange */
  --gold: #b09063;            /* struck coin face, lit half */
  --bone: #feefce;            /* hottest part of the flame */
  --bone-dim: #aaaa96;        /* bone at 65 percent over the deep teal */
  --gold-faint: #464e41;      /* gold at 35 percent over the deep teal */

  /* ---------- roles (what they do) ---------- */
  --bg: var(--ink-deep-teal);
  --surface: var(--ink-teal-raised);
  --text: var(--bone);
  --text-muted: var(--bone-dim);
  --accent: var(--gold);
  --action: var(--ember);
  --on-action: var(--ink-deep-teal);
  --rule: var(--gold-faint);
  --focus: var(--ember);
  --selection-bg: var(--gold);
  --selection-text: var(--ink-deep-teal);
  --scrim: color-mix(in srgb, var(--ink-deep-teal) 82%, transparent);

  /* ---------- type ---------- */
  --font-body: "Source Serif 4", "Body Fallback", Georgia, "Times New Roman", serif;
  --font-quill: "Doubloon Quill", "Quill Fallback", "Snell Roundhand", cursive;

  --weight-body: 400;
  --weight-quill: 400;

  --size-body: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  --size-small: 0.875rem;
  --size-label: 0.8125rem;
  --size-quill-scene: clamp(2.75rem, 1.6rem + 5.2vw, 5.75rem);
  --size-quill-section: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);

  --leading-body: 1.6;
  --leading-quill: 1;
  --tracking-label: 0.14em;
  --tracking-quill: 0;

  --measure: 34em;

  /* ---------- sections part (scene words, quill ink, depth layer) ---------- */
  /* quill ink: pale gold, a little lighter than the coin face */
  --quill-ink: color-mix(in srgb, var(--bone) 72%, var(--gold));
  --quill-bleed: var(--gold);
  --quill-halo: color-mix(in srgb, var(--ink-deep-teal) 80%, transparent);
  --quill-scale: 1.2;              /* per-face size trim; Mrs Saint Delafield has a small x-height */
  /* legibility halo behind body text that sits over the film */
  --words-halo: color-mix(in srgb, var(--ink-deep-teal) 85%, transparent);
  /* masks only read alpha: "ink" is any solid color, "clear" is none */
  --mask-ink: var(--ink-deep-teal);
  --mask-clear: transparent;
  --mask-thin: color-mix(in srgb, var(--ink-deep-teal) 82%, transparent);
  /* depth layer specks */
  --speck-ember: color-mix(in srgb, var(--ember) 55%, transparent);
  --speck-bubble: color-mix(in srgb, var(--bone) 18%, transparent);
  --speck-dust: color-mix(in srgb, var(--gold) 45%, transparent);
  --speck-clear: transparent;
  /* form fields and the photo slot */
  --field-bg: var(--ink-deep-teal);
  --field-border: color-mix(in srgb, var(--gold) 45%, var(--ink-deep-teal));
}
