@import url("../shared/theme-tones.css");
@import url("../shared/theme-components.css");
/* Semantic palette contract. Layout belongs to page and component styles. */

/* Diagrams and images keep the Cyber Elite look in every theme (Brett 2026-10-25): svg and .bb-scene re-declare the Cyber values. */
:root, [data-bb-theme="cyber"], [data-bb-theme] :is(svg, .bb-scene) {
  --theme-page: #05080a;
  --theme-surface: #0f161b;
  --theme-raised: #0f161b;
  --theme-inset: #05080a;
  --theme-ink: #ECEFF1;
  --theme-muted: #90A4AE;
  --theme-on-primary: #000000;
  --theme-primary: #00C853;
  --theme-primary-hover: #00E676;
  --theme-header: #0f161b;
  --theme-on-header: #ECEFF1;
  --theme-accent: #00C853;
  --theme-success: #00C853;
  --theme-success-bg: #0f161b;
  --theme-error: #FF5252;
  --theme-error-bg: #0f161b;
  --theme-warning: #FFD600;
  --theme-warning-bg: #05080a;
  --theme-info: #00B0FF;
  --theme-info-bg: #05080a;
  --theme-focus: #FFD600;
  --theme-focus-on-header: #ECEFF1;
  --theme-disabled-ink: #90A4AE;
  --theme-disabled-bg: #05080a;
  --theme-border: #546E7A;
  --theme-border-decorative: #546E7A;
  --theme-shadow: none;
  --theme-glow-heading: none;
  --theme-glow-action: 0 0 20px rgba(0,200,83,.25);
  --theme-glow-hover: 0 0 35px rgba(0,200,83,.45);
  --theme-glow-success: none;
  --theme-glow-error: none;
  --theme-category-1: #00C853;
  --theme-category-2: #00C853;
  --theme-category-3: #FFD600;
  --theme-chart-1: #00C853;
  --theme-chart-2: #00C853;
  --theme-chart-3: #FF5252;
  --theme-chart-4: #FFD600;
  --theme-scene-bg: #05080a;
  --theme-scene-ink: #ECEFF1;
  --theme-scene-muted: #90A4AE;
  --theme-scene-border: #546E7A;
  --theme-font-heading: 'Ultra', Georgia, serif;
  --theme-font-body: 'Geist', sans-serif;
  --theme-font-code: 'JetBrains Mono', monospace;
}

[data-bb-theme="patriotic"] {
  color-scheme: light;
  --theme-page: #e4eaf0;
  --theme-surface: #f6f8fa;
  --theme-raised: #19385b;
  --theme-inset: #dce5ef;
  --theme-ink: #172b46;
  --theme-muted: #485b70;
  --theme-on-primary: #f6f8fa;
  --theme-primary: #19385b;
  --theme-primary-hover: #244b76;
  --theme-header: #19385b;
  --theme-on-header: #f6f8fa;
  --theme-accent: #a33c45;
  --theme-success: #205c44;
  --theme-success-bg: #e0ece6;
  --theme-error: #8b3038;
  --theme-error-bg: #f2e2e4;
  --theme-warning: #705522;
  --theme-warning-bg: #dce5ef;
  --theme-info: #19385b;
  --theme-info-bg: #dce5ef;
  --theme-focus: #705522;
  --theme-focus-on-header: #f6f8fa;
  --theme-disabled-ink: #485b70;
  --theme-disabled-bg: #dce5ef;
  --theme-border: #738397;
  --theme-border-decorative: #738397;
  --theme-shadow: none;
  --theme-glow-heading: none;
  --theme-glow-action: none;
  --theme-glow-hover: var(--theme-glow-action);
  --theme-glow-success: none;
  --theme-glow-error: none;
  --theme-category-1: #a33c45;
  --theme-category-2: #19385b;
  --theme-category-3: #705522;
  --theme-chart-1: #19385b;
  --theme-chart-2: #205c44;
  --theme-chart-3: #8b3038;
  --theme-chart-4: #705522;
  --theme-scene-bg: #05080a;
  --theme-scene-ink: #ECEFF1;
  --theme-scene-muted: #90A4AE;
  --theme-scene-border: #546E7A;
  --theme-font-heading: 'Ultra', Georgia, serif;
  --theme-font-body: 'Geist', sans-serif;
  --theme-font-code: 'JetBrains Mono', monospace;
}

