/* NODERVA dual-theme layer — loaded after every visual stylesheet. */
:root[data-theme="dark"] {
  --theme-bg: #080809;
  --theme-surface: #111113;
  --theme-surface-2: #171719;
  --theme-text: #f8f7f5;
  --theme-muted: #aaa5a5;
  --theme-line: rgba(255,255,255,.14);
  --theme-header: rgba(8,8,9,.93);
}

:root[data-theme="light"] {
  --theme-bg: #ffffff;
  --theme-surface: #eee1e2;
  --theme-surface-2: #eee1e2;
  --theme-text: #171415;
  --theme-muted: #6f6668;
  --theme-line: rgba(119,30,40,.17);
  --theme-header: rgba(255,255,255,.94);
}

html[data-theme] body,
html[data-theme] .site-header,
html[data-theme] .section,
html[data-theme] .section-soft,
html[data-theme] .service-card,
html[data-theme] .project-card,
html[data-theme] .team-card,
html[data-theme] .contact-form,
html[data-theme] .field input,
html[data-theme] .field select,
html[data-theme] .field textarea,
html[data-theme] .tech-item,
html[data-theme] .founder-mini,
html[data-theme] .module-grid article,
html[data-theme] .project-filters button {
  transition: background-color .42s ease, color .42s ease, border-color .42s ease, box-shadow .42s ease;
}

.theme-toggle {
  position: relative;
  height: 44px;
  min-width: 84px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(164,42,54,.42);
  background: transparent;
  color: var(--red);
  cursor: pointer;
  overflow: hidden;
  font: 700 9px/1 var(--mono);
  letter-spacing: .06em;
  transition: color .25s, background .25s, border-color .25s, transform .25s;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(.35);
  transition: transform .28s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  outline: none;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
}

