:root {
  color-scheme: light;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #f7f1e7;
  color: #17130f;
  --orange: #f3a73f;
  --ink: #17130f;
  --paper: #f7f1e7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-width: 18rem;
  margin: 0;
  background: var(--paper);
}

button, a { -webkit-tap-highlight-color: transparent; }

.masthead, main, footer {
  width: min(100% - 2rem, 92rem);
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.25rem 4rem;
}

.masthead p, footer p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.wordmark {
  color: inherit;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.045em;
  text-decoration: none;
}

h1 {
  max-width: 9ch;
  margin: 0 0 4rem;
  font-size: clamp(4.25rem, 11vw, 10.5rem);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.gallery {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.4vw, 1.5rem);
}

.photo {
  grid-column: span 5;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: #ded5c8;
  cursor: zoom-in;
}

.photo--wide {
  grid-column: span 7;
  aspect-ratio: 3 / 2;
}

.photo--tall {
  grid-column: span 5;
  grid-row: span 2;
  aspect-ratio: 3 / 4;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 250ms ease;
}

.photo:hover img {
  transform: scale(1.025);
  filter: saturate(1.06);
}

.photo:focus-visible {
  outline: 0.25rem solid var(--orange);
  outline-offset: 0.25rem;
}

footer { padding-block: 5rem 2rem; }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: rgba(16, 14, 12, 0.97);
  color: white;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 4rem;
  align-items: center;
}

.lightbox::backdrop { background: #100e0c; }

.lightbox figure {
  display: grid;
  min-width: 0;
  height: 100%;
  margin: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.8rem;
}

.lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  color: #c9c1b7;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lightbox__close, .lightbox__arrow {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.lightbox__close {
  position: fixed;
  z-index: 1;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lightbox__arrow {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  transition: background 150ms ease;
}

.lightbox__arrow:hover,
.lightbox__arrow:focus-visible,
.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

@media (max-width: 44rem) {
  .masthead { align-items: flex-start; padding-bottom: 3rem; }
  .masthead p { max-width: 15rem; text-align: right; }
  h1 { margin-bottom: 3rem; }

  .photo, .photo--wide, .photo--tall {
    grid-column: span 12;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .photo--tall { aspect-ratio: 3 / 4; }
  .lightbox { padding: 4.5rem 0.75rem 1rem; }
  .lightbox[open] { grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem; }
  .lightbox__hint { display: none; }
}

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