:root {
  --paper: #fcfcf8;
  --ink: #111;
  --muted: #6b6b66;
  --rule: #e4e4dc;
  --accent: #5c1f1f;
  --gutter: clamp(20px, 4vw, 56px);
  --measure: 34rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.75;
}

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

a { color: inherit; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  padding: 6px 0;
}

.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }

.site-nav a {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.site-nav a.nav-contact {
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.site-nav a.nav-contact:hover { background: var(--accent); color: var(--paper); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  display: block;
  width: 24px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform 0.2s, background 0.2s;
}

.menu-toggle span::before { transform: translateY(-7px); }
.menu-toggle span::after { transform: translateY(5.5px); }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-1.5px) rotate(-45deg); }

/* Buttons */

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 13px 30px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.button:hover { background: var(--accent); color: var(--paper); }

/* Home */

.hero { padding: var(--gutter) var(--gutter) 0; }

.hero picture,
.feature-image picture { display: contents; }

.hero img {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
}

.caption {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.intro {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  text-align: center;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.7;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 6vw, 88px);
  padding: clamp(36px, 6vw, 80px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.feature:nth-of-type(even) .feature-image { order: 2; }

.feature-text { max-width: var(--measure); justify-self: center; }

.feature-image img { width: 100%; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2 {
  margin: 0 0 18px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

p { margin: 0 0 1em; }

.contact-band {
  padding: clamp(56px, 9vw, 112px) var(--gutter);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.contact-band p { max-width: 36rem; margin: 0 auto 1em; }

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  padding: 30px var(--gutter);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer p { margin: 0; }

/* Gallery */

.page-head {
  padding: clamp(40px, 6vw, 72px) var(--gutter) 8px;
  text-align: center;
}

.page-head p { max-width: 38rem; margin: 0 auto; color: var(--muted); }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  padding: 26px var(--gutter) 34px;
}

.filters button {
  min-height: 44px;
  padding: 6px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.gallery {
  columns: 3;
  column-gap: clamp(16px, 2.5vw, 36px);
  padding: 0 var(--gutter) clamp(48px, 7vw, 88px);
}

.gallery figure {
  margin: 0 0 clamp(22px, 3vw, 40px);
  break-inside: avoid;
}

.gallery figure[hidden] { display: none; }

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.gallery img { width: 100%; transition: opacity 0.2s; }
.gallery button:hover img { opacity: 0.86; }

.gallery figcaption { margin-top: 9px; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* Full-screen viewer */

.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.viewer::backdrop { background: var(--paper); }

.viewer-inner {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  padding: 56px var(--gutter) 22px;
}

.viewer picture { display: contents; }

.viewer img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.viewer-caption { margin: 14px 0 0; text-align: center; font-size: 0.88rem; color: var(--muted); }

.viewer button {
  position: absolute;
  width: 48px;
  height: 48px;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.viewer-close { top: 6px; right: 10px; }
.viewer-prev { top: 50%; left: 4px; transform: translateY(-50%); }
.viewer-next { top: 50%; right: 4px; transform: translateY(-50%); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Skip link (visible only when focused with the keyboard) */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--paper);
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.skip-link:focus { left: 8px; }

.site-footer a { display: inline-block; padding: 12px 0; margin: -12px 0; }

/* Reading pages: Biography, Books, Career, Contact */

.prose {
  max-width: 38rem;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 104px);
}

.prose h2 {
  margin-top: clamp(48px, 7vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
}

.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.prose h3 {
  margin: 36px 0 14px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose .lead { font-size: clamp(1.1rem, 1.8vw, 1.25rem); }

.prose a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }

.portrait { margin: 0 0 40px; }
.portrait picture { display: contents; }
.portrait img { width: 100%; }

.wide { max-width: 52rem; }

/* Books */

.book-list { list-style: none; margin: 0; padding: 0; }

.book {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.book:first-child { border-top: 0; padding-top: 8px; }

.book-cover {
  aspect-ratio: 2 / 3;
  border: 1px solid var(--rule);
  background: #f4f4ee;
}

/* With a real cover, show it whole at its own shape (some books are wider than tall). */
.book-cover:has(img) { aspect-ratio: auto; border: 0; background: none; display: grid; gap: 10px; }
.book-cover img { width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }

.book-title { margin: 0 0 6px; font-size: 1.2rem; font-style: italic; line-height: 1.35; }
.book p { margin: 0 0 4px; }
.book .meta { color: var(--muted); font-size: 0.92rem; }

/* Career record: date on the left, entry on the right; stacked on phones */

.record { list-style: none; margin: 0; padding: 0; }

.record li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 4px 28px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.record li:first-child { border-top: 0; }

.record .when { color: var(--muted); font-size: 0.92rem; padding-top: 2px; }
.record p { margin: 0; }
.record .note { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }

.name-list {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.name-list li { padding: 4px 0; break-inside: avoid; }

/* Contact form */

.inquiry { margin-top: 36px; }

.field { margin-bottom: 26px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #c9c9c0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.field textarea { min-height: 180px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.field [aria-invalid="true"] { border-color: var(--accent); }

.error { margin: 8px 0 0; color: var(--accent); font-size: 0.9rem; font-weight: 400; }
.error:empty { display: none; }

.honeypot { position: absolute; left: -9999px; }

.inquiry .button { margin-top: 4px; min-height: 48px; background: none; font: inherit; font-size: 0.82rem; font-weight: 400; cursor: pointer; }
.inquiry .button:hover { background: var(--accent); color: var(--paper); }

/* Tablet */

@media (max-width: 900px) {
  .gallery { columns: 2; }
}

/* Phone */

@media (max-width: 720px) {
  body { font-size: 1rem; }

  .site-header { padding: 11px var(--gutter); }
  .site-name { font-size: 1.2rem; }
  .menu-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 69px 0 0;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
  }

  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }

  .site-nav a { font-size: 1rem; padding: 10px 0; }
  .site-nav a.nav-contact { padding: 10px 22px; }

  .book { grid-template-columns: 76px 1fr; gap: 18px; }
  .record li { grid-template-columns: 1fr; }
  .name-list { columns: 1; }

  .hero { padding: 0; }
  .hero img { max-height: 62vh; }
  .hero .caption { padding: 0 var(--gutter); }

  .feature { grid-template-columns: 1fr; gap: 26px; }
  .feature:nth-of-type(even) .feature-image { order: 0; }
  .feature-text { justify-self: start; }

  .gallery { columns: 1; }

  .site-footer { flex-direction: column; }

  .viewer-inner { padding: 52px 0 18px; }
  .viewer-caption { padding: 0 var(--gutter); }
}
