/* Vollko Multi-Theme Design System & Presets */

:root {
  /* Default Baseline Theme: Tokyo Night */
  --theme-name: "tokyo-night";
  color-scheme: dark;
  --t-bg-deep: #13141c;
  --t-bg: #1a1b26;
  --t-surface: #1f2230;
  --t-surface-2: #24283b;
  --t-border-subtle: #24283b;
  --t-border-strong: #414868;
  --t-text: #c0caf5;
  --t-text-secondary: #a9b1d6;
  --t-text-muted: #8b93b8;
  --t-brand: #9ece6a;
  --t-brand-soft: rgba(158, 206, 106, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #292e42;
  --t-field-bg: #0e0e14;
  --t-field-lit: #9ece6a;

  /* Tokyo Night Functional Accents */
  --accent-red: #f7768e;
  --accent-orange: #ff9e64;
  --accent-yellow: #e0af68;
  --accent-green: #9ece6a;
  --accent-cyan: #7dcfff;
  --accent-blue: #7aa2f7;
  --accent-purple: #bb9af7;
  --accent-clay: #f7768e;

  --accent-blue-tint: rgba(122, 162, 247, 0.15);
  --accent-green-tint: rgba(158, 206, 106, 0.15);
  --accent-clay-tint: rgba(247, 118, 142, 0.15);
  --accent-purple-tint: rgba(187, 154, 247, 0.15);

  /* Core Token Mappings */
  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #343b58;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #565f89;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #565f89;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #bbdd97;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  /* Surface Aliases */
  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* 1. TOKYO NIGHT (Default Primary Theme) */
html[data-theme="tokyo-night"] {
  --theme-name: "tokyo-night";
  color-scheme: dark;
  --t-bg-deep: #13141c;
  --t-bg: #1a1b26;
  --t-surface: #1f2230;
  --t-surface-2: #24283b;
  --t-border-subtle: #24283b;
  --t-border-strong: #414868;
  --t-text: #c0caf5;
  --t-text-secondary: #a9b1d6;
  --t-text-muted: #8b93b8;
  --t-brand: #9ece6a;
  --t-brand-soft: rgba(158, 206, 106, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #292e42;
  --t-field-bg: #0e0e14;
  --t-field-lit: #9ece6a;

  --accent-red: #f7768e;
  --accent-orange: #ff9e64;
  --accent-yellow: #e0af68;
  --accent-green: #9ece6a;
  --accent-cyan: #7dcfff;
  --accent-blue: #7aa2f7;
  --accent-purple: #bb9af7;
  --accent-clay: #f7768e;

  --accent-blue-tint: rgba(122, 162, 247, 0.15);
  --accent-green-tint: rgba(158, 206, 106, 0.15);
  --accent-clay-tint: rgba(247, 118, 142, 0.15);
  --accent-purple-tint: rgba(187, 154, 247, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #343b58;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #565f89;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #565f89;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #bbdd97;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 2. CATPPUCCIN (Mocha) */
html[data-theme="catppuccin"] {
  --theme-name: "catppuccin";
  color-scheme: dark;
  --t-bg-deep: #161622;
  --t-bg: #1e1e2e;
  --t-surface: #282839;
  --t-surface-2: #313244;
  --t-border-subtle: #313244;
  --t-border-strong: #585b70;
  --t-text: #cdd6f4;
  --t-text-secondary: #bac2de;
  --t-text-muted: #9399b2;
  --t-brand: #89b4fa;
  --t-brand-soft: rgba(137, 180, 250, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #45475a;
  --t-field-bg: #101019;
  --t-field-lit: #89b4fa;

  --accent-red: #f38ba8;
  --accent-orange: #fab387;
  --accent-yellow: #f9e2af;
  --accent-green: #a6e3a1;
  --accent-cyan: #74c7ec;
  --accent-blue: #89b4fa;
  --accent-purple: #cba6f7;
  --accent-clay: #f38ba8;

  --accent-blue-tint: rgba(137, 180, 250, 0.15);
  --accent-green-tint: rgba(166, 227, 161, 0.15);
  --accent-clay-tint: rgba(243, 139, 168, 0.15);
  --accent-purple-tint: rgba(203, 166, 247, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #45475a;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #6c7086;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #6c7086;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #accafc;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 3. NORD */
html[data-theme="nord"] {
  --theme-name: "nord";
  color-scheme: dark;
  --t-bg-deep: #222730;
  --t-bg: #2e3440;
  --t-surface: #343b49;
  --t-surface-2: #3b4252;
  --t-border-subtle: #3b4252;
  --t-border-strong: #4c566a;
  --t-text: #d8dee9;
  --t-text-secondary: #e5e9f0;
  --t-text-muted: #9fa7b4;
  --t-brand: #81a1c1;
  --t-brand-soft: rgba(129, 161, 193, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #434c5e;
  --t-field-bg: #191c23;
  --t-field-lit: #81a1c1;

  --accent-red: #bf616a;
  --accent-orange: #d08770;
  --accent-yellow: #ebcb8b;
  --accent-green: #a3be8c;
  --accent-cyan: #88c0d0;
  --accent-blue: #81a1c1;
  --accent-purple: #b48ead;
  --accent-clay: #bf616a;

  --accent-blue-tint: rgba(129, 161, 193, 0.15);
  --accent-green-tint: rgba(163, 190, 140, 0.15);
  --accent-clay-tint: rgba(191, 97, 106, 0.15);
  --accent-purple-tint: rgba(180, 142, 173, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #4c566a;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #5e81ac;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #4c566a;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #a7bdd4;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 4. GRUVBOX */
html[data-theme="gruvbox"] {
  --theme-name: "gruvbox";
  color-scheme: dark;
  --t-bg-deep: #1e1e1e;
  --t-bg: #282828;
  --t-surface: #32302f;
  --t-surface-2: #3c3836;
  --t-border-subtle: #3c3836;
  --t-border-strong: #665c54;
  --t-text: #d4be98;
  --t-text-secondary: #ebdbb2;
  --t-text-muted: #a89984;
  --t-brand: #7daea3;
  --t-brand-soft: rgba(125, 174, 163, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #504945;
  --t-field-bg: #161616;
  --t-field-lit: #7daea3;

  --accent-red: #ea6962;
  --accent-orange: #e78a4e;
  --accent-yellow: #d8a657;
  --accent-green: #a9b665;
  --accent-cyan: #7daea3;
  --accent-blue: #7daea3;
  --accent-purple: #d3869b;
  --accent-clay: #ea6962;

  --accent-blue-tint: rgba(125, 174, 163, 0.15);
  --accent-green-tint: rgba(169, 182, 101, 0.15);
  --accent-clay-tint: rgba(234, 105, 98, 0.15);
  --accent-purple-tint: rgba(211, 134, 155, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #504945;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #7c6f64;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #7c6f64;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #a4c6bf;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 5. SOLITUDE */
html[data-theme="solitude"] {
  --theme-name: "solitude";
  color-scheme: dark;
  --t-bg-deep: #0c0e10;
  --t-bg: #101315;
  --t-surface: #14181a;
  --t-surface-2: #181d20;
  --t-border-subtle: #1e2427;
  --t-border-strong: #4b4e55;
  --t-text: #cacccc;
  --t-text-secondary: #a5aeb4;
  --t-text-muted: #8a8d90;
  --t-brand: #949ea5;
  --t-brand-soft: rgba(148, 158, 165, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #343d41;
  --t-field-bg: #080a0b;
  --t-field-lit: #798186;

  --accent-red: #e06c75;
  --accent-orange: #d19a66;
  --accent-yellow: #e5c07b;
  --accent-green: #98c379;
  --accent-cyan: #56b6c2;
  --accent-blue: #61afef;
  --accent-purple: #c678dd;
  --accent-clay: #e06c75;

  --accent-blue-tint: rgba(97, 175, 239, 0.15);
  --accent-green-tint: rgba(152, 195, 121, 0.15);
  --accent-clay-tint: rgba(224, 108, 117, 0.15);
  --accent-purple-tint: rgba(198, 120, 221, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #242a2e;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #6c727a;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #565d63;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #b0bac2;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 6. LUMON */
html[data-theme="lumon"] {
  --theme-name: "lumon";
  color-scheme: dark;
  --t-bg-deep: #101b21;
  --t-bg: #16242d;
  --t-surface: #182836;
  --t-surface-2: #1b2d40;
  --t-border-subtle: #1b2d40;
  --t-border-strong: #304860;
  --t-text: #f2fcff;
  --t-text-secondary: #d6e2ee;
  --t-text-muted: #a0c1d8;
  --t-brand: #8bc9eb;
  --t-brand-soft: rgba(139, 201, 235, 0.12);
  --t-brand-ink: #0c0e10;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #243d56;
  --t-field-bg: #0b1216;
  --t-field-lit: #8bc9eb;

  --accent-red: #ff6b81;
  --accent-orange: #ff9f43;
  --accent-yellow: #feca57;
  --accent-green: #1dd1a1;
  --accent-cyan: #48dbfb;
  --accent-blue: #8bc9eb;
  --accent-purple: #9b59b6;
  --accent-clay: #ff6b81;

  --accent-blue-tint: rgba(139, 201, 235, 0.15);
  --accent-green-tint: rgba(29, 209, 161, 0.15);
  --accent-clay-tint: rgba(255, 107, 129, 0.15);
  --accent-purple-tint: rgba(155, 89, 182, 0.15);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #233e58;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #45688a;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #45688a;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #aed9f1;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* 7. OBSIDIAN & AMBER */
html[data-theme="obsidian"] {
  --theme-name: "obsidian";
  color-scheme: dark;
  --t-bg-deep: #08090a;
  --t-bg: #0c0d0e;
  --t-surface: #15181b;
  --t-surface-2: #1d2125;
  --t-border-subtle: #1e2227;
  --t-border-strong: #282e35;
  --t-text: #f8fafc;
  --t-text-secondary: #94a3b8;
  --t-text-muted: #64748b;
  --t-brand: #f59e0b;
  --t-brand-soft: rgba(245, 158, 11, 0.12);
  --t-brand-ink: #08090a;
  --t-elevation: 0 0 0 1px oklch(100% 0 0 / 0.07);
  --t-elevation-hover: 0 0 0 1px oklch(100% 0 0 / 0.13);
  --t-img-outline: #ffffff1a;
  --t-scroll-thumb: #ffffff24;
  --t-selection: #24292e;
  --t-field-bg: #101214;
  --t-field-lit: #f59e0b;

  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-yellow: #fef08a;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  --accent-clay: #f43f5e;

  --accent-blue-tint: rgba(56, 189, 248, 0.12);
  --accent-green-tint: rgba(16, 185, 129, 0.12);
  --accent-clay-tint: rgba(244, 63, 94, 0.12);
  --accent-purple-tint: rgba(192, 132, 252, 0.12);

  --bg-app: var(--t-bg-deep);
  --bg-canvas: var(--t-bg);
  --bg-sidebar: var(--t-surface);
  --bg-surface: var(--t-surface);
  --bg-surface-elevated: var(--t-surface-2);
  --bg-surface-hover: var(--t-selection);
  --bg-surface-active: #2c3238;
  --bg-modal: var(--t-surface-2);
  --border-subtle: var(--t-border-subtle);
  --border-default: var(--t-border-strong);
  --border-emphasis: #475569;
  --border-focus: var(--t-brand);
  --text-primary: var(--t-text);
  --text-secondary: var(--t-text-secondary);
  --text-muted: var(--t-text-muted);
  --text-faint: #475569;
  --brand-amber: var(--t-brand);
  --brand-amber-hover: #fbbf24;
  --brand-amber-tint: var(--t-brand-soft);
  --brand-ink: var(--t-brand-ink);

  --bg-surface-0: var(--bg-app);
  --bg-surface-1: var(--bg-sidebar);
  --bg-surface-2: var(--bg-surface);
  --bg-surface-3: var(--bg-surface-elevated);
}

/* ==========================================================
   Full Site Visual Harmonization Overrides
   ========================================================== */

/* Body & Base Canvas */
body {
  background-color: var(--t-bg-deep) !important;
  color: var(--t-text) !important;
}

/* Navigation Header */
header {
  background-color: color-mix(in srgb, var(--t-bg-deep) 85%, transparent) !important;
  border-bottom-color: color-mix(in srgb, var(--t-border-subtle) 60%, transparent) !important;
}

/* Dynamic Brand Mark SVG in Navigation, Headers & Footers */
.header-brand-icon,
.brand-icon,
header a svg[role="img"][aria-label="vollko"],
header a svg[aria-label="vollko"],
[data-brand-icon],
footer svg.text-ember-500,
footer svg[viewBox="0 0 32 32"],
footer a svg {
  color: var(--t-brand) !important;
}
.header-brand-icon path,
.brand-icon path,
[data-brand-icon] path,
header a svg[aria-label="vollko"] path,
footer svg.text-ember-500 path,
footer svg[viewBox="0 0 32 32"] path {
  stroke: var(--t-brand) !important;
}
.header-brand-icon circle,
.brand-icon circle,
[data-brand-icon] circle,
header a svg[aria-label="vollko"] circle,
footer svg.text-ember-500 circle,
footer svg[viewBox="0 0 32 32"] circle {
  fill: var(--t-brand) !important;
}

/* Background Surface Tokens */
.bg-ink-950 { background-color: var(--t-bg-deep) !important; }
.bg-ink-950\/80 { background-color: color-mix(in srgb, var(--t-bg-deep) 80%, transparent) !important; }
.bg-ink-900 { background-color: var(--t-bg) !important; }
.bg-ink-800 { background-color: var(--t-surface) !important; }
.bg-ink-800\/30 { background-color: color-mix(in srgb, var(--t-surface) 30%, transparent) !important; }
.bg-ink-800\/40 { background-color: color-mix(in srgb, var(--t-surface) 40%, transparent) !important; }
.bg-ink-800\/60 { background-color: color-mix(in srgb, var(--t-surface) 60%, transparent) !important; }
.bg-ink-700\/60 { background-color: color-mix(in srgb, var(--t-surface-2) 60%, transparent) !important; }
.bg-ink-700\/80 { background-color: color-mix(in srgb, var(--t-surface-2) 80%, transparent) !important; }
.bg-ink-600 { background-color: var(--t-surface-2) !important; }
.bg-ink-500\/60 { background-color: color-mix(in srgb, var(--t-border-subtle) 60%, transparent) !important; }
.hover\:bg-ink-600:hover { background-color: var(--t-selection) !important; }

/* Border Tokens */
.border-ink-500\/30 { border-color: color-mix(in srgb, var(--t-border-subtle) 30%, transparent) !important; }
.border-ink-500\/40 { border-color: color-mix(in srgb, var(--t-border-subtle) 40%, transparent) !important; }
.border-ink-500\/60 { border-color: color-mix(in srgb, var(--t-border-subtle) 60%, transparent) !important; }
.border-ink-400\/60 { border-color: color-mix(in srgb, var(--t-border-strong) 60%, transparent) !important; }

/* Typography Tokens */
.text-paper-50 { color: #ffffff !important; }
.text-paper-100 { color: var(--t-text) !important; }
.text-paper-200 { color: var(--t-text) !important; }
.text-paper-300 { color: var(--t-text-secondary) !important; }
.text-paper-400 { color: var(--t-text-muted) !important; }
.text-paper-500 { color: var(--text-faint) !important; }
.hover\:text-paper-100:hover { color: var(--t-text) !important; }
.hover\:text-paper-300:hover { color: var(--t-text-secondary) !important; }
.hover\:border-paper-400:hover { border-color: var(--border-emphasis, var(--t-border-strong)) !important; }
.text-ink-400 { color: var(--t-text-muted) !important; }
.text-ink-950 { color: var(--t-brand-ink) !important; }

/* Brand Accent Tokens */
.text-ember-200 { color: var(--brand-amber-hover, var(--t-brand)) !important; }
.text-ember-300 { color: var(--accent-orange, var(--t-brand)) !important; }
.text-ember-400 { color: var(--t-brand) !important; }
.text-ember-400\/70 { color: color-mix(in srgb, var(--t-brand) 70%, transparent) !important; }
.text-ember-400\/80 { color: color-mix(in srgb, var(--t-brand) 80%, transparent) !important; }
.text-ember-500 { color: var(--t-brand) !important; }
.hover\:text-ember-300:hover { color: var(--accent-orange, var(--t-brand)) !important; }
.hover\:text-ember-400:hover { color: var(--t-brand) !important; }
.group:hover .group-hover\:text-ember-300 { color: var(--accent-orange, var(--t-brand)) !important; }

.bg-ember-500 { background-color: var(--t-brand) !important; color: var(--t-brand-ink) !important; }
.bg-ember-500\/10 { background-color: var(--t-brand-soft) !important; }
.bg-ember-500\/\[0\.05\] { background-color: color-mix(in srgb, var(--t-brand) 5%, transparent) !important; }
.hover\:bg-ember-400:hover { background-color: var(--brand-amber-hover, var(--t-brand)) !important; color: var(--t-brand-ink) !important; }
.focus\:bg-ember-500:focus { background-color: var(--t-brand) !important; color: var(--t-brand-ink) !important; }
.focus\:text-ink-950:focus { color: var(--t-brand-ink) !important; }

.border-ember-500\/20 { border-color: color-mix(in srgb, var(--t-brand) 20%, transparent) !important; }
.border-ember-500\/40 { border-color: color-mix(in srgb, var(--t-brand) 40%, transparent) !important; }
.border-ember-500\/70 { border-color: color-mix(in srgb, var(--t-brand) 70%, transparent) !important; }
.hover\:border-ember-500\/60:hover { border-color: color-mix(in srgb, var(--t-brand) 60%, transparent) !important; }
.hover\:border-ember-500\/80:hover { border-color: color-mix(in srgb, var(--t-brand) 80%, transparent) !important; }

/* Interactive & Accent Details */
::selection { background: var(--t-selection) !important; color: var(--t-text) !important; }
:focus-visible { outline-color: var(--t-brand) !important; }
.ring-glow { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 12px 32px -12px color-mix(in srgb, var(--t-brand) 35%, transparent) !important; }
.pulse-dot { background: var(--t-brand) !important; }
.pulse-dot::after { border-color: color-mix(in srgb, var(--t-brand) 55%, transparent) !important; }
.bg-radial-spot {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--t-brand) 15%, transparent), transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 110%, color-mix(in srgb, var(--t-brand) 8%, transparent), transparent 60%) !important;
}
.text-gradient {
  background: linear-gradient(180deg, var(--t-text) 0%, var(--t-text-muted) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
.diag {
  background: color-mix(in srgb, var(--t-surface) 50%, transparent) !important;
  border-color: var(--t-border-subtle) !important;
}
.cube-face {
  background: color-mix(in srgb, var(--t-bg) 86%, transparent) !important;
  border-color: var(--t-brand) !important;
  color: var(--t-brand) !important;
}
.cube-face .face-title { color: var(--t-text) !important; }
.cube-face .face-sub { color: var(--text-faint) !important; }
.borg { color: var(--t-brand) !important; }
.borg-label { color: var(--t-brand) !important; }
.stat-num { color: var(--t-brand) !important; }
.stat-lbl { color: var(--t-text-muted) !important; }
.lbl-em { fill: var(--t-brand) !important; }
.lbl-paper { fill: var(--t-text) !important; }

/* SVG Diagram Element Harmonization */
svg [stroke="#F97316"], svg [stroke="#F97316" i] { stroke: var(--t-brand) !important; }
svg [stroke="#FB923C"], svg [stroke="#FB923C" i] { stroke: var(--t-brand) !important; }
svg [stroke="#FDBA74"], svg [stroke="#FDBA74" i] { stroke: var(--brand-amber-hover, var(--t-brand)) !important; }
svg [stroke="#EA580C"], svg [stroke="#EA580C" i] { stroke: var(--t-brand) !important; }
svg [fill="#F97316"], svg [fill="#F97316" i] { fill: var(--t-brand) !important; }
svg [fill="#FB923C"], svg [fill="#FB923C" i] { fill: var(--t-brand) !important; }
svg [fill="#FDBA74"], svg [fill="#FDBA74" i] { fill: var(--brand-amber-hover, var(--t-brand)) !important; }
svg [fill="#EA580C"], svg [fill="#EA580C" i] { fill: var(--t-brand) !important; }
svg [fill*="rgba(249,115,22"] { fill: var(--t-brand-soft) !important; }
svg [stroke*="rgba(249,115,22"] { stroke: color-mix(in srgb, var(--t-brand) 30%, transparent) !important; }
svg [fill="#0a0a0a"], svg [fill="#0a0a0a" i] { fill: var(--t-bg) !important; }
svg [fill="#050505"], svg [fill="#050505" i] { fill: var(--t-bg-deep) !important; }

/* SVG Gradient Stop-Colors */
svg stop[stop-color="#F97316"], svg stop[stop-color="#F97316" i] { stop-color: var(--t-brand) !important; }
svg stop[stop-color="#FB923C"], svg stop[stop-color="#FB923C" i] { stop-color: var(--t-brand) !important; }
svg stop[stop-color="#FDBA74"], svg stop[stop-color="#FDBA74" i] { stop-color: var(--brand-amber-hover, var(--t-brand)) !important; }
svg stop[stop-color="#EA580C"], svg stop[stop-color="#EA580C" i] { stop-color: var(--t-brand) !important; }

/* Diagram Component Primitives, Cards & Flow Particles */
.diag svg .node-ember { stroke: var(--t-brand) !important; }
.diag svg .arrow-em { stroke: var(--t-brand) !important; }
.anatomy-pill .pill-num { color: var(--t-brand) !important; }
.anatomy-pill:hover { border-color: color-mix(in srgb, var(--t-brand) 55%, transparent) !important; background: var(--t-brand-soft) !important; }
.repo-card:hover { border-color: color-mix(in srgb, var(--t-brand) 45%, transparent) !important; }
.repo-card:hover .repo-name { color: var(--brand-amber-hover, var(--t-brand)) !important; }
.slot-tag { color: var(--t-brand) !important; }
.card:hover { border-color: color-mix(in srgb, var(--t-brand) 45%, transparent) !important; }
.mat-step { border-color: var(--t-border-subtle) !important; background: color-mix(in srgb, var(--t-surface) 50%, transparent) !important; }
.stat-tile { border-color: var(--t-border-subtle) !important; background: color-mix(in srgb, var(--t-surface) 40%, transparent) !important; }
.flow-dot { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--t-brand) 80%, transparent)) !important; }
svg circle[style*="drop-shadow"],
circle[style*="drop-shadow"] { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--t-brand) 85%, transparent)) !important; }

/* Inline Style Harmonization Overrides for Cards, Boxes & Badges */
[style*="border-top: 2px solid #F97316"],
[style*="border-top: 2px solid #F97316" i],
[style*="border-top:2px solid #F97316"],
[style*="border-top:2px solid #F97316" i],
[style*="border-top: 2px solid #FB923C"],
[style*="border-top: 2px solid #FB923C" i],
[style*="border-top:2px solid #FB923C"],
[style*="border-top:2px solid #FB923C" i],
[style*="border-top: 2px solid #FDBA74"],
[style*="border-top: 2px solid #FDBA74" i],
[style*="border-top:2px solid #FDBA74"],
[style*="border-top:2px solid #FDBA74" i],
[style*="border-top-color:#F97316"],
[style*="border-top-color:#F97316" i],
[style*="border-top-color: #F97316"],
[style*="border-top-color: #F97316" i],
[style*="border-top-color:#FB923C"],
[style*="border-top-color:#FB923C" i],
[style*="border-top-color: #FB923C"],
[style*="border-top-color: #FB923C" i],
[style*="border-top-color:#FDBA74"],
[style*="border-top-color:#FDBA74" i],
[style*="border-top-color: #FDBA74"],
[style*="border-top-color: #FDBA74" i] {
  border-top-color: var(--t-brand) !important;
}
[style*="border:1px solid #F97316"],
[style*="border:1px solid #F97316" i],
[style*="border: 1px solid #F97316"],
[style*="border: 1px solid #F97316" i],
[style*="border:1px solid #FB923C"],
[style*="border:1px solid #FB923C" i],
[style*="border: 1px solid #FB923C"],
[style*="border: 1px solid #FB923C" i],
[style*="border:1px solid #FDBA74"],
[style*="border:1px solid #FDBA74" i],
[style*="border: 1px solid #FDBA74"],
[style*="border: 1px solid #FDBA74" i] {
  border-color: var(--t-brand) !important;
}
[style*="color:#F97316"],
[style*="color:#F97316" i],
[style*="color: #F97316"],
[style*="color: #F97316" i],
[style*="color:#FB923C"],
[style*="color:#FB923C" i],
[style*="color: #FB923C"],
[style*="color: #FB923C" i],
[style*="color:#FDBA74"],
[style*="color:#FDBA74" i],
[style*="color: #FDBA74"],
[style*="color: #FDBA74" i] {
  color: var(--t-brand) !important;
}
[style*="background:#0a0a0a"],
[style*="background:#0a0a0a" i],
[style*="background: #0a0a0a"],
[style*="background: #0a0a0a" i] {
  background-color: var(--t-bg) !important;
}
[style*="background:#1a1a1a"],
[style*="background:#1a1a1a" i],
[style*="background: #1a1a1a"],
[style*="background: #1a1a1a" i] {
  background-color: var(--t-surface) !important;
}
[style*="linear-gradient(90deg,#F97316"],
[style*="linear-gradient(90deg,#F97316" i] {
  background: linear-gradient(90deg, var(--t-brand), var(--brand-amber-hover, var(--t-brand)), var(--accent-yellow, var(--t-brand)), var(--brand-amber-hover, var(--t-brand)), var(--t-brand)) !important;
}

/* Inline Style Overrides for RGBA Ember Backgrounds and Borders */
[style*="border-color: rgba(249,115,22"],
[style*="border-color: rgba(249,115,22" i],
[style*="border-color:rgba(249,115,22"],
[style*="border-color:rgba(249,115,22" i] {
  border-color: color-mix(in srgb, var(--t-brand) 45%, transparent) !important;
}
[style*="background: rgba(249,115,22"],
[style*="background: rgba(249,115,22" i],
[style*="background:rgba(249,115,22"],
[style*="background:rgba(249,115,22" i] {
  background: var(--t-brand-soft) !important;
}

/* Mobile Drawer */
#mobile-drawer {
  background-color: var(--t-bg) !important;
  border-left-color: var(--t-border-subtle) !important;
}

/* Scrollbar */
::-webkit-scrollbar-track { background: var(--t-bg) !important; }
::-webkit-scrollbar-thumb { background: var(--t-border-strong) !important; border: 2px solid var(--t-bg) !important; }
::-webkit-scrollbar-thumb:hover { background: var(--t-brand) !important; }
* { scrollbar-color: var(--t-border-strong) var(--t-bg) !important; }

/* Theme Switcher Popover & Dropdown */
.theme-switcher-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-menu-popover {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 250px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theme-menu-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
  font-family: inherit;
}

.theme-menu-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.theme-menu-item.active {
  background: var(--brand-amber-tint);
  border-color: var(--brand-amber);
  color: var(--text-primary);
  font-weight: 600;
}

.theme-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.theme-swatch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.theme-name {
  flex: 1;
}

.theme-badge-default {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--brand-amber-tint);
  color: var(--brand-amber);
  letter-spacing: 0.4px;
}

.theme-check {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-amber);
  margin-left: auto;
}

.theme-menu-item.active .theme-check {
  display: inline-block;
}

@media (max-width: 640px) {
  .theme-menu-popover {
    right: -44px;
    width: min(240px, calc(100vw - 32px));
  }
}
