/* Two complete site skins. Light is the first-visit default. */
:root { --ks-page: #ffffff; --ks-button: #c83432; --ks-button-hover: #ac2928; }
html { background: var(--ks-page); }
body { background: var(--ks-page); }
.button-red, .demo-kill-button { color: #fff; background: var(--ks-button); border-color: var(--ks-button); }
.button-red:hover, .demo-kill-button:hover { background: var(--ks-button-hover); border-color: var(--ks-button-hover); }

/* The switch is the last item at the top right in every viewport. */
.floating-header .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 54px;
  width: 54px; height: 44px; min-height: 44px; padding: 4px; border: 0;
  border-radius: 8px; background: transparent; cursor: pointer;
}
.floating-header .theme-toggle:hover { background: var(--ks-surface); }
.theme-toggle:focus-visible { outline: 2px solid var(--ks-red); outline-offset: 3px; }
.theme-track { display: flex; align-items: center; justify-content: space-between; width: 46px; height: 26px; padding: 5px; position: relative; border: 1px solid #53677f; border-radius: 20px; background: #6d7f96; }
.theme-track svg { width: 13px; height: 13px; position: relative; z-index: 1; flex-shrink: 0; stroke-width: 1.6; }
.theme-sun { color: #6a4b25; }
.theme-moon { color: #f1f5fb; }
.theme-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #17283d26; transition: transform .18s ease; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ks-page: #0b1220;
  --ks-ink: #edf3fb;
  --ks-muted: #b6c5d9;
  --ks-line: #34445b;
  --ks-surface: #162237;
  --ks-card: #122035;
  --ks-dim: #a4b7d0;
  --ks-subtle: #a6bad3;
  --ks-hover: #203149;
  --ks-red: #ff9387;
  --ks-red-soft: #3b252d;
}
[data-theme="dark"] .theme-track { background: #283e5b; border-color: #738aa6; }
[data-theme="dark"] .theme-thumb { transform: translateX(20px); background: #edf3fb; box-shadow: 0 1px 5px #0006; }
[data-theme="dark"] .theme-sun { color: #b9cce2; }
[data-theme="dark"] .theme-moon { color: #20334d; }

/* Shared navigation, surfaces, typography, and footer. */
[data-theme="dark"] .floating-header,
[data-theme="dark"] .floating-header.has-scrolled { background: #122035f2; border-color: var(--ks-line); box-shadow: 0 8px 28px #0003; }
[data-theme="dark"] .floating-header .nav-link { color: var(--ks-muted); }
[data-theme="dark"] .floating-header .nav-link:hover,
[data-theme="dark"] .floating-header .nav-link.is-current,
[data-theme="dark"] .floating-header .nav-link[aria-expanded="true"] { color: var(--ks-red); }
[data-theme="dark"] .nav-dropdown-panel,
[data-theme="dark"] .floating-header .mobile-nav:not([hidden]) { background: var(--ks-card); border-color: var(--ks-line); box-shadow: 0 18px 48px #0005; }
[data-theme="dark"] .floating-header .nav-dropdown-panel a:hover { background: var(--ks-hover); }
[data-theme="dark"] .dropdown-symbol { border-color: #814d4d; }
[data-theme="dark"] :is(.brand-sub, .floating-header .brand-sub, .dropdown-arrow, .floating-header .mobile-nav a span,
  .launch-note, .strip-label, .service-top .mono, .service-tags, .section-footnote, .solution-visual-top,
  .flow-caption, .solution-visual-foot, .about-signoff, .footer-bottom, .footer-bottom button,
  .dialog-close, .form-note, .demo-back, .simulation-label, .simulation-note, .reset-tour,
  .demo-closing .eyebrow) { color: var(--ks-subtle); }
[data-theme="dark"] :is(.dim, .hero h1 .dim, .closing h2 .dim) { color: var(--ks-dim); }
[data-theme="dark"] :is(.eyebrow, .closing-top .eyebrow) { color: var(--ks-muted); }
[data-theme="dark"] .eyebrow.red { color: var(--ks-red); }
[data-theme="dark"] .tiny-ring { border-color: var(--ks-subtle); }
[data-theme="dark"] .note-divider { color: #849bb8; }
[data-theme="dark"] .skip-link { background: var(--ks-button); color: #fff; }
[data-theme="dark"] :is(.hero, .testimonials, .company-hero, .investor-hero, .investor-build) { border-color: var(--ks-line); }
[data-theme="dark"] :is(.service-card, .service-card:first-child, .service-card:nth-child(3), .service-card:nth-child(4),
  .customer-story, .solution-node, .solution-infrastructure span, .scenario-choice, .founder-profile,
  .investment-visual, .investor-contact-card, .investor-partner-grid article) { background: var(--ks-card); border-color: var(--ks-line); }
[data-theme="dark"] .service-card:hover { background: var(--ks-hover); border-color: #667d9a; box-shadow: 0 8px 28px #0002; }
[data-theme="dark"] .solution-node.solution-node-human { background: var(--ks-red-soft); border-color: #9b6561; }
[data-theme="dark"] .solution-node-human small { color: #efb9af; }
[data-theme="dark"] .solution-node-icon { color: var(--ks-subtle); }
[data-theme="dark"] .solution-node-human .solution-node-icon { color: var(--ks-red); }
[data-theme="dark"] .solution-flow > span:first-child { background: #748aa7; }
[data-theme="dark"] .solution-infrastructure span { color: var(--ks-muted); }
[data-theme="dark"] .story-symbol { color: #8198b5; }
[data-theme="dark"] .story-badge { background: var(--ks-surface); color: var(--ks-subtle); }
[data-theme="dark"] .faq summary span { color: var(--ks-subtle); }
[data-theme="dark"] .footer-bottom button:hover { color: var(--ks-red); }

/* Native forms and dialogs share the selected skin. */
[data-theme="dark"] :is(.plan-dialog, .privacy-dialog) { color-scheme: dark; color: var(--ks-ink); background: var(--ks-card); border-color: #566c89; box-shadow: 0 25px 100px #0007; }
[data-theme="dark"] :is(.plan-dialog, .privacy-dialog)::backdrop { background: #020713b8; }
[data-theme="dark"] :is(.plan-dialog label, .plan-dialog legend) { color: #d6e1ef; }
[data-theme="dark"] .plan-dialog label > span:not(.check-label span) { color: var(--ks-subtle); }
[data-theme="dark"] :is(.plan-dialog input:not([type=checkbox]), .plan-dialog select) { background: #0d1829; border-color: #607591; }
[data-theme="dark"] .plan-dialog input::placeholder { color: #a0b2cb; }
[data-theme="dark"] .recovery-checklist > div { color: var(--ks-muted); }
[data-theme="dark"] .recovery-checklist span { color: #9dd4b8; }

/* Demo page framing changes; the operational visualization keeps its own palette. */
[data-theme="dark"] .scenario-choice[aria-pressed="true"] { color: var(--ks-ink); background: var(--ks-red-soft); border-color: #b67a71; }
[data-theme="dark"] .scenario-choice:hover { border-color: #8da5c3; }
[data-theme="dark"] :is(.demo-back:hover, .reset-tour:hover) { color: var(--ks-red); }

/* Investor page and its independent-authority illustration. */
[data-theme="dark"] :is(.investment-visual-top, .authority-label small, .authority-person,
  .investment-visual figcaption, .investor-principles > span, .roadmap-status, .partner-value,
  .investor-development-note, .contact-card-label, .investor-contact-card .investor-contact-note,
  .investor-questions summary > span, .investor-stage) { color: var(--ks-subtle); }
[data-theme="dark"] :is(.concept-tag, .authority-label, .thesis-systems > span, .roadmap-marker > span) { border-color: var(--ks-line); }
[data-theme="dark"] :is(.authority-label, .thesis-systems > span) { background: var(--ks-surface); }
[data-theme="dark"] .thesis-systems > span { color: var(--ks-muted); }
[data-theme="dark"] .thesis-switch { background: var(--ks-button); border-color: var(--ks-card); box-shadow: 0 0 0 1px #9a6561,0 0 0 10px var(--ks-red-soft),0 12px 30px #0003; }
[data-theme="dark"] :is(.authority-connection, .thesis-branches:before, .thesis-branches span, .roadmap-marker i) { background: #637b99; }
[data-theme="dark"] .roadmap-marker > span { background: var(--ks-card); color: var(--ks-subtle); }
[data-theme="dark"] .roadmap-status.available { color: #9dd4b8; }

/* Leadership portraits stay in their natural photographic colors. */
[data-theme="dark"] :is(.company-stage, .founder-focus > span, .founder-focus li,
  .team-coming-symbol, .team-coming-mark) { color: var(--ks-subtle); }
[data-theme="dark"] .founder-bio .founder-intro { color: var(--ks-muted); }
[data-theme="dark"] .founder-focus li { border-color: var(--ks-line); }
[data-theme="dark"] .founder-portrait { background: #263851; }

@media (max-width: 1150px) {
  .floating-header { gap: 13px; }
  .floating-header .desktop-nav { gap: 19px; }
}
@media (max-width: 980px) {
  .floating-header .menu-toggle { margin-left: 0; flex-shrink: 0; }
}
@media (max-width: 700px) {
  .floating-header { gap: 10px; padding-inline: 14px; }
  .floating-header .theme-toggle { margin-left: 0; }
}
@media (max-width: 600px) {
  .floating-header .header-cta { display: none; }
  .floating-header .menu-toggle { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-thumb { transition: none; }
}
