:root {
  color-scheme: light dark;
  --paper: #fbfcf8;
  --plate: #f1f4ec;
  --ink: #1b241e;
  --muted: #5b665e;
  --accent: #4f7a28;
  --rule: #cfd6c8;
  --prose: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --lettering: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue",
    Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131a15;
    --plate: #1a231c;
    --ink: #e3e8e0;
    --muted: #9ba69d;
    --accent: #a3cf6a;
    --rule: #2e3a31;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.6 var(--prose);
  -webkit-text-size-adjust: 100%;
}

/* One column, anchored to the left like text on a drawing sheet. With a
   max-width the right margin only bites on a narrow screen, as the gutter. */
.masthead,
main {
  max-width: 42rem;
  margin-inline: clamp(1.25rem, 10vw - 1.5rem, 9rem) 1.25rem;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding-block: 1.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--lettering);
}

.masthead nav {
  display: flex;
  gap: 1.25rem;
  margin-inline-start: auto;
}

.masthead a {
  color: var(--ink);
  text-decoration: none;
}

.masthead a:hover,
.masthead a[aria-current] {
  color: var(--accent);
}

main {
  padding-block: 2.5rem 5rem;
}

h1,
h2,
h3 {
  font-family: var(--lettering);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
  scroll-margin-top: 1.5rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3rem);
  letter-spacing: -0.01em;
}

h2 {
  margin: 3.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 1.75rem;
}

h3 {
  margin: 2.75rem 0 0;
  font-size: 1.3125rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* A project's fields, set like the title block of a drawing. The 1px gap
   over the rule colour draws the lines, however the cells wrap. */
.plate {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--rule);
  background: var(--rule);
  font-family: var(--lettering);
}

.plate div {
  padding: 0.5rem 0.75rem 0.6rem;
  background: var(--plate);
}

.plate dt {
  color: var(--accent);
  font-size: 0.875rem;
}

.plate dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.index {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-family: var(--lettering);
  font-size: 1.3125rem;
}

.index li + li {
  margin-top: 0.35rem;
}

.note {
  color: var(--muted);
}
