:root {
  color-scheme: light;
  --ground: #F4EEE3;
  --ink: #000000;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #000000;
  --ink: #F4EEE3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ground: #000000;
    --ink: #F4EEE3;
  }
}

[hidden] { display: none !important; }
.theme-logo { display: block; }
.theme-logo .logo-dark, .hint-bird.logo-dark { display: none; }
:root[data-theme="dark"] .theme-logo .logo-light,
:root[data-theme="dark"] .hint-bird.logo-light { display: none; }
:root[data-theme="dark"] .theme-logo .logo-dark { display: block; }
:root[data-theme="dark"] .hint-bird.logo-dark { display: inline-block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-logo .logo-light,
  :root:not([data-theme]) .hint-bird.logo-light { display: none; }
  :root:not([data-theme]) .theme-logo .logo-dark { display: block; }
  :root:not([data-theme]) .hint-bird.logo-dark { display: inline-block; }
}

.theme-toggle {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle span[data-mode] { padding: 5px 6px; }
.theme-toggle[aria-pressed="false"] [data-mode="light"],
.theme-toggle[aria-pressed="true"] [data-mode="dark"] {
  background: var(--ink);
  color: var(--ground);
}
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }

/* Reserve the header's right-hand space for the toggle on the join page. */
.site-header { align-items: flex-start; }
.site-header .back-link { margin-top: 52px; }
