/* DedSec Project — premium color-only overlay, October 2026.
   SAFE REVERT: remove the link to this stylesheet from HTML files.
   This file deliberately never changes layout, sizing, positioning, fonts,
   content, display, flex/grid, overflow, animations, or functionality.
   It is loaded LAST to override legacy color-only !important rules. */

/* Design tokens. Existing theme toggle remains in /script.js. */
html body.dark-theme {
  --nm-abyss-blue: #080910 !important;
  --ded-page-surface: #080910 !important;
  --nm-nav-solid: #101019 !important;
  --nm-menu-solid: #101019 !important;
  --nm-darkest: #11111d !important;
  --nm-dark: #15131f !important;
  --nm-container: #15131f !important;
  --ded-card-surface-dark: #15131f !important;
  --nm-disclaimer-bg: #15131f !important;
  --nm-accent: #a855f7 !important;
  --nm-accent-hover: #c084fc !important;
  --nm-border: rgba(168,85,247,.38) !important;
  --nm-text: #f5f4fb !important;
  --nm-text-accent: #f5f4fb !important;
  --nm-text-muted: #c7c3d3 !important;
  --nm-text-on-accent: #160d21 !important;
  --nm-success: #52d6b0 !important;
  --nm-warning: #f5c879 !important;
  --glow-rgb: 168,85,247 !important;
  --ded-border-dark: rgba(168,85,247,.40) !important;
  --ded-accent-purple: #a855f7 !important;
  --ded-accent-lavender: #c89bff !important;
}
html body.light-theme {
  --nm-abyss-blue: #f7f5fb !important;
  --ded-page-surface: #f7f5fb !important;
  --nm-nav-solid: #fff !important;
  --nm-menu-solid: #fff !important;
  --nm-darkest: #fff !important;
  --nm-dark: #fff !important;
  --nm-container: #fff !important;
  --ded-card-surface-light: #fff !important;
  --nm-disclaimer-bg: #fff !important;
  --nm-accent: #7832c6 !important;
  --nm-accent-hover: #6224a6 !important;
  --nm-border: rgba(120,50,198,.24) !important;
  --nm-text: #211b2e !important;
  --nm-text-accent: #211b2e !important;
  --nm-text-muted: #50475e !important;
  --nm-text-on-accent: #fff !important;
  --nm-success: #137a58 !important;
  --nm-warning: #a36917 !important;
  --glow-rgb: 120,50,198 !important;
  --ded-border-light: rgba(120,50,198,.28) !important;
  --ded-accent-purple: #7832c6 !important;
  --ded-accent-lavender: #9b65d0 !important;
}

