/* Site-wide light/dark theme (2026-10-28). Dark is the original palette; light overrides the 5 palette vars
   and the few hard-coded colours. The choice lives in a .ovrwtch.com cookie "ow-theme" (session/local storage fallback) and is applied by an inline
   <head> script before paint; with no saved choice we follow prefers-color-scheme. High-contrast mode (a11y-hc) wins. */

/* Header toggle (upper right) */
.theme-toggle {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; margin: 0; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--brand) 70%, transparent); border-radius: 999px; background: transparent;
  color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--hdr-hover, transparent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; }
.theme-toggle .ti-moon { display: none; }
html[data-theme="light"] .theme-toggle .ti-sun { display: none; }
html[data-theme="light"] .theme-toggle .ti-moon { display: block; }
@media (max-width: 420px) { .theme-toggle { width: 2.4rem; height: 2.4rem; } .theme-toggle svg { width: 1.1rem; height: 1.1rem; } }
@media (max-width: 359.98px) { .theme-toggle { width: 2.2rem; height: 2.2rem; } }

/* Logo swap: white logo in dark mode, black logo in light mode.
   Applies to the header mark and the Client/Cyber bridge lockup. */
.logo-img-light { display: none; }
html[data-theme="light"]:not(.a11y-hc) .logo-img-dark { display: none; }
html[data-theme="light"]:not(.a11y-hc) .logo-img-light { display: block; }

/* ---------- Light palette ---------- */
html[data-theme="light"]:not(.a11y-hc) {
  --brand: #5b6479;
  --bg: #f6f7f9;
  --text: #14171c;
  --muted: #4b5262;
  --accent: #7d5c1e;
  color-scheme: light;
}

