@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0b0a;
  --bg-2: #141412;
  --fg: #ece7de;
  --muted: #8d877d;
  --line: #2a2825;
  --accent: #d8b67c; /* golden hour */
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  transition: background 0.5s, backdrop-filter 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgb(11 11 10 / 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-color: var(--line);
}
.brand {
  font: italic 400 24px/1 var(--serif);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}
.nav nav a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.nav nav a:hover {
  color: var(--fg);
}

/* ---------- hero: a letterboxed 2.39:1 frame ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
}
.hero-frame {
  position: relative;
  width: min(100%, (100svh - 220px) * 2.39);
  aspect-ratio: 2.39;
  overflow: hidden;
  /* The "shutter" opens from the middle on load. */
  clip-path: inset(50% 0 50% 0);
  animation: open 1.6s var(--ease) 0.15s forwards;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50%) 50%;
  background-size: cover;
  background-position: var(--focus, 50%) 50%;
  transform: scale(1.12) translateY(var(--parallax, 0px));
  animation: settle 3.2s var(--ease) 0.15s forwards;
  will-change: transform;
}
.hero-text {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(28px, 6svh, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 32px;
}
.hero h1 {
  margin: 0;
  font: 400 clamp(48px, 7vw, 104px)/0.95 var(--serif);
  letter-spacing: -0.015em;
}
.tagline {
  margin: 0;
  font: italic 400 clamp(19px, 1.8vw, 26px)/1.3 var(--serif);
  color: var(--muted);
}
/* Text slides up from behind a mask. */
.line {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1.2s var(--ease) forwards;
}
.hero h1 .line {
  animation-delay: 0.9s;
}
.tagline .line {
  animation-delay: 1.1s;
}
.hero h1,
.tagline {
  overflow: hidden;
  padding-bottom: 0.08em;
}
.scroll-cue {
  position: absolute;
  top: 50%;
  right: var(--gutter);
  display: none;
}

.hero--plain {
  min-height: 70svh;
  background: var(--bg);
}
.hero--plain .hero-text {
  position: static;
  padding: 0 var(--gutter);
  flex-direction: column;
  align-items: flex-start;
}

@keyframes open {
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes settle {
  to {
    transform: scale(1) translateY(var(--parallax, 0px));
  }
}
@keyframes rise {
  to {
    transform: none;
  }
}

/* ---------- sections ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: clamp(20px, 3vw, 36px);
}
h2 {
  margin: 0;
  font: 400 clamp(34px, 4vw, 52px)/1 var(--serif);
  letter-spacing: -0.01em;
}
.count {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.work {
  padding: clamp(72px, 12vw, 140px) var(--gutter) clamp(56px, 8vw, 100px);
}
.empty {
  color: var(--muted);
  font: italic 22px var(--serif);
}

/* ---------- gallery (justified rows, laid out by site.js) ---------- */

.grid {
  position: relative;
  /* site.js sets the height and positions every tile absolutely */
}
.tile {
  position: absolute;
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-2) center / cover no-repeat;
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease);
}
.tile.in {
  opacity: 1;
  translate: 0 0;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.0001);
  transition: opacity 0.6s, transform 1.2s var(--ease), filter 0.6s;
}
.tile img.loaded {
  opacity: 1;
}
.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.035);
}
.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 36px 14px 12px;
  font: italic 18px/1.2 var(--serif);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.6));
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.4s, translate 0.4s var(--ease);
  pointer-events: none;
}
.tile:hover figcaption {
  opacity: 1;
  translate: 0 0;
}

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding: clamp(56px, 8vw, 110px) var(--gutter) clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line);
  margin: 0 var(--gutter);
  padding-inline: 0;
}
.about:not(:has(.portrait)) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
}
.portrait {
  margin: 0;
  overflow: hidden;
}
.portrait img {
  width: 100%;
  height: auto;
  background-size: cover;
}
.about-text {
  max-width: 34em;
}
.about-text h2 {
  margin-bottom: 24px;
}
.about-text p {
  margin: 0 0 1.1em;
  color: #cfc9bf;
  font-size: 17px;
}
.gear {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 28px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.gear dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.gear dd {
  margin: 0;
}
.contact {
  margin-top: 28px !important;
  font-size: 15px !important;
}
.contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgb(216 182 124 / 0.35);
  transition: border-color 0.3s;
}
.contact a:hover {
  border-color: var(--accent);
}
.contact .dot {
  margin: 0 10px;
  color: var(--muted);
}

