:root {
  color-scheme: light;
  --page-bg: #fff;
  --text: #111;
  --muted: #666;
  background: var(--page-bg);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #171717;
  --text: #eee;
  --muted: #aaa;
}

body {
  max-width: 40em;
  margin: 0 auto;
  padding: 0 1em;
  color: var(--text);
  background: var(--page-bg);
}

a:link,
a:visited {
  color: var(--muted);
}

nav {
  display: flex;
  align-items: flex-start;
  gap: 1em;
  margin-bottom: 2em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.2em;
  row-gap: 0.35em;
}

nav a {
  text-decoration: none;
  color: var(--muted);
}

nav a:hover {
  text-decoration: underline;
}

nav a.current {
  color: var(--text);
  font-weight: bold;
}

#theme-toggle {
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

#theme-toggle:hover {
  text-decoration: underline;
}

#theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
