/**
 * manabi-palette.css — 学び's OWN COLOUR PALETTE: porcelain blue by day, deep indigo by night.
 *
 * WHY (Joshua, 2026-11-05, on the iPhone and iPad): "I find myself often switching between dark and light
 * mode on the iphone, as I have difficulties to read sometimes. I also found the kanji or goi 'blue'
 * learning mode much easier for the eyes … the blue color schema looks more modern … maybe the blue
 * schema could be the main light mode, and we keep the dark blue one for the night mode".
 * ⇒ The two palettes are the Study mode's (dominos-extras.css body.study-mode) promoted to the main pair —
 *   and every TEXT role re-tuned, because the measurement said the blue alone would not have fixed the
 *   reading: rendered across ③④⑤⑥②, 40–55% of the light theme's text runs were under WCAG AA (4.5:1), the
 *   English example gloss on every card at 2.4:1. Each role below clears 4.6:1 on canvas, elevated surface
 *   AND the deepest card surface (the ratio is written beside it); body text and furigana sit far above.
 *
 * ⚖ THE DRIFT RULING. _shared/portfolio-drift.json css/design.css: "Dominos IS the design source of truth …
 *   the token VALUES must never diverge". design.css stays byte-identical to Dokusho's; THIS file overrides
 *   the values for 学び only, by his decision of 2026-11-05 ("at least Manabi, and if good, for the app
 *   future versions") — recorded in that ruling. The sibling apps adopt it, or not, at their next binaries.
 *
 * Loaded LAST in index.html, and every selector is at least as specific as the sheet it overrides
 * (design.css :root / body[data-theme="light"], dominos-tokens.css body.game-page /
 * :root[data-theme="light"] body.game-page, dominos-extras.css body.study-mode / the !important light one).
 * Study mode keeps ONE cue of its own on the shared blue ground: its accent turns hanada (vermilion → blue),
 * plus the filled Study chip.
 */

/* ── NIGHT · deep indigo ─────────────────────────────────────────────────── ratios on #182438 / #232f48 / #2a3752 */
:root, :root body, :root body.game-page {
  --canvas:       #182438;
  --canvas-elev:  #232f48;
  --canvas-deep:  rgba(20, 28, 50, 0.5);
  --indigo:       #2a334a;
  --bone:         #d6dfeb;      /* the tile face: porcelain, as in Study mode */
  --bone-bright:  #e3ecf5;
  --bone-shadow:  #98a3b6;
  --tile-edge:    #3a4258;
  --tile-engrave: #182438;
  --text:         #eceff5;      /* 13.9 / 11.9 / 10.6 — a soft white, not #fff (glare) */
  --text-soft:    #c0c8d3;      /*  9.2 /  7.9 /  7.0 — furigana, subtitles */
  --text-faint:   #9aa2b1;      /*  6.1 /  5.2 /  4.6 — was 3.1 / 2.7: the card glosses */
  --brass:        #cdab70;      /*  7.2 /  6.1 /  5.5 — and 4.6 on the chips' tint (#3e424c) */
  --vermilion:    #f07a68;      /*  5.7 /  4.9 /  4.4 — was #d44a3a at 3.6 / 3.1 */
  --hanada:       #86a4cc;      /*  6.1 /  5.2 /  4.6 */
  --rule:         rgba(200, 214, 240, 0.14);
  --card-inset:   rgba(255, 255, 255, 0.06);
  --card-outline: rgba(220, 230, 245, 0.8);
  --read-furi:    #c8e0ff;      /* 11.5 /  9.9 /  8.8 */
  --read-pattern: #a8c8f5;
  --read-kun:     #eb8673;      /*  6.1 /  5.2 /  4.6 */
  --read-on:      #8aa0d8;      /*  6.0 /  5.2 /  4.6 */
  --read-label:   #d8c08a;      /*  8.8 /  7.5 /  6.7 */
}
:root body.study-mode { --vermilion: #86a4cc; }

/* ── DAY · porcelain blue ────────────────────────────────────────────────── ratios on #dde4ee / #e9eef6 / #d3dbe7 */
:root body[data-theme="light"],
:root[data-theme="light"] body.game-page,
:root[data-theme="light"] body.study-mode {
  --canvas:       #dde4ee !important;
  --canvas-elev:  #e9eef6 !important;
  --canvas-deep:  rgba(200, 212, 230, 0.6) !important;
  --indigo:       #3a4675 !important;
  --bone:         #eef2f8 !important;
  --bone-bright:  #f7fafd !important;
  --bone-shadow:  #bcc7da !important;
  --tile-edge:    #aab4c6 !important;
  --tile-engrave: #182438 !important;
  --text:         #181e26 !important;   /* 13.1 / 14.4 / 12.0 */
  --text-soft:    #3c4451 !important;   /*  7.7 /  8.4 /  7.0 — was 4.8 / 4.3 */
  --text-faint:   #575f6e !important;   /*  5.0 /  5.5 /  4.6 — was 2.6 / 2.4 */
  --brass:        #775818 !important;   /*  5.1 /  5.6 /  4.7 — was 3.6 / 3.3 */
  --vermilion:    #a73728 !important;   /*  5.1 /  5.6 /  4.7 — was 4.2 / 3.7 */
  --hanada:       #396092 !important;   /*  5.0 /  5.5 /  4.6 */
  --rule:         rgba(40, 56, 84, 0.2) !important;
  --card-inset:   rgba(24, 36, 56, 0.05) !important;
  --card-outline: rgba(24, 36, 56, 0.26) !important;
  --read-furi:    #3b6090 !important;   /*  5.0 /  5.5 /  4.6 */
  --read-pattern: #36598a !important;
  --read-kun:     #a8382a !important;   /*  5.0 /  5.5 /  4.6 */
  --read-on:      #3b6090 !important;
  --read-label:   #755a1a !important;   /*  5.1 /  5.6 /  4.7 */
}
:root[data-theme="light"] body.study-mode { --vermilion: #396092 !important; }

/* ── the page's ambient glow (design.css body::before): a 6% vermilion haze top-left, made for parchment,
      read as a PINK cast on porcelain (seen on the iPad, 2026-11-05). Same two soft lights, in the palette's
      own hues: hanada top-left, a trace of brass bottom-right; the fine grain is unchanged. ── */
:root body::before {
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(94, 133, 187, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 164, 100, 0.04) 0%, transparent 50%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.008) 0px, transparent 1px, transparent 4px);
}

