/*
 * Redesign UI palettes (RD4). PROPOSED, not confirmed. See docs/design/redesign/palettes.md.
 * Same role names as theme/assets/tokens.css. Deliberately NOT derived from the product colours
 * (G-Angry red/white/black, G-Soft dusty rose/mauve/grey) nor from the current navy/burgundy/cream.
 * Extra roles: --color-reading-bg / -fg / -link = the long-form reading surface
 * (research: all 12 education sites keep long text on a light surface).
 * Checked by scripts/check-palettes.mjs (part of `npm run contrast`).
 * Apply with <html data-palette="1|2|3"> (or any container).
 */

/* 1. Deep Teal: dark, "armored calm". Reading panels switch to a light surface. */
[data-palette="1"] {
  --color-bg: #0c1a1d;
  --color-surface: #14292d;
  --color-fg: #e6eeec;
  --color-muted: #9db6b2;
  --color-border: #5b8288;
  --color-accent: #3dbcab;
  --color-on-accent: #04201c;
  --color-link: #6fd6c7;
  --color-focus: #f0c254;
  --color-success: #67d68a;
  --color-error: #ff9d84;
  --color-reading-bg: #f2f6f4;
  --color-reading-fg: #12262a;
  --color-reading-link: #0b6b5f;
  color-scheme: dark;
}

/* 2. Daylight Amber: light, "warm and awake". */
[data-palette="2"] {
  --color-bg: #f6f6f3;
  --color-surface: #ffffff;
  --color-fg: #1c1b17;
  --color-muted: #5c5a52;
  --color-border: #86847a;
  --color-accent: #c27f00;
  --color-on-accent: #1c1b17;
  --color-link: #8a5200;
  --color-focus: #1c1b17;
  --color-success: #1f7a45;
  --color-error: #b3261e;
  --color-reading-bg: #ffffff;
  --color-reading-fg: #1c1b17;
  --color-reading-link: #8a5200;
  color-scheme: light;
}

/* 3. Cobalt Studio: light, "clear-eyed and editorial". */
[data-palette="3"] {
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-fg: #15191f;
  --color-muted: #525c6b;
  --color-border: #7d8898;
  --color-accent: #2450d6;
  --color-on-accent: #ffffff;
  --color-link: #1d45b8;
  --color-focus: #b45309;
  --color-success: #1c7a4a;
  --color-error: #b3261e;
  --color-reading-bg: #ffffff;
  --color-reading-fg: #15191f;
  --color-reading-link: #1d45b8;
  color-scheme: light;
}

/*
 * CR2: palettes 4-6, built from the colour research (docs/design/colour-research/). PROPOSED.
 * Light, warm base (R2: warm off-white, never #fff / #000), deep accents in small areas.
 * Accents are plum / blue-green / peach, the research's substitutes for the pink and red
 * (product hues) the owner excluded. Apply with data-palette="4|5|6".
 */

/* 4. Plum Linen: light, warm, one deep plum accent. "Held, then empowered". */
[data-palette="4"] {
  --color-bg: #f4f0eb;
  --color-surface: #faf7f3;
  --color-fg: #2a2430;
  --color-muted: #5f5666;
  --color-border: #877d8c;
  --color-accent: #732da9;
  --color-on-accent: #faf7f3;
  --color-link: #5a2f86;
  --color-focus: #a3480a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #faf7f3;
  --color-reading-fg: #2a2430;
  --color-reading-link: #5a2f86;
  color-scheme: light;
}

/* 5. Sea Glass: light, warm base with sage surfaces and a blue-green accent. "Slow and steady". */
[data-palette="5"] {
  --color-bg: #f3efea;
  --color-surface: #e8efea;
  --color-fg: #232a28;
  --color-muted: #4f5c58;
  --color-border: #75857f;
  --color-accent: #226f6a;
  --color-on-accent: #f3efea;
  --color-link: #17605b;
  --color-focus: #8c4a0e;
  --color-success: #2a6b45;
  --color-error: #a82f1c;
  --color-reading-bg: #f9f6f1;
  --color-reading-fg: #232a28;
  --color-reading-link: #17605b;
  color-scheme: light;
}