.reveal-up {
  opacity: 0;
  translate: 0 32px;
  transition: opacity 1s var(--ease), translate 1s var(--ease);
}
.reveal-up.in {
  opacity: 1;
  translate: 0 0;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer a {
  text-decoration: none;
  transition: color 0.3s;
}
.footer a:hover {
  color: var(--fg);
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #060605;
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.35s, overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}
.lightbox[open] {
  opacity: 1;
}
@starting-style {
  .lightbox[open] {
    opacity: 0;
  }
}
.lightbox::backdrop {
  background: transparent;
}
.lb-stage {
  position: absolute;
  inset: 56px 0 96px;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}
.lb-stage img {
  grid-area: 1 / 1;
  max-width: calc(100vw - 2 * var(--gutter) - 80px);
  max-height: calc(100svh - 56px - 96px);
  width: auto;
  height: auto;
  object-fit: contain;
  background-size: cover;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.lb-stage img.leaving {
  opacity: 0;
}
.lb-stage img.entering {
  opacity: 0;
  transform: translateX(calc(var(--dir, 1) * 40px));
}
.lb-meta {
  position: absolute;
  inset: auto var(--gutter) max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
}
.lb-title {
  font: italic 22px/1.25 var(--serif);
}
.lb-caption {
  display: block;
  font: 14px/1.5 var(--sans);
  font-style: normal;
  color: #bdb7ad;
  margin-top: 2px;
}
.lb-exif {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font: 300 26px/1 var(--sans);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.25s, background 0.25s;
}
.lb-btn:hover,
.lb-btn:focus-visible {
  opacity: 1;
  background: rgb(255 255 255 / 0.07);
  outline: none;
}
.lb-close {
  top: max(6px, env(safe-area-inset-top));
  right: calc(var(--gutter) - 12px);
}
.lb-prev,
.lb-next {
  top: 50%;
  translate: 0 -50%;
}
.lb-prev {
  left: calc(var(--gutter) - 12px);
}
.lb-next {
  right: calc(var(--gutter) - 12px);
}
.lb-count {
  position: absolute;
  top: max(20px, calc(env(safe-area-inset-top) + 14px));
  left: var(--gutter);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 404 ---------- */

.notfound main {
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: var(--gutter);
}
.notfound h1 {
  font: 400 clamp(48px, 8vw, 96px)/1 var(--serif);
  margin: 0 0 16px;
}
.notfound a {
  color: var(--accent);
}

/* ---------- small screens ---------- */

@media (max-width: 800px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
  }
  .portrait {
    max-width: 480px;
  }
}

@media (max-width: 700px) {
  /* A 2.39:1 strip is tiny on a phone, so crop the hero taller around the focus point. */
  .hero {
    display: block;
    min-height: auto;
    padding-top: 64px;
  }
  .hero-frame {
    width: 100%;
    aspect-ratio: 4 / 5;
  }
  .hero-text {
    position: static;
    width: 100%;
    padding: 28px var(--gutter) 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .lb-prev,
  .lb-next {
    display: none; /* swipe instead */
  }
  .lb-stage {
    inset: 56px 0 120px;
  }
  .lb-stage img {
    max-width: 100vw;
    max-height: calc(100svh - 56px - 120px);
  }
  .tile figcaption {
    display: none;
  }
  .footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
