/* Keep --paper light: the original design also uses it as text on navy. */
:root {
  color-scheme: light;
  --theme-surface: var(--paper);
}

.site-header {
  column-gap: clamp(.65rem, 1.1vw, 1.1rem);
}

.site-header .brand {
  margin-right: auto;
}

.site-header nav {
  margin-left: .4rem;
}

.theme-toggle {
  display: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid oklch(52% .03 250);
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  line-height: 1;
}

html[data-theme-ready="true"] .theme-toggle {
  display: inline-flex;
}

.theme-toggle span {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle[aria-pressed="true"] {
  border-color: var(--cyan);
  background: oklch(77% .137 217 / .1);
  color: var(--cyan);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

html.no-js .theme-toggle {
  display: none;
}

/* A caregiver reading on a phone in a dim room can choose a quiet navy page,
   while the illuminated cyan wayfinding and photographic chapters stay familiar. */
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-surface: oklch(18% .021 252);
  --ink: oklch(94% .008 239);
  --soft: oklch(24% .024 252);
  --muted: oklch(78% .02 240);
  --line: oklch(42% .025 247);
  --cyan-dark: oklch(81% .11 216);
  --lilac: oklch(25% .028 299);
  background: var(--theme-surface);
  color: var(--ink);
}

html[data-theme="dark"] body {
  background: var(--theme-surface);
  color: var(--ink);
}

html[data-theme="dark"] .eco-node,
html[data-theme="dark"] .search-label input {
  background: var(--theme-surface);
}

html[data-theme="dark"] .search-label input {
  border-color: oklch(54% .025 247);
  color: var(--ink);
  caret-color: var(--cyan);
}

html[data-theme="dark"] .search-label input::placeholder {
  opacity: 1;
}

html[data-theme="dark"] .ecosystem-person,
html[data-theme="dark"] .compute-visual {
  box-shadow: inset 0 0 0 1px var(--line);
}

html[data-theme="dark"] .ecosystem-lines {
  stroke: oklch(60% .075 219);
}

html[data-theme="dark"] .measure-layers > div:nth-child(3) {
  box-shadow: inset 0 0 0 1px var(--line);
}

html[data-theme="dark"] .women-feature h2 span {
  color: oklch(83% .07 306);
}

html[data-theme="dark"] .feature-link {
  border-color: oklch(48% .038 301);
}

html[data-theme="dark"] .centre-coordinate {
  background-image: radial-gradient(oklch(46% .029 232) .7px, transparent .7px);
}

html[data-theme="dark"] .filter {
  border-color: oklch(54% .025 247);
}

html[data-theme="dark"] .filter.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--navy);
}

/* Cyan panels need dark lettering even when the page's normal ink is light. */
html[data-theme="dark"] .cta-section,
html[data-theme="dark"] .continuity-strip {
  --ink: var(--navy);
  --muted: oklch(30% .03 250);
  color: var(--navy);
}

/* Preserve the supplied logo artwork on its intended light surface. */
html[data-theme="dark"] .architecture-mark {
  background: var(--paper);
  border-radius: 12px;
}

@media (min-width: 801px) and (max-width: 1050px) {
  .site-header {
    column-gap: .75rem;
  }

  .site-header nav {
    gap: .8rem;
    margin-left: 0;
    font-size: .72rem;
  }

  .site-header .nav-centre {
    padding-inline: 12px;
    gap: 8px;
  }
}

@media (max-width: 800px) {
  .site-header .brand {
    width: min(140px, 37vw);
    margin-right: 0;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .site-header nav {
    margin-left: 0;
  }

  .menu-toggle {
    min-height: 44px;
    padding-left: 0;
    gap: .6rem;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .theme-toggle {
    transition: color .2s ease-out, background-color .2s ease-out, border-color .2s ease-out;
  }
}

@media (forced-colors: active) {
  .theme-toggle,
  .theme-toggle:hover,
  .theme-toggle[aria-pressed="true"] {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  .theme-toggle:focus-visible {
    outline-color: Highlight;
  }
}

@media print {
  .theme-toggle {
    display: none !important;
  }

  html[data-theme="dark"] {
    color-scheme: light;
    --theme-surface: oklch(98% .005 235);
    --ink: oklch(26% .049 261);
    --soft: oklch(95% .012 231);
    --muted: oklch(47% .025 250);
    --line: oklch(85% .016 239);
    --cyan-dark: oklch(44% .09 223);
    --lilac: oklch(93% .028 306);
  }
}
