:root {
  --bg: #0b0c0f;
  --text: #e7e4dc;
  --muted: #8b8a90;
  --line: #1d1e23;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }

.top, main, .bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.logo {
  font: 500 20px/1 var(--serif);
  letter-spacing: 0.02em;
}

nav { display: flex; gap: 24px; font-size: 14px; color: var(--muted); }

.intro { padding: 12vh 0 14vh; }

/* wide header image: blurred and darkened at the top under the menu, fading into the page below */
.hero {
  position: relative;
  min-height: min(62vh, 600px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/images/hero.webp") 62% 60% / cover no-repeat;
}

/* progressive blur: stacked layers, each stronger and shorter, so sharpness fades out
   gradually toward the top instead of a single soft blob */
.hero-blur { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.hero-blur i { position: absolute; inset: 0; }

.hero-blur i:nth-child(1) {
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 38%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 38%);
}

.hero-blur i:nth-child(2) {
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 8%, transparent 28%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 8%, transparent 28%);
}

.hero-blur i:nth-child(3) {
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 4%, transparent 20%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 4%, transparent 20%);
}

.hero-blur i:nth-child(4) {
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 13%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 13%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
    rgba(11, 12, 15, 0.45) 0%,
    rgba(11, 12, 15, 0.12) 22%,
    rgba(11, 12, 15, 0) 40%,
    rgba(11, 12, 15, 0.5) 72%,
    var(--bg) 100%);
}

.hero .top { width: 100%; color: #fff; }
.hero nav { color: rgba(255, 255, 255, 0.78); }

.hero .intro {
  width: 100%;
  max-width: 1200px;
  margin: auto auto 0;
  padding: 0 24px 6vh;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
  .hero { min-height: 52vh; }
  .hero-bg { background-position: 68% 60%; }
}

h1, h2 { font-family: var(--serif); font-weight: 400; }

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 20px;
  font-size: 14px;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 48px 28px;
}

.series {
  grid-column: 1 / -1;
  margin: 72px 0 -16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font: 400 22px/1.2 var(--serif);
}

.series:first-child { margin-top: 0; }

.work { margin: 0; cursor: zoom-in; }

.work.wide { grid-column: span 2; }
.work.wide .frame { aspect-ratio: 8 / 5; }

@media (max-width: 640px) {
  .work.wide { grid-column: auto; }
  .work.wide .frame { aspect-ratio: 4 / 5; }
}

.work .frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #111216;
}

.work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, opacity 0.6s ease;
  opacity: 0.92;
}

.work:hover img { transform: scale(1.02); opacity: 1; }

.work figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.work .meta { color: var(--muted); }

.empty { color: var(--muted); }

.about, .contact {
  max-width: 560px;
  padding-top: 18vh;
}

.about p, .contact p { margin: 0; color: #c9c6be; }

.contact a { border-bottom: 1px solid var(--line); }

.bottom {
  padding-top: 18vh;
  padding-bottom: 40px;
  font-size: 13px;
  color: var(--muted);
}

/* viewer */
dialog {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(6, 7, 9, 0.97);
  color: var(--text);
}

dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.8); }

dialog figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 140px);
}

dialog img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

dialog figcaption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

dialog .hires {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

dialog .hires[hidden] { display: none; }

dialog button {
  background: none;
  border: 0;
  color: var(--muted);
  font: 300 40px/1 var(--sans);
  padding: 16px 20px;
  cursor: pointer;
}

dialog button:hover { color: #fff; }

dialog .close { position: absolute; top: 8px; right: 8px; font-size: 32px; }

@media (max-width: 640px) {
  nav { gap: 16px; }
  .works { gap: 36px; }
  dialog figure { max-width: 100vw; }
  dialog .prev, dialog .next { position: absolute; bottom: 8px; }
  dialog .prev { left: 8px; }
  dialog .next { right: 8px; }
}
