@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --ink: #131311;
  --paper: #f3f0e9;
  --muted: #79766f;
  --line: rgba(19, 19, 17, 0.2);
  --gutter: clamp(20px, 3.6vw, 58px);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--gutter);
  color: white;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.42);
}

.wordmark {
  color: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

nav a,
nav button {
  border: 0;
  padding: 0;
  background: none;
  text-decoration: none;
  cursor: pointer;
}

.hero {
  position: relative;
  height: 100svh;
  min-height: 650px;
  overflow: hidden;
  color: white;
  background: #18221e;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  animation: settle 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 34%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent 56%);
}

.hero-copy {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(64px, 9vh, 110px);
}

.hero-copy p {
  margin: 0 0 18px 5px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(82px, 13vw, 205px);
  font-weight: 400;
  line-height: 0.72;
  letter-spacing: -0.045em;
}

.hero-index {
  position: absolute;
  right: var(--gutter);
  bottom: 44px;
  display: flex;
  gap: 46px;
  align-items: center;
  color: white;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 3fr;
  min-height: 76vh;
  padding: 12vh var(--gutter);
  align-items: start;
}

.chapter-number {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.intro h2 {
  max-width: 920px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(62px, 9vw, 146px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.035em;
}

.intro-note {
  max-width: 380px;
  margin: 64px 0 0 48%;
  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.55;
}

.gallery-section {
  padding: 40px var(--gutter) 14vh;
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 50px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.gallery-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 400;
}

.filters {
  display: flex;
  gap: 24px;
}

.filter {
  border: 0;
  padding: 7px 0;
  color: var(--muted);
  background: none;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter.active {
  color: var(--ink);
  box-shadow: inset 0 -1px var(--ink);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(18px, 2.4vw, 38px);
}

.photo-card {
  grid-column: span 6;
  margin: 0 0 clamp(38px, 8vw, 118px);
}

.photo-card:nth-child(5n + 1) {
  grid-column: 1 / span 7;
}

.photo-card:nth-child(5n + 2) {
  grid-column: 9 / span 4;
  margin-top: 18vw;
}

.photo-card:nth-child(5n + 3) {
  grid-column: 2 / span 4;
}

.photo-card:nth-child(5n + 4) {
  grid-column: 7 / span 6;
}

.photo-card:nth-child(5n) {
  grid-column: 3 / span 8;
}

.photo-button {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #dad7d0;
  cursor: zoom-in;
}

.photo-button img {
  display: block;
  width: 100%;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 400ms ease;
}

.photo-button:hover img {
  transform: scale(1.018);
  filter: contrast(1.02);
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.photo-card[hidden] {
  display: none;
}

.closing {
  display: grid;
  min-height: 78vh;
  place-items: center;
  padding: 15vh var(--gutter);
  text-align: center;
}

.closing p {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 8vw, 126px);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.closing button {
  margin-top: 60px;
  border: 1px solid var(--ink);
  border-radius: 100%;
  padding: 28px 34px;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 250ms ease, background 250ms ease;
}

.closing button:hover {
  color: var(--paper);
  background: var(--ink);
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  padding: 34px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

footer p:last-child {
  text-align: right;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  color: white;
  background: #0e0e0d;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  place-items: center;
}

.lightbox::backdrop {
  background: #0e0e0d;
}

.lightbox-bar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding: 26px 32px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.close-button,
.lightbox-nav {
  border: 0;
  color: white;
  background: none;
  cursor: pointer;
}

.close-button {
  padding: 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lightbox-nav {
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.lightbox figure {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  place-items: center;
  padding: 70px 0 42px;
}

.lightbox figure img {
  max-width: 100%;
  max-height: calc(100vh - 125px);
  object-fit: contain;
}

.lightbox figcaption {
  position: absolute;
  bottom: 18px;
  left: 50%;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(-50%);
}

@keyframes settle {
  from {
    opacity: 0.2;
    transform: scale(1.035);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  nav a {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .hero-image {
    object-position: 48% center;
  }

  .hero h1 {
    font-size: clamp(72px, 25vw, 112px);
    line-height: 0.77;
  }

  .hero-index {
    right: auto;
    left: var(--gutter);
    bottom: 24px;
    width: calc(100% - var(--gutter) * 2);
    justify-content: space-between;
  }

  .intro {
    display: block;
    min-height: auto;
    padding: 100px var(--gutter) 130px;
  }

  .chapter-number {
    margin-bottom: 60px;
  }

  .intro-note {
    margin: 42px 0 0;
  }

  .gallery-heading {
    display: block;
  }

  .filters {
    margin-top: 28px;
    gap: 18px;
    overflow-x: auto;
  }

  .gallery-grid {
    display: block;
  }

  .photo-card,
  .photo-card:nth-child(n) {
    margin: 0 0 54px;
  }

  .lightbox[open] {
    grid-template-columns: 45px 1fr 45px;
  }

  .lightbox figure {
    padding: 64px 0 52px;
  }

  footer {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  footer p:nth-child(2) {
    display: none;
  }
}

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