.theme-toggle:hover::before,
.theme-toggle:focus-visible::before { transform: scaleX(1); background: #fff; }
.theme-toggle-icon { width: 17px; height: 17px; display: grid; place-items: center; }
.theme-toggle-icon svg { width: 17px; height: 17px; }
.theme-switching .theme-toggle-icon { animation: theme-icon-turn .48s cubic-bezier(.2,.8,.2,1); }

.discipline-orbit b.discipline-logo {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0;
  filter: drop-shadow(0 0 10px rgba(164,42,54,.38));
  animation: discipline-logo-pulse 3.2s ease-in-out infinite;
}

.discipline-logo img {
  width: 92%;
  height: 92%;
  display: block;
  object-fit: contain;
  background: transparent;
}

/* Center every discipline label directly on the rotating outer ring. */
.discipline-orbit > span {
  right: auto !important;
  bottom: auto !important;
  z-index: 3;
  width: 92px;
  height: 32px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  translate: -50% -50%;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  transform-origin: center;
}
.discipline-orbit span:nth-child(1) { left: 50%; top: 0; }
.discipline-orbit span:nth-child(2) { left: 85.355%; top: 14.645%; }
.discipline-orbit span:nth-child(3) { left: 100%; top: 50%; }
.discipline-orbit span:nth-child(4) { left: 85.355%; top: 85.355%; }
.discipline-orbit span:nth-child(5) { left: 50%; top: 100%; }
.discipline-orbit span:nth-child(6) { left: 14.645%; top: 85.355%; }
.discipline-orbit span:nth-child(7) { left: 0; top: 50%; }
.discipline-orbit span:nth-child(8) { left: 14.645%; top: 14.645%; }

@keyframes theme-icon-turn {
  50% { transform: rotate(130deg) scale(.55); opacity: .25; }
  100% { transform: rotate(260deg) scale(1); opacity: 1; }
}

@keyframes discipline-logo-pulse {
  50% { filter: drop-shadow(0 0 19px rgba(164,42,54,.62)); transform: translate(-50%,-50%) scale(1.055); }
}

/* Dark theme: black surfaces, white type, red signals. */
html[data-theme="dark"],
html[data-theme="dark"] body { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] body:not(.v3-home) .site-header,
html[data-theme="dark"] .v3-home .site-header,
html[data-theme="dark"] .site-header {
  background: var(--theme-header);
  color: var(--theme-text);
  border-color: var(--theme-line);
}
html[data-theme="dark"] .site-header .brand b,
html[data-theme="dark"] .site-header .desktop-nav a:hover { color: #fff; }
html[data-theme="dark"] .language-control { border-color: var(--theme-line); }
html[data-theme="dark"] .language-control select { color: #fff; }
html[data-theme="dark"] .language-control option { color: #111; background: #fff; }
html[data-theme="dark"] .theme-toggle { background: rgba(164,42,54,.06); }

html[data-theme="dark"] .section,
html[data-theme="dark"] .manifesto-section,
html[data-theme="dark"] .capability-section,
html[data-theme="dark"] .method-section,
html[data-theme="dark"] .v3-ecosystem,
html[data-theme="dark"] .ecosystem-shell { background-color: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] .section-soft { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .manifesto-columns p,
html[data-theme="dark"] .capability-list p,
html[data-theme="dark"] .method-line p,
html[data-theme="dark"] .ecosystem-heading p,
html[data-theme="dark"] .ecosystem-note,
html[data-theme="dark"] .service-card p,
html[data-theme="dark"] .project-card p,
html[data-theme="dark"] .team-card p,
html[data-theme="dark"] .team-card small,
html[data-theme="dark"] .culture-list p,
html[data-theme="dark"] .faq-item p,
html[data-theme="dark"] .legal-shell p,
html[data-theme="dark"] .legal-shell li,
html[data-theme="dark"] .two-column-story p,
html[data-theme="dark"] .roadmap p,
html[data-theme="dark"] .form-note,
html[data-theme="dark"] .check-field { color: var(--theme-muted); }

html[data-theme="dark"] .service-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .founder-mini,
html[data-theme="dark"] .model-grid article,
html[data-theme="dark"] .culture-list article,
html[data-theme="dark"] .module-grid article,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .roadmap article {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-line);
}

html[data-theme="dark"] .service-card:hover,
html[data-theme="dark"] .contact-card:hover { background: var(--red); color: #fff; }
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .project-filters button,
html[data-theme="dark"] .tech-item,
html[data-theme="dark"] .service-nav a {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-line);
}
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .field textarea::placeholder { color: #827b7c; }
html[data-theme="dark"] .story-note,
html[data-theme="dark"] .online-note,
html[data-theme="dark"] .concept-notice { background: #2f0d12; border-color: rgba(164,42,54,.45); }
html[data-theme="dark"] .online-note strong,
html[data-theme="dark"] .story-note { color: #c1646d; }
html[data-theme="dark"] .capability-row { border-color: var(--theme-line); }
html[data-theme="dark"] .capability-row:not(.head) { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="dark"] .capability-row > div { border-color: var(--theme-line); }
html[data-theme="dark"] .project-showcase { background: linear-gradient(var(--red) 0 155px,var(--theme-bg) 155px); }
html[data-theme="dark"] .project-shot { background: var(--theme-surface); }
html[data-theme="dark"] .discipline-orbit span { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] .vertical-word { color: rgba(255,255,255,.08); }
html[data-theme="dark"] .capability-list,
html[data-theme="dark"] .capability-list > a,
html[data-theme="dark"] .method-line,
html[data-theme="dark"] .method-line article { border-color: var(--theme-line); }
html[data-theme="dark"] .section.section-red,
html[data-theme="dark"] .network-section,
html[data-theme="dark"] .v3-closing,
html[data-theme="dark"] .quote-band,
html[data-theme="dark"] .impact-section,
html[data-theme="dark"] .cta-panel { background: var(--red); color: #fff; }
html[data-theme="dark"] .service-card:hover p { color: rgba(255,255,255,.78); }

/* Light theme: white canvas, red architecture, dark readable type. */
html[data-theme="light"],
html[data-theme="light"] body { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="light"] body:not(.v3-home) .site-header,
html[data-theme="light"] .v3-home .site-header,
html[data-theme="light"] .site-header {
  background: var(--theme-header);
  color: var(--theme-text);
  border-color: var(--theme-line);
  box-shadow: 0 10px 35px rgba(86,22,30,.055);
}
html[data-theme="light"] .site-header .brand b,
html[data-theme="light"] .site-header .desktop-nav a:hover { color: var(--theme-text); }
html[data-theme="light"] .language-control { border-color: var(--theme-line); }
html[data-theme="light"] body .site-header .language-control select { color: #111; }
html[data-theme="light"] body .site-header .language-control option { color: #111; background: #fff; }
html[data-theme="light"] .theme-toggle { background: #eee1e2; }

html[data-theme="light"] .engine-hero,
html[data-theme="light"] .neural-hero { background: #fff; color: var(--theme-text); }
html[data-theme="light"] .neural-hero::before,
html[data-theme="light"] .engine-hero::before {
  background:
    linear-gradient(90deg,rgba(255,255,255,.99) 0%,rgba(255,255,255,.96) 35%,rgba(255,255,255,.62) 59%,rgba(238,225,226,.88) 100%),
    radial-gradient(circle at 78% 44%,rgba(164,42,54,.18),transparent 42%);
}
html[data-theme="light"] .engine-grid {
  opacity: .72;
  background-image: linear-gradient(rgba(119,30,40,.075) 1px,transparent 1px),linear-gradient(90deg,rgba(119,30,40,.075) 1px,transparent 1px);
}
html[data-theme="light"] .engine-kicker,
html[data-theme="light"] .engine-copy > p { color: #6d6264; }
html[data-theme="light"] .engine-copy h1 span { color: #171415; }
html[data-theme="light"] .engine-proof > span { border-color: rgba(119,30,40,.17); background: rgba(255,255,255,.68); }
html[data-theme="light"] .engine-proof small { color: #6d6264; }
html[data-theme="light"] .v3-button.ghost { color: var(--theme-text); border-color: rgba(119,30,40,.25); background: rgba(255,255,255,.78); }
html[data-theme="light"] .v3-button.ghost:hover { background: var(--red); color: #fff; border-color: var(--red); }

html[data-theme="light"] .prey-stage::before { color: rgba(86,22,30,.48); }
html[data-theme="light"] .prey-stage::after {
  background: radial-gradient(circle at 50% 47%,rgba(164,42,54,.15),transparent 13%,rgba(164,42,54,.035) 38%,transparent 70%),repeating-radial-gradient(circle at 50% 47%,transparent 0 45px,rgba(119,30,40,.055) 46px 47px);
  box-shadow: inset 0 0 100px rgba(119,30,40,.07);
}
html[data-theme="light"] .prey-orb {
  border-color: rgba(119,30,40,.32);
  background: radial-gradient(circle at 34% 27%,#fff,transparent 13%),radial-gradient(circle at 50% 48%,#eee1e2,#eee1e2 55%,#fff 78%);
  color: var(--theme-text);
  box-shadow: 0 0 0 8px rgba(164,42,54,.035),0 18px 44px rgba(86,22,30,.13),inset 0 0 38px rgba(164,42,54,.09);
}
html[data-theme="light"] .prey-orb::before { border-color: rgba(119,30,40,.16); }
html[data-theme="light"] .prey-orb::after { border-color: rgba(164,42,54,.2); }
html[data-theme="light"] .prey-orb > strong { color: #2f0d12; text-shadow: 0 2px 12px rgba(255,255,255,.9); }
html[data-theme="light"] .prey-orb > small,
html[data-theme="light"] .orb-number { color: rgba(86,22,30,.48); }
html[data-theme="light"] .orb-components i {
  border-color: rgba(119,30,40,.28);
  background: rgba(255,255,255,.94);
  color: #56161e;
  box-shadow: 0 4px 12px rgba(86,22,30,.1),0 0 12px rgba(164,42,54,.08);
}
html[data-theme="light"] .prey-orb.is-active .orb-components i,
html[data-theme="light"] .prey-orb:hover .orb-components i { color: #fff; background: var(--red-dark); }
html[data-theme="light"] .prey-inspector {
  background: rgba(255,255,255,.94);
  border-color: rgba(164,42,54,.52);
  box-shadow: 0 18px 48px rgba(86,22,30,.14),0 0 25px rgba(164,42,54,.08);
}
html[data-theme="light"] .prey-inspector > span,
html[data-theme="light"] .prey-inspector small { color: #77696b; }
html[data-theme="light"] .prey-inspector p { color: #4f4446; }

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 { background-color: var(--theme-bg); color: var(--theme-text); }
html[data-theme="light"] .section-soft { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="light"] .page-hero,
html[data-theme="light"] .project-detail-hero {
  background: linear-gradient(125deg,#fff 0%,#fff 58%,#eee1e2 100%);
  color: var(--theme-text);
}
html[data-theme="light"] .page-hero::before { background: linear-gradient(120deg,transparent 0 52%,rgba(164,42,54,.08) 52% 53%,transparent 53% 59%,rgba(164,42,54,.22) 59% 60%,transparent 60%); }
html[data-theme="light"] .page-hero h1 { color: var(--theme-text); }
html[data-theme="light"] .page-hero p,
html[data-theme="light"] .detail-hero-grid p { color: var(--theme-muted); }
html[data-theme="light"] .page-hero-aside,
html[data-theme="light"] .detail-hero-meta { border-color: var(--red); }
html[data-theme="light"] .eyebrow.light { color: var(--red); }

html[data-theme="light"] .section-dark,
html[data-theme="light"] .team-signal-section {
  background: var(--theme-surface);
  color: var(--theme-text);
}
html[data-theme="light"] .section-dark .section-heading p,
html[data-theme="light"] .team-signal-grid > div:last-child p { color: var(--theme-muted); }
html[data-theme="light"] .v3-kicker.light { color: var(--red); }
html[data-theme="light"] .discipline-orbit { border-color: rgba(164,42,54,.3); }
html[data-theme="light"] .discipline-orbit::before,
html[data-theme="light"] .discipline-orbit::after { border-color: rgba(164,42,54,.17); }
html[data-theme="light"] .discipline-orbit span { background: #fff; color: var(--theme-text); border-color: rgba(164,42,54,.22); }
html[data-theme="light"] .section.section-red,
html[data-theme="light"] .network-section,
html[data-theme="light"] .v3-closing,
html[data-theme="light"] .quote-band,
html[data-theme="light"] .impact-section,
html[data-theme="light"] .cta-panel { background: var(--red); color: #fff; }
html[data-theme="light"] .section-dark .process-card { border-color: rgba(164,42,54,.2); }
html[data-theme="light"] .section-dark .process-card > span,
html[data-theme="light"] .section-dark .process-card p { color: var(--theme-muted); }
html[data-theme="light"] .section-dark .process-card i { background: rgba(164,42,54,.14); }
html[data-theme="light"] .section-dark .process-card i::after { background: var(--red); }
html[data-theme="light"] .discipline-band div { border-color: rgba(164,42,54,.2); }

html[data-theme="light"] .service-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .team-card,
html[data-theme="light"] .founder-mini,
html[data-theme="light"] .model-grid article,
html[data-theme="light"] .culture-list article,
html[data-theme="light"] .module-grid article,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .roadmap article {
  background: #fff;
  color: var(--theme-text);
  border-color: var(--theme-line);
}
html[data-theme="light"] .service-card:hover,
html[data-theme="light"] .contact-card:hover { background: var(--red); color: #fff; }
html[data-theme="light"] .service-card:hover p { color: rgba(255,255,255,.8); }
html[data-theme="light"] .section-heading p,
html[data-theme="light"] .manifesto-columns p,
html[data-theme="light"] .capability-list p,
html[data-theme="light"] .method-line p,
html[data-theme="light"] .ecosystem-heading p,
html[data-theme="light"] .ecosystem-note,
html[data-theme="light"] .service-card p,
html[data-theme="light"] .project-card p,
html[data-theme="light"] .team-card p,
html[data-theme="light"] .team-card small,
html[data-theme="light"] .culture-list p,
html[data-theme="light"] .faq-item p,
html[data-theme="light"] .legal-shell p,
html[data-theme="light"] .legal-shell li,
html[data-theme="light"] .two-column-story p,
html[data-theme="light"] .roadmap p,
html[data-theme="light"] .form-note,
html[data-theme="light"] .check-field { color: var(--theme-muted); }
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"] .service-nav a { background: #fff; color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="light"] .capability-row { border-color: var(--theme-line); }
html[data-theme="light"] .capability-row:not(.head) { background: #fff; color: var(--theme-text); }
html[data-theme="light"] .capability-row.head { background: var(--red); }
html[data-theme="light"] .lab-note { background: var(--red); }
html[data-theme="light"] .stats-band { background: #fff; color: var(--theme-text); border-block: 1px solid var(--theme-line); }
html[data-theme="light"] .stat-cell { border-color: var(--theme-line); }
html[data-theme="light"] .stat-cell span { color: var(--theme-muted); }
html[data-theme="light"] .stat-cell:nth-child(2) { color: #fff; }
html[data-theme="light"] .stat-cell:nth-child(2) span { color: #fff; }
html[data-theme="light"] .project-showcase { background: linear-gradient(var(--red) 0 155px,#fff 155px); }
html[data-theme="light"] .project-shot { background: #fff; }
html[data-theme="light"] .project-pagination { background: var(--red-dark); }
html[data-theme="light"] .site-footer { background: var(--red-dark); color: #fff; }
html[data-theme="light"] .footer-redline { background: #c1646d; }
html[data-theme="light"] .whatsapp-label { background: var(--red-dark); }
html[data-theme="light"] .vertical-word { color: rgba(119,30,40,.08); }

@media (max-width: 1080px) {
  .theme-toggle { min-width: 44px; width: 44px; padding: 0; }
  .theme-toggle-label { display: none; }
  html[data-theme="light"] .mobile-panel {
    background-color: #a42a36;
    background-image: linear-gradient(145deg,#c1646d 0%,#a42a36 58%,#771e28 100%);
    color: #fff;
  }
}

@media (max-width: 760px) {
  .theme-toggle { height: 42px; width: 42px; min-width: 42px; }
  .theme-toggle-icon,
  .theme-toggle-icon svg { width: 16px; height: 16px; }
  .discipline-orbit b.discipline-logo { width: 78px; height: 78px; }
  .discipline-orbit > span { width: 82px; height: 29px; padding-inline: 6px; font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body,
  html[data-theme] .site-header,
  html[data-theme] .section { transition: none; }
  .theme-switching .theme-toggle-icon { animation: none; }
  .discipline-orbit b.discipline-logo { animation: none; }
}
