:root {
  --background: #faf8f4;
  --foreground: #1c1814;
  --muted: #6f6964;
  --border: #e7e5e0;
  --card: #ffffff;
  --accent: #b45309;
  --radius: 0.85rem;
  /* No font files ship with these static pages (and nothing may be fetched), so the stacks stay on system fonts. */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}

.dark {
  --background: #1c1814;
  --foreground: #faf8f4;
  --muted: #a8a29e;
  --border: #2d2520;
  --card: #28221d;
  --accent: #f59e0b;
  color-scheme: dark;
}

html,
body {
  background: var(--background);
  color: var(--foreground);
}

body {
  font-family: var(--font-sans);
  margin: 0;
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.site-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--foreground);
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  transition: opacity 220ms ease-out;
}

.site-brand:hover {
  opacity: 0.75;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  transition: opacity 220ms ease-out;
}

.site-nav a:hover {
  opacity: 0.75;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.55rem 0.85rem;
  min-height: 2.4rem;
  min-width: 2.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.theme-toggle:hover {
  opacity: 0.85;
}

.theme-toggle:active {
  transform: scale(0.97);
}

.site-brand:focus-visible,
.site-nav a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  /* phone: every tap target in the bar is at least 44px tall */
  .site-brand,
  .site-nav a,
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .theme-toggle {
    min-width: 44px;
    justify-content: center;
    margin-left: auto;
  }
}

@media (max-width: 390px) {
  .site-bar {
    padding: 0.7rem 0.75rem;
  }
  .site-brand {
    font-size: 0.7rem;
  }
  .site-nav a {
    padding: 0.5rem 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-brand,
  .site-nav a,
  .theme-toggle {
    transition: none;
  }
  .theme-toggle:active {
    transform: none;
  }
}
