/* Knotwick web design system: tokens.
 *
 * One world, by choice: the game is dark throughout, so the site is the same
 * bench at night, with parchment, oak and brass laid on it. There is no light
 * theme.
 *
 * Every value here comes from the game unless it says otherwise:
 * Design/design-tokens.json and Design/visual-direction.md. Change them there
 * first, then here.
 */
:root {
  color-scheme: dark;

  /* Grounds: the bench and the board. */
  --bench: #111F28;          /* workbench ink, the page's ground */
  --slate: #101C25;          /* the board's flat interior */
  --grid: #1D2B34;           /* cell lines, hairlines on dark */
  --bench-lift: #182B36;     /* web only: a raised patch of bench */

  /* Dusk: web only, sampled from the opening painting of the tower. */
  --dusk: #4E3447;
  --dusk-deep: #2A1F2E;
  --lamp: #E9A24B;           /* window and lantern light */

  /* Materials. */
  --parchment: #E7D1A8;
  --paper: #F4E8CE;
  --oak: #302722;
  --brass: #D9C18D;
  --brass-hi: #E2C68F;
  --flax: #B99D76;
  --flax-hi: #E8D8B5;
  --cord-key: #302B32;
  --oxblood: #773543;        /* wax. An accent, never a fourth ink. */

  /* The three inks. Each has a mark, so color is never the only cue. */
  --nightshade: #624A85;     /* crescent */
  --mugwort: #81A98D;        /* eye */
  --tallow: #E9D9BC;         /* star */
  --rune-plum: #3E263F;      /* mark on mugwort and tallow */
  --rune-chalk: #E8D8B5;     /* mark on nightshade */

  /* Signals. */
  --ghost: #A6C6C7;          /* landing outline, quiet hints */
  --strain: #DE937D;         /* a strained ward. Always with words. */

  /* Text. Paper on dark, ink on parchment and brass. */
  --text: var(--paper);
  --text-dim: rgb(244 232 206 / 0.74);
  --text-ink: #302630;
  --text-ink-dim: rgb(48 38 48 / 0.76);

  /* Type. The game uses the system's Cochin and Baskerville and bundles no
     fonts. The site does the same and asks no other server for a font. */
  --font-display: Cochin, "Hoefler Text", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-text: Baskerville, "Baskerville Old Face", "Hoefler Text", "Palatino Linotype", Palatino, Georgia, serif;

  --text-label: 0.8125rem;                              /* 13: spaced capitals */
  --text-small: 1rem;                                   /* 16 */
  --text-body: 1.1875rem;                               /* 19 */
  --text-lead: clamp(1.3rem, 1.1rem + 0.7vw, 1.55rem);
  --text-h3: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  --text-h2: clamp(2.2rem, 1.5rem + 3vw, 3.5rem);
  --text-h1: clamp(2.8rem, 1.6rem + 5.2vw, 5rem);

  --leading-tight: 1.08;
  --leading-body: 1.55;
  --track-label: 0.14em;

  /* Space: a 4px step. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;

  /* Layout. */
  --page: 74rem;
  --measure: 34rem;
  --gutter-left: max(1.25rem, env(safe-area-inset-left, 0px));
  --gutter-right: max(1.25rem, env(safe-area-inset-right, 0px));

  /* Shape. The game's materials have clipped, worn corners, not round ones. */
  --radius-small: 4px;
  --radius-painting: 10px;
  --shadow-bench: 0 18px 40px rgb(4 10 14 / 0.55), 0 2px 6px rgb(4 10 14 / 0.5);
  --shadow-lift: 0 30px 70px rgb(4 10 14 / 0.6);

  /* Motion: the game's own timings (motion_ms in design-tokens.json). */
  --t-press: 70ms;           /* a control letting go */
  --t-move: 80ms;            /* a capsule turning or setting */
  --t-fade: 120ms;           /* Nell's expression changing */
  --t-burst: 220ms;          /* a clear */
  --t-chain: 450ms;          /* the chain label */
  --t-settle: 600ms;         /* web only: things arriving on the page */
  --idle: 2100ms;            /* a knot's idle flex, 1.8 to 2.4 s */
  --sway: 2200ms;            /* a drifting knot's sway */
  --pan: 40s;                /* the opening's slow pan across a painting */
  --ease-set: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-drift: cubic-bezier(0.45, 0, 0.55, 1);

  /* Skins: the game's painted interface art, used as nine-slice borders.
     Slice numbers are from Design/assets/ui/manifest.json (art is 3x). */
  --skin: 1;                 /* scale the borders up or down */
  --skin-parchment: url("../img/ui/parchment-panel.webp");
  --skin-hud-tag: url("../img/ui/hud-tag.webp");
  --skin-callout: url("../img/ui/callout-tag.webp");
  --skin-slate: url("../img/ui/tally-plate.webp");
  --skin-brass: url("../img/ui/action-primary.webp");
  --skin-slate-action: url("../img/ui/action-secondary.webp");
  --skin-frame: url("../img/ui/playfield-frame.webp");
  --skin-key: url("../img/ui/button-face-normal.webp");
  --skin-key-pressed: url("../img/ui/button-face-pressed.webp");
}
