:root {
  color-scheme: light;
}

/* Blue accents stay luminous; surfaces and body text stay quiet for reading. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #8ccaff;
  --sky: #67bdf0;
  --charcoal: #c0cbd6;
  --medium: #8294a6;
  --light: #a9b8c6;
  --ink: #dce5ee;
  --muted: #a0b1c2;
  --paper: #101820;
  --mist: #162330;
  --line: #314354;
  --solid-blue: #183c59;
  --diagram-bg: #0c2133;
}

.site-header nav {
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mist);
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--navy);
}

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

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

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

@media (max-width: 1100px) {
  .header-inner { height: auto; min-height: 116px; flex-wrap: wrap; padding-block: 20px; }
  .site-header nav { flex-wrap: wrap; gap: 14px 24px; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 100px; }
  .site-header nav { width: 100%; gap: 10px 20px; }
  .theme-toggle { font-size: 13px; }
}

@media print {
  :root[data-theme] {
    color-scheme: light;
    --navy: #003d6f;
    --sky: #5eb6e4;
    --charcoal: #4c4f49;
    --ink: #1a1a1a;
    --muted: #59636b;
    --paper: #fff;
    --mist: #f3f7fa;
    --line: #dce4e9;
    --solid-blue: #003d6f;
    --diagram-bg: #003d6f;
  }
}
