:root {
  --ink: #1a1a1a;
  --ink-soft: #55555f;
  --rule: #e2e2e6;
  --bg: #fdfdfc;
  --accent: #0b4f6c;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8e6;
    --ink-soft: #a3a3ab;
    --rule: #32323a;
    --bg: #16161a;
    --accent: #7fc3de;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  max-width: var(--measure);
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, Charter, "Iowan Old Style", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration: none; }

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 1.1rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.875rem;
}

.masthead nav a { text-decoration: none; color: var(--ink-soft); }
.masthead nav a:hover { color: var(--accent); }
.masthead nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main { padding-top: 2rem; }

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 1.1rem; }

.lead { font-size: 1.1875rem; color: var(--ink); }

.portrait {
  float: right;
  width: 148px;
  height: auto;
  margin: 0.25rem 0 1rem 1.75rem;
  border-radius: 2px;
}

@media (max-width: 460px) {
  .portrait { width: 108px; margin-left: 1.1rem; }
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.4rem;
}

.small { font-size: 0.9375rem; color: var(--ink-soft); }
.small a { color: var(--accent); }

.jump { margin-top: -0.5rem; }

.sidenav { display: none; }

@media (min-width: 1180px) {
  .jump { display: none; }

  .sidenav {
    display: block;
    position: fixed;
    top: 8.5rem;
    left: calc(50% - 22rem - 10.5rem);
    width: 9.5rem;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 0.8125rem;
    line-height: 1.35;
    border-left: 1px solid var(--rule);
  }

  .sidenav a {
    display: block;
    padding: 0.35rem 0 0.35rem 0.75rem;
    color: var(--ink-soft);
    text-decoration: none;
  }

  .sidenav a:hover { color: var(--accent); }
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

ul { margin: 0 0 1.1rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

.index li { margin-bottom: 0.6rem; }

.refs {
  font-size: 0.9375rem;
  list-style: none;
  padding-left: 0;
}

.refs li {
  margin-bottom: 0.85rem;
  padding-left: 1.1rem;
  text-indent: -1.1rem;
}

ol.refs {
  list-style: decimal;
  padding-left: 2.4rem;
}

ol.refs li {
  padding-left: 0.3rem;
  text-indent: 0;
}

ol.refs li::marker {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.refs strong { font-weight: 600; }

.plate {
  display: block;
  line-height: 0;
}

.plate img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.plate:hover img { border-color: var(--accent); }

a.pdf {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  white-space: nowrap;
}

a.pdf:hover { border-color: var(--accent); }

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

footer p { margin: 0; }

:target { scroll-margin-top: 1rem; }
