/*
  🎨 The app's colours: ONLY tokens, light in :root and dark under prefers-color-scheme (the device decides).
  Every other stylesheet (app.css, navmenu.css, the widgets, the Marmot kit) reads these names and never a
  colour of its own, so a new Boy app is a new accent here and nothing else.

  scripts/new-app.mjs writes the two ACCENT lines below (light, then dark) and the two ACCENT-CONTRAST lines (the
  text on the accent: white or near-black, whichever reads better on it), the manifest's colours and index.html's
  theme-color metas; the rest follows from them (hover, soft fills, the text on a tint, the Beta pill, the review
  popup: --mr-*), so a new app's colours are one command.

  The names are the family's (ChefBoy's and ChoreBoy's token block): --surface*, --text*, --border*, --accent*,
  --good/--warn/--bad (+ -soft; --bad-text and --bad-contrast: the words on --bad-soft and on --bad), --info, --shadow-*, --radius*, --font; plus --brand* (the logo colour),
  --beta-* (the Beta pill), --mr-* (⭐ the review popup kit, marmot-review.css) and --toast-* (the toast).
*/
:root {
  color-scheme: light;
  --accent: #7c3aed; /* ACCENT (light): new-app.mjs --accent */

  /* The neutrals (cool grey, ChoreBoy's and DressBoy's). */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --sunken: #eceff3;
  --border: #e3e6eb;
  --border-strong: #cdd2da;
  --line: var(--border);
  --card: var(--surface);
  --text: #15181d;
  --text-2: #464c56;
  --text-3: #6a717c;

  /* From the accent. */
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --accent-contrast: #ffffff; /* ACCENT-CONTRAST (light): new-app.mjs, from the accent */
  --accent-text: color-mix(in srgb, var(--accent) 72%, #000);
  --brand: var(--accent);
  --brand-deep: var(--accent-text);
  --brand-tint: var(--accent-soft);

  /* What things mean (the same in every Boy app). */
  --good: #15803d;
  --good-soft: #ecfdf3;
  --warn: #b86a05;
  --warn-soft: #fff7e6;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --bad-text: #b91c1c; /* words on --bad-soft: 5.7:1 (--bad itself is 4.2:1 there) */
  --bad-contrast: #fff; /* words on --bad: 4.8:1 */
  --info: #026aa2;
  --info-soft: #f0f9ff;
  --gold: #f2b630;
  /* (the older names some widgets and charts.js still read) */
  --in: var(--good);
  --out: var(--text);
  --over: var(--bad);
  --over-soft: var(--bad-soft);
  --move: #64748b;

  /* The Beta pill next to the logo (index.html .beta-pill). */
  --beta-border: color-mix(in srgb, var(--accent) 55%, var(--border));
  --beta-bg: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --beta-text: var(--accent-text);

  /* The toast: dark on light, light on dark. */
  --toast-bg: var(--text);
  --toast-text: var(--bg);
  --toast-btn: color-mix(in srgb, var(--accent) 45%, #fff);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --scrim: rgba(12, 10, 8, .5);
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* ⭐ The review popup (marmot-review.css, the same kit in every Boy app) in this app's colours. 480 sits over
     boxes, menus, toasts and OK/Cancel (90) and pickers (400), under the tour (500). */
  --mr-bg: var(--surface);
  --mr-text: var(--text);
  --mr-muted: var(--text-2);
  --mr-border: var(--border-strong);
  --mr-field: var(--surface);
  --mr-accent: var(--accent);
  --mr-accent-hover: var(--accent-hover);
  --mr-accent-text: var(--accent-contrast);
  --mr-star: var(--gold);
  --mr-bad: var(--bad);
  --mr-scrim: var(--scrim);
  --mr-shadow: var(--shadow-lg);
  --mr-radius: var(--radius-lg);
  --mr-radius-sm: var(--radius);
  --mr-font: var(--font);
  --mr-z: 480;

  /* 📖 The book: a page's paper and ink (the reader, the writing page's last page), the book font, and the covers
     (shared/novel.js COVERS: --cover-<key>, the words on them --cover-ink). */
  --paper: #fdfbf6;
  --paper-edge: #e9e3d6;
  --paper-ink: #24211c;
  --paper-ink-2: #6b6458;
  --paper-shadow: 0 1px 2px rgba(60, 45, 20, .10), 0 10px 30px rgba(60, 45, 20, .14);
  --book-font: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --cover-violet: #5b21b6;
  --cover-midnight: #1e293b;
  --cover-forest: #166534;
  --cover-wine: #881337;
  --cover-ocean: #075985;
  --cover-amber: #92400e;
  --cover-rose: #be185d;
  --cover-slate: #475569;
  --cover-ink: #fdfbf6;
  --cover-shade: #000000; /* (the spine: the cover mixed with it) */
  --print-ink: #000000; /* 🖨️ printed words are black, light or dark mode */
  --highlight: color-mix(in srgb, var(--gold) 38%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --accent: #a78bfa; /* ACCENT (dark): new-app.mjs --accent-dark */

    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --sunken: #13161c;
    --border: #2a2f3a;
    --border-strong: #3a404d;
    --text: #e8eaf0;
    --text-2: #b8bdc8;
    --text-3: #8f96a3;

    --accent-hover: color-mix(in srgb, var(--accent) 80%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
    --accent-contrast: #0b0d12; /* ACCENT-CONTRAST (dark): new-app.mjs, from the accent */
    --accent-text: color-mix(in srgb, var(--accent) 70%, #fff);

    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, .14);
    --bad-text: var(--bad);
    --bad-contrast: #0b0d12; /* near-black on the light red: 7.0:1 (white was 2.8:1) */
    --info: #7cd4fd;
    --info-soft: rgba(124, 212, 253, .12);
    --gold: #f5c75a;
    --move: #94a3b8;

    --toast-btn: color-mix(in srgb, var(--accent) 70%, #000);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);

    --paper: #1d1b18;
    --paper-edge: #2e2a24;
    --paper-ink: #e9e4d8;
    --paper-ink-2: #a39b8c;
    --paper-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .45);
  }
}
