:root {
  --paper: #f5efea;
  --panel: #fffaf7;
  --ink: #261b1d;
  --quiet: #645459;
  --line: #dccfc9;
  --accent: #761f35;
  --accent-dark: #521225;
  --dark: #22191c;
  --max: 76rem;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #e6c5ce; color: var(--ink); }

.wrap { width: min(calc(100% - 7rem), var(--max)); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 10;
  inset: 1rem auto auto 1rem;
  transform: translateY(-200%);
  padding: .65rem 1rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  min-height: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-size: .88rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.8rem; }
.site-nav a, .footer a {
  text-decoration: none;
  font-size: .94rem;
  font-weight: 600;
}
.site-nav a:hover, .footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .25em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  gap: clamp(2rem, 7vw, 6.2rem);
  align-items: center;
  min-height: clamp(26rem, 42vw, 35rem);
  padding-block: clamp(3rem, 5.5vw, 5.75rem);
  scroll-margin-top: 1.5rem;
}
.hero-summary {
  max-width: 27rem;
  padding-top: 1.28rem;
  border-top: 1px solid var(--accent);
}
.eyebrow, .project-category {
  color: var(--accent);
  font-size: .83rem;
  font-weight: 740;
  letter-spacing: .115em;
  text-transform: uppercase;
}
.eyebrow { margin-bottom: 1.35rem; }
h1, .work-heading h2, .project-heading h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.065em;
}
h1 {
  font-size: clamp(4.45rem, 10.1vw, 9.2rem);
  line-height: .87;
  margin-left: -.055em;
}
.hero-role {
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  line-height: 1.3;
  font-weight: 640;
  letter-spacing: -.025em;
}
.bio {
  max-width: 41ch;
  margin-block: .8rem 1.55rem;
  color: var(--quiet);
}
.work-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .6rem 1.15rem;
  background: var(--accent);
  color: var(--panel);
  font-size: .94rem;
  font-weight: 690;
  text-decoration: none;
}
.work-link:hover { background: var(--accent-dark); }

.work-section {
  padding-top: clamp(2.55rem, 4.2vw, 4.4rem);
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.work-heading { margin-bottom: clamp(1.4rem, 2.7vw, 2.35rem); }
.work-heading h2 { font-size: clamp(3.35rem, 6vw, 5.75rem); line-height: .96; }
.project-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(1.15rem, 2.3vw, 2rem) clamp(.8rem, 1.55vw, 1.3rem);
  margin-bottom: clamp(2.7rem, 5.2vw, 5.1rem);
}
.project-index-card {
  display: flex;
  flex-direction: column;
  gap: .57rem;
  min-width: 0;
  text-decoration: none;
  font-weight: 630;
  line-height: 1.24;
  letter-spacing: -.015em;
}
.project-index-card:first-child { grid-column: span 2; }
.project-index-card img {
  width: 100%;
  height: clamp(7rem, 13vw, 10.3rem);
  object-fit: cover;
  background: #eee2dc;
}
.project-index-card:hover span {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .24em;
}

.project {
  border-top: 1px solid var(--line);
  padding: clamp(2.2rem, 4.2vw, 4.2rem) max(0px, calc((100% - 68rem) / 2)) clamp(2.75rem, 5vw, 5rem);
  scroll-margin-top: .5rem;
}
.project-heading { margin-bottom: 1.25rem; }
.project-category { margin-bottom: .55rem; }
.project-heading h3 {
  font-size: clamp(2.15rem, 4.6vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.project-context {
  margin-top: .65rem;
  color: var(--quiet);
  font-size: .94rem;
}

.viewer { border: 1px solid var(--dark); }
.viewer-stage {
  display: grid;
  place-items: center;
  aspect-ratio: var(--slide-aspect, 16 / 9);
  background: var(--dark);
  touch-action: pan-y pinch-zoom;
}
.viewer-stage:focus-visible { outline-color: #e5b9c6; outline-offset: -3px; }
.slide-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.viewer-controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1rem;
  padding: .65rem .75rem;
  background: #f2e8e3;
}
.viewer-travel, .viewer-tools, .zoom-nav { display: flex; align-items: center; gap: .45rem; }
.viewer button, .dialog-inner button {
  min-height: 2.75rem;
  padding: .38rem .78rem;
  border: 1px solid #bbaba6;
  background: transparent;
  color: var(--ink);
  font-size: .89rem;
  font-weight: 660;
}
.viewer button:not(:disabled):hover { background: #ecddd9; }
.viewer button:disabled { color: #6f6360; border-color: #c5b5b0; }
.viewer .slide-enlarge { background: var(--accent); border-color: var(--accent); color: white; }
.viewer .slide-enlarge:hover { background: var(--accent-dark); }
.slide-count, .zoom-count {
  min-width: 6ch;
  padding-inline: .12rem;
  text-align: center;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.3rem, 1fr));
  gap: .55rem;
  max-height: min(45vh, 20rem);
  padding: .65rem .75rem .85rem;
  overflow: auto;
  background: #f2e8e3;
  border-top: 1px solid var(--line);
}
.viewer .slide-thumb { padding: .25rem; text-align: left; }
.slide-thumb img {
  width: 100%;
  aspect-ratio: var(--slide-aspect, 16 / 9);
  object-fit: contain;
  background: var(--dark);
}
.slide-thumb span { display: block; padding: .14rem .17rem; font-variant-numeric: tabular-nums; }
.slide-thumb[aria-current='true'] { box-shadow: inset 0 0 0 2px var(--accent); }

.project-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.55rem);
  padding-top: clamp(1.3rem, 2.7vw, 2.25rem);
}
.project-detail h4 {
  margin-bottom: .42rem;
  font: 400 clamp(1.25rem, 1.85vw, 1.53rem)/1.2 var(--serif);
}
.project-detail p { color: var(--quiet); }

