/* themes.css — theme overrides for tokens.css (foundation-ui shell floor).
 * Dark is the default (tokens.css :root); named themes override on [data-theme].
 * A new theme = append a new [data-theme="…"] selector that overrides token
 * VALUES only — never redeclare shell/component selectors.
 * A consumer's own theme override loads AFTER this file and wins by cascade.
 */

[data-theme="light"] {
  /* ── Catppuccin Latte palette ── */
  --base:     #eff1f5;
  --mantle:   #e6e9ef;
  --crust:    #dce0e8;
  --surface0: #dce0e8;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --overlay2: #7c7f93;
  --subtext0: #5e6176;
  --subtext1: #5c5f77;
  --text:     #494c66;

  --rosewater: #dc8a78;
  --flamingo:  #dd7878;
  --pink:      #ea76cb;
  --mauve:     #8839ef;
  --red:       #c5002f;
  --maroon:    #e64553;
  --peach:     #fe640b;
  --yellow:    #984c00;
  --green:     #007200;
  --teal:      #006c74; /* HC-U6: OKLCH L 0.477 from Latte #179299, 4.67:1 on the card */
  --sky:       #0065a2;
  --sapphire:  #209fb5;
  --blue:      #0b55e3;
  --lavender:  #7287fd;

  --accent-rgb:   11, 85, 227;
  --success-rgb:  0, 114, 0;
  --warning-rgb:  152, 76, 0;
  --danger-rgb:   197, 0, 47;
  --info-rgb:     0, 101, 162;
  --fg-muted-rgb: 94, 97, 118;
  --fg-rgb:       76, 79, 105;

  /* --viz-* light values: viz.css */

  --shadow-sm: 0 1px 2px  rgba(var(--shadow-rgb), 0.10);
  --shadow-md: 0 4px 12px rgba(var(--shadow-rgb), 0.12);
  --shadow-lg: 0 12px 32px rgba(var(--shadow-rgb), 0.15);

  /* contrast (heritage-contrast-scheme HC-U2, owner ruling B1): cards one Latte step lighter,
     then only what still failed darkened in OKLCH lightness; muted text reads subtext0. */
  --fg-muted: var(--subtext0);
}

/* Stone — warm, low-chroma light neutral. */
[data-theme="stone"] {
  --base:     #e7e5e4;
  --mantle:   #dedad7;
  --crust:    #d1cdca;
  --surface0: #cbc7c4;
  --surface1: #b8b3af;
  --surface2: #a39d98;
  --overlay0: #8b8580;
  --overlay1: #736d68;
  --overlay2: #625c57;
  --subtext0: #57514c;
  --subtext1: #44403c;
  --text:     #292524;
  --fg-muted-rgb: 87, 81, 76;
  --fg-rgb:       41, 37, 36;

  --shadow-sm: 0 1px 2px  rgba(var(--shadow-rgb), 0.10);
  --shadow-md: 0 4px 12px rgba(var(--shadow-rgb), 0.13);
  --shadow-lg: 0 12px 32px rgba(var(--shadow-rgb), 0.17);

  /* contrast (U9): stone is light, so the heritage pastel accents are replaced by darker, hue-preserving steps, and muted text reads subtext0 */
  --blue: #2c5190;
  --red: #8e3050;
  --sky: #005b68;
  --teal: #005c64; /* HC-U6: OKLCH L 0.422 from Latte #179299, 4.61:1 on the card */
  --green: #245e22;
  --yellow: #634f1f;
  --fg-muted: var(--subtext0);
  --accent-rgb: 44, 81, 144;
  --success-rgb: 36, 94, 34;
  --warning-rgb: 99, 79, 31;
  --danger-rgb: 142, 48, 80;
  --info-rgb: 0, 91, 104;
}

/* Slate — cool structural grey, darker than Stone and lighter than Charcoal. */
[data-theme="slate"] {
  --base:     #3f4854;
  --mantle:   #363e48;
  --crust:    #2d343d;
  --surface0: #4b5663;
  --surface1: #5b6775;
  --surface2: #6b7887;
  --overlay0: #84909d;
  --overlay1: #9ba5af;
  --overlay2: #adb6bf;
  --subtext0: #c6cdd4;
  --subtext1: #d4d9de;
  --text:     #f1f4f6;
  --fg-muted-rgb: 198, 205, 212;
  --fg-rgb:       241, 244, 246;

  /* contrast (U9): blue and red lifted in OKLCH lightness; subtext0 nudged, and muted text reads it */
  --blue: #a3d0ff;
  --red: #ffb8d5;
  --fg-muted: var(--subtext0);
  --accent-rgb: 163, 208, 255;
  --danger-rgb: 255, 184, 213;
}

/* Charcoal — high-contrast neutral dark; separate from heritage Dark. */
[data-theme="charcoal"] {
  --base:     #333333;
  --mantle:   #2b2b2b;
  --crust:    #232323;
  --surface0: #404040;
  --surface1: #4d4d4d;
  --surface2: #5a5a5a;
  --overlay0: #767676;
  --overlay1: #8f8f8f;
  --overlay2: #a3a3a3;
  --subtext0: #c4c4c4;
  --subtext1: #d6d6d6;
  --text:     #f2f2f2;
  --fg-muted-rgb: 196, 196, 196;
  --fg-rgb:       242, 242, 242;

  /* contrast (U9): red nudged lighter; muted text reads subtext0 (overlay1 is 3.21:1 on --bg-card) */
  --red: #f68eab;
  --fg-muted: var(--subtext0);
  --danger-rgb: 246, 142, 171;
}

/* Midnight — blue-black operator theme. */
[data-theme="midnight"] {
  --base:     #111827;
  --mantle:   #0f172a;
  --crust:    #0b1120;
  --surface0: #1f2937;
  --surface1: #334155;
  --surface2: #475569;
  --overlay0: #64748b;
  --overlay1: #8290a3;
  --overlay2: #9ca8b8;
  --subtext0: #b8c2cf;
  --subtext1: #d1d8e0;
  --text:     #f1f5f9;
  --fg-muted-rgb: 130, 144, 163;
  --fg-rgb:       241, 245, 249;
  /* keep this theme's own muted step: heritage dark now points muted text at subtext0
     (heritage-contrast-scheme HC-U3), which must not leak into an accepted named theme */
  --fg-muted: var(--overlay1);
}

/* Obsidian — near-black neutral, the deepest platform theme. */
[data-theme="obsidian"] {
  --base:     #151517;
  --mantle:   #101012;
  --crust:    #0b0b0d;
  --surface0: #222226;
  --surface1: #303036;
  --surface2: #414148;
  --overlay0: #62626b;
  --overlay1: #8b8b95;
  --overlay2: #9d9da7;
  --subtext0: #bdbdc5;
  --subtext1: #d6d6dc;
  --text:     #f5f5f7;
  --fg-muted-rgb: 139, 139, 149;
  --fg-rgb:       245, 245, 247;
  /* contrast (U9): overlay1 nudged lighter (4.34:1 on --bg-card before) */
  /* keep this theme's own muted step: heritage dark now points muted text at subtext0
     (heritage-contrast-scheme HC-U3), which must not leak into an accepted named theme */
  --fg-muted: var(--overlay1);
}