/* ── surfaces that stay LIGHT in the night theme: the ④ study cards are tile-faced buttons (var(--bone)),
      so the night red (#f07a68, made for a dark ground) measured 2.0 on them; inside, the day red: 5.5 ── */
:root body:not([data-theme="light"]) .mnb-atelier-card { --vermilion: #9a3226; }

/* ── the board TILES (②予習 · ⑥稽古 · 挑戦 · 部首) are porcelain in BOTH themes too, and their furigana is
      var(--vermilion): by night the night red on the tile face measured ~1.7:1 (188 runs on 第1課's ② board,
      found 2026-11-06 while porting this palette to ドミノ Dominos 2.2 — same rule, same sheet). The face is a
      gradient a step darker than --bone (it averages #c6cfdd), so the tile takes one step deeper than the day
      tokens: red 5.1 (4.5 on the amber first-peek glow), hanada 5.0 for Study mode. Same values as Dominos
      css/design.css «SURFACES THAT ARE LIGHT IN BOTH THEMES». ── */
:root .domino-face-front { --vermilion: #922e22; --brass: #6a4e14; --hanada: #2f5283; --text-faint: #4a5160; }
:root body.study-mode .domino-face-front { --vermilion: #2f5283; }

/* ── the ④ "◀ 第1課" pointer keeps his HERO RED (#de7660, 2026-07-25) on dark; on porcelain it read 2.4,
      so by day it deepens to the palette red (5.1) — same hue family, legible ── */
:root body[data-theme="light"] .mnb-ao-arrow { color: #a73728; }

/* ── the reading surface's literal golds (design.css paints these with fixed colours, not --brass) ── */
:root body[data-theme="light"] .reader .tile-span { border-bottom-color: rgba(119, 88, 24, 0.85); }
:root body[data-theme="light"] .reader .sentence-num,
:root body[data-theme="light"] .reader .block-en,
:root body[data-theme="light"] .grammar-rack-head { color: #755a1a; }      /* the English line: 3.9 → 5.1 */
:root body[data-theme="light"] .reader .sentence-voice .audio-btn,
:root body[data-theme="light"] .reader .bunpou-btn { color: rgba(119, 88, 24, 0.85); }
