/* Cyberville design tokens. Light is the default. Dark is only ever a player's choice.
   Every color pair used for text is measured in STYLE.md. */

@font-face {
  font-family: "Jersey 20";
  src: url("fonts/Jersey20-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* color: built from the 16 colors of the Look C art (the DawnBringer 16 palette), so panels and sprites match */
  --ink: #140c1c;   /* text, outlines, name tabs: the art's own outline color */
  --ink-soft: #442434;   /* second-level text */
  --paper: #deeed6;   /* panels: the art's own white */
  --paper-2: #cadaca;   /* wells, insets, key caps */
  --page: #bcdaa3;   /* the ground behind a widget */
  --main: #30346d;   /* the main button, the town shield */
  --main-tint: #b3cad3;
  --gold: #dad45e;   /* the quest pin, the outer focus ring; never text on paper */
  --gold-tint: #dce094;
  --warn: #8a353e;   /* "watch out", a fake, a wrong try */
  --warn-tint: #dbd0bc;
  --safe: #346524;   /* "safe", a real one, a right answer */
  --safe-tint: #c5dfb1;
  --pal: #36515e;   /* companions */
  --pal-tint: #a6d8d0;
  --on-dark: #deeed6;   /* text on ink, main, warn, safe, pal */

  /* type */
  --font-display: "Jersey 20", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Jersey 20 draws small for its size, so display text is set about 1.25 times the body beside it */
  --display-sm: 1.25rem;   /* 20 px: a tag, a map label */
  --display-md: 1.5rem;    /* 24 px: a button, a name tab */
  --display-lg: 2rem;      /* 32 px: a widget title, the town name */
  --display-xl: 2.75rem;   /* 44 px: a screen title */
  --text-sm: 1rem;         /* 16 px: a label, a hint. Nothing a player reads is smaller. */
  --text-md: 1.125rem;     /* 18 px: body */
  --text-lg: 1.3125rem;    /* 21 px: speech in the dialog box */
  --text-xl: 1.625rem;     /* 26 px: a widget title */
  --text-2xl: 2.125rem;    /* 34 px: a screen title */
  --leading: 1.45;
  --measure: 34rem;        /* the longest line of reading text */

  /* shape */
  --border: 3px;
  --radius: 6px;
  --radius-pill: 999px;
  --lip: 4px;              /* the hard lower edge of a button or a panel */
  --shadow-panel: 0 5px 0 rgba(20, 12, 28, 0.28);
  --shadow-button: 0 var(--lip) 0 var(--ink);
  --tap: 48px;             /* the smallest side of anything a finger presses */

  /* space: a 4 px step */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* focus: two rings, ink inside and gold outside, so one of them shows on any tile */
  --focus-inner: 3px solid var(--ink);
  --focus-outer: 0 0 0 7px var(--gold);

  /* motion: only as an answer to the player's own action */
  --quick: 90ms;
  --settle: 180ms;
}

[data-theme="dark"] {
  --ink: #deeed6;
  --ink-soft: #b6c6be;
  --paper: #1b1630;
  --paper-2: #222044;
  --page: #140c1c;
  --main: #6dc2ca;
  --main-tint: #2a2c5d;
  --gold: #dad45e;
  --gold-tint: #463e2c;
  --warn: #d69288;
  --warn-tint: #4c1d29;
  --safe: #8fbe5f;
  --safe-tint: #274121;
  --pal: #6dc2ca;
  --pal-tint: #2a2c5d;
  --on-dark: #140c1c;
  --shadow-panel: 0 5px 0 rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  :root { --quick: 0ms; --settle: 0ms; }
}
