/* ===========================================================================
   THE PALETTE. One file, three pages.

   Lifted out of index.html so the home page, the legal pages and the 404 read
   from the same source. A palette copied into three files is a palette that
   will differ in three files.

   Six roles, one accent hue, two faces plus a mono for figures. The accent is
   keyed to the ground and swaps with it: FOREST on paper, MINT on ink. Each is
   type-safe on its own ground and neither is on the other, which is what makes
   one hue serve both themes without re-picking a colour.

   Three theme states, which is what a theme actually needs: an explicit choice
   wins in BOTH directions, and with no choice the operating system decides.
   Writing only the media query would leave a reader who wants light on a dark
   machine with no way to say so.
   =========================================================================== */

:root {
  --sc-canvas:     #F4F6F4;   /* paper                                     */
  --sc-surface:    #FFFFFF;   /* raised plates                             */
  --sc-ink:        #0E1A16;   /* 14.6:1 on paper                           */
  --sc-ink-soft:   #4E5F58;   /* slate, 6.8:1 on paper                     */
  --sc-accent:     #0A6B4F;   /* forest, 5.99:1 on paper. TYPE-SAFE.       */
  --sc-accent-ink: #F4F6F4;   /* paper, on forest                          */
  --seam-fill:     #48E0AD;   /* mint. FILL ONLY. 1.54:1, never as type.   */

  --sc-font-display: "Spectral", Georgia, serif;
  --sc-font-text:    "Archivo", system-ui, sans-serif;
  --sc-font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --seam-leading-body: 1.62;

  /* The engine's depth tokens are tuned for a near-black ground. On paper the
     ink-tinted inset highlight reads as dirt along the top lip and the shadow
     alphas read as smudge, so both are re-pitched here. */
  --sc-edge: inset 0 1px 0 rgb(255 255 255 / 0.9);
  --sc-shadow-color: 155 12% 40%;
  --seam-grain: 0.02;   /* paper does not band; a dark ground does */
  --seam-rule:  6%;     /* the pad's ruling, as a share of the ink */

  /* The wordmark is dark letters with a mint bowl, drawn for a paper ground. */
  --seam-mark-filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sc-canvas:     #0B0F0E;   /* the ground                                */
    --sc-surface:    #141A18;   /* raised plates                             */
    --sc-ink:        #F4F6F4;   /* paper, 16.6:1 on the ground               */
    --sc-ink-soft:   #8DA298;   /* sage, 6.6:1                               */
    --sc-accent:     #48E0AD;   /* mint, 12.1:1. TYPE-SAFE here, not on paper */
    --sc-accent-ink: #0B0F0E;
    --seam-fill:     #0A6B4F;   /* forest is the fill-only stop on this ground */

    /* An ink-tinted inset reads as dirt on paper and as a lit lip on ink. */
    --sc-edge: inset 0 1px 0 rgb(244 246 244 / 0.08);
    --sc-shadow-color: 160 30% 3%;
    --seam-grain: 0.05;
    --seam-rule:  8%;

    /* On ink the letters would disappear. Inverting lifts them, at the cost of
       flattening the mint bowl to white - the same compromise the previous site
       made. A light export of the artwork would replace this with `none`. */
    --seam-mark-filter: brightness(0) invert(1);
  }
}

:root[data-theme="dark"] {
  --sc-canvas:     #0B0F0E;
  --sc-surface:    #141A18;
  --sc-ink:        #F4F6F4;
  --sc-ink-soft:   #8DA298;
  --sc-accent:     #48E0AD;
  --sc-accent-ink: #0B0F0E;
  --seam-fill:     #0A6B4F;

  --sc-edge: inset 0 1px 0 rgb(244 246 244 / 0.08);
  --sc-shadow-color: 160 30% 3%;
  --seam-grain: 0.05;
  --seam-rule:  8%;
  --seam-mark-filter: brightness(0) invert(1);
}