/* 6. Dusk Plum: dark option, aubergine-black with a peach accent. "Moody, but kind". Reading panels are light. */
[data-palette="6"] {
  --color-bg: #1c1724;
  --color-surface: #2e1f40;
  --color-fg: #efe9e4;
  --color-muted: #b8aebf;
  --color-border: #7f7290;
  --color-accent: #e9a982;
  --color-on-accent: #2a1d18;
  --color-link: #f0b895;
  --color-focus: #9fd6c9;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #f4efea;
  --color-reading-fg: #2a2430;
  --color-reading-link: #5a2f86;
  color-scheme: dark;
}

/*
 * PV: palettes 7-10, the owner's "plum / peach / sea glass" direction. PROPOSED, nothing decided.
 * Research mapping (docs/design/colour-research/): light warm base (R2), deep accent used in small areas (R4, R13),
 * low saturation on large areas, peach as the research's "comforted" hue. Palette 8 is a PREVIEW-ONLY exception.
 */

/* 7. Plum Peach: Plum Linen's warm base, with peach as a strong second voice (peach cards, tints and mood band).
      Plum stays the accent and link colour. Mood: "Held, warm, then bold". Research: comforted (peach), empowered (deep plum). Light. */
[data-palette="7"] {
  --color-bg: #f6efe8;
  --color-surface: #fbe8da;
  --color-fg: #2a2430;
  --color-muted: #5b4f58;
  --color-border: #8a7480;
  --color-accent: #732da9;
  --color-on-accent: #fbf7f3;
  --color-link: #5a2f86;
  --color-focus: #a3480a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #fcf8f3;
  --color-reading-fg: #2a2430;
  --color-reading-link: #5a2f86;
  color-scheme: light;
}

/* 8. Evidence Pick (PREVIEW ONLY: uses rose/red, which the current rule excludes).
      What the colour research alone would choose: warm off-white, soft pink comfort surfaces (positive valence),
      a deep red for power/dominance, peach highlights, plum links, near-black text. Mood: "Tender, then fierce". Light.
      The red/rose guard in check-palettes / check-gradients is waived for palette 8 only. */
[data-palette="8"] {
  --color-bg: #f7eee7;
  --color-surface: #f6dfe0;
  --color-fg: #281839;
  --color-muted: #5c4553;
  --color-border: #8b6a76;
  --color-accent: #8a2336;
  --color-on-accent: #fff6f0;
  --color-link: #6a2a94;
  --color-focus: #1e5f7a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #fdf7f1;
  --color-reading-fg: #281839;
  --color-reading-link: #6a2a94;
  color-scheme: light;
}

/* 9. Sea Glass Plum: Sea Glass's warm off-white and sage surfaces, with a plum accent that bridges toward Plum Linen.
      Mood: "Slow, steady, then bold". Research: calm (sage), empowered (plum). Light. */
[data-palette="9"] {
  --color-bg: #f3efea;
  --color-surface: #e6eee8;
  --color-fg: #232a28;
  --color-muted: #4f5c58;
  --color-border: #73837d;
  --color-accent: #6d2f9a;
  --color-on-accent: #f6f3ee;
  --color-link: #5a2f86;
  --color-focus: #8c4a0e;
  --color-success: #2a6b45;
  --color-error: #a82f1c;
  --color-reading-bg: #f9f6f1;
  --color-reading-fg: #232a28;
  --color-reading-link: #5a2f86;
  color-scheme: light;
}

/* 10. Dusk Peach: Dusk Plum with peach leading (peach tinted cards, a peach mood band, brighter peach glow).
       Mood: "Moody, warm, kind". Dark page, dark reading panels (owner rule 2026-10-10: no big light blocks on dark pages). */
[data-palette="10"] {
  --color-bg: #1e1621;
  --color-surface: #35262a;
  --color-fg: #f3ebe5;
  --color-muted: #c4b6b8;
  --color-border: #8c7578;
  --color-accent: #f0b48c;
  --color-on-accent: #2a1a14;
  --color-link: #f5c4a2;
  --color-focus: #9fd6c9;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #271d28;
  --color-reading-fg: #f1e8e0;
  --color-reading-link: #f2c19b;
  color-scheme: dark;
}

/*
 * PX: palettes 11-20, five light/dark pairs that vary on the owner's references (4 Plum Linen light, 6 Dusk Plum dark).
 * PROPOSED, nothing decided. Pairs: 11/12 Apricot, 13/14 Lavender Ash, 15/16 Ink Plum, 17/18 Soft Focus, 19/20 Plum & Sage.
 * Same 14 roles; accents stay out of red/rose/mauve (290-20 deg). Checked by `npm run contrast`.
 */
