@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #17212b;
  --muted: #53606c;
  --paper: #f3f5f7;
  --rule: #c5cdd5;
  --link: #1b4f9c;
  --link-hover: #0f3470;
  --focus: #1b4f9c;
  --error: #a3261a;

  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --display: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif;

  --measure: 36rem;
  --gutter: 1.25rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf1;
    --muted: #a0acb8;
    --paper: #0f161d;
    --rule: #2c3947;
    --link: #8db4f0;
    --link-hover: #bcd3f7;
    --focus: #8db4f0;
    --error: #ff9a8f;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

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

.page {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 3rem;
}

/* Masthead: the name is the one loud thing on the page. */
/* Masthead: the name is the one loud thing on the page. The portrait is not a box: it bleeds off the
   right edge and dissolves into the page. Luminosity blending keeps the photo's light and shade but takes
   its colour from the page, so the foliage becomes ink-blue in dark mode and neutral grey in light. */
.masthead {
  --pw: min(78vw, 22rem);
  position: relative;
  padding: clamp(11.5rem, 62vw, 16rem) 0 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead > div {
  position: relative;
  z-index: 1;
}

.portrait {
  position: absolute;
  top: 0;
  right: calc(50% - 50vw);
  z-index: 0;
  width: var(--pw);
  height: auto;
  pointer-events: none;
  mix-blend-mode: luminosity;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.18) 16%, rgba(0, 0, 0, 0.55) 34%, #000 58%), linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 12%, #000 28%, #000 58%, rgba(0, 0, 0, 0.5) 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.18) 16%, rgba(0, 0, 0, 0.55) 34%, #000 58%), linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 12%, #000 28%, #000 58%, rgba(0, 0, 0, 0.5) 82%, transparent 100%);
  mask-composite: intersect;
}

.name {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.4rem, 12vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.name a {
  color: inherit;
  text-decoration: none;
}

.bio {
  max-width: var(--measure);
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.55;
}

.nowrap { white-space: nowrap; }

.bio + .bio {
  margin-top: 1em;
}

@media (min-width: 52rem) {
  .page {
    padding-top: 5rem;
  }

  .name {
    font-size: clamp(3.4rem, 9.5vw, 7.5rem);
  }

  .masthead {
    --pw: min(31rem, 52vw);
    display: flex;
    align-items: flex-end;
    min-height: calc(var(--pw) * 0.92 + 3rem);
    padding: 0 0 3rem;
  }
}

/* Index: section titles sit in the margin, entries in the column. */
.group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 3rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.group h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--muted);
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.entries li + li {
  margin-top: 1.6rem;
}

.entry-title {
  display: inline;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
}

.entry-where {
  color: var(--muted);
  font-size: 1rem;
}

.entry-note {
  margin: 0.25rem 0 0;
}

@media (min-width: 52rem) {
  .group {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1.75rem;
  color: var(--muted);
  font-size: 1rem;
}

.foot a {
  color: var(--muted);
}

.foot a:hover {
  color: var(--ink);
}

/* Contact page */
.back {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.contact-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.contact-lede {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  font-size: 1.2rem;
}

.form {
  max-width: var(--measure);
}

.field {
  margin-bottom: 1.4rem;
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 1rem;
}

.field .optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 2px;
}

.field textarea {
  min-height: 11rem;
  resize: vertical;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
}

.button:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
  color: #fff;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.status {
  margin: 1.25rem 0 0;
  min-height: 1.6em;
}

.status.is-error {
  color: var(--error);
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .button {
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
  }
}
