/*
  Design tokens shared by every place on the site.
  Mood: data-mood on <html> is always set ("day" or "night") before first paint
  by the snippet in each page's <head>; js/mood.js keeps it current.
  Fonts are loaded by a <link> in each page's <head>, not an @import here.
*/


:root {
  /* ── Type ─────────────────────────────────────────── */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;

  /* Five steps, no more. */
  --step-display: clamp(52px, 7vw, 104px);
  --step-large: clamp(30px, 2.6vw, 36px);
  --step-statement: clamp(21px, 2vw, 27px);
  --step-body: clamp(17px, 1.2vw, 18px);
  --step-small: 15px;

  /* ── Space ────────────────────────────────────────── */
  --margin: clamp(18px, 2.2vw, 32px);

  /* ── Motion (see the ui-craft skill) ──────────────── */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 320ms;
  --duration-page: 400ms;
  --ease-out-snappy: cubic-bezier(0.2, 0.9, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-anticipate: cubic-bezier(0.5, -0.35, 0.4, 1);
  --ease-overshoot: cubic-bezier(0.3, 1.5, 0.6, 1);

  /* ── Day: a clear midday chart ────────────────────── */
  --paper: #f4f4ef;        /* deep water / chart paper: main ground */
  --shallow: #dbe8f0;      /* shallow water: soft areas behind text */
  --ink: #0f2a3a;          /* deep fjord ink */
  --muted: #45596a;        /* secondary text */
  --rule: rgba(15, 42, 58, 0.18);
  --contour: rgba(29, 90, 138, 0.35);
  --land: #2f6a35;         /* meadow green: drawn land only, never behind text */
  --land-ink: #f4f4ef;
  --fjord: #1d5a8a;        /* the fjord: harbour field */
  --fjord-ink: #f4f4ef;
  --accent: #b3261e;       /* boathouse red: the course and the action */
  --accent-ink: #ffffff;
  --focus: #b3261e;

  /* Signal-flag and cargo colours: real flag colours, the same in both moods. */
  --flag-blue: #1d5a8a;
  --flag-red: #c0302a;
  --flag-white: #ffffff;
  --flag-yellow: #ffd166;
  --flag-green: #2f6a35;

  /* Pier and world materials (also read by the 3D scenes). */
  --wood: #8b6a4c;
  --sky: #cfe3f0;

  color-scheme: light;
}

/* ── Night: the pier on a late-August night ─────────── */
:root[data-mood="night"] {
  --paper: #14243b;
  --shallow: #1d3352;
  --ink: #e5e2dc;          /* warm lamp light */
  --muted: #b8b0a2;
  --rule: rgba(229, 226, 220, 0.2);
  --contour: rgba(229, 226, 220, 0.3);
  --land: #1e3a26;
  --land-ink: #e5e2dc;
  --fjord: #060d18;
  --fjord-ink: #e5e2dc;
  --accent: #ffb347;       /* the pier lamp */
  --accent-ink: #1a1206;
  --focus: #ffb347;
  --wood: #4f3d2e;
  --sky: #0d1a2c;

  color-scheme: dark;
}


@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 1ms;
    --duration-fast: 1ms;
    --duration-base: 1ms;
    --duration-slow: 1ms;
    --duration-page: 1ms;
  }
}
