/* ============================================================
   tokens.css - the palette and type tokens, light and dark.
   Values are decisions from docs/art-direction.md section 2.
   Components reference roles, never raw hex.
   ============================================================ */

:root {
  /* Light: the paper (default) */
  --paper: #F2EDDE;       /* page ground, aged cream, never white */
  --paper-deep: #E8E2CE;  /* alternating sections, photo mats */
  --ink: #1C1915;         /* primary text, warm letterpress black */
  --ink-soft: #4A443A;    /* secondary text, the lightness FLOOR */
  --bark: #6E6355;        /* hairline rules, borders, captions */
  --sky: #AEBFC9;         /* hero ground before the photo lands */
  --denim: #4A6480;       /* links, quiet interactive accents */
  --sawdust: #D9BE92;     /* thick underlines, marks, ornaments */
  --stamp: #A63A24;       /* the one red; stamp + emergency line */

  /* Proof-mode blue pencil. Not part of the printed piece. */
  --proof: #2D5B8E;
  --proof-soft: rgba(45, 91, 142, 0.10);

  /* Interaction states */
  --bar-press: #2A251E;   /* pinned bar press, light mode */

  /* The stamp has two grounds, so it has two inks. --stamp is the
     one pressed onto the paper (footer, emergency line). --stamp-hero
     is the same stamp pressed onto the hero photograph, which in
     some directions is far darker than the paper is. Here they are
     the same value: on the cobalt sky the paper red already reads. */
  --stamp-hero: #A63A24;

  /* The pinned bar's second line. It sits on --ink, which inverts
     with the scheme, so it cannot simply be --sawdust everywhere. */
  --bar-sub: #D9BE92;

  /* The hero sky, sampled from Wes's own photo (wes_001, left
     edge, top to bottom). Constant across light and dark: the
     hero is the same at night (hero-photo-addendum). */
  --hero-sky-top: #254B89;
  --hero-sky-mid: #2E60AE;
  --hero-sky-low: #3C6BB8;
  --cream: #F2EDDE;       /* hero type over the sky; never flips */

  /* Type */
  --font-display: Besley, "Rockwell", Georgia, serif;
  --font-body: Charter, Georgia, "Times New Roman", serif;
  /* Hand annotation register, proof mode only. System stack, zero
     bytes; this face never appears on the shipped site. */
  --font-hand: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;

  /* Paper grain: inline SVG turbulence, no downloads. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: the night call. Wet bark, not blue-black. */
    --paper: #17150F;
    --paper-deep: #211E16;
    --ink: #ECE5D3;         /* bone */
    --ink-soft: #B3AA95;
    --bark: #918675;        /* lifted from #857A6B: 13px kickers on
                               charcoal measured 4.34:1, under AA */
    --sky: #33404C;         /* night slate behind photos */
    --denim: #8FA6BD;
    --sawdust: #C9A96E;
    --stamp: #C7532F;       /* brightened; reads like a lit sign */

    --proof: #7FA8D4;
    --proof-soft: rgba(127, 168, 212, 0.12);

    --bar-press: #D8CFBA;   /* dark-mode bar is bone; press warms it */
    --stamp-hero: #C7532F;  /* the photograph does not change at night,
                               but the rest of the sheet does, so the
                               stamp on it follows the brightened red */
    /* The dark bar is bone, so the second line cannot stay a light
       sawdust: #C9A96E on #ECE5D3 measured 1.78:1, effectively
       invisible on the one control the whole site exists for. */
    --bar-sub: #6B5326;

    /* Bone speckle for the night paper. */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.93 0 0 0 0 0.9 0 0 0 0 0.83 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}
