/* =============================================================================
   Light mode — site-wide. Loaded last by zoth-theme.js so page :root and
   hardcoded dark shells cannot keep white ink on dark cards.
   ============================================================================= */

html[data-theme="light"],
html.theme-light {
  color-scheme: light;

  --bg: #f7f9fc;
  --bg-2: #ffffff;
  --bg-3: #eef2f7;
  --bg-subtle: #f3f4f6;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --surface-highlight: #f3f4f6;
  --card-bg: #ffffff;
  --card-border: rgba(17, 24, 39, 0.12);

  --text: #1f2937;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-dim: #6b7280;
  --text-body: #1f2937;
  --text-subhead: #374151;
  --muted: #4b5563;
  --mute: #4b5563;

  --line: rgba(17, 24, 39, 0.1);
  --line-strong: rgba(99, 91, 255, 0.35);
  --border-card: rgba(17, 24, 39, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-panel-bg: rgba(255, 255, 255, 0.94);
  --glass-panel-border: rgba(17, 24, 39, 0.12);
  --input-bg: #ffffff;
  --input-text: #111827;
  --code-bg: #f3f4f6;
  --code-text: #4338ca;
  --shadow-color: rgba(17, 24, 39, 0.08);

  --docs-bg: #f7f9fc;
  --docs-card: #ffffff;
  --docs-card-hover: #f3f4f6;
  --docs-text: #111827;
  --docs-primary: #111827;
  --docs-body: #1f2937;
  --docs-muted: #4b5563;
  --docs-subtle: #6b7280;
  --docs-line: rgba(17, 24, 39, 0.12);
  --docs-line-subtle: rgba(17, 24, 39, 0.08);
  --docs-cyan: #5b21b6;
  --docs-magenta: #6d28d9;
  --docs-purple: #5b21b6;
  --docs-emerald: #047857;
  --docs-amber: #b45309;

  --agent-bg: #f7f9fc;
  --agent-card: #ffffff;
  --agent-border: rgba(17, 24, 39, 0.12);
  --agent-text: #111827;
  --agent-text-bright: #111827;
  --agent-text-body: #1f2937;
  --agent-text-dossier: #1f2937;
  --agent-text-specs: #374151;
  --agent-text-dim: #6b7280;
  --agent-axiom-color: #92400e;
}

html[data-theme="light"] body,
html.theme-light body,
html[data-theme="light"] body.docs-page,
html[data-theme="light"] body.deck-page,
html[data-theme="light"] body.signal-deck {
  background: #f7f9fc !important;
  background-color: #f7f9fc !important;
  background-image: none !important;
  animation: none !important;
  color: #1f2937 !important;
}
html[data-theme="light"] body.signal-deck,
html[data-theme="light"] body.bg-zinc-950,
html[data-theme="light"] body.bg-black,
html[data-theme="light"] body.bg-neutral-950 {
  background: #f7f9fc !important;
  background-color: #f7f9fc !important;
  color: #1f2937 !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] .hero-h1,
html[data-theme="light"] .studio-title,
html[data-theme="light"] .brand-title,
html[data-theme="light"] .station-title,
html[data-theme="light"] .recon-title h1,
html[data-theme="light"] .hero-title,
html[data-theme="light"] .card-title,
html[data-theme="light"] .signal-title,
html[data-theme="light"] .sig-deck-kicker h2 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  text-shadow: none !important;
}

html[data-theme="light"] p,
html[data-theme="light"] li,
html[data-theme="light"] .lede,
html[data-theme="light"] .studio-subtitle,
html[data-theme="light"] small {
  color: #1f2937;
}

html[data-theme="light"] a:not(.btn):not(.btn-on):not(.btn-gold):not(.nav-pill):not(.magic-shimmer-btn) {
  color: inherit;
}

/* Inputs / search */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] .docs-search-input,
html[data-theme="light"] .search-box input,
html[data-theme="light"] input[type="search"] {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: rgba(17, 24, 39, 0.16) !important;
}