[data-bb-theme="neon"] {
  color-scheme: dark;
  --theme-page: #10091c;
  --theme-surface: #1b1230;
  --theme-raised: #231536;
  --theme-inset: #291b40;
  --theme-ink: #f6efff;
  --theme-muted: #bbb0cf;
  --theme-on-primary: #10091c;
  --theme-primary: #4deaff;
  --theme-primary-hover: #80f1ff;
  --theme-header: #231536;
  --theme-on-header: #f6efff;
  --theme-accent: #ff57c8;
  --theme-success: #c7ff58;
  --theme-success-bg: #213018;
  --theme-error: #ff2a4f;
  --theme-error-bg: #3a1218;
  --theme-warning: #c7ff58;
  --theme-warning-bg: #291b40;
  --theme-info: #4deaff;
  --theme-info-bg: #291b40;
  --theme-focus: #c7ff58;
  --theme-focus-on-header: #f6efff;
  --theme-disabled-ink: #bbb0cf;
  --theme-disabled-bg: #291b40;
  --theme-border: #827394;
  --theme-border-decorative: #827394;
  --theme-shadow: none;
  --theme-glow-heading: 0 0 22px #ff57c855;
  --theme-glow-action: 0 0 16px #4deaff33;
  --theme-glow-hover: var(--theme-glow-action);
  --theme-glow-success: 0 0 12px #c7ff5822;
  --theme-glow-error: 0 0 14px #ff2a4f66;
  --theme-category-1: #ff57c8;
  --theme-category-2: #4deaff;
  --theme-category-3: #c7ff58;
  --theme-chart-1: #4deaff;
  --theme-chart-2: #c7ff58;
  --theme-chart-3: #ff88c9;
  --theme-chart-4: #c7ff58;
  --theme-scene-bg: #05080a;
  --theme-scene-ink: #ECEFF1;
  --theme-scene-muted: #90A4AE;
  --theme-scene-border: #546E7A;
  --theme-font-heading: 'Ultra', Georgia, serif;
  --theme-font-body: 'Geist', sans-serif;
  --theme-font-code: 'JetBrains Mono', monospace;
}

[data-bb-theme="reserve"] {
  color-scheme: dark;
  --theme-page: #08090a;
  --theme-surface: #111419;
  --theme-raised: #181c23;
  --theme-inset: #181c23;
  --theme-ink: #f2e9d8;
  --theme-muted: #8f9aab;
  --theme-on-primary: #08090a;
  --theme-primary: #d8b85d;
  --theme-primary-hover: #e5cb83;
  --theme-header: #181c23;
  --theme-on-header: #f2e9d8;
  --theme-accent: #8a7134;
  --theme-success: #49c47b;
  --theme-success-bg: #10251a;
  --theme-error: #e5484d;
  --theme-error-bg: #2a1214;
  --theme-warning: #d8b85d;
  --theme-warning-bg: #181c23;
  --theme-info: #d8b85d;
  --theme-info-bg: #181c23;
  --theme-focus: #d8b85d;
  --theme-focus-on-header: #f2e9d8;
  --theme-disabled-ink: #8f9aab;
  --theme-disabled-bg: #181c23;
  --theme-border: #747e8d;
  --theme-border-decorative: #2a2f37;
  --theme-shadow: 0 24px 90px rgba(0,0,0,.34);
  --theme-glow-heading: none;
  --theme-glow-action: none;
  --theme-glow-hover: var(--theme-glow-action);
  --theme-glow-success: none;
  --theme-glow-error: none;
  --theme-category-1: #d8b85d;
  --theme-category-2: #7fcab5;
  --theme-category-3: #71aee8;
  --theme-chart-1: #d8b85d;
  --theme-chart-2: #49c47b;
  --theme-chart-3: #e58cac;
  --theme-chart-4: #d8b85d;
  --theme-scene-bg: #05080a;
  --theme-scene-ink: #ECEFF1;
  --theme-scene-muted: #90A4AE;
  --theme-scene-border: #546E7A;
  --theme-font-heading: 'Ultra', Georgia, serif;
  --theme-font-body: 'Geist', sans-serif;
  --theme-font-code: 'JetBrains Mono', monospace;
}

/* Old Glory: parchment, navy and brick red. A variant of Dress Blues (bb-theme.js sets data-bb-theme="patriotic" + data-bb-variant="oldglory"), so it inherits every Dress Blues rule. */
[data-bb-theme="patriotic"][data-bb-variant="oldglory"] {
  color-scheme: light;
  --theme-page: #ece7dc;
  --theme-surface: #f7f2e7;
  --theme-raised: #293e59;
  --theme-inset: #e8e0cf;
  --theme-ink: #283447;
  --theme-muted: #5e5b54;
  --theme-on-primary: #f7f2e7;
  --theme-primary: #293e59;
  --theme-primary-hover: #344f72;
  --theme-header: #e6dfd0;
  --theme-on-header: #283447;
  --theme-accent: #93483d;
  --theme-success: #305b43;
  --theme-success-bg: #e2e8da;
  --theme-error: #8b3732;
  --theme-error-bg: #efdfd5;
  --theme-warning: #795c22;
  --theme-warning-bg: #e8e0cf;
  --theme-info: #293e59;
  --theme-info-bg: #e8e0cf;
  --theme-focus: #93483d;
  --theme-focus-on-header: #93483d;
  --theme-disabled-ink: #5e5b54;
  --theme-disabled-bg: #e8e0cf;
  --theme-border: #868077;
  --theme-border-decorative: #868077;
  --theme-category-1: #93483d;
  --theme-category-2: #293e59;
  --theme-category-3: #795c22;
  --theme-chart-1: #293e59;
  --theme-chart-2: #305b43;
  --theme-chart-3: #8b3732;
  --theme-chart-4: #795c22;
}

