/* ── THE PALETTE ───────────────────────────────────────────────────────────
   Change a color here and it changes everywhere on the site at once. This is
   the one file where a color is defined; everything else uses these names.

   Night is the default (:root) and day overrides it ([data-theme='light']).
   The inline script in index.html picks one before the page paints: a saved
   choice, otherwise the visitor's clock.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces: a forest at dusk, deep green rather than near-black. */
  --bg: #1b3125;
  --bg-raised: #213a2c;
  --panel: #24402f;
  --panel-strong: #2b4a37;
  --line: rgb(226 238 229 / 0.12);
  --line-strong: rgb(226 238 229 / 0.24);

  /* Ink. */
  --ink: #ecf3ee;
  --ink-soft: #c2d3c6;
  --ink-faint: #a3b7aa;

  /* Moss: links, active menu items, the brand's green. */
  --moss: #9edcac;
  --moss-strong: #bdecc7;

  /* Sunrise: the one warm accent — buttons and the things to press. */
  --sunrise: #f4a259;
  --sunrise-strong: #ffbb7c;
  --on-sunrise: #24140a;

  /* Difficulty, used on chips. */
  --easy: #8ad898;
  --moderate: #f2c45a;
  --hard: #f59a7e;

  /* Ridge illustrations (engine/ridge.js): sky, moon, four ridges far to near. */
  --sky-top: #1d3349;
  --sky-bottom: #44607a;
  --sun: #efe3c2;
  --ridge-1: #4a6e57;
  --ridge-2: #3a5c46;
  --ridge-3: #2d4b38;
  --ridge-4: #213b2c;

  /* The trail map. */
  --map-sea: #1c3e52;
  --map-land: #3e5f49;
  --map-coast: #85aa8f;
  --map-pin: var(--sunrise);

  /* Type. One family, the system's own, which covers Chinese characters too. */
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans TC', 'PingFang TC',
    'Microsoft JhengHei', 'Helvetica Neue', Arial, sans-serif;

  /* ── THE FOUR SIZES OF TEXT ─────────────────────────────────────────────
     t1  the title of a page
     t2  a heading inside a page — a card, a section
     t3  body text: paragraphs, links, buttons
     t4  small print: dates, prices, chips, captions
     Anything that wants a fifth size wants one of these four instead. */
  --text-t1: clamp(1.875rem, 1.35rem + 1.5vw, 2.5rem);
  --text-t2: clamp(1.25rem, 1.1rem + 0.45vw, 1.4375rem);
  --text-t3: clamp(1rem, 0.9rem + 0.35vw, 1.125rem);
  --text-t4: clamp(0.9375rem, 0.875rem + 0.2vw, 1rem);

  --radius-sm: 0.5rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.2rem;

  --shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  --page-width: 72rem;
}

:root[data-theme='light'] {
  --bg: #f4f1e8;
  --bg-raised: #ece7da;
  --panel: #ffffff;
  --panel-strong: #fbfaf5;
  --line: rgb(20 35 27 / 0.12);
  --line-strong: rgb(20 35 27 / 0.24);

  --ink: #14231b;
  --ink-soft: #3f5347;
  --ink-faint: #627467;

  --moss: #24693a;
  --moss-strong: #17522b;

  --sunrise: #b9531a;
  --sunrise-strong: #a04614;
  --on-sunrise: #ffffff;

  --easy: #2e7d3e;
  --moderate: #8a6200;
  --hard: #b23a1c;

  --sky-top: #9ccbe6;
  --sky-bottom: #f7dcb5;
  --sun: #f6b24f;
  --ridge-1: #9dbfa6;
  --ridge-2: #77a084;
  --ridge-3: #567f63;
  --ridge-4: #3a5e47;

  --map-sea: #d6eaf3;
  --map-land: #e9e3cf;
  --map-coast: #9b8a62;

  --shadow: 0 10px 30px rgb(40 50 30 / 0.12);
}

/* Text on a ridge illustration keeps the night ink in both themes: the
   picture under it has its own dark foreground. */
.on-art {
  --ink: #f4f7f2;
  --ink-soft: #dfe9e1;
}