html[data-theme="light"] .drawer {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.1) !important;
}
html[data-theme="light"] .drawer a,
html[data-theme="light"] .drawer-heading {
  color: #1f2937 !important;
}

/* Docs */
html[data-theme="light"] .docs-nav,
html[data-theme="light"] .docs-toc-toggle {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06) !important;
}
html[data-theme="light"] .docs-nav a {
  color: #374151 !important;
}
html[data-theme="light"] .docs-nav a:hover,
html[data-theme="light"] .docs-nav a.active {
  background: #f3f4f6 !important;
  color: #111827 !important;
}
html[data-theme="light"] .docs-nav-group-title {
  color: #6d28d9 !important;
}

/* Agents */
html[data-theme="light"] .agent-filter-toolbar,
html[data-theme="light"] .studio-filter-section,
html[data-theme="light"] .feed-controls,
html[data-theme="light"] .ticker-bar,
html[data-theme="light"] .controls-bar {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.1) !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] .filter-pill {
  background: #f3f4f6 !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}
html[data-theme="light"] .filter-pill.active {
  background: #111827 !important;
  color: #ffffff !important;
}
html[data-theme="light"] .agent-filter-chip,
html[data-theme="light"] .goal-chip:not(.active) {
  background: #f3f4f6 !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}
html[data-theme="light"] .agent-filter-chip:hover,
html[data-theme="light"] .agent-filter-chip.active {
  color: #111827 !important;
}

html[data-theme="light"] .pantheon-card,
html[data-theme="light"] .ws-card,
html[data-theme="light"] .social-card,
html[data-theme="light"] article.social-card,
html[data-theme="light"] .agent-stat-item {
  background: #ffffff !important;
  border-color: rgba(17, 24, 39, 0.1) !important;
  color: #1f2937 !important;
}
html[data-theme="light"] .agent-stat-val {
  color: #111827 !important;
}
html[data-theme="light"] .author-name,
html[data-theme="light"] .pantheon-card-name,
html[data-theme="light"] .ws-title {
  color: #111827 !important;
}
html[data-theme="light"] .card-content,
html[data-theme="light"] .card-quote-box {
  color: #1f2937 !important;
}
html[data-theme="light"] .card-quote-box {
  background: #eef2ff !important;
}

/* Studio hero + chips */
html[data-theme="light"] .studio-hero {
  background: #f7f9fc !important;
  border-bottom-color: rgba(17, 24, 39, 0.08) !important;
}
html[data-theme="light"] .hero-badge-row {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}
html[data-theme="light"] .btn-outline {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: rgba(17, 24, 39, 0.16) !important;
}

/* Social quotes / HUD */
html[data-theme="light"] .social-card blockquote,
html[data-theme="light"] .hermetic-hud-footer,
html[data-theme="light"] .card-footer {
  background: #f8fafc !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.08) !important;
}

/* Adytum / Tailwind dark shells */
html[data-theme="light"] .bg-zinc-950,
html[data-theme="light"] .bg-zinc-900,
html[data-theme="light"] .bg-neutral-950,
html[data-theme="light"] .bg-neutral-900,
html[data-theme="light"] .bg-black {
  background-color: #ffffff !important;
}
html[data-theme="light"] .text-zinc-50,
html[data-theme="light"] .text-zinc-100,
html[data-theme="light"] .text-zinc-200,
html[data-theme="light"] .text-white {
  color: #111827 !important;
}
html[data-theme="light"] .text-zinc-400,
html[data-theme="light"] .text-zinc-300,
html[data-theme="light"] .text-zinc-500 {
  color: #4b5563 !important;
}
html[data-theme="light"] .border-zinc-800,
html[data-theme="light"] .border-zinc-700,
html[data-theme="light"] .border-white\/10 {
  border-color: rgba(17, 24, 39, 0.12) !important;
}

html[data-theme="light"] #root,
html[data-theme="light"] #root > div,
html[data-theme="light"] #root > div > div {
  background-color: #f7f4ee !important;
  color: #1c1917 !important;
}
html[data-theme="light"] #root h1,
html[data-theme="light"] #root h2,
html[data-theme="light"] #root p,
html[data-theme="light"] #root span {
  color: #1c1917;
}
html[data-theme="light"] #root [class*="bg-zinc"],
html[data-theme="light"] #root [class*="bg-neutral"],
html[data-theme="light"] #root [class*="bg-black"],
html[data-theme="light"] #root [class*="bg-slate-9"],
html[data-theme="light"] #root [class*="bg-gray-9"] {
  background-color: #ffffff !important;
}
html[data-theme="light"] #root [class*="text-zinc"],
html[data-theme="light"] #root [class*="text-neutral"],
html[data-theme="light"] #root [class*="text-slate"],
html[data-theme="light"] #root [class*="text-white"] {
  color: #1f2937 !important;
}
html[data-theme="light"] #root [class*="bg-amber"],
html[data-theme="light"] #root [class*="bg-yellow"] {
  background-color: #e8c872 !important;
  color: #1a1204 !important;
}

