/* Scheduled theme: 07:00-18:59 light, 19:00-06:59 dark. */
html[data-theme="dark"] {
  --navy: #03142b;
  --navy-2: #061d3c;
  --ink: #edf6ff;
  --muted: #9db1c8;
  --line: rgba(156, 194, 226, 0.2);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
  outline: none;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle[data-theme="light"] .theme-icon-sun,
.theme-toggle[data-theme="dark"] .theme-icon-moon {
  display: none;
}

@media (max-width: 800px) {
  .theme-toggle {
    margin-left: auto;
  }
}

html[data-theme="dark"] body,
html[data-theme="dark"] body:has(.home-page),
html[data-theme="dark"] .home-page,
html[data-theme="dark"] .modules-page,
html[data-theme="dark"] .value-page,
html[data-theme="dark"] .contact-page,
html[data-theme="dark"] .materials-page {
  background: var(--navy);
  color: var(--ink);
}

html[data-theme="dark"] .home-page .proof,
html[data-theme="dark"] .home-page .section,
html[data-theme="dark"] .home-page .contact,
html[data-theme="dark"] .home-page .partners-home,
html[data-theme="dark"] .modules-page .inner-section,
html[data-theme="dark"] .value-page .inner-section,
html[data-theme="dark"] .contact-page .inner-section,
html[data-theme="dark"] .materials-page .cases-section,
html[data-theme="dark"] .materials-page .partner-section {
  background: var(--navy);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .home-page .section h2,
html[data-theme="dark"] .home-page .compare b,
html[data-theme="dark"] .home-page .module-list h3,
html[data-theme="dark"] .home-page .value-points strong,
html[data-theme="dark"] .home-page .partners-home h2,
html[data-theme="dark"] .home-page .contact h2,
html[data-theme="dark"] .modules-page .inner-section h2,
html[data-theme="dark"] .modules-page .feature-grid h3,
html[data-theme="dark"] .modules-page .detail-list h3,
html[data-theme="dark"] .modules-page .cta-band h2,
html[data-theme="dark"] .value-page .inner-section h2,
html[data-theme="dark"] .value-page .detail-list h3,
html[data-theme="dark"] .value-page .barrier-list h3,
html[data-theme="dark"] .value-page .cta-band h2,
html[data-theme="dark"] .contact-page .inner-section h2,
html[data-theme="dark"] .materials-page .cases-section h2,
html[data-theme="dark"] .materials-page .partner-section h2,
html[data-theme="dark"] .materials-page .case-grid h3,
html[data-theme="dark"] .materials-page .case-grid strong {
  color: var(--ink);
}

html[data-theme="dark"] .home-page .proof span,
html[data-theme="dark"] .home-page .positioning-copy > p,
html[data-theme="dark"] .home-page .compare span,
html[data-theme="dark"] .home-page .value-copy > p:not(.eyebrow),
html[data-theme="dark"] .home-page .value-points span,
html[data-theme="dark"] .home-page .module-list p,
html[data-theme="dark"] .modules-page .feature-grid p,
html[data-theme="dark"] .modules-page .detail-list p,
html[data-theme="dark"] .value-page .detail-list p,
html[data-theme="dark"] .value-page .barrier-list p,
html[data-theme="dark"] .contact-page form label,
html[data-theme="dark"] .materials-page .case-intro,
html[data-theme="dark"] .materials-page .case-grid .case-summary,
html[data-theme="dark"] .materials-page .case-grid p {
  color: var(--muted);
}

html[data-theme="dark"] .home-page .proof,
html[data-theme="dark"] .home-page .proof div,
html[data-theme="dark"] .home-page .compare,
html[data-theme="dark"] .home-page .value-points,
html[data-theme="dark"] .home-page .modules,
html[data-theme="dark"] .home-page .value,
html[data-theme="dark"] .home-page .contact,
html[data-theme="dark"] .modules-page .inner-section,
html[data-theme="dark"] .modules-page .cta-band,
html[data-theme="dark"] .value-page .inner-section,
html[data-theme="dark"] .value-page .cta-band,
html[data-theme="dark"] .contact-page .inner-section,
html[data-theme="dark"] .materials-page .cases-section,
html[data-theme="dark"] .materials-page .partner-section {
  border-color: var(--line);
}

html[data-theme="dark"] .home-page .module-list article,
html[data-theme="dark"] .modules-page .feature-grid article,
html[data-theme="dark"] .value-page .barrier-list article,
html[data-theme="dark"] .materials-page .case-grid article {
  background: rgba(6, 29, 60, 0.58);
  border-color: var(--line);
}

html[data-theme="dark"] .home-page .module-list article:hover,
html[data-theme="dark"] .modules-page .feature-grid article:hover,
html[data-theme="dark"] .value-page .barrier-list article:hover,
html[data-theme="dark"] .materials-page .case-grid article:hover {
  background: var(--navy-2);
  border-color: rgba(101, 199, 255, 0.55);
}

html[data-theme="dark"] .home-page .value-visual,
html[data-theme="dark"] .materials-page .case-media {
  background: #021127;
  border-color: var(--line);
}

html[data-theme="dark"] .home-page .partners-home .button-quiet {
  color: var(--ink);
  border-color: rgba(156, 194, 226, 0.4);
}

/* Client marks stay on their original white swatches in both themes. */
html[data-theme="dark"] .partner-logo-wall {
  border-color: #dbe3e8;
}

html[data-theme="dark"] .partner-logo-wall img {
  background: #ffffff;
  border-color: #dbe3e8;
}

html[data-theme="dark"] .contact-page form input,
html[data-theme="dark"] .contact-page form select,
html[data-theme="dark"] .contact-page form textarea {
  background: rgba(6, 29, 60, 0.72);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .contact-page .lead-form-status {
  color: var(--muted);
}

html[data-theme="dark"] .contact-page .lead-form-status[data-state="success"] {
  color: #7bd6a7;
}

html[data-theme="dark"] .contact-page .lead-form-status[data-state="error"] {
  color: #ff9b93;
}

html[data-theme="dark"] .home-page ~ .site-footer,
html[data-theme="dark"] .home-page .contact + .site-footer,
html[data-theme="dark"] .materials-page + .site-footer {
  background: var(--navy);
  color: var(--muted);
  border-top-color: var(--line);
}

html[data-theme="dark"] ::selection {
  background: rgba(101, 199, 255, 0.3);
  color: #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
  body,
  main,
  section,
  article,
  footer,
  input,
  select,
  textarea {
    transition:
      background-color 0.35s ease,
      border-color 0.35s ease,
      color 0.35s ease;
  }
}
