:root {
  color-scheme: light;
  --paper: #f8f7f3;
  --ink: #211f1b;
  --muted: #5f5a50;
  --line: #d7d2c7;
  --accent: #864735;
  --surface: #efede6;
  --gutter: clamp(20px, 5.4vw, 86px);
  --photo-gap: clamp(12px, 1.6vw, 26px);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--sans); }
body:has(.viewer[open]) { overflow: hidden; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #ead0c5; color: var(--ink); }

.frame { width: min(100% - 2 * var(--gutter), 1380px); margin-inline: auto; }

.skip {
  position: absolute;
  z-index: 1;
  padding: 0.7rem 1rem;
  background: var(--paper);
}

.skip:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark { font: 400 1.4rem/1 var(--serif); letter-spacing: -0.06em; }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 3.4vw, 48px); font-size: 0.9rem; }
.site-header nav a, .work-link { display: inline-flex; align-items: center; min-height: 44px; }
.site-header a:hover, .work-link:hover, .contact a:hover { color: var(--accent); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(24px, 4vw, 68px);
  padding-block: clamp(28px, 4vw, 62px) clamp(62px, 8vw, 126px);
}

h1, h2 { font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(3.35rem, 5.75vw, 6.1rem); line-height: 0.97; letter-spacing: -0.067em; }
h2 { font-size: clamp(2.65rem, 5.1vw, 5.2rem); line-height: 1.03; letter-spacing: -0.062em; }
.discipline { margin-bottom: clamp(12px, 1.6vw, 24px); color: var(--accent); font-size: 0.92rem; }
.work-link { gap: 0.8rem; margin-top: clamp(12px, 1.7vw, 30px); font-size: 0.88rem; }
.work-link span, .contact a span { color: var(--accent); }
.work-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.photo { position: relative; display: block; min-width: 0; cursor: zoom-in; }
.photo img { width: 100%; height: auto; background: var(--surface); }
.photo::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--paper);
  content: "+" / "";
  font-size: 1.15rem;
  opacity: 0;
  transition: opacity 150ms ease;
}

.photo:hover::after, .photo:focus-visible::after { opacity: 1; }

.work, .about, .contact { scroll-margin-top: 24px; }
.work { border-top: 1px solid var(--line); padding-top: clamp(22px, 3.2vw, 46px); }
.work h2 { margin-bottom: clamp(25px, 3.1vw, 48px); }
.gallery { display: grid; gap: var(--photo-gap); }
.photo-row { display: flex; align-items: start; gap: var(--photo-gap); }
.photo-row .photo { flex: var(--ratio) 1 0; }

.about { margin-block: clamp(70px, 10vw, 155px); border-top: 1px solid var(--line); }
.about-inner, .contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(22px, 4vw, 68px);
  padding-top: clamp(26px, 4vw, 62px);
}

.about-inner > div, .contact address { width: min(100%, 580px); }
.about-lead { margin-bottom: 1rem; font: 400 clamp(1.75rem, 3vw, 3.1rem)/1.16 var(--serif); letter-spacing: -0.038em; }
.about p + p { max-width: 34rem; color: var(--muted); }

.contact { padding: 0 0 8px; border-top: 1px solid var(--line); background: var(--surface); }
.contact-inner { padding-bottom: clamp(32px, 5vw, 75px); }
.contact address { align-self: center; font-style: normal; }
.contact address a, .footer-line { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.contact address a { min-height: 50px; border-bottom: 1px solid var(--line); font-size: clamp(0.97rem, 1.35vw, 1.2rem); }
.footer-line { min-height: 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.84rem; }
.footer-line small { font-size: inherit; }

.viewer {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(10px, 2.2vw, 28px);
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.viewer::backdrop { background: var(--paper); }
.viewer-layout { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; gap: 10px; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; padding-left: 0.35rem; }
.viewer-index { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.viewer-stage {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  scrollbar-color: #9b9384 var(--surface);
}

.viewer-stage:focus-visible { outline-offset: -2px; }

.viewer-canvas { display: grid; place-items: center; width: max-content; height: max-content; min-width: 100%; min-height: 100%; }
.viewer-image { max-width: none; flex: none; cursor: zoom-in; }
.viewer-stage.zoomed .viewer-image { cursor: grab; }
.viewer-stage.dragging .viewer-image { cursor: grabbing; }

.viewer-controls { display: flex; justify-content: center; gap: clamp(10px, 2.5vw, 28px); }
.viewer-controls > div { display: flex; gap: 5px; }

.viewer button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.viewer button:hover { border-color: var(--accent); color: var(--accent); }
.viewer button[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.viewer .viewer-reset { min-width: 64px; padding-inline: 4px; font-size: 0.8rem; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: clamp(14px, 4vw, 34px); }
  h1 { font-size: clamp(3.15rem, 10vw, 5.75rem); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .photo-row { display: contents; }
  .gallery .portrait { width: min(86%, 320px); justify-self: center; }
}

@media (max-width: 555px) {
  .site-header { min-height: 60px; }
  .site-header nav { font-size: 0.82rem; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .portrait { width: min(76%, 310px); }
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo::after { transition: none; }
}
