/* =============================================================================================
   SecNCode — dark theme
   Applied when <html data-theme="dark"> (set by boot.js from the visitor's choice or device).
   Palette: deep navy shades of Dark Cornflower Blue (#273F99) for backgrounds; white and light
   blue tints for text; brand red and brand blue unchanged for accents, bands and buttons.
   ============================================================================================= */

/* ---- Theme toggle button (both themes) ---- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: 10px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
}
.nav__cta {
  white-space: nowrap;
}
.theme-toggle__sun {
  display: none;
}
.theme-toggle:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.theme-toggle:active {
  transform: scale(0.94);
}
/* keep the toggle right next to "Let's talk" on desktop, and between logo and menu button on phones */
.site-header__inner > .nav {
  margin-left: auto;
}
@media (max-width: 900px) {
  .site-header__inner > .nav {
    margin-left: 0;
  }
  .theme-toggle {
    margin-left: auto;
    order: 2;
  }
  .site-header__inner > .nav-toggle {
    order: 3;
    margin-left: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none;
  }
  .theme-toggle:active {
    transform: none;
  }
}

/* logo swap: approved white logo on dark backgrounds */
.brand .logo-light,
.footer-brand .logo-light {
  display: block;
}
.brand .logo-dark,
.footer-brand .logo-dark {
  display: none;
}
:root[data-theme="dark"] .brand .logo-light,
:root[data-theme="dark"] .footer-brand .logo-light {
  display: none;
}
:root[data-theme="dark"] .brand .logo-dark,
:root[data-theme="dark"] .footer-brand .logo-dark {
  display: block;
}

/* smooth colour change when the visitor switches (not on page load) */
.theme-switching body,
.theme-switching body *,
.theme-switching body *::before,
.theme-switching body *::after {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    fill 0.3s ease,
    stroke 0.3s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-switching body * {
    transition: none !important;
  }
}

/* =============================== DARK ================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --d-bg: #070c22; /* page */
  --d-bg-2: #0b1230; /* alternate sections, footer */
  --surface: #111a40; /* cards, panels, inputs */
  --d-surface-2: #17224f; /* hover / raised */
  --c-blue: #c3cffb; /* blue text -> light blue tint (bright enough to read on navy) */
  --text: #f1f4fb;
  --ink: #e8ecf7;
  --black: #e8ecf7;
  --muted: #cad2ea;
  --tint: #0b1230;
  --tint-2: #1a2556;
  --line: #24305f;
  --blue-ring: rgba(169, 186, 245, 0.22);
  --hex-blue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 1 54 16v30L28 61 2 46V16z M28 61v36 M0 97V82 M56 97V82' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1.2'/%3E%3C/svg%3E");
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] body {
  background: var(--d-bg);
  color: var(--text);
}
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5 {
  color: #ffffff;
}
:root[data-theme="dark"] ::selection {
  background: var(--red);
  color: #ffffff;
}

/* eyebrows: brand red is too dim for small text on navy, so use a light tint (red stays in rules, dots, tags) */
:root[data-theme="dark"] p.eyebrow:not(.tag-label):not(.eyebrow--on-blue) {
  color: var(--muted);
}

