/* ==========================================================================
   Gotland Style — design tokens
   --------------------------------------------------------------------------
   Two committed themes, never a system-driven blend:

     Kalkvit  (light)  the limewashed farmhouse in daylight   :root
     Tjära    (dark)   the tarred boathouse at lamplight      [data-theme="dark"]

   Pages ship data-theme="dark" on <html>; assets/js/theme.js restores whatever
   the reader last chose. prefers-color-scheme is deliberately NOT consulted —
   see docs/DECISIONS.md, ADR-004.

   Every value under "material" was measured off the source plates in
   site/assets/img rather than picked by eye. See docs/PALETTE.md.
   ========================================================================== */

:root{
  color-scheme:light;

  /* --- material: limestone, wood, limewash ------------------------------ */
  --bg:#FAF8F3;          /* kalkputs — limewashed wall, the ground          */
  --bg-2:#F1EDE4;        /* panel                                          */
  --bg-3:#E7E1D3;        /* sunk panel, table head                         */
  --fg:#221F19;          /* etching ink — never #000                       */
  --fg-2:#57514A;        /* secondary prose                                */
  --fg-3:#8A8374;        /* labels, captions, disabled                     */
  --hair:#E0DACB;        /* hairline rule                                  */
  --hair-2:#CBC3B0;      /* stronger rule, input border                    */
  --sten:#A9A296;        /* kalksten — grey biased 45°, never neutral      */
  --ek:#8C6A3C;          /* weathered oak — the one warm structural note   */

  /* --- heraldry: the arms of Gotland, 1280 seal / 1936 blasonering ------ */
  --blatt:#1B4B7D;       /* azure field — links, selection                 */
  --blatt-soft:#E3EAF2;
  --guld:#8A6D18;        /* or — labels, counters, the mark's staff        */
  --guld-soft:#F1E9D2;
  --baner:#A82F26;       /* gules — the banner. Once per page, at most.    */
  --baner-soft:#F5E3E1;

  /* --- state (kept separate from the accent hue) ------------------------ */
  --ok:#3E6B4A;      --ok-soft:#E3EDE5;
  --warn:#8A6A1E;    --warn-soft:#F4EDDA;
  --idle:#6E6A62;    --idle-soft:#EAE7E0;

  /* --- image treatment -------------------------------------------------- */
  /* Line art and photographs cannot share a treatment: the etchings span
     roughly 5–85% luminance and go muddy on white, the photograph spans
     nearly the full range. See docs/IMAGERY.md.                            */
  --etch-filter:none;
  --etch-blend:multiply;
  --photo-filter:none;
  --hero-img:.30;        /* plate reads as a pale drawing behind the head   */
  --hero-veil:62%;
  --plate-shadow:rgba(34,31,25,.13);
  --grain:.05;

  /* --- type scale ------------------------------------------------------- */
  --step--1:.8125rem;
  --step-0:1.0625rem;
  --step-1:1.1875rem;
  --step-2:clamp(1.25rem,1.6vw,1.5rem);
  --step-3:clamp(1.5rem,2.4vw,2rem);
  --step-4:clamp(1.85rem,3.4vw,2.6rem);
  --step-5:clamp(2.4rem,7vw,5.4rem);

  /* --- space & measure -------------------------------------------------- */
  --gap-1:.5rem; --gap-2:.875rem; --gap-3:1.375rem;
  --gap-4:2.25rem; --gap-5:clamp(2.5rem,6vh,4.5rem); --gap-6:clamp(3.5rem,9vh,7rem);
  --measure:66ch;
  --shell:1200px;
  --pad:clamp(1.25rem,4vw,3rem);
}

[data-theme="dark"]{
  color-scheme:dark;

  --bg:#14110D;          /* tjära — tarred board                           */
  --bg-2:#1D1913;
  --bg-3:#282219;
  --fg:#EDE7D9;          /* limewash, now the ink                          */
  --fg-2:#B3AB99;
  --fg-3:#7E7767;
  --hair:#332C21;
  --hair-2:#463D2E;
  --sten:#8A8271;
  --ek:#C39B62;

  --blatt:#7FA8CE;       --blatt-soft:#1A2A3A;
  --guld:#D4AC46;        --guld-soft:#2C2515;
  --baner:#D2564C;       --baner-soft:#2E1918;

  --ok:#8CC49C;      --ok-soft:#18271C;
  --warn:#D6B25C;    --warn-soft:#2A2314;
  --idle:#9C978E;    --idle-soft:#242320;

  /* Inverting line art turns an etching into a night scene, which is the
     whole point of Tjära. Inverting a photograph makes a negative — so the
     photo opts out via .photo. */
  --etch-filter:invert(1) contrast(.82) brightness(1.18);
  --etch-blend:screen;
  --photo-filter:brightness(.82) contrast(1.12);
  --hero-img:.42;
  --hero-veil:30%;
  --plate-shadow:rgba(0,0,0,.5);
  --grain:.085;
}
