/* The 5 themes. Every colour in the app comes from these tokens.
   Cozy Library is the default and gets the full design in Phase 1;
   the others are colour tokens for now and get polish in Phase 7.

   Token guide
   --bg / --surface / --surface-2 : page, cards, inset areas
   --text / --text-muted          : body text (AA on bg and surface)
   --accent / --accent-ink        : primary buttons, links, active nav (accent-ink = text on accent)
   --accent-soft                  : tinted backgrounds for chips / active rows
   --gold / --gold-ink            : decorative gold; gold-ink is safe for text
   --rose                         : spice/hearts/decorative
   --sidebar-*                    : laptop sidebar */

:root,
[data-theme="cozy"] {
  color-scheme: light;
  /* shelf */
  --wood: #8A5A3B; --wood-dark: #5E3B26; --wood-light: #B07C55; --plant: #5E7F4A; --pot: #C07A5E; --wax: #F6EAD6; --flame: #E3A33A;
  /* Chart categorical slots (validated: dataviz palette, light steps) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6;
  --bg: #F6EFE4;
  --bg-texture-opacity: .55;
  --surface: #FFFBF5;
  --surface-2: #F1E7D8;
  --border: #E3D5C0;
  --border-strong: #CDB89B;
  --text: #33241A;
  --text-muted: #6E5A4A;
  --accent: #6B4430;
  --accent-hover: #5A3726;
  --accent-ink: #FFF8EE;
  --accent-soft: #EEDFCB;
  --gold: #C9A04F;
  --gold-ink: #7A5617;
  --rose: #B86F5E;
  --success: #4F6B3A;
  --danger: #A63D2F;
  --danger-soft: #F6DFD9;
  --focus: #B07A1E;
  --shadow: 0 1px 2px rgba(60, 38, 20, .06), 0 4px 14px rgba(60, 38, 20, .06);
  --shadow-lg: 0 10px 40px rgba(40, 24, 12, .22);
  --overlay: rgba(40, 26, 16, .42);
  --sidebar-bg: #4A3022;
  --sidebar-text: #F3E6CF;
  --sidebar-muted: #CDB89B;
  --sidebar-active: rgba(243, 230, 207, .14);
  --nav-bg: rgba(255, 251, 245, .94);
  --meta-theme: #F6EFE4;
}

[data-theme="academia"] {
  color-scheme: dark;
  /* shelf */
  --wood: #4A3826; --wood-dark: #2C2117; --wood-light: #6B5238; --plant: #7C9A68; --pot: #8C6A4A; --wax: #E6DCC6; --flame: #E2B45E;
  /* Chart categorical slots (validated: dataviz palette, dark steps) */
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9;
  --bg: #151A16;
  --bg-texture-opacity: .18;
  --surface: #1D241F;
  --surface-2: #262F29;
  --border: #354039;
  --border-strong: #4A574E;
  --text: #EDE3CF;
  --text-muted: #B5AA92;
  --accent: #C8A25A;
  --accent-hover: #D6B26C;
  --accent-ink: #18170F;
  --accent-soft: #2F3326;
  --gold: #C8A25A;
  --gold-ink: #D9B76E;
  --rose: #B98A7A;
  --success: #8FAE78;
  --danger: #E08A7A;
  --danger-soft: #3A2421;
  --focus: #E2C27F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --overlay: rgba(0, 0, 0, .55);
  --sidebar-bg: #0F1310;
  --sidebar-text: #EDE3CF;
  --sidebar-muted: #A39A84;
  --sidebar-active: rgba(200, 162, 90, .16);
  --nav-bg: rgba(29, 36, 31, .95);
  --meta-theme: #151A16;
}

