/* NODERVA V16 — single matte crimson system, loaded after every legacy layer. */
:root {
  --matte-black: #070606;
  --matte-black-2: #0e0b0c;
  --matte-black-3: #171113;
  --matte-red: #a42a36;
  --matte-red-dark: #771e28;
  --matte-red-deep: #3e1117;
  --matte-red-soft: #c1646d;
  --matte-red-pale: #dba4a9;
  --matte-white: #f1eaea;
  --red: var(--matte-red);
  --red-dark: var(--matte-red-dark);
  --red-deep: var(--matte-red-deep);
  --red-soft: #eee1e2;
  --v3-red: var(--matte-red);
  --v3-red-dark: var(--matte-red-dark);
  --core-red: var(--matte-red);
  --core-red-bright: var(--matte-red-soft);
  --web-red: var(--matte-red);
  --web-red-hot: var(--matte-red-soft);
  --prey-red: var(--matte-red);
  --prey-hot: var(--matte-red-soft);
  accent-color: var(--matte-red);
}

::selection { color: var(--matte-white); background: var(--matte-red); }

:root[data-theme="dark"] {
  --theme-bg: var(--matte-black);
  --theme-surface: var(--matte-black-2);
  --theme-surface-2: var(--matte-black-3);
  --theme-text: var(--matte-white);
  --theme-muted: #a99c9e;
  --theme-line: rgba(219,164,169,.15);
  --theme-header: rgba(7,6,6,.97);
}

:root[data-theme="light"] {
  --theme-bg: #eee9e8;
  --theme-surface: #f5f0ef;
  --theme-surface-2: #e5dddc;
  --theme-text: #171113;
  --theme-muted: #685b5d;
  --theme-line: rgba(119,30,40,.2);
  --theme-header: rgba(238,233,232,.97);
}