/* Terminals */
html[data-theme="light"] .terminal,
html[data-theme="light"] pre,
html[data-theme="light"] code {
  color: #1f2937;
}
html[data-theme="light"] .terminal {
  background: #f3f4f6 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}

/* Keep primary buttons readable */
html[data-theme="light"] .btn-on,
html[data-theme="light"] .btn-gold,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .magic-shimmer-btn {
  color: #111827;
}

/* =============================================================================
   Footer — always full device width, never a boxed container
   ============================================================================= */
footer.site,
footer.site-footer,
body > footer {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  display: block;
}
footer.site,
html[data-theme="dark"] footer.site {
  background: #05060a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="light"] footer.site,
html[data-theme="light"] footer.site-footer,
html.theme-light footer.site {
  background: #eef2f7 !important;
  background-image: none !important;
  color: #1f2937 !important;
  border-top: 1px solid rgba(17, 24, 39, 0.1) !important;
}
html[data-theme="matrix"] footer.site {
  background: #000800 !important;
  border-top-color: rgba(0, 255, 80, 0.25) !important;
}
html[data-theme="gold"] footer.site {
  background: #0c0802 !important;
  border-top-color: rgba(232, 200, 114, 0.28) !important;
}

.site-foot-band {
  width: 100%;
  padding: 64px clamp(20px, 4vw, 40px) 36px;
  box-sizing: border-box;
}
.site-foot-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.site-foot-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 40px;
}
.site-foot-brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}
.site-foot-brand strong {
  font-family: var(--font-theme-heading, var(--font-display, inherit));
  font-size: 1.35rem;
  color: var(--text-primary);
}
.site-foot-brand small {
  color: var(--muted);
  font-size: 0.95rem;
}
.site-foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 48px;
}
.site-foot-grid h3 {
  font-family: var(--font-theme-mono, var(--font-mono, monospace));
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.site-foot-grid a {
  display: block;
  padding: 5px 0;
  text-decoration: none;
}
.site-foot-rule {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
@media (max-width: 720px) {
  .site-foot-grid { grid-template-columns: 1fr; gap: 28px; }
}
html[data-theme="light"] .site-foot-band {
  background: #eef2f7 !important;
}
html[data-theme="light"] footer.site strong,
html[data-theme="light"] footer.site h3,
html[data-theme="light"] footer.site a,
html[data-theme="light"] .mega-footer-link {
  color: #1f2937 !important;
  text-shadow: none !important;
}
html[data-theme="light"] footer.site small,
html[data-theme="light"] footer.site p {
  color: #4b5563 !important;
}
html[data-theme="light"] .mega-footer-link:hover {
  color: #5b21b6 !important;
}
html[data-theme="light"] footer.site .site-foot-rule {
  border-top-color: rgba(17, 24, 39, 0.1) !important;
}

html[data-theme="light"] .skip-to-content {
  color: #111827;
}

html[data-theme="light"] .btn-share-x {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
}
html[data-theme="light"] .btn-ducky-x {
  background: #fff7ed !important;
  color: #92400e !important;
  border-color: rgba(146, 64, 14, 0.3) !important;
}
html[data-theme="light"] .card-footer {
  border-top-color: rgba(17, 24, 39, 0.08) !important;
}
html[data-theme="light"] .social-hero {
  background: #f7f9fc !important;
}
html[data-theme="light"] .social-hero h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
}
html[data-theme="light"] .social-hero .hero-sub,
html[data-theme="light"] .social-hero p {
  color: #374151 !important;
}
html[data-theme="light"] .reaction-btn {
  background: #f3f4f6 !important;
  color: #1f2937 !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}


/* =============================================================================
   ⚡ ZOTH STUDIO — LIGHT MODE PERFECTION & MOBILE ZERO-OVERFLOW (v4.5 Ultra)
   Guarantees:
     1. Strict WCAG AAA Text-to-Background Contrast across all cards & surfaces
     2. Zero dark-on-dark unreadable text anywhere
     3. Fluid responsive heading typography preventing mobile horizontal overflow
     4. High-contrast terminal & code box rendering
   ============================================================================= */

/* --- 1. Root & Typography Scale Normalization --- */
html[data-theme="light"],
html.theme-light,
body[data-theme="light"],
body.theme-light {
  --bg-surface: #ffffff !important;
  --bg-card: #ffffff !important;
  --bg-card-hover: #f8fafc !important;
  --surface-card: #ffffff !important;
  --border: rgba(17, 24, 39, 0.12) !important;
  --border-bright: rgba(99, 91, 255, 0.4) !important;
  --text-dim: #4b5563 !important;
  --text-secondary: #374151 !important;
  --text-primary: #111827 !important;
  --muted: #4b5563 !important;
  --cyan: #0284c7 !important;
  --purple: #7c3aed !important;
  --emerald: #059669 !important;
  --amber: #d97706 !important;
}

/* Fluid Heading Typography & Mobile Overflow Protection */
html[data-theme="light"] h1,
html[data-theme="light"] .hero-h1,
html[data-theme="light"] .hero-title,
html[data-theme="light"] .studio-title,
html[data-theme="light"] .brand-title,
html[data-theme="light"] .station-title,
html[data-theme="light"] .recon-title h1,
html[data-theme="light"] .card-title,
html[data-theme="light"] .sig-deck-kicker h2 {
  font-family: var(--font-theme-heading, "Plus Jakarta Sans", "Figtree", system-ui, sans-serif) !important;
  font-size: clamp(1.6rem, 4vw, 2.6rem) !important;
  font-weight: 800 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.025em !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  text-shadow: none !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html[data-theme="light"] h2 {
  font-family: var(--font-theme-heading, "Plus Jakarta Sans", "Figtree", system-ui, sans-serif) !important;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
}

html[data-theme="light"] h3 {
  font-family: var(--font-theme-heading, "Plus Jakarta Sans", "Figtree", system-ui, sans-serif) !important;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
}

/* --- 2. Fix All Dark Background Areas on Light Mode --- */

/* Hero banners & studio sections */
html[data-theme="light"] .hero-banner,
html[data-theme="light"] .hero-card,
html[data-theme="light"] .recon-banner,
html[data-theme="light"] .consensus-hero,
html[data-theme="light"] .swarm-hero {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(17, 24, 39, 0.12) !important;
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.05) !important;
  color: #1f2937 !important;
}

/* Interactive Topic buttons, chips & filter pills */
html[data-theme="light"] .topic-btn,
html[data-theme="light"] .topic-bar button,
html[data-theme="light"] .chip,
html[data-theme="light"] .tab-btn,
html[data-theme="light"] .subsweep-tab-btn,
html[data-theme="light"] .tab-btn-inspector,
html[data-theme="light"] .tab-btn-math,
html[data-theme="light"] .tab-btn-proof {
  background: #f3f4f6 !important;
  color: #1f2937 !important;
  border: 1px solid rgba(17, 24, 39, 0.12) !important;
}
html[data-theme="light"] .topic-btn:hover,
html[data-theme="light"] .topic-btn.active,
html[data-theme="light"] .tab-btn.active,
html[data-theme="light"] .subsweep-tab-btn.active,
html[data-theme="light"] .tab-btn-inspector.active,
html[data-theme="light"] .tab-btn-math.active,
html[data-theme="light"] .tab-btn-proof.active {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
}

/* Consensus, Radar, Vault & Studio Panels */
html[data-theme="light"] .consensus-panel,
html[data-theme="light"] .recon-card,
html[data-theme="light"] .polar-radar-box,
html[data-theme="light"] .vault-card,
html[data-theme="light"] .webgen-card,
html[data-theme="light"] .omni-card,
html[data-theme="light"] .card,
html[data-theme="light"] .hud-card,
html[data-theme="light"] .studio-panel,
html[data-theme="light"] .panel {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, 0.1) !important;
  color: #1f2937 !important;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04) !important;
}

/* Telemetry Strips & Metric HUD Bars */
html[data-theme="light"] .telemetry-strip,
html[data-theme="light"] .hud-telemetry-bar,
html[data-theme="light"] .top-bar,
html[data-theme="light"] .stat-pill,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .recon-strip {
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, 0.12) !important;
  color: #111827 !important;
}
html[data-theme="light"] .tel-label,
html[data-theme="light"] .metric-label,
html[data-theme="light"] .stat-lbl,
html[data-theme="light"] .kicker {
  color: #4b5563 !important;
}
html[data-theme="light"] .tel-val,
html[data-theme="light"] .metric-val,
html[data-theme="light"] .stat-num {
  color: #111827 !important;
}