.footer {
  min-height: 5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer span { font-weight: 650; }

#slide-dialog {
  width: min(calc(100% - 2rem), 94rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #826f74;
  background: var(--dark);
  color: var(--paper);
}
#slide-dialog::backdrop { background: rgb(25 16 20 / 89%); }
.dialog-inner { padding: .85rem; }
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding-bottom: .75rem;
}
.dialog-header h2 { font: 400 clamp(1.12rem, 3.6vw, 1.8rem)/1.17 var(--serif); }
.dialog-inner button { border-color: #a68e96; color: var(--panel); }
.dialog-inner button:focus-visible, .zoom-art:focus-visible { outline-color: #e5b9c6; }
.dialog-inner button:not(:disabled):hover { background: #443039; }
.dialog-inner button:disabled { color: #ab969e; border-color: #68575e; }
.zoom-art {
  width: 100%;
  height: min(70dvh, 49rem);
  overflow: auto;
  background: #170f12;
}
.zoom-image { width: 100%; height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }
.zoom-art.is-enlarged .zoom-image {
  width: max(165%, 47.5rem);
  max-width: none;
  height: auto;
  touch-action: auto;
}
.zoom-nav { padding-top: .75rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 62rem) {
  .wrap { width: calc(100% - 4rem); }
  .hero { gap: clamp(1.5rem, 4vw, 3.3rem); }
  .project-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-index-card:first-child { grid-column: auto; }
}

@media (max-width: 45rem) {
  .wrap { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 3.65rem; }
  .site-nav { gap: 1rem; }
  .hero {
    grid-template-columns: 1fr;
    gap: 1.65rem;
    min-height: auto;
    padding-block: 2.3rem 3.25rem;
  }
  .hero-summary { max-width: 34rem; padding-top: 1rem; }
  .eyebrow { margin-bottom: .86rem; }
  h1 { font-size: clamp(4.25rem, 14.5vw, 7rem); }
  .bio { max-width: 51ch; margin-block: .65rem 1.13rem; }
  .project-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-index-card:first-child { grid-column: span 2; }
  .project-index-card:first-child img { height: auto; aspect-ratio: 2.2; }
  .project-index-card img { height: auto; aspect-ratio: 1.55; }
  .project-copy { grid-template-columns: 1fr; gap: 1rem; }
  .project-detail + .project-detail { padding-top: 1rem; border-top: 1px solid var(--line); }
  .viewer-controls { display: grid; padding: .55rem; }
  .viewer-travel { justify-content: space-between; }
  .viewer-tools > * { flex: 1 1 0; padding-inline: .32rem; }
  .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
  #slide-dialog { width: 100%; max-height: none; height: 100dvh; margin: 0; border: 0; }
  .dialog-inner {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    padding: 0;
  }
  .dialog-header, .zoom-nav { padding: .65rem .55rem; }
  .zoom-art { height: 100%; }
}

@media (max-width: 23rem) {
  .wordmark { letter-spacing: .075em; }
  .site-nav { gap: .7rem; }
  h1 { font-size: clamp(3.65rem, 20vw, 4.35rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.viewer-stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.viewer--artwork .viewer-stage {
  height: clamp(17rem, 55vw, 37rem);
  padding: clamp(.4rem, 1.35vw, 1rem);
  aspect-ratio: auto;
}
.project-publications {
  margin-top: clamp(1.2rem, 3vw, 2rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.project-publications h4 { font: 400 1.28rem/1.2 var(--serif); }
.project-publications ul {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.5rem;
  margin: .57rem 0 0;
  padding: 0;
  list-style: none;
}
.project-publications a {
  color: var(--accent);
  text-underline-offset: .24em;
  font-weight: 630;
}
