@font-face {
  font-family: Cormorant;
  src: url("assets/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171717;
  --quiet: #625f5b;
  --line: #eaeaea;
  --frame: calc(100% - max(32px, env(safe-area-inset-left) + env(safe-area-inset-right) + 16px));
  font-family: Cormorant, Baskerville, Georgia, serif;
  font-weight: 400;
  color: var(--ink);
  background: white;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
}

p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.frame { width: var(--frame); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }

.header-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: clamp(20px, 6.25vw, 29px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: #000;
  text-decoration: underline;
  text-decoration-thickness: .045em;
  text-underline-offset: .08em;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: clamp(10px, 3vw, 24px);
  color: var(--quiet);
  font-size: clamp(13px, 3.75vw, 17px);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.top-nav a { display: grid; min-height: 44px; align-items: center; }
.top-nav a:hover, .top-nav a[aria-current] { color: #000; }
.stage { position: relative; container-type: size; isolation: isolate; }
.view { position: absolute; inset: 0; display: grid; place-items: center; }
.outgoing-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: white;
  pointer-events: none;
}
.home img { width: var(--frame); height: 100%; max-height: 96cqh; object-fit: contain; }

.about-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(9px, 2cqh, 19px);
  height: min(92cqh, 680px);
  max-width: 560px;
}

.about-portrait { min-height: 0; min-width: 0; }
.about-portrait img { width: 100%; height: 100%; object-fit: contain; }
.about-side { display: grid; align-content: end; min-width: 0; }
.about-statement {
  max-width: 60ch;
  margin-bottom: clamp(10px, 2cqh, 18px);
  font-size: clamp(15px, 4.25vw, 18px);
  line-height: 1.18;
}
.about-statement p + p { margin-top: .68em; }
.contact {
  margin: 0 0 clamp(9px, 2cqh, 18px);
  color: #3c3c3c;
  font-size: clamp(14px, 4.15vw, 20px);
  font-style: normal;
  line-height: 1.06;
}
.contact > span { display: block; }
.contact-links { white-space: nowrap; }
.contact a:hover { text-decoration: underline; text-underline-offset: .12em; }
.contact-sheet { position: relative; }
.contact-sheet picture { display: block; }
.contact-sheet img { width: 100%; height: auto; aspect-ratio: 1992 / 394; object-fit: contain; }

.portrait-buttons {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(2, 1fr);
  column-gap: .5%;
  row-gap: 2.54%;
}

.portrait-buttons button { width: 100%; min-width: 0; }
.portrait-buttons button:hover { box-shadow: inset 0 0 0 1px #85827d; }
.portrait-buttons button:focus-visible { z-index: 1; outline-offset: 0; }

.site-footer { z-index: 1; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.project-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-group { display: contents; }
.group-toggle {
  grid-row: 2;
  min-height: 44px;
  color: var(--quiet);
  font-size: clamp(13px, 3.75vw, 18px);
  font-weight: 300;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.group-toggle[aria-pressed="true"] { color: #000; text-decoration: underline; text-underline-offset: .27em; }
.group-label { display: none; }

.group-panel {
  grid-area: 1 / 1 / 2 / -1;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  margin-inline: -8px;
  border-bottom: 1px solid var(--line);
  padding-top: 7px;
}

.group-toggle[aria-pressed="true"] + .group-panel { display: grid; }
.group-heading {
  justify-self: center;
  color: var(--quiet);
  font-size: clamp(8.5px, 2.3vw, 11px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-list {
  display: flex;
  gap: clamp(14px, 4vw, 24px);
  overflow-x: auto;
  scrollbar-width: thin;
  padding-inline: 3px;
}
.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  color: #514f4a;
  font-size: clamp(11px, 3.65vw, 16px);
  font-weight: 300;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
}
.project-link:first-child { margin-inline-start: auto; }
.project-link:last-child { margin-inline-end: auto; }
.project-list .project-link:focus-visible { outline-offset: -1px; }
.project-link br { display: none; }
.project-link:hover { color: #000; }
.project-link[aria-current],
.project-group[data-current] .group-label,
.project-group[data-current] .group-toggle {
  color: #000;
  font-weight: 500;
  -webkit-text-stroke-width: 0;
}
.project-group[data-current] .group-heading { color: #222; font-weight: 450; }

@media (width < 1080px), (height < 460px) {
  .project-list:has(.project-link:nth-child(4)) { gap: clamp(5px, 1.6vw, 16px); }
  .project-list:has(.project-link:nth-child(4)) .project-link { flex: none; }
  .project-list:has(.project-link:nth-child(4)) br { display: initial; }
}

@media (max-width: 300px) {
  .project-list:has(.project-link:nth-child(4)) { gap: 3px; padding-inline: 0; }
}

.reader-layout {
  --spread-width: min(calc(100cqw - 24px), 1460px, calc((100cqh - 64px) * var(--spread-ratio, 1.4142)));
  display: grid;
  grid-template:
    "spread spread spread" auto
    "previous reader-footer next" 44px / 44px minmax(0, 1fr) 44px;
  width: var(--spread-width);
  align-items: center;
}

.spread-viewport {
  position: relative;
  grid-area: spread;
  display: flex;
  height: calc(var(--spread-width) / var(--spread-ratio, 1.4142));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pages {
  display: grid;
  grid-template-columns: repeat(var(--page-count, 2), minmax(0, 1fr));
  column-gap: clamp(2px, .24vw, 4px);
  width: 100%;
  margin: auto;
  flex: none;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}

.page {
  min-width: 0;
  width: 100%;
  aspect-ratio: var(--page-ratio, .7071);
  object-fit: fill;
  outline: 1px solid #e8e8e8;
  outline-offset: -1px;
}

.outgoing-pages {
  position: absolute;
  z-index: 1;
  margin: 0;
  background: white;
  pointer-events: none;
}

.pages:focus-visible { outline-offset: -2px; }
.pages[aria-busy="true"] { cursor: wait; }
.reader-error { position: absolute; inset: 50% 0 auto; text-align: center; font-size: 16px; }
.reader-error button { text-decoration: underline; }

.turn {
  display: grid;
  place-items: center;
  min-height: 44px;
  color: #393632;
}
.turn::before {
  content: "";
  grid-area: 1 / 1;
  width: 11px;
  height: 11px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: translateX(-1px) rotate(45deg);
}
.turn::after {
  content: "";
  grid-area: 1 / 1;
  width: 33px;
  height: 33px;
  border: 1px solid #dedbd7;
  border-radius: 50%;
}
.turn:hover { color: #000; }
.turn:hover::after { border-color: #a8a39c; }
.turn:disabled { visibility: hidden; }
#previous { grid-area: previous; }
#previous::before { transform: translateX(1px) rotate(-135deg); }
#next { grid-area: next; }

.spread-progress {
  grid-area: reader-footer;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.spread-progress span {
  width: 12px;
  height: 2px;
  background: #a7a39e;
}
.spread-progress span[data-current] { background: #242424; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#portfolio-download {
  grid-area: reader-footer;
  justify-self: center;
  display: grid;
  place-items: center;
  min-height: 44px;
  font-size: clamp(13px, 2.7vw, 16px);
  color: var(--quiet);
}
#portfolio-download:hover { color: #000; text-decoration: underline; text-underline-offset: .18em; }

.reader.is-zoomed .reader-layout { width: 100%; height: 100cqh; grid-template: "spread" minmax(0, 1fr) / 100%; }
.reader.is-zoomed .spread-viewport { height: 100%; overflow: auto; overscroll-behavior: contain; }
.reader.is-zoomed .pages { width: max(140%, 920px); cursor: zoom-out; touch-action: auto; }
.reader.is-zoomed .turn, .reader.is-zoomed .spread-progress, .reader.is-zoomed #portfolio-download { display: none; }

@media (min-width: 760px) {
  .reader-layout {
    --spread-width: min(calc(100cqw - 128px), 1460px, calc((100cqh - 38px) * var(--spread-ratio, 1.4142)));
    width: calc(var(--spread-width) + 96px);
    grid-template: "previous spread next" auto ". reader-footer ." minmax(24px, auto) / 48px minmax(0, 1fr) 48px;
  }
  .reader-layout:has(#portfolio-download:not([hidden])) {
    --spread-width: min(calc(100cqw - 128px), 1460px, calc((100cqh - 64px) * var(--spread-ratio, 1.4142)));
  }
}

.detail {
  width: min(100% - 24px, 900px);
  height: min(100dvh - 24px, 1000px);
  padding: 18px;
  border: 0;
  background: white;
}
.detail::backdrop { background: rgb(0 0 0 / 25%); }
.detail form { position: absolute; top: 5px; right: 5px; }
.detail button { width: 44px; height: 44px; font: 22px/1 Cormorant, Georgia, serif; }
.detail img { width: 100%; height: 100%; object-fit: contain; }

@media (min-width: 600px) and (min-aspect-ratio: 5/4) {
  .home img { width: min(75vw, 1680px); max-height: 95cqh; }
  .about-layout {
    max-width: none;
    height: min(78.2cqh, 52.2cqw, 885px);
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: .22cqw;
    transform: translateY(3.75cqh);
  }
  .about-portrait { height: 100%; aspect-ratio: 1725 / 2213; }
  .about-statement {
    margin-bottom: clamp(15px, 2.2cqw, 55px);
    font-size: clamp(15px, 1.06vw, 27px);
  }
  .contact { margin-bottom: min(3.38cqw, 86px); font-size: clamp(13px, 1.06vw, 27px); }
}

@media (min-width: 600px) and (min-aspect-ratio: 5/4) and (max-height: 519px) {
  .about-layout { height: 92cqh; gap: 16px; transform: none; }
  .about-side { align-content: center; }
  .about-statement { max-width: 74ch; margin-bottom: 8px; font-size: clamp(12px, 5cqh, 15px); line-height: 1.12; }
  .contact { margin-bottom: 9px; font-size: clamp(12px, 5.8cqh, 15px); }
  .contact-sheet { width: min(100%, 325px, 115cqh); }
}

@media (max-height: 620px) and (max-aspect-ratio: 5/4) {
  .about-layout { --about-gap: 6px; }
  .about-statement p + p { margin-top: .55em; }
}

@media (width < 600px), (aspect-ratio < 5/4) {
  .about-layout {
    grid-template:
      "portrait studies" minmax(50%, max-content)
      "statement statement" minmax(0, max-content)
      "contact contact" auto / minmax(0, 3.1fr) minmax(0, 1fr);
    align-content: center;
    height: min(96cqh, 800px);
    gap: var(--about-gap, clamp(6px, 1.4cqh, 12px)) clamp(5px, 2vw, 10px);
  }
  .about-side { display: contents; }
  .about-portrait {
    grid-area: portrait;
    align-self: center;
    width: 100%;
    max-height: 100%;
    aspect-ratio: 1725 / 2213;
  }
  .about-portrait img { object-position: right center; }
  .about-gallery {
    grid-area: studies;
    display: grid;
    align-items: center;
    min-width: 0;
    min-height: 0;
    container-type: size;
  }
  .contact-sheet { width: min(100%, 25cqh); }
  .contact-sheet img { aspect-ratio: 1 / 4; }
  .portrait-buttons {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(9, 1fr);
    column-gap: 1.786%;
    row-gap: .446%;
  }
  .about-statement {
    grid-area: statement;
    margin-bottom: 0;
    font-size: clamp(12px, 3.2vw, 14px);
    line-height: 1.14;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .about-layout .contact {
    grid-area: contact;
    margin-bottom: 0;
    font-size: clamp(12px, 3.3vw, 14px);
  }
}

@media (min-width: 1080px) and (min-height: 460px) {
  :root { --frame: min(67.25vw, 1692px); font-weight: 300; }
  .site-header, .site-footer { -webkit-text-stroke: min(.008vw, .2px) white; }
  .header-inner { min-height: clamp(36px, 3.03vw, 78px); padding-inline: .67vw; }
  .wordmark { font-size: clamp(23px, 2.08vw, 53px); -webkit-text-stroke-width: min(.006vw, .15px); }
  .top-nav { gap: .48em; color: #9e9e9e; font-size: clamp(12px, 1vw, 25.2px); }
  .top-nav a { min-height: 0; }
  .top-nav a[aria-current] { color: inherit; }
  .top-nav a:hover { color: #000; }
  .project-nav {
    grid-template-columns: 29.3% 30.7% 40%;
    padding-block: clamp(9px, .72vw, 19px) clamp(8px, .54vw, 15px);
  }
  .project-group { display: block; min-width: 0; }
  .group-toggle { display: none; }
  .group-label {
    display: block;
    margin-bottom: .16em;
    color: #414141;
    font-size: clamp(11px, 1.055vw, 27px);
    line-height: 1.04;
    letter-spacing: .008em;
  }
  .group-panel, .group-toggle[aria-pressed="true"] + .group-panel {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .project-link {
    justify-content: normal;
    font-size: clamp(11px, 1.055vw, 27px);
    line-height: 1.02;
    text-align: start;
    white-space: nowrap;
  }
  .group-heading {
    color: #3c3c3c;
    font-size: clamp(9px, .82vw, 21px);
    line-height: 1.08;
    letter-spacing: .046em;
    text-decoration: underline;
    text-decoration-color: #4a4a4a;
    text-decoration-thickness: 1px;
    text-underline-offset: .13em;
    -webkit-text-stroke-width: 0;
  }
  .project-link[aria-current], .project-group[data-current] .group-label { font-weight: 480; }
  .project-group[data-current] .group-heading { font-weight: 440; }
  .project-list {
    display: grid;
    grid-template-columns: 50% 50%;
    margin-top: clamp(3px, .25vw, 6px);
    align-items: stretch;
    gap: 0;
    overflow: visible;
    padding: 0;
  }
  .project-group:nth-child(2) .project-list { grid-template-columns: 32% 68%; }
  .project-group:nth-child(3) .project-list { grid-template-columns: 25% 27% 24% 24%; }
  .project-link { min-height: 2.04em; color: #989898; display: grid; align-content: center; letter-spacing: normal; }
  .project-link:first-child, .project-link:last-child { margin: 0; }
  .project-link br { display: initial; }
}

@media (prefers-contrast: more) {
  .site-header, .site-footer, .wordmark { -webkit-text-stroke-width: 0; }
  .top-nav, .project-link { color: #505050; }
}