html[data-theme="light"]:not(.a11y-hc) .site-header {
  --hdr-bg: #ffffff;
  --hdr-panel: #ffffff;
  --hdr-hover: color-mix(in srgb, var(--brand) 10%, #fff);
  --hdr-line: color-mix(in srgb, var(--brand) 30%, transparent);
  box-shadow: 0 1px 10px rgb(20 23 28 / 8%);
}
html[data-theme="light"]:not(.a11y-hc) .nav-dd-menu,
html[data-theme="light"]:not(.a11y-hc) .nav-mobile { box-shadow: 0 16px 38px rgb(20 23 28 / 14%); }
html[data-theme="light"]:not(.a11y-hc) .nav-ico { color: #5b6479; }
html[data-theme="light"]:not(.a11y-hc) .nav-cta:hover,
html[data-theme="light"]:not(.a11y-hc) .nav .nav-mobile-cta:hover { background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff !important; }
html[data-theme="light"]:not(.a11y-hc) .nav-cta,
html[data-theme="light"]:not(.a11y-hc) .nav .nav-mobile-cta,
html[data-theme="light"]:not(.a11y-hc) .btn-primary,
html[data-theme="light"]:not(.a11y-hc) .promo-tag { color: #fff !important; }
html[data-theme="light"]:not(.a11y-hc) .btn-primary:hover { filter: none; background: color-mix(in srgb, var(--accent) 85%, #000); }
html[data-theme="light"]:not(.a11y-hc) .nav-scout { border-color: #8a93a8; }

/* Solid service cards keep their palette fills in light mode (same AA contrast).
   Other panels still lift off the light grey page. */
html[data-theme="light"]:not(.a11y-hc) .isp-card,
html[data-theme="light"]:not(.a11y-hc) .isp-success { background: #3d4658; color: #e8eaed; box-shadow: none; }
html[data-theme="light"]:not(.a11y-hc) .isp-title,
html[data-theme="light"]:not(.a11y-hc) .isp-section,
html[data-theme="light"]:not(.a11y-hc) .isp-field > label.isp-label,
html[data-theme="light"]:not(.a11y-hc) .isp-success { color: #e8eaed; }
html[data-theme="light"]:not(.a11y-hc) .isp-sub { color: #d5d8de; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner {
  background: #3d4658;
  color: #e8eaed;
  border: 0;
}
html[data-theme="light"]:not(.a11y-hc) .cta-inner h2 { color: #ffffff; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner p { color: #d5d8de; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner .btn-primary,
html[data-theme="light"]:not(.a11y-hc) .cta-inner .btn-primary:hover { color: #0c0e12 !important; background: #c4a574; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner .btn-primary:hover { background: #d4b98a; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner .btn-secondary { color: #e8eaed; border-color: #e8eaed; background: transparent; }
html[data-theme="light"]:not(.a11y-hc) .cta-inner .btn-secondary:hover { background: #e8eaed; color: #0c0e12 !important; }
html.a11y-hc .cta-inner {
  background: var(--bg);
  color: var(--text);
  border: 0;
}
html.a11y-hc .cta-inner h2,
html.a11y-hc .cta-inner p { color: var(--text); }
html[data-theme="light"]:not(.a11y-hc) .hero {
  background:
    radial-gradient(ellipse 70% 55% at 75% -5%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 55%),
    radial-gradient(ellipse 45% 40% at 5% 90%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
}
/* Footer stays plain dark in both themes (TFF-style). High-contrast mode follows the a11y palette. */
html[data-theme="light"]:not(.a11y-hc) .site-footer {
  background: #0c0e12;
  color: #e8eaed;
  --footer-bg: #0c0e12;
  --footer-text: #e8eaed;
  --footer-muted: #9aa3b2;
}
html[data-theme="light"]:not(.a11y-hc) .site-footer .copyright { opacity: 1; color: #9aa3b2; }
html[data-theme="light"]:not(.a11y-hc) .site-footer .copyright a { color: #e8eaed; }
html.a11y-hc .site-footer {
  background: var(--bg);
  color: var(--text);
  --footer-bg: var(--bg);
  --footer-text: var(--text);
  --footer-muted: var(--muted);
}
html.a11y-hc .footer-mark { filter: none; }

/* Trusted-by strip: logos as soft black marks on light; hover still shows original colours */
html[data-theme="light"]:not(.a11y-hc) .client img { filter: brightness(0); opacity: 0.68; }
html[data-theme="light"]:not(.a11y-hc) .client:hover img,
html[data-theme="light"]:not(.a11y-hc) .client:focus-within img { filter: none; opacity: 1; }
html[data-theme="light"]:not(.a11y-hc) .client:hover,
html[data-theme="light"]:not(.a11y-hc) .client:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent); }

/* Calculators (estimate / ROI): light green input cells, dark text (AA) */
html[data-theme="light"]:not(.a11y-hc) .roi-inputs .roi-row input[type=number],
html[data-theme="light"]:not(.a11y-hc) .roi-preset select,
html[data-theme="light"]:not(.a11y-hc) .roi-pdf-email input { background: #eaf6ef; color: #0f3d24; border-color: #2f8a57; }
html[data-theme="light"]:not(.a11y-hc) .roi-inputs .roi-row input[type=number]:focus-visible,
html[data-theme="light"]:not(.a11y-hc) .roi-preset select:focus-visible,
html[data-theme="light"]:not(.a11y-hc) .roi-pdf-email input:focus-visible { outline-color: #2f8a57; }
html[data-theme="light"]:not(.a11y-hc) .est-row input[type=number] { background: #fff; }
html[data-theme="light"]:not(.a11y-hc) .est-row input::placeholder,
html[data-theme="light"]:not(.a11y-hc) .roi-preset input::placeholder,
html[data-theme="light"]:not(.a11y-hc) .roi-pdf-email input::placeholder { color: #5f6779; }
html[data-theme="light"]:not(.a11y-hc) .roi-chart-val { fill: #fff; }
html[data-theme="light"]:not(.a11y-hc) .roi-pdf-email input[aria-invalid=true] { border-color: #b4232a; }

/* Forms */
html[data-theme="light"]:not(.a11y-hc) .isp-input,
html[data-theme="light"]:not(.a11y-hc) .isp-textarea { background: #fff; }
html[data-theme="light"]:not(.a11y-hc) .isp-status { color: #b4232a; }

/* Cookie consent banner */
html[data-theme="light"]:not(.a11y-hc) .ow-cc-box { background: #fff; color: #14171c; box-shadow: 0 12px 40px rgb(20 23 28 / 18%); }
html[data-theme="light"]:not(.a11y-hc) .ow-cc-gpc { color: #6b4e17; }

/* Ask Scott dialog is already a light panel; soften the backdrop in light mode */
html[data-theme="light"]:not(.a11y-hc) .scout-dialog { box-shadow: 0 30px 70px rgb(20 23 28 / 25%); }
html[data-theme="light"]:not(.a11y-hc) .scout-dialog::backdrop { background: rgb(20 23 28 / 45%); }

/* Make room for the toggle in the desktop header (>=1080px) without crowding the logo */
@media (min-width: 1080px) {
  .nav { gap: 0.5rem; }
  .nav-link, .nav-dd-toggle { padding: 0 0.5rem; }
  .nav-scout { padding: 0 0.8rem; }
  .nav-cta { padding-left: 1rem; padding-right: 1rem; }
  .theme-toggle { width: 2.5rem; height: 2.5rem; }
}
@media (min-width: 1080px) and (max-width: 1199.98px) {
  .nav { gap: 0.4rem; }
  .nav-link, .nav-dd-toggle { padding: 0 0.38rem; font-size: 0.92rem; }
  .nav-scout { padding: 0 0.6rem; }
  .nav-cta { padding-left: 0.8rem; padding-right: 0.8rem; }
  .logo-img:not(.logo-img-sm) { height: 3rem; }
}

/* Affiliate logos are white-on-transparent artwork: give them a dark tile in light mode */
/* /affiliates (2026-10-29): light mode shows each brand's official color logo; dark mode keeps the white versions */
.affiliate-logo.affiliate-logo-light { display: none; }
html[data-theme="light"]:not(.a11y-hc) .affiliate-logo.affiliate-logo-dark { display: none; }
html[data-theme="light"]:not(.a11y-hc) .affiliate-logo.affiliate-logo-light { display: block; }
