body {
  padding: 0 12px;
  margin: 1rem auto 3rem;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  font-size: 1.1rem;
  max-width: 40em;
  -webkit-font-smoothing: antialiased;
  color: #111;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
}

h2,
h3 {
  margin-top: 1.5em;
}

h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: 2rem;
}

strong {
  font-weight: 600;
}

a {
  color: currentColor;
}

a:hover {
  text-underline-offset: 0.2lh;
}

h1 a {
  text-decoration: none;
}

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

.authors {
  font-size: 0.95rem;
  margin: 0 0 2rem;
}

.lead {
  font-size: 1.3rem;
  margin: 0 0 2rem;
}

header nav {
  --repel-vertical-alignment: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 2.5rem;
}

.page-count {
  min-width: 6ch;
  text-align: right;
}

.section {
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

nav a {
  text-decoration: none;
}

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

/* External link icon on article titles */
article h1 a::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.3em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.4;
  vertical-align: middle;
  transition: opacity 0.2s;
}

article h1 a:hover::after {
  opacity: 0.65;
}

/* Footer navigation */
footer nav {
  margin: 3rem 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e0e0e0;
}

footer nav a {
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s;
  background-color: #f5f5f5;
  color: #333;
}

footer nav a:hover {
  background-color: #e0e0e0;
  text-decoration: none;
}

.dim {
  color: #666;
}

.repel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: var(--repel-vertical-alignment, center);
  gap: var(--gutter, 1rem);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body {
    color: unset;
  }

  .dim {
    color: #999;
  }

  header nav,
  footer nav {
    border-color: #333;
  }

  footer nav a {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }

  footer nav a:hover {
    background-color: #333;
  }
}