/* header + navigation */
:root[data-theme="dark"] .site-header {
  background: rgba(7, 12, 34, 0.94);
  border-bottom-color: var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .nav__link {
  color: var(--text);
}
:root[data-theme="dark"] .nav__link:hover,
:root[data-theme="dark"] .nav__link[aria-current="page"] {
  color: #ffffff;
}
:root[data-theme="dark"] .nav-toggle span:not(:first-child) {
  background: #ffffff;
}
:root[data-theme="dark"] .theme-toggle {
  color: #ffffff;
  border-color: var(--line);
}
:root[data-theme="dark"] .theme-toggle:hover {
  background: var(--blue);
  border-color: var(--blue);
}
:root[data-theme="dark"] .theme-toggle__moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle__sun {
  display: block;
}
@media (max-width: 900px) {
  :root[data-theme="dark"] .site-header {
    background: var(--d-bg);
  }
  :root[data-theme="dark"] .nav {
    background: var(--d-bg) var(--hex-blue);
  }
}

/* page backgrounds */
:root[data-theme="dark"] .hero {
  background: var(--d-bg);
}
:root[data-theme="dark"] .page-hero {
  background: var(--d-bg) var(--hex-blue);
  border-bottom-color: var(--line);
}
:root[data-theme="dark"] .section--tint {
  background: var(--d-bg-2);
}
:root[data-theme="dark"] .site-footer {
  background: var(--d-bg-2);
}

/* radar artwork */
:root[data-theme="dark"] .radar .ring,
:root[data-theme="dark"] .radar .axis,
:root[data-theme="dark"] .radar .sweep-line {
  stroke: #a9baf5;
}
:root[data-theme="dark"] .radar .core,
:root[data-theme="dark"] .radar .dot-blue {
  fill: #a9baf5;
}
:root[data-theme="dark"] .radar stop {
  stop-color: #a9baf5;
}

/* buttons: brand blue, with a light edge so they read on navy */
:root[data-theme="dark"] .btn:not(.btn--white):not(.btn--ghost):not(.btn--ghost-white) {
  box-shadow: inset 0 0 0 1px rgba(169, 186, 245, 0.35);
}
:root[data-theme="dark"] .btn--ghost {
  color: #ffffff;
  border-color: #a9baf5;
  background-color: transparent;
}
:root[data-theme="dark"] .hero .btn--ghost {
  background-color: var(--d-bg);
}
:root[data-theme="dark"] .btn--ghost:hover {
  color: #ffffff;
  border-color: var(--blue);
}

/* cards and panels: navy surfaces with a hairline so they separate from the page */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .step,
:root[data-theme="dark"] .svc-card,
:root[data-theme="dark"] .credg,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .sub-panel,
:root[data-theme="dark"] .sub-tabs,
:root[data-theme="dark"] .ack-grid li,
:root[data-theme="dark"] .svc-nav a,
:root[data-theme="dark"] .svc-mini,
:root[data-theme="dark"] .ind-card:not(.ind-card--cta),
:root[data-theme="dark"] .cve,
:root[data-theme="dark"] .mstep {
  box-shadow: inset 0 0 0 1px var(--line);
}
:root[data-theme="dark"] .card:hover,
:root[data-theme="dark"] .svc-card:hover,
:root[data-theme="dark"] .step:hover,
:root[data-theme="dark"] .credg:hover,
:root[data-theme="dark"] .mstep:hover {
  box-shadow:
    inset 0 0 0 1px #33427a,
    0 14px 30px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .svc-mini:hover,
:root[data-theme="dark"] .svc-mini:focus-visible {
  background: var(--d-surface-2);
}
:root[data-theme="dark"] .svc-mini--static:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
:root[data-theme="dark"] .svc-mini__ico,
:root[data-theme="dark"] .ind-card__ico,
:root[data-theme="dark"] .svc-mini--static:hover .svc-mini__ico {
  background: rgba(169, 186, 245, 0.1);
}
:root[data-theme="dark"] .svc-mini__go {
  color: #a9baf5;
}

/* chips, tags, badges */
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .badge,
:root[data-theme="dark"] .ind-tags li:not(.ind-tags__more),
:root[data-theme="dark"] .section--tint .chip,
:root[data-theme="dark"] .svc-summary .chip,
:root[data-theme="dark"] .section--tint .sub-panel .chip {
  background: rgba(169, 186, 245, 0.1);
  color: #dce3fa;
  border-color: transparent;
}
:root[data-theme="dark"] .chip:hover,
:root[data-theme="dark"] .badge:hover {
  background: var(--blue);
  color: #ffffff;
}
:root[data-theme="dark"] .svc-card__num {
  color: #26336a;
}
:root[data-theme="dark"] .outcome,
:root[data-theme="dark"] .svc-summary .outcome {
  background: var(--d-surface-2);
}
:root[data-theme="dark"] .deliv li,
:root[data-theme="dark"] .sub-block--approach p {
  background: var(--d-surface-2);
}
:root[data-theme="dark"] .sub-tab:hover {
  background: var(--d-surface-2);
}

/* research cards on the blue band */
:root[data-theme="dark"] .section--blue .cve p,
:root[data-theme="dark"] .cve__meta {
  color: var(--muted);
}
:root[data-theme="dark"] .sev--high {
  background: transparent;
  color: #ffffff;
  border-color: var(--red);
}
:root[data-theme="dark"] .sev--medium {
  background: transparent;
  color: #dce3fa;
  border-color: #a9baf5;
}

/* forms */
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea {
  background: var(--d-bg-2);
  color: var(--text);
  border-bottom-color: #33427a;
}
:root[data-theme="dark"] .field input:hover,
:root[data-theme="dark"] .field textarea:hover {
  color: var(--text);
}
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field textarea:focus {
  background: var(--d-bg);
  color: #ffffff;
  border-color: #a9baf5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .form-status {
  background: var(--d-surface-2);
}

/* privacy page */

/* 404 */
:root[data-theme="dark"] .nf__code,
:root[data-theme="dark"] .nf p.nf__code {
  color: #ffffff;
}
:root[data-theme="dark"] .nf__help a {
  color: #a9baf5;
}

/* footer */
:root[data-theme="dark"] .footer-col a:not(.btn) {
  color: var(--text);
}
:root[data-theme="dark"] .footer-col a:not(.btn):hover {
  color: #ffffff;
}
:root[data-theme="dark"] a.social__item:focus-visible {
  outline-color: #a9baf5;
}

/* toast */
:root[data-theme="dark"] .copy-toast {
  background: var(--d-surface-2);
  color: #ffffff;
  border-color: #33427a;
}

/* small red labels: brand red is below 4.5:1 on navy, so small text uses the light blue tint.
   Red stays on icons, dots, rules, tags with white text, and other decorative accents. */
:root[data-theme="dark"] .credg__family,
:root[data-theme="dark"] .cve__vendor,
:root[data-theme="dark"] .footer-col h2,
:root[data-theme="dark"] .mstep__get small,
:root[data-theme="dark"] .mstep__num,
:root[data-theme="dark"] .ind-card__svc span,
:root[data-theme="dark"] .step__get small,
:root[data-theme="dark"] .sub-block h4,
:root[data-theme="dark"] .pblock h2 span,
:root[data-theme="dark"] .step h3 b,
:root[data-theme="dark"] .outcome p.eyebrow,
:root[data-theme="dark"] .section-head p.eyebrow,
:root[data-theme="dark"] .ptoc a.is-active span,
:root[data-theme="dark"] .ind-tags li.ind-tags__more,
:root[data-theme="dark"] .badge--more,
:root[data-theme="dark"] .chip--more,
:root[data-theme="dark"] .field label .req {
  color: var(--c-blue);
}
:root[data-theme="dark"] .badge--more,
:root[data-theme="dark"] .chip--more {
  border-color: #a9baf5;
}
:root[data-theme="dark"] .field__error,
:root[data-theme="dark"] .form-status.is-error strong {
  color: #ffffff;
}
:root[data-theme="dark"] .field__error:not(:empty) {
  border-left: 3px solid var(--red);
  padding-left: 8px;
}
/* red hover text -> white */
:root[data-theme="dark"] a:not(.btn):not(.proof-link):not(.social__item):not(.svc-mini):not(.sub-tab):hover,
:root[data-theme="dark"] .text-link:hover,
:root[data-theme="dark"] .crumbs a:hover,
:root[data-theme="dark"] .footer-col a:hover,
:root[data-theme="dark"] .nf__help a:hover,
:root[data-theme="dark"] .ind-card__svc a:hover,
:root[data-theme="dark"] .ind-card__svc a:focus-visible,
:root[data-theme="dark"] .ind-card__svc a.ind-card__all:hover,
:root[data-theme="dark"] .ack-grid li:hover,
:root[data-theme="dark"] .cve:hover .cve__id,
:root[data-theme="dark"] .step:hover .step__get strong,
:root[data-theme="dark"] .svc-card:hover .svc-card__num {
  color: #ffffff;
}
:root[data-theme="dark"] .ind-card__svc a {
  text-decoration-color: rgba(169, 186, 245, 0.55);
}
:root[data-theme="dark"] .ind-card__svc a:hover {
  text-decoration-color: var(--red);
}
/* the track-record links keep their white hover card in both themes */
:root[data-theme="dark"] .proof-link:hover .proof-link__txt small,
:root[data-theme="dark"] .proof-link:focus-visible .proof-link__txt small {
  color: #5a5f6e;
}

/* readability on navy: thin (300) body text and tinted text look faint on dark backgrounds,
   so dark mode uses regular weight and brighter text throughout */
:root[data-theme="dark"] .lead,
:root[data-theme="dark"] .hero__lead,
:root[data-theme="dark"] .page-hero .lead {
  font-weight: 400;
}
:root[data-theme="dark"] .hero__hook {
  color: #ffffff;
}
:root[data-theme="dark"] .hero__lead {
  color: var(--muted);
}
:root[data-theme="dark"] p,
:root[data-theme="dark"] li {
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] .section--blue .section-head p,
:root[data-theme="dark"] .section--blue p,
:root[data-theme="dark"] .cta p {
  color: rgba(255, 255, 255, 0.9);
}