/* Compatibility properties still consumed by existing components and page styles. */
[data-bb-theme="patriotic"], [data-bb-theme="neon"], [data-bb-theme="reserve"] {
  --bb-bg: var(--theme-page);
  --bb-bg-deep: var(--theme-page);
  --bb-bg-surface: var(--theme-surface);
  --bb-bg-glass: var(--theme-surface);
  --bb-panel-bg: var(--theme-surface);
  --bb-panel: var(--theme-surface);

  --bb-surface: var(--theme-surface);
  --bb-surface-2: var(--theme-inset);
  --bb-text: var(--theme-ink);
  --bb-text-main: var(--theme-ink);
  --bb-text-muted: var(--theme-muted);
  --bb-text-dim: var(--theme-muted);
  --bb-ink: var(--theme-ink);
  --bb-muted: var(--theme-muted);
  --bb-kelly: var(--theme-primary);
  --bb-accent: var(--theme-primary);
  --bb-cyan: var(--theme-info);
  --bb-blue: var(--theme-info);
  --bb-error: var(--theme-error);
  --bb-gold: var(--theme-warning);

  --bb-soft-line: var(--theme-border);
  --bb-glow-primary: var(--theme-glow-action);
  --bb-glow-hover: var(--theme-glow-hover);
  --bb-control-accent: var(--theme-primary);
  --bb-control-ink: var(--theme-ink);
  --bb-control-muted: var(--theme-muted);
  --bb-control-on-accent: var(--theme-on-primary);
  --bb-control-border: var(--theme-border);
  --bb-control-field-border: var(--theme-border);
  --bb-control-tab-border: var(--theme-border);
  --bb-control-surface: var(--theme-inset);
  --bb-control-field-surface: var(--theme-surface);
  --bb-control-selected-surface: var(--theme-inset);
  --bb-control-danger: var(--theme-error);
  --font-tech: var(--theme-font-heading);
  --font-body: var(--theme-font-body);
  --font-code: var(--theme-font-code);
}
:where([data-bb-theme="cyber"]), [data-bb-theme] :is(svg, .bb-scene) {
  --bb-bg-deep: #05080a;
  --bb-bg-surface: #0f161b;
  --bb-bg-glass: rgba(15, 22, 27, 0.75);
  --bb-text-main: #ECEFF1;
  --bb-text-muted: #90A4AE;
  --bb-text-dim: #546E7A;
  --bb-kelly: #00C853;
  --bb-cyan: #00B0FF;
  --bb-error: #FF5252;
  --bb-gold: #FFD600;
  --bb-glow-primary: 0 0 20px rgba(0, 200, 83, 0.25);
  --bb-glow-hover: 0 0 35px rgba(0, 200, 83, 0.45);
}

[data-bb-theme="neon"][data-bb-reduce-glow="true"] {
  --theme-glow-heading: none;
  --theme-glow-action: none;
  --theme-glow-hover: none;
  --theme-glow-success: none;
  --theme-glow-error: none;
}
@media (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
  [data-bb-theme="neon"] {
  --theme-glow-heading: none;
  --theme-glow-action: none;
  --theme-glow-hover: none;
  --theme-glow-success: none;
  --theme-glow-error: none;
  }
}

/* Exported paper is an explicit fixed scene. */
:root { --theme-print-paper: #ffffff; --theme-print-ink: #000000; }

/* Tactical reticle on the light Dress Blues and Old Glory themes (Brett 2026-10-26): navy ring, red crosshair ticks and dot,
   navy readout, theme-colored glow. The default white dot and green glow vanish on these light pages. Covers the shared
   reticle and the per-page copies (.cursor / .cursor-dot / .cursor-coords). */
[data-bb-theme="patriotic"] .cursor {
  border-color: var(--theme-primary) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-primary) 35%, transparent) !important;
  background-image: linear-gradient(90deg, var(--theme-accent) 20%, transparent 20%, transparent 80%, var(--theme-accent) 80%), linear-gradient(180deg, var(--theme-accent) 20%, transparent 20%, transparent 80%, var(--theme-accent) 80%) !important;
}
[data-bb-theme="patriotic"] .cursor::before, [data-bb-theme="patriotic"] .cursor::after { border-color: var(--theme-primary) !important; }
[data-bb-theme="patriotic"] .cursor.active { background-color: color-mix(in srgb, var(--theme-primary) 12%, transparent) !important; border-color: var(--theme-accent) !important; }
[data-bb-theme="patriotic"] .cursor-dot { background: var(--theme-accent) !important; box-shadow: 0 0 6px color-mix(in srgb, var(--theme-accent) 60%, transparent) !important; }
[data-bb-theme="patriotic"] .cursor-coords { color: var(--theme-primary) !important; text-shadow: none !important; }