/* 11. Apricot, light. Plum Linen with a warmer base and apricot leading the secondary colour (research: peach is the comforted hue, R4). Plum stays the one small deep accent. */
[data-palette="11"] {
  --color-bg: #f7eee4;
  --color-surface: #fdf6ec;
  --color-fg: #2e2420;
  --color-muted: #66554e;
  --color-border: #8d7a70;
  --color-accent: #752d9e;
  --color-on-accent: #fdf6ec;
  --color-link: #5e2a80;
  --color-focus: #a3480a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #fdf6ec;
  --color-reading-fg: #2e2420;
  --color-reading-link: #5e2a80;
  color-scheme: light;
}

/* 12. Apricot, dark. Dusk Plum with an apricot-orange accent, a warmer plum base and an apricot mood band. Low-saturation page, warm light only in small areas. */
[data-palette="12"] {
  --color-bg: #201620;
  --color-surface: #352139;
  --color-fg: #f0e8e2;
  --color-muted: #bdb0b6;
  --color-border: #85768f;
  --color-accent: #f4a76a;
  --color-on-accent: #2a1810;
  --color-link: #f7bd8c;
  --color-focus: #9fd6c9;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #f7eee4;
  --color-reading-fg: #2e2420;
  --color-reading-link: #5e2a80;
  color-scheme: dark;
}

/* 13. Lavender Ash, light. Cooler Plum Linen: greyed lilac linen, a blue-violet accent (hue 260, clear of the mauve guard). Cool, quiet, low saturation on large areas. */
[data-palette="13"] {
  --color-bg: #f0eff4;
  --color-surface: #f8f7fb;
  --color-fg: #25232e;
  --color-muted: #59566a;
  --color-border: #837f9b;
  --color-accent: #5a3a9e;
  --color-on-accent: #f8f7fb;
  --color-link: #483390;
  --color-focus: #9a4a0a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #f8f7fb;
  --color-reading-fg: #25232e;
  --color-reading-link: #483390;
  color-scheme: light;
}

/* 14. Lavender Ash, dark. Midnight plum: a blue-leaning dark base with a lilac accent. The cool sibling of Dusk Plum, same lightness steps. */
[data-palette="14"] {
  --color-bg: #15131f;
  --color-surface: #231f39;
  --color-fg: #ebe8f1;
  --color-muted: #b3afc5;
  --color-border: #78749c;
  --color-accent: #b9a8f2;
  --color-on-accent: #1a1530;
  --color-link: #c8bbf6;
  --color-focus: #a8dccb;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #f0eff4;
  --color-reading-fg: #25232e;
  --color-reading-link: #483390;
  color-scheme: dark;
}

/* 15. Ink Plum, light. Bolder, higher contrast: crisp white surfaces, near-black ink, a deep aubergine accent and a strong mood band (research: deep accents in small areas, R13). */
[data-palette="15"] {
  --color-bg: #f6f3ee;
  --color-surface: #ffffff;
  --color-fg: #17121d;
  --color-muted: #4c4353;
  --color-border: #6c6172;
  --color-accent: #561987;
  --color-on-accent: #ffffff;
  --color-link: #491374;
  --color-focus: #b04a00;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #ffffff;
  --color-reading-fg: #17121d;
  --color-reading-link: #491374;
  color-scheme: light;
}

/* 16. Ink Plum, dark. Near-black aubergine with a bright apricot accent and a saturated plum mood band. Highest contrast of the dark set. */
[data-palette="16"] {
  --color-bg: #120d1a;
  --color-surface: #241634;
  --color-fg: #f8f3ee;
  --color-muted: #c3b8cb;
  --color-border: #8c7ea3;
  --color-accent: #ffb887;
  --color-on-accent: #1a0f08;
  --color-link: #ffc9a2;
  --color-focus: #8fe0cf;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #ffffff;
  --color-reading-fg: #17121d;
  --color-reading-link: #491374;
  color-scheme: dark;
}

/* 17. Soft Focus, light. Gentlest and lowest stimulation: very low saturation, quiet dusty-plum accent, near-flat gradients. For overload-prone readers (research: low saturation on large areas). */
[data-palette="17"] {
  --color-bg: #f2efeb;
  --color-surface: #f8f6f3;
  --color-fg: #2c2831;
  --color-muted: #5d5963;
  --color-border: #858089;
  --color-accent: #6a4a8c;
  --color-on-accent: #f8f6f3;
  --color-link: #58407a;
  --color-focus: #8f5a2a;
  --color-success: #34664d;
  --color-error: #9a3a2a;
  --color-reading-bg: #f8f6f3;
  --color-reading-fg: #2c2831;
  --color-reading-link: #58407a;
  color-scheme: light;
}