/* Modals, Dialogs & Flyout Sheets */
html[data-theme="light"] dialog,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .dialog-content,
html[data-theme="light"] .sheet,
html[data-theme="light"] .keybind-modal-content {
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid rgba(17, 24, 39, 0.16) !important;
  box-shadow: 0 20px 48px rgba(17, 24, 39, 0.15) !important;
}

/* Terminal & Code Blocks: Dedicated Clean High-Contrast Dark Slate */
html[data-theme="light"] .threat-log,
html[data-theme="light"] .stream-log,
html[data-theme="light"] .terminal-box,
html[data-theme="light"] .code-box,
html[data-theme="light"] .terminal-screen,
html[data-theme="light"] pre.code-block {
  background: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.3) !important;
  color: #f8fafc !important;
}
html[data-theme="light"] .threat-log *,
html[data-theme="light"] .stream-log *,
html[data-theme="light"] .terminal-screen * {
  color: #f8fafc;
}
html[data-theme="light"] .log-time { color: #94a3b8 !important; }
html[data-theme="light"] .log-ok { color: #34d399 !important; }
html[data-theme="light"] .log-warn { color: #fbbf24 !important; }
html[data-theme="light"] .log-crit { color: #f87171 !important; }

/* Inline Code & Badges on Light Surfaces */
html[data-theme="light"] :not(pre) > code,
html[data-theme="light"] kbd {
  background: #f1f5f9 !important;
  color: #4338ca !important;
  border: 1px solid rgba(17, 24, 39, 0.1) !important;
}

/* Mobile Layout Shift & Horizontal Overflow Safeguards */
html[data-theme="light"],
html[data-theme="light"] body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}