/* Large signal areas are deliberately flat: no glossy red gradients. */
.section-red,
.network-section,
.v3-closing,
.quote-band,
.impact-section,
.cta-panel,
.contact-signal-strip,
.engine-stream,
.v3-ticker,
.stats-band .stat-cell:nth-child(2),
html[data-theme] .section.section-red,
html[data-theme] .network-section,
html[data-theme] .v3-closing,
html[data-theme] .quote-band,
html[data-theme] .impact-section,
html[data-theme] .cta-panel,
html[data-theme] .mobile-panel {
  background-color: var(--matte-red-dark) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.footer-redline,
.page-hero-stripe,
.signal-label i,
.method-line i::after,
.capability-dot i,
.status-dot,
.web-heart::before,
.web-heart::after {
  background-color: var(--matte-red) !important;
  box-shadow: none !important;
}

.eyebrow.red,
.v3-kicker,
.v3-section-head > span,
.v3-section-head > a,
.service-number,
.method-line span,
.capability-list span,
.text-link,
.card-link,
.story-note,
.spider-caption i,
.prey-inspector strong,
.sponsor-count strong {
  color: var(--matte-red-soft) !important;
  text-shadow: none !important;
}

/* Buttons keep strong contrast but share one matte red family. */
.button:not(.button-light):not(.button-outline),
.v3-button.primary,
.button.nav-cta,
.menu-button,
.service-icon {
  color: var(--matte-white) !important;
  background: var(--matte-red) !important;
  border-color: var(--matte-red-soft) !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.button:not(.button-light):not(.button-outline):hover,
.v3-button.primary:hover,
.button.nav-cta:hover,
.menu-button:hover,
.service-card:hover .service-icon {
  color: var(--matte-red-pale) !important;
  background: var(--matte-red-deep) !important;
  border-color: var(--matte-red-soft) !important;
}

.button-outline,
.v3-button.ghost,
.theme-toggle,
.project-filters button,
.card-link,
.text-link,
.text-link.light,
.manifesto-cta {
  color: var(--matte-red-soft) !important;
  background: var(--matte-black-2) !important;
  border-color: var(--matte-red) !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.button-outline:hover,
.v3-button.ghost:hover,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.project-filters button:hover,
.project-filters button.active,
.card-link:hover,
.text-link:hover,
.manifesto-cta:hover {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
  border-color: var(--matte-red-soft) !important;
}

.button-light,
.v3-button.light {
  color: var(--matte-red-deep) !important;
  background: var(--matte-red-pale) !important;
  border-color: var(--matte-red-pale) !important;
  box-shadow: none !important;
}

.manifesto-cta b {
  color: var(--matte-white) !important;
  background: var(--matte-red) !important;
  box-shadow: none !important;
}

/* Spider/service hero: matte red rings and nodes, without neon bloom. */
.engine-aura,
.global-glow { opacity: .18 !important; filter: none !important; }

.prey-stage::after {
  background: radial-gradient(circle at 50% 47%,rgba(164,42,54,.09),transparent 13%,rgba(119,30,40,.025) 38%,transparent 70%),repeating-radial-gradient(circle at 50% 47%,transparent 0 45px,rgba(255,255,255,.022) 46px 47px) !important;
  box-shadow: none !important;
}

.prey-orb,
.web-node,
.web-heart,
.strand-tag,
.spider-status,
.spider-caption,
.prey-inspector,
.orb-components i {
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.prey-orb {
  background: var(--matte-black-2) !important;
  border-color: rgba(193,100,109,.4) !important;
}

.prey-orb:hover,
.prey-orb.is-active,
.web-node.is-active {
  background: var(--matte-red-deep) !important;
  border-color: var(--matte-red-soft) !important;
}

.orb-components i {
  color: var(--matte-red-pale) !important;
  background: var(--matte-black) !important;
  border-color: rgba(193,100,109,.32) !important;
}

.prey-inspector {
  background: rgba(7,6,6,.96) !important;
  border-color: rgba(193,100,109,.42) !important;
}

.code-spider,
.code-spider span { filter: none !important; box-shadow: none !important; }
.code-spider span { background: var(--matte-red-soft) !important; }

/* Animated capability fill remains fluid, but now reads as matte ink. */
.discipline-band > div::before {
  background: var(--matte-red) !important;
  box-shadow: none !important;
}
.discipline-band > div::after {
  background: var(--matte-red-soft) !important;
  box-shadow: none !important;
}
.discipline-band > div:hover {
  border-color: var(--matte-red-soft) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.32) !important;
}
.discipline-band > div > span { color: var(--matte-red-soft) !important; text-shadow: none !important; }

.capability-table,
.capability-row,
.capability-row:not(.head):hover,
.capability-dot i { box-shadow: none !important; }
.capability-row.head,
.capability-row:not(.head)::before {
  background: var(--matte-red-dark) !important;
  background-image: none !important;
}
.capability-row:not(.head)::after,
.capability-dot i {
  background: var(--matte-red) !important;
  border-color: var(--matte-red) !important;
}

/* Cards, tags, forms, project details and sponsors use the same matte signal. */
.service-outputs span,
html[data-theme="dark"] .service-outputs span,
.concept-badge,
.project-tag,
.strand-tag {
  color: var(--matte-red-pale) !important;
  background: var(--matte-red-deep) !important;
  border-color: rgba(193,100,109,.3) !important;
  box-shadow: none !important;
}

.contact-form,
.service-card,
.project-card,
.team-card { border-color: var(--matte-red) !important; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--matte-red) !important;
  box-shadow: 0 0 0 2px rgba(164,42,54,.16) !important;
}

.sponsor-section { --section-red: var(--matte-red); }
.sponsor-featured {
  background: var(--matte-red-dark) !important;
  background-image: none !important;
  box-shadow: none !important;
}
.sponsor-card,
.sponsor-symbol,
.sponsor-symbol::before,
.sponsor-symbol::after,
.sponsor-symbol i { box-shadow: none !important; filter: none !important; }

.whatsapp-float { box-shadow: 0 12px 30px rgba(0,0,0,.25) !important; }

html[data-theme="light"] .button-outline,
html[data-theme="light"] .v3-button.ghost,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .project-filters button,
html[data-theme="light"] .card-link,
html[data-theme="light"] .text-link,
html[data-theme="light"] .manifesto-cta {
  color: var(--matte-red-dark) !important;
  background: #f1eaea !important;
  border-color: var(--matte-red) !important;
}

html[data-theme="light"] .button-outline:hover,
html[data-theme="light"] .v3-button.ghost:hover,
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .project-filters button:hover,
html[data-theme="light"] .project-filters button.active,
html[data-theme="light"] .card-link:hover,
html[data-theme="light"] .text-link:hover,
html[data-theme="light"] .manifesto-cta:hover {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
}

@media (prefers-reduced-motion: reduce) {
  .signal-label i,
  .capability-dot i { box-shadow: none !important; }
}

/* --------------------------------------------------------------------------
   NODERVA V17 — complete light-theme surface and contrast pass
   This file is loaded last, so every light override intentionally lives here.
   -------------------------------------------------------------------------- */
html[data-theme="light"],
html[data-theme="light"] body {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] .site-header {
  background: rgba(238,233,232,.96) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-line) !important;
  box-shadow: 0 14px 40px rgba(62,17,23,.06) !important;
}
html[data-theme="light"] .brand b,
html[data-theme="light"] .brand small,
html[data-theme="light"] .desktop-nav a,
html[data-theme="light"] .language-control,
html[data-theme="light"] .language-control select,
html[data-theme="light"] .theme-toggle-label,
html[data-theme="light"] .menu-toggle {
  color: var(--theme-text) !important;
}
html[data-theme="light"] .language-control,
html[data-theme="light"] .language-control select,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .menu-toggle {
  background: var(--theme-surface) !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="light"] .language-control select option {
  color: var(--theme-text) !important;
  background: var(--theme-surface) !important;
}

html[data-theme="light"] .section,
html[data-theme="light"] .manifesto-section,
html[data-theme="light"] .capability-section,
html[data-theme="light"] .method-section,
html[data-theme="light"] .v3-ecosystem,
html[data-theme="light"] .ecosystem-shell,
html[data-theme="light"] .sponsor-section,
html[data-theme="light"] .project-detail-page,
html[data-theme="light"] .page-shell {
  background-color: var(--theme-bg) !important;
  color: var(--theme-text) !important;
}
html[data-theme="light"] .section-soft,
html[data-theme="light"] .section-alt {
  background: var(--theme-surface-2) !important;
  color: var(--theme-text) !important;
}
html[data-theme="light"] .section-dark:not(.impact-section):not(.signal-section):not(.red-hero) {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}

/* Home hero and the interactive web become a true light canvas. */
html[data-theme="light"] .engine-hero,
html[data-theme="light"] .neural-hero,
html[data-theme="light"] .global-hero {
  background:
    linear-gradient(90deg, rgba(238,233,232,.99) 0%, rgba(238,233,232,.96) 38%, rgba(238,233,232,.52) 62%, rgba(238,233,232,.12) 100%),
    radial-gradient(circle at 82% 28%, rgba(164,42,54,.14), transparent 40%),
    var(--theme-bg) !important;
  color: var(--theme-text) !important;
}
html[data-theme="light"] .engine-copy h1,
html[data-theme="light"] .global-copy h1,
html[data-theme="light"] .engine-copy p,
html[data-theme="light"] .global-copy p,
html[data-theme="light"] .engine-kicker,
html[data-theme="light"] .v3-kicker,
html[data-theme="light"] .engine-index,
html[data-theme="light"] .engine-index b,
html[data-theme="light"] .engine-index small {
  color: var(--theme-text) !important;
}
html[data-theme="light"] .engine-copy h1 .accent,
html[data-theme="light"] .global-copy h1 .accent,
html[data-theme="light"] .engine-kicker i,
html[data-theme="light"] .v3-kicker i {
  color: var(--matte-red) !important;
}
html[data-theme="light"] .engine-copy p,
html[data-theme="light"] .global-copy p,
html[data-theme="light"] .engine-index small {
  color: var(--theme-muted) !important;
}
html[data-theme="light"] .engine-grid,
html[data-theme="light"] .global-grid {
  border-color: rgba(119,30,40,.11) !important;
}

html[data-theme="light"] .prey-stage::before {
  background: radial-gradient(circle at 50% 50%, rgba(164,42,54,.12), transparent 63%) !important;
}
html[data-theme="light"] .prey-stage::after {
  background:
    repeating-radial-gradient(circle at center, transparent 0 49px, rgba(119,30,40,.11) 50px 51px),
    repeating-conic-gradient(from 0deg, rgba(119,30,40,.09) 0deg .7deg, transparent .7deg 30deg) !important;
  opacity: .92 !important;
}
html[data-theme="light"] .prey-orb {
  color: var(--theme-text) !important;
  background: rgba(245,240,239,.97) !important;
  border-color: rgba(119,30,40,.32) !important;
  box-shadow: 0 18px 42px rgba(62,17,23,.10) !important;
}
html[data-theme="light"] .prey-orb:hover,
html[data-theme="light"] .prey-orb.is-active {
  color: var(--theme-text) !important;
  background: #eadcdd !important;
  border-color: var(--matte-red) !important;
}
html[data-theme="light"] .prey-orb strong,
html[data-theme="light"] .prey-orb small,
html[data-theme="light"] .prey-orb b {
  color: inherit !important;
}
html[data-theme="light"] .orb-components i {
  color: #5d2028 !important;
  background: #fbf7f6 !important;
  border-color: rgba(119,30,40,.24) !important;
}
html[data-theme="light"] .prey-inspector {
  color: var(--theme-text) !important;
  background: rgba(245,240,239,.97) !important;
  border-color: rgba(119,30,40,.30) !important;
  box-shadow: 0 20px 45px rgba(62,17,23,.11) !important;
}
html[data-theme="light"] .prey-inspector strong { color: var(--matte-red-dark) !important; }
html[data-theme="light"] .prey-inspector p,
html[data-theme="light"] .prey-inspector small,
html[data-theme="light"] .prey-inspector span { color: var(--theme-muted) !important; }

/* Compatibility surfaces for the earlier map/web variants still used by pages. */
html[data-theme="light"] .neural-hub,
html[data-theme="light"] .spider-center,
html[data-theme="light"] .web-heart {
  color: var(--theme-text) !important;
  background: radial-gradient(circle, #fbf7f6 0 42%, #e8d9db 72%, rgba(164,42,54,.12) 100%) !important;
  border-color: rgba(119,30,40,.34) !important;
  box-shadow: 0 18px 46px rgba(62,17,23,.12) !important;
}
html[data-theme="light"] .neural-hub strong,
html[data-theme="light"] .neural-hub small,
html[data-theme="light"] .spider-center strong,
html[data-theme="light"] .spider-center small,
html[data-theme="light"] .web-heart strong,
html[data-theme="light"] .web-heart small { color: var(--theme-text) !important; }
html[data-theme="light"] .web-node,
html[data-theme="light"] .core-node,
html[data-theme="light"] .web-card,
html[data-theme="light"] .web-readout,
html[data-theme="light"] .core-module,
html[data-theme="light"] .core-readout,
html[data-theme="light"] .spider-status,
html[data-theme="light"] .spider-caption {
  color: var(--theme-text) !important;
  background: rgba(245,240,239,.96) !important;
  border-color: rgba(119,30,40,.26) !important;
  box-shadow: 0 12px 30px rgba(62,17,23,.08) !important;
}
html[data-theme="light"] .web-node.is-active {
  background: #eadcdd !important;
  border-color: var(--matte-red) !important;
}
html[data-theme="light"] .core-node,
html[data-theme="light"] .core-module,
html[data-theme="light"] .core-readout,
html[data-theme="light"] .core-node strong,
html[data-theme="light"] .core-module strong,
html[data-theme="light"] .core-readout strong { color: var(--theme-text) !important; }
html[data-theme="light"] .strand-tag,
html[data-theme="light"] .project-tech-badge,
html[data-theme="light"] .service-outputs span,
html[data-theme="light"] .project-tag {
  color: var(--matte-red-dark) !important;
  background: #eadcdd !important;
  border-color: rgba(119,30,40,.23) !important;
}

/* Every ordinary card, table cell and form field gets a light material surface. */
html[data-theme="light"] .service-card,
html[data-theme="light"] .services-grid .service-card:nth-child(6),
html[data-theme="light"] .project-card,
html[data-theme="light"] .team-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .faq-item,
html[data-theme="light"] .contact-form,
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .project-filters button,
html[data-theme="light"] .tech-item,
html[data-theme="light"] .module-grid article,
html[data-theme="light"] .culture-list article,
html[data-theme="light"] .roadmap article,
html[data-theme="light"] .model-grid article,
html[data-theme="light"] .founder-mini,
html[data-theme="light"] .project-shot,
html[data-theme="light"] .sponsor-card,
html[data-theme="light"] .discipline-band > div,
html[data-theme="light"] .capability-row:not(.head) {
  color: var(--theme-text) !important;
  background: var(--theme-surface) !important;
  background-image: none !important;
  border-color: var(--theme-line) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .service-card:hover,
html[data-theme="light"] .contact-card:hover {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
  border-color: var(--matte-red-dark) !important;
}
html[data-theme="light"] .service-card:hover p,
html[data-theme="light"] .service-card:hover h3,
html[data-theme="light"] .service-card:hover .card-link,
html[data-theme="light"] .contact-card:hover p,
html[data-theme="light"] .contact-card:hover h3 { color: var(--matte-white) !important; }
html[data-theme="light"] .project-card:hover,
html[data-theme="light"] .team-card:hover,
html[data-theme="light"] .sponsor-card:hover {
  background: #eadcdd !important;
  border-color: var(--matte-red) !important;
}
html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder { color: #8a777a !important; }

html[data-theme="light"] .method-visual {
  background: #e7dddc !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="light"] .contact-signal-strip {
  color: var(--theme-text) !important;
  background: var(--theme-surface-2) !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="light"] .contact-signal-strip strong,
html[data-theme="light"] .contact-signal-strip span { color: var(--theme-text) !important; }
html[data-theme="light"] .contact-signal-strip small { color: var(--theme-muted) !important; }

html[data-theme="light"] .hero-code {
  color: var(--theme-text) !important;
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-line) !important;
  box-shadow: 10px 10px 0 rgba(119,30,40,.12) !important;
}
html[data-theme="light"] .page-hero,
html[data-theme="light"] .project-detail-hero {
  color: var(--theme-text) !important;
  background:
    radial-gradient(circle at 85% 12%, rgba(164,42,54,.13), transparent 34%),
    linear-gradient(135deg, var(--theme-bg), var(--theme-surface-2)) !important;
}
html[data-theme="light"] .detail-hero-grid p,
html[data-theme="light"] .page-hero p { color: var(--theme-muted) !important; }
html[data-theme="light"] .detail-hero-meta {
  color: var(--theme-text) !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="light"] .project-showcase {
  background: linear-gradient(var(--theme-surface-2) 0 155px, var(--theme-bg) 155px) !important;
}
html[data-theme="light"] .concept-notice {
  background: #e7d6d8 !important;
  border-color: var(--theme-line) !important;
}

/* Deliberate signal bands remain red in both themes. */
html[data-theme="light"] .red-hero,
html[data-theme="light"] .impact-section,
html[data-theme="light"] .signal-section,
html[data-theme="light"] .capability-row.head,
html[data-theme="light"] .lab-note,
html[data-theme="light"] .project-pagination,
html[data-theme="light"] .sponsor-featured,
html[data-theme="light"] .site-footer {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
  background-image: none !important;
}
html[data-theme="light"] .red-hero p,
html[data-theme="light"] .impact-section p,
html[data-theme="light"] .signal-section p,
html[data-theme="light"] .lab-note p,
html[data-theme="light"] .site-footer p,
html[data-theme="light"] .site-footer a { color: rgba(241,234,234,.78) !important; }
html[data-theme="light"] .sponsor-featured,
html[data-theme="light"] .sponsor-featured strong,
html[data-theme="light"] .sponsor-featured span,
html[data-theme="light"] .sponsor-featured p { color: var(--matte-white) !important; }

/* Legacy route console and status widgets no longer stay black in light mode. */
html[data-theme="light"] .route-console-section,
html[data-theme="light"] .flight-console,
html[data-theme="light"] .hero-status-bar {
  color: var(--theme-text) !important;
  background: rgba(245,240,239,.96) !important;
  border-color: var(--theme-line) !important;
  box-shadow: 0 16px 38px rgba(62,17,23,.08) !important;
}
html[data-theme="light"] .console-head,
html[data-theme="light"] .route-row,
html[data-theme="light"] .hero-status-bar div { border-color: var(--theme-line) !important; }
html[data-theme="light"] .console-head b,
html[data-theme="light"] .route-row b,
html[data-theme="light"] .hero-status-bar strong { color: var(--theme-text) !important; }
html[data-theme="light"] .route-row small,
html[data-theme="light"] .console-foot,
html[data-theme="light"] .hero-status-bar span,
html[data-theme="light"] .global-coordinates { color: var(--theme-muted) !important; }
html[data-theme="light"] .route-row i { background: rgba(119,30,40,.24) !important; }

html[data-theme="light"] .stats-band {
  color: var(--theme-text) !important;
  background: var(--theme-surface) !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="light"] .stats-band > div { border-color: var(--theme-line) !important; }
html[data-theme="light"] .stats-band > div:nth-child(2) {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
}
html[data-theme="light"] .whatsapp-label {
  color: var(--matte-white) !important;
  background: var(--matte-red-dark) !important;
}

@media (max-width: 980px) {
  html[data-theme="light"] .mobile-panel {
    color: var(--matte-white) !important;
    background: var(--matte-red-dark) !important;
    background-image: linear-gradient(155deg, var(--matte-red-dark), #50151d) !important;
  }
  html[data-theme="light"] .mobile-panel a,
  html[data-theme="light"] .mobile-panel .brand b,
  html[data-theme="light"] .mobile-panel .brand small,
  html[data-theme="light"] .mobile-panel .theme-toggle-label,
  html[data-theme="light"] .mobile-panel .language-control,
  html[data-theme="light"] .mobile-panel .language-control select {
    color: var(--matte-white) !important;
  }
  html[data-theme="light"] .mobile-panel .language-control,
  html[data-theme="light"] .mobile-panel .language-control select,
  html[data-theme="light"] .mobile-panel .theme-toggle,
  html[data-theme="light"] .mobile-panel-head button {
    background: rgba(62,17,23,.20) !important;
    border-color: rgba(241,234,234,.46) !important;
  }
  html[data-theme="light"] .mobile-panel .language-control select option {
    color: var(--theme-text) !important;
    background: var(--theme-surface) !important;
  }
}