/* 18. Soft Focus, dark. Charcoal-plum with a muted peach accent and low-chroma surfaces. The quietest dark: no saturated area bigger than a button. */
[data-palette="18"] {
  --color-bg: #1d1b22;
  --color-surface: #2a2633;
  --color-fg: #e8e4e6;
  --color-muted: #aba6b1;
  --color-border: #787285;
  --color-accent: #cfa88d;
  --color-on-accent: #231a15;
  --color-link: #dbb9a0;
  --color-focus: #9cc9bf;
  --color-success: #93c9a3;
  --color-error: #f0a08c;
  --color-reading-bg: #f2efeb;
  --color-reading-fg: #2c2831;
  --color-reading-link: #58407a;
  color-scheme: dark;
}

/* 19. Plum & Sage, light. Plum Linen with a sage secondary for calm (research: calm skews green-blue-grey). Plum accent and links, sage in borders, glows and the mood band. */
[data-palette="19"] {
  --color-bg: #f2f0e8;
  --color-surface: #f9f7f1;
  --color-fg: #2a2530;
  --color-muted: #5b5a60;
  --color-border: #7c8a7a;
  --color-accent: #6b2f9c;
  --color-on-accent: #f9f7f1;
  --color-link: #55307f;
  --color-focus: #a3480a;
  --color-success: #2b6a47;
  --color-error: #a82f1c;
  --color-reading-bg: #f9f7f1;
  --color-reading-fg: #2a2530;
  --color-reading-link: #55307f;
  color-scheme: light;
}

/* 20. Plum & Sage, dark. Dusk Plum with a sage accent and plum surfaces: calm green on a deep plum dark. */
[data-palette="20"] {
  --color-bg: #1a1822;
  --color-surface: #28233a;
  --color-fg: #ece8e6;
  --color-muted: #b3b0bb;
  --color-border: #7a7a92;
  --color-accent: #a8d3ae;
  --color-on-accent: #14231a;
  --color-link: #b9deb9;
  --color-focus: #e8c58f;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #f2f0e8;
  --color-reading-fg: #2a2530;
  --color-reading-link: #55307f;
  color-scheme: dark;
}


/* 21. Painted Linen, light. PROPOSED (2026-10-10). Plum Peach pulled toward the colours measured in the approved illustrations
   (cream paper, slate ink, terracotta-peach, a quiet indigo): the accent is Plum Peach's plum at lower chroma, hue moved toward the art's indigo.
   Secondary role (not a token, see gradients.css): peach #efc9a6 for tints, terracotta #b9744f for small details.
   Analysis: docs/design/colour-research/image-palette-analysis.md. */
[data-palette="21"] {
  --color-bg: #fbf6ef;
  --color-surface: #f3e8db;
  --color-fg: #2b2a3a;
  --color-muted: #5a5568;
  --color-border: #8d8389;
  --color-accent: #5e4a86;
  --color-on-accent: #fbf6ef;
  --color-link: #574178;
  --color-focus: #a8562f;
  --color-success: #2f6b4a;
  --color-error: #a3401f;
  --color-reading-bg: #fdf9f3;
  --color-reading-fg: #2b2a3a;
  --color-reading-link: #574178;
  color-scheme: light;
}

/* 22. Painted Dusk, dark. PROPOSED (2026-10-10). Dusk Peach on the art's slate ink: terracotta-peach accent, periwinkle focus ring.
   Unlike palette 10, the reading surface is DARK (no big light blocks on a dark page). */
[data-palette="22"] {
  --color-bg: #1d1c2a;
  --color-surface: #2a2838;
  --color-fg: #f3ebe2;
  --color-muted: #bdb5bd;
  --color-border: #7d788f;
  --color-accent: #e3ad83;
  --color-on-accent: #2a1a14;
  --color-link: #efbc91;
  --color-focus: #a9a7dc;
  --color-success: #8fd6a4;
  --color-error: #ff9d84;
  --color-reading-bg: #242231;
  --color-reading-fg: #efe7de;
  --color-reading-link: #f0c39c;
  color-scheme: dark;
}
