:root {
  color-scheme: light;
  --theme-control-bg: #fff;
  --theme-control-border: #a2b3c2;
}

.header-inner {
  min-height: 94px;
  gap: 12px;
}

.brand .brand-dark {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-control {
  position: relative;
}

.theme-control[hidden],
.theme-options[hidden],
.theme-toggle [data-icon] {
  display: none;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--theme-control-border);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.theme-toggle:hover,
.theme-toggle[aria-expanded="true"] {
  background: var(--theme-control-bg);
  border-color: currentColor;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-preference="system"] [data-icon="system"],
[data-preference="light"] [data-icon="light"],
[data-preference="dark"] [data-icon="dark"] {
  display: block;
}

.theme-options {
  position: absolute;
  z-index: 2;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: 192px;
  padding: 6px;
  border: 1px solid var(--theme-control-border);
  background: var(--theme-control-bg);
  box-shadow: 0 12px 30px rgb(0 16 34 / 18%);
}

.theme-options button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  text-align: start;
}

.theme-options button:is(:hover, :focus-visible, [aria-checked="true"]) {
  background: var(--paper);
}

.theme-options button:focus-visible {
  outline-offset: -2px;
}

.theme-options button span {
  visibility: hidden;
}

.theme-options button[aria-checked="true"] span {
  visibility: visible;
}

@media (min-width: 901px) {
  .header-inner nav {
    margin-inline-start: auto;
    gap: clamp(16px, 2vw, 30px);
  }

  .site-header .nav-contact {
    min-height: 48px;
    padding-block: 0;
    border-color: var(--theme-control-border);
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    min-height: 76px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .header-actions .menu-toggle {
    min-height: 44px;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .header-inner {
    gap: 10px;
  }

  .brand img {
    width: 96px;
  }

  .header-actions {
    gap: 10px;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef5ff;
  --muted: #b7c8db;
  --white: #0b1728;
  --paper: #101f33;
  --line: #3e536b;
  --theme-control-bg: #12253b;
  --theme-control-border: #728ca6;
  --theme-panel: #14263e;
  --theme-deep: #08192d;
  --theme-accent: #a9cdff;
  --theme-action: #d3e6ff;
  --theme-action-ink: #102a47;
}

[data-theme="dark"] .brand .brand-light {
  display: none;
}

[data-theme="dark"] .brand .brand-dark {
  display: block;
}

[data-theme="dark"] :is(.site-header, .site-header nav, .method-section, .site-footer) {
  background: var(--theme-deep);
}

[data-theme="dark"] :is(.strategy-card, .contact-section, .person-monogram, .tag) {
  background: var(--theme-panel);
}

[data-theme="dark"] :is(
  .hero-copy > p, .figure-top, .fact-index, .section-number, .muted,
  .company-columns p:not(.lead), .company-note > span, .company-note p, .section-heading-row > p,
  .tag, .card-number, .strategy-card > p:not(.strategy-risk), .strategy-specs dt,
  .strategy-risk, .note-mark, .platform-note p, .institutional-intro, .fund-panel > p,
  .fund-responsibility > span, .person-monogram > span, .person-role, .person > p:last-child,
  .extended-team h3, .extended-team p span, .contact-section h2 + p, .contact-details .eyebrow
) {
  color: var(--muted);
}

[data-theme="dark"] :is(
  .institutional-section h2 em, .contact-section h2 em, .person-monogram,
  .email-link:hover, .site-header nav > a:not(.nav-contact):hover
) {
  color: var(--theme-accent);
}

[data-theme="dark"] :is(
  .hero-facts, .strategy-specs > div, .note-mark, .fund-panel, .fund-responsibility,
  .person-monogram, .contact-details, .email-link
),
[data-theme="dark"] .person-monogram::after {
  border-color: var(--line);
}

[data-theme="dark"] :is(.nav-contact, .button-light) {
  border-color: var(--theme-control-border);
  color: var(--ink);
}

[data-theme="dark"] :is(.button-blue, .nav-contact:hover, .button-light:hover, .skip-link) {
  border-color: var(--theme-action);
  background: var(--theme-action);
  color: var(--theme-action-ink);
}

[data-theme="dark"] .button-blue:hover {
  background: #ecf5ff;
}

[data-theme="dark"] .menu-toggle {
  color: var(--ink);
}

[data-theme="dark"] .menu-icon,
[data-theme="dark"] .menu-toggle[aria-expanded="true"] .menu-icon::before,
[data-theme="dark"] .menu-toggle[aria-expanded="true"] .menu-icon::after {
  border-color: currentColor;
}

[data-theme="dark"] :is(a, button, select, summary):focus-visible {
  outline-color: var(--theme-accent);
}

[data-theme="dark"] .hero-topline .eyebrow::before,
[data-theme="dark"] .signal-figure figcaption i {
  background: var(--theme-accent);
}

[data-theme="dark"] #signal-dots circle {
  fill: #a4c9ef;
}

[data-theme="dark"] #signal-gradient stop:last-child {
  stop-color: #90bcf2;
}

[data-theme="dark"] :is(.signal-flow, .engine-orbit, #signal-output path) {
  stroke: #8bb5ea;
}

[data-theme="dark"] .engine-core {
  fill: #255586;
}

[data-theme="dark"] #signal-output rect {
  fill: #7da0c8;
}

[data-theme="dark"] #signal-output rect:nth-of-type(-n + 5) {
  fill: #b4d5ff;
}