[data-theme="romantasy"] {
  color-scheme: dark;
  /* shelf */
  --wood: #4B2E4F; --wood-dark: #2E1A33; --wood-light: #6E4673; --plant: #8FB08C; --pot: #C9849A; --wax: #F3E4EC; --flame: #E8C27A;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9;
  --bg: #1C1424;
  --bg-texture-opacity: .16;
  --surface: #261B31;
  --surface-2: #31233F;
  --border: #44324F;
  --border-strong: #5C4569;
  --text: #F6E8F0;
  --text-muted: #C6B0C1;
  --accent: #E8A0B6;
  --accent-hover: #F0B3C5;
  --accent-ink: #2A1426;
  --accent-soft: #3D2944;
  --gold: #D8B46A;
  --gold-ink: #E4C381;
  --rose: #E8A0B6;
  --success: #9CC49A;
  --danger: #F08F8F;
  --danger-soft: #45222E;
  --focus: #E4C381;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
  --overlay: rgba(8, 2, 12, .6);
  --sidebar-bg: #150F1C;
  --sidebar-text: #F6E8F0;
  --sidebar-muted: #B49DB0;
  --sidebar-active: rgba(232, 160, 182, .16);
  --nav-bg: rgba(38, 27, 49, .95);
  --meta-theme: #1C1424;
}

[data-theme="fairy"] {
  color-scheme: light;
  /* shelf */
  --wood: #E7C9D6; --wood-dark: #C99DB2; --wood-light: #F6E3EC; --plant: #7FA37E; --pot: #D98BA6; --wax: #FFFFFF; --flame: #EDB45A;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6;
  --bg: #FBF1F4;
  --bg-texture-opacity: .35;
  --surface: #FFFAFC;
  --surface-2: #F6E6EE;
  --border: #EBD3DF;
  --border-strong: #D9B6C8;
  --text: #3B2533;
  --text-muted: #725364;
  --accent: #96477A;
  --accent-hover: #823C69;
  --accent-ink: #FFFFFF;
  --accent-soft: #F3DCEA;
  --gold: #C9A7D6;
  --gold-ink: #74508C;
  --rose: #D98BA6;
  --success: #4E7350;
  --danger: #A8364A;
  --danger-soft: #F8DDE3;
  --focus: #96477A;
  --shadow: 0 1px 2px rgba(90, 40, 70, .06), 0 4px 14px rgba(90, 40, 70, .07);
  --shadow-lg: 0 10px 40px rgba(70, 30, 55, .2);
  --overlay: rgba(60, 25, 50, .38);
  --sidebar-bg: #F3DDE8;
  --sidebar-text: #3B2533;
  --sidebar-muted: #725364;
  --sidebar-active: rgba(150, 71, 122, .12);
  --nav-bg: rgba(255, 250, 252, .94);
  --meta-theme: #FBF1F4;
}

[data-theme="midnight"] {
  color-scheme: dark;
  /* shelf */
  --wood: #2A3754; --wood-dark: #18223A; --wood-light: #3B4B6E; --plant: #7FB08F; --pot: #A37F65; --wax: #EEF1F7; --flame: #E8A951;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9;
  --bg: #0F1626;
  --bg-texture-opacity: .14;
  --surface: #162036;
  --surface-2: #1D2944;
  --border: #2A3754;
  --border-strong: #3B4B6E;
  --text: #EEF1F7;
  --text-muted: #A9B2C6;
  --accent: #E8A951;
  --accent-hover: #F0B866;
  --accent-ink: #1A1408;
  --accent-soft: #2A2F3A;
  --gold: #E8A951;
  --gold-ink: #F0BC6E;
  --rose: #E79A8C;
  --success: #8CC79A;
  --danger: #F09080;
  --danger-soft: #3A2228;
  --focus: #F0BC6E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
  --overlay: rgba(3, 6, 14, .6);
  --sidebar-bg: #0A1020;
  --sidebar-text: #EEF1F7;
  --sidebar-muted: #9AA3B8;
  --sidebar-active: rgba(232, 169, 81, .15);
  --nav-bg: rgba(22, 32, 54, .95);
  --meta-theme: #0F1626;
}
