@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f2e7;
  --sand: #eae2d2;
  --ink: #252921;
  --muted: #55574b;
  --line: #cfc7b8;
  --accent: #f2bb81;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(1.25rem, 5.5vw, 5.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.6 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: .95; }
img { display: block; max-inline-size: 100%; }
a { color: inherit; text-underline-offset: .24em; }
button { color: inherit; font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
[id] { scroll-margin-block-start: 1.5rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), 82rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  z-index: 2;
  inset: .75rem auto auto var(--gutter);
  padding: .7rem 1rem;
  background: var(--paper);
  transform: translateY(-150%);
}

.skip:focus { transform: translateY(0); }

.masthead {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--paper);
  border-bottom: 1px solid rgb(247 242 231 / .38);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.masthead nav { display: flex; gap: clamp(.85rem, 3vw, 2.5rem); }
.masthead nav a { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; text-decoration: none; font-size: .9rem; }
.masthead nav a:hover, .site-footer a:hover { text-decoration: underline; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(37rem, 91svh, 58rem);
  display: grid;
  align-items: end;
  padding-block: 9rem clamp(3.25rem, 7.5vh, 5.5rem);
  color: var(--paper);
  background: #363a35;
}

.hero-photo, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-photo { object-fit: cover; object-position: center 54%; }
.hero::after {
  content: "";
  background: linear-gradient(0deg, rgb(15 21 18 / .73), transparent 64%, rgb(16 22 19 / .61)),
              linear-gradient(90deg, rgb(20 25 23 / .50), transparent 77%);
}

.hero-content { position: relative; }
.overline { font-size: .73rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 1.1rem 0 2.2rem; font-size: clamp(4rem, 10vw, 9.2rem); letter-spacing: -.035em; }
.hero h1 em { font-weight: inherit; color: #ffe4c4; }
.hero-caption { position: absolute; inset: auto 0 0 auto; font-size: .82rem; }
.hero-link, .contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .65rem 0 .45rem;
  min-height: 44px;
  border-bottom: 1px solid;
  font-weight: 600;
  text-decoration: none;
}
.hero-link:hover { color: var(--accent); }

.portfolio { padding-block: clamp(4rem, 9vw, 8rem); }
.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
  padding-bottom: 1.7rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.section-header h2, .about h2, .contact h2 { font-size: clamp(3.2rem, 7.8vw, 7.1rem); letter-spacing: -.025em; }
.section-header p { max-width: 27ch; color: var(--muted); }
.series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.7vw, 2.65rem); }
.series:nth-child(2) { padding-top: clamp(1.5rem, 5vw, 4.75rem); }
.series-link { display: block; text-decoration: none; }
.series-image { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sand); }
.series-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 330ms ease-out; }
.series:nth-child(2) img { object-position: 44% center; }
.series:nth-child(3) img { object-position: center 78%; }
.series-link:hover img { transform: scale(1.035); }
.series-link:hover .series-action { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.series-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-block: .95rem .35rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.series-action {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.series h3 { font-size: clamp(2rem, 3.15vw, 3.6rem); }
.series > p { max-width: 34ch; margin-top: .72rem; color: var(--muted); font-size: .94rem; }

.about { background: var(--sand); }
.about-layout, .contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
  align-items: start;
  gap: 2.1rem clamp(2.5rem, 7vw, 8rem);
  padding-block: clamp(3.5rem, 8vw, 7.5rem);
}

.about h2, .contact h2 { margin-top: .6rem; }
.about-text { padding-top: .3rem; max-width: 48ch; }
.about-text p:first-child { font-size: clamp(1.1rem, 2vw, 1.47rem); line-height: 1.45; }
.about-text p + p { margin-top: .9rem; color: var(--muted); }
.contact { color: var(--paper); background: var(--ink); }
.contact .overline, .contact-link { color: var(--accent); }
.contact-layout { align-items: end; }
.contact-layout > div + div { max-width: 43ch; }
.contact-link { margin-top: .95rem; }
.contact-link:hover { color: var(--paper); }
.demo { margin-top: .65rem; color: #d3cdbe; font-size: .82rem; }

.site-footer { color: var(--paper); background: var(--ink); font-size: .84rem; }
.site-footer .wrap { border-top: 1px solid rgb(247 242 231 / .3); padding-block: 1.1rem 1.55rem; }
.footer-line { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.footer-line a { padding-block: .5rem; white-space: nowrap; text-decoration: none; }
.site-footer details { color: #ded7c9; }
.site-footer summary { width: fit-content; cursor: pointer; }
.site-footer ul { margin: .75rem 0 0; padding-inline-start: 1.2rem; }

body:has(.gallery[open]) { overflow: hidden; }
.gallery {
  width: min(calc(100% - 1.5rem), 64rem);
  max-height: calc(100% - 1.5rem);
  border: 1px solid #55584e;
  padding: clamp(1rem, 3vw, 2rem);
  color: var(--paper);
  background: var(--ink);
}
.gallery::backdrop { background: rgb(20 23 19 / .85); }
.gallery-header, .gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gallery-header h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
.gallery figure { margin-top: 1rem; }
.gallery-image { width: 100%; height: min(58vh, 37rem); background: #1a1c17; object-fit: contain; }
.gallery figcaption { margin-top: .65rem; font-size: .9rem; }
.gallery-controls { justify-content: end; margin-top: .7rem; }
.icon-button { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid #84867a; border-radius: 50%; padding: 0; background: transparent; font-size: 1.4rem; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--paper); }

@media (max-width: 44rem) {
  .masthead { flex-wrap: wrap; gap: .2rem .8rem; padding-block: .9rem .35rem; }
  .masthead nav { gap: .75rem; }
  .masthead nav a { font-size: .81rem; }
  .hero { min-height: clamp(35rem, 89svh, 46rem); padding-bottom: 2rem; }
  .hero-photo { object-position: 56% center; }
  .hero h1 { margin-bottom: 1.3rem; font-size: clamp(3.3rem, 13vw, 5rem); }
  .hero-caption { position: static; margin-top: .5rem; }
  .hero-link { margin-top: .85rem; }
  .section-header, .about-layout, .contact-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .series-grid { grid-template-columns: minmax(0, 1fr); gap: 2.7rem; }
  .series:nth-child(2) { padding-top: 0; }
  .series-image { aspect-ratio: 5 / 4; }
  .series h3 { font-size: 2.65rem; }
}

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