/* Reset, element typography, links, focus. */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The nav is sticky and 67px tall, so without this every fragment target
     lands underneath it: a "Read more about this work" link scrolls 4,000px
     to put the project title completely behind the bar. On the scroll
     container rather than per-id, so it covers the section ids, the year
     group ids, the *-heading ids and the skip link, plus keyboard focus
     scrolling. */
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  /* Two declarations, not one shorthand. The colour is the whole canvas and
     the wash is an image painted over its first 46rem, so a browser that
     cannot resolve the gradient — or a print stylesheet that sets
     --ground-wash to none — still gets a correctly filled page rather than a
     transparent one. no-repeat matters: the gradient's positioning area is the
     full document box, so its 46rem stop is 46rem from the top of the page and
     the flat --ground carries every screenful after that. */
  background-color: var(--ground);
  background-image: var(--ground-wash);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-prose);
  font-size: var(--text-base);
  line-height: var(--leading-prose);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  line-height: var(--leading-tight);
  font-weight: 600;
  text-wrap: balance;
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

img { max-width: 100%; height: auto; display: block; }

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

/* Focus rings appear only once a visitor has used the keyboard. */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.using-keyboard :focus {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0; left: var(--space-4);
  transform: translateY(-120%);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--ground-raised);
  color: var(--ink);
  border: var(--rule-width) solid var(--rule);
  font-family: var(--font-meta);
  font-size: var(--text-sm);
}
.skip-link:focus { transform: translateY(0); }

.noscript-warning, .load-error {
  max-width: var(--measure-prose);
  margin: var(--space-16) auto;
  padding: 0 var(--gutter);
  font-family: var(--font-meta);
}
