:root {
  --ink: #000;

  /* Home colour is the swatch Sadie chose. The rest are picked to sit with it:
     its complement (teal), neighbours (orange, mustard, sand) and cool
     contrasts (blue, green, lilac), all at a similar strength. */
  --home: #d68178;
  --teal: #4fb3a6;
  --mustard: #e8b83a;
  --sand: #efc98a;
  --blue: #6c9bd6;
  --orange: #ea8f4e;
  --green: #8fbf6a;
  --lilac: #a98fd0;

  --bar: 68px;
  --edge: clamp(16px, 2.2vw, 30px);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--home);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.42;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- corner type: top left, top right, bottom left, bottom right ---------- */

.top,
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--bar);
  padding: 0 var(--edge);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--ink);
  /* background is set by the script to the colour of the field behind */
  background: var(--home);
}
.top { top: 0; font-size: 18px; font-weight: 600; }
.bottom { bottom: 0; }

.top nav { display: flex; gap: 1.4em; }
.top-right { justify-content: flex-end; }

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark span { font-style: italic; font-weight: 500; }
.wordmark:hover { text-decoration: none; }

/* date left, book page right: old-style figures, heavy enough to hold the colour */
.bottom .num {
  font-family: var(--display);
  font-weight: 700;
  font-variant-numeric: oldstyle-nums;
  font-size: clamp(32px, 4.2vw, 50px);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: opacity 0.16s ease;
}
.bottom .num:last-child { text-align: right; }
.bottom .label {
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1.5px solid currentColor;
  transition: opacity 0.16s ease;
}
.bottom.swap .num,
.bottom.swap .label { opacity: 0; }

/* ---------- fields: every section is one full-bleed colour ---------- */

.field {
  --pad: clamp(20px, 4vh, 48px);
  background: var(--field);
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--bar) + var(--pad)) clamp(20px, 6vw, 96px);
  display: grid;
  align-items: center;
}

/* home: the cover in the middle */
.hero { place-items: center; }

.cover {
  display: block;
  width: min(78%, 0.6 * (max(480px, 100svh) - 2 * var(--bar)));
  height: auto;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* title fields: words in the middle */
.title { justify-items: center; text-align: center; }
.title > div { max-width: 32em; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
  line-height: 1;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(52px, 9vw, 120px); }
h2 { font-size: clamp(48px, 8vw, 108px); }
h3 { font-size: clamp(34px, 4.4vw, 60px); }

.byline { font-style: italic; margin: 0.8em 0 1.2em; }
.title h2 + p { margin-top: 1.3em; }

.kicker {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 1.1em;
}

/* image and text side by side */
.block {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px);
}
.block .text { max-width: 26em; }
.block h3 + p { margin-top: 0.8em; }
.block .text p:last-child { margin-bottom: 0; }
/* links in running text stay underlined so they read as links */
.text p a { text-decoration: underline; text-underline-offset: 3px; }

/* image on the right instead */
.block.flip .ph { order: 2; }
.block.flip .text { justify-self: end; }

/* image in the middle, words underneath */
.block.centred {
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: clamp(20px, 3.5vh, 36px);
}
.block.centred .ph { width: min(100%, 78vh); width: min(100%, 78svh); }
.block.centred .text { max-width: 30em; }
.block.centred .kicker { margin-bottom: 0.7em; }

.colophon { font-size: 16px; margin-top: 2.4em; }

/* ---------- placeholders ---------- */

.ph {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - 2 * var(--bar) - 2 * var(--pad));
  max-height: calc(100svh - 2 * var(--bar) - 2 * var(--pad));
  justify-self: center;
  border: 2px dashed var(--ink);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 14px),
    rgba(255, 255, 255, 0.3);
  font-size: 17px;
  line-height: 1.35;
}
.ph b {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.1;
  margin: 0.25em 0;
}
.ph small { font-style: italic; font-size: 16px; }
.ph-wide { aspect-ratio: 3 / 2; }
.ph-portrait { aspect-ratio: 1; max-width: 460px; position: relative; overflow: hidden; }

/* bio photo: square head-and-shoulders crop of a tall phone portrait */
.bio-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 36%;
}

/* draft copy reads as draft */
.placeholder-text { font-style: italic; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  :root { --bar: 58px; }
  body { font-size: 18px; }
  .top { font-size: 15px; }
  .top nav { gap: 0.9em; }
  .wordmark { font-size: 21px; }
  .top-left a:first-child { display: none; }
  .bottom { grid-template-columns: 1fr 1fr; }
  .bottom .label { display: none; }

  .block,
  .block.centred {
    grid-template-columns: 1fr;
    align-content: center;
    text-align: left;
    justify-items: stretch;
    gap: 22px;
  }
  .block.flip .ph { order: 0; }
  .block.flip .text { justify-self: start; }
  .ph { max-height: 52svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bottom .num, .bottom .label { transition: none; }
}