/* Backdrop and fixed navigation. Colors only — current mobile header is untouched. */
html body.dark-theme { background: #080910 !important; background-color: #080910 !important; }
html body.light-theme { background: #f7f5fb !important; background-color: #f7f5fb !important; }
html body.dark-theme :is(.main-nav,.nav-menu,.nav-action-btn,.burger-menu,.nav-menu .nav-link):not(#dedsec-theme-specificity) {
  background: #101019 !important; background-color: #101019 !important;
}
html body.light-theme :is(.main-nav,.nav-menu,.nav-action-btn,.burger-menu,.nav-menu .nav-link):not(#dedsec-theme-specificity) {
  background: #fff !important; background-color: #fff !important;
}
html body.dark-theme .main-nav:not(#dedsec-theme-specificity) { border-bottom-color: rgba(200,155,255,.35) !important; }
html body.light-theme .main-nav:not(#dedsec-theme-specificity) { border-bottom-color: rgba(120,50,198,.25) !important; }

/* Existing boxes keep identical geometry; only their fills and outlines change. */
html body.dark-theme :is(
  .page-header,.hero-section,.content-section,.home-intro-panel,
  .feature-card,.community-card,.tool-card,.stat-card,.glance-card,.step-card,
  .trust-item,.category,.category-header,.tool-item,
  [class*="-card"],[class*="_card"],[class*="Card"],
  [class*="-box"],[class*="_box"],[class*="-panel"],[class*="_panel"],
  .callout,.note,.warning,.note-warning,.danger,.tip,details,
  .cookie-banner,.modal-content,.modal-disclaimer,.dedsec-cookie-settings,
  .code-container,.search-modal,.academy-main-header,.academy-lesson-header,
  .academy-meta-row span,.academy-filter,.academy-command-list > div,
  .academy-table-wrap,.academy-table-wrap table,.academy-table-wrap th,
  .academy-brief-card,.academy-platform-card,.academy-evidence-box,
  .academy-callout,.academy-quality-item
):not(#dedsec-theme-specificity) {
  background: #15131f !important; background-color: #15131f !important;
  border-color: rgba(168,85,247,.30) !important;
}
html body.light-theme :is(
  .page-header,.hero-section,.content-section,.home-intro-panel,
  .feature-card,.community-card,.tool-card,.stat-card,.glance-card,.step-card,
  .trust-item,.category,.category-header,.tool-item,
  [class*="-card"],[class*="_card"],[class*="Card"],
  [class*="-box"],[class*="_box"],[class*="-panel"],[class*="_panel"],
  .callout,.note,.warning,.note-warning,.danger,.tip,details,
  .cookie-banner,.modal-content,.modal-disclaimer,.dedsec-cookie-settings,
  .code-container,.search-modal,.academy-main-header,.academy-lesson-header,
  .academy-meta-row span,.academy-filter,.academy-command-list > div,
  .academy-table-wrap,.academy-table-wrap table,.academy-table-wrap th,
  .academy-brief-card,.academy-platform-card,.academy-evidence-box,
  .academy-callout,.academy-quality-item
):not(#dedsec-theme-specificity) {
  background: #fff !important; background-color: #fff !important;
  border-color: rgba(120,50,198,.22) !important;
}
/* Code blocks should remain distinct from ordinary cards. */
html body.dark-theme :is(pre,.code-container):not(#dedsec-theme-specificity) { background: #0d0c16 !important; background-color: #0d0c16 !important; }
html body.light-theme :is(pre,.code-container):not(#dedsec-theme-specificity) { background: #f0ebf7 !important; background-color: #f0ebf7 !important; }

/* Global readable text; honor the legacy blanket theme !important declarations. */
html body.dark-theme :is(p,li,label,h1,h2,h3,h4,h5,h6,summary,.sales-hero-subtitle,.sales-section-intro,.home-decision-note):not(#dedsec-theme-specificity) {
  color: #f5f4fb !important; -webkit-text-fill-color: #f5f4fb !important;
}
html body.light-theme :is(p,li,label,h1,h2,h3,h4,h5,h6,summary,.sales-hero-subtitle,.sales-section-intro,.home-decision-note):not(#dedsec-theme-specificity) {
  color: #211b2e !important; -webkit-text-fill-color: #211b2e !important;
}
/* Less contrast on descriptions without turning text low-visibility. */
html body.dark-theme :is(.sales-hero-subtitle,.sales-section-intro,.home-decision-note,.feature-description,.tool-description):not(#dedsec-theme-specificity) {
  color: #c7c3d3 !important; -webkit-text-fill-color: #c7c3d3 !important;
}
html body.light-theme :is(.sales-hero-subtitle,.sales-section-intro,.home-decision-note,.feature-description,.tool-description):not(#dedsec-theme-specificity) {
  color: #50475e !important; -webkit-text-fill-color: #50475e !important;
}

/* Contrast-correct CTAs, all their text descendants, and hover states.
   The extra :not(#...) wins over old global !important black/white locks. */
html body.dark-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity),
html body.dark-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity):is(:hover,:focus,:active) {
  background: #a855f7 !important; background-color: #a855f7 !important;
  color: #160d21 !important; -webkit-text-fill-color: #160d21 !important;
  border-color: #a855f7 !important;
}
html body.light-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity),
html body.light-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity):is(:hover,:focus,:active) {
  background: #7832c6 !important; background-color: #7832c6 !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  border-color: #7832c6 !important;
}
html body.dark-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity) :is(span,strong,i,svg):not(#dedsec-theme-specificity) {
  color: #160d21 !important; -webkit-text-fill-color: #160d21 !important;
}
html body.light-theme :is(.sales-btn-primary,.btn-primary,.starter-path-btn-primary):not(#dedsec-theme-specificity) :is(span,strong,i,svg):not(#dedsec-theme-specificity) {
  color: #fff !important; -webkit-text-fill-color: #fff !important;
}
/* Secondary buttons remain distinct, including GitHub and contact links. */
html body.dark-theme :is(.sales-btn-secondary,.btn-secondary,.footer-mini-btn):not(#dedsec-theme-specificity) {
  background: #211b2d !important; background-color: #211b2d !important;
  color: #eee6fa !important; -webkit-text-fill-color: #eee6fa !important;
  border-color: #644586 !important;
}
html body.light-theme :is(.sales-btn-secondary,.btn-secondary,.footer-mini-btn):not(#dedsec-theme-specificity) {
  background: #f1eaf9 !important; background-color: #f1eaf9 !important;
  color: #40236c !important; -webkit-text-fill-color: #40236c !important;
  border-color: #c1a8dd !important;
}
html body.dark-theme :is(.sales-btn-secondary,.btn-secondary,.footer-mini-btn):not(#dedsec-theme-specificity) :is(span,strong,i):not(#dedsec-theme-specificity) {
  color: #eee6fa !important; -webkit-text-fill-color: #eee6fa !important;
}
html body.light-theme :is(.sales-btn-secondary,.btn-secondary,.footer-mini-btn):not(#dedsec-theme-specificity) :is(span,strong,i):not(#dedsec-theme-specificity) {
  color: #40236c !important; -webkit-text-fill-color: #40236c !important;
}

/* Accent labels, visible links and functional indicators. */
html body.dark-theme :is(.sales-section-label,.sales-eyebrow,.home-decision-number,.sponsor-eyebrow,.sponsor-tier-price):not(#dedsec-theme-specificity) {
  color: #c89bff !important; -webkit-text-fill-color: #c89bff !important;
}
html body.light-theme :is(.sales-section-label,.sales-eyebrow,.home-decision-number,.sponsor-eyebrow,.sponsor-tier-price):not(#dedsec-theme-specificity) {
  color: #7832c6 !important; -webkit-text-fill-color: #7832c6 !important;
}
html body.dark-theme a:not([class]):not(#dedsec-theme-specificity) { color: #c89bff !important; -webkit-text-fill-color: #c89bff !important; }
html body.light-theme a:not([class]):not(#dedsec-theme-specificity) { color: #7832c6 !important; -webkit-text-fill-color: #7832c6 !important; }
/* Preserve theme and language toggle icon contrast. */
html body.dark-theme :is(.nav-action-btn,.nav-action-btn span,.burger-menu,.burger-label,.nav-link):not(#dedsec-theme-specificity) {
  color: #f5f4fb !important; -webkit-text-fill-color: #f5f4fb !important;
}
html body.light-theme :is(.nav-action-btn,.nav-action-btn span,.burger-menu,.burger-label,.nav-link):not(#dedsec-theme-specificity) {
  color: #211b2e !important; -webkit-text-fill-color: #211b2e !important;
}
/* Hover feedback uses a darker/lighter surface; no animation or geometry changes. */
html body.dark-theme .nav-menu .nav-link:is(:hover,:focus-visible):not(#dedsec-theme-specificity),
html body.dark-theme .nav-action-btn:is(:hover,:focus-visible):not(#dedsec-theme-specificity) {
  background: #2b1c40 !important; background-color: #2b1c40 !important;
  border-color: #8656b6 !important;
}
html body.light-theme .nav-menu .nav-link:is(:hover,:focus-visible):not(#dedsec-theme-specificity),
html body.light-theme .nav-action-btn:is(:hover,:focus-visible):not(#dedsec-theme-specificity) {
  background: #eee6f8 !important; background-color: #eee6f8 !important;
  border-color: #b394d7 !important;
}
/* Visible keyboard focus without changing control geometry. */
html body :is(a,button,input,textarea,select):focus-visible { outline-color: var(--nm-accent) !important; }
