:root {
  --paper: #f1f1ee;
  --paper-deep: #e8e8e4;
  --ink: #111111;
  --ink-soft: #3b3b39;
  --line: #1c1c1c;
  --line-soft: #b9b9b2;
  --accent: #d91f26;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0 28%, rgba(0, 0, 0, 0) 65%),
    radial-gradient(circle at 85% 12%, rgba(217, 31, 38, 0.08), transparent 36%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
}

.site-header,
.section,
.site-footer {
  width: min(1220px, 94vw);
  margin-inline: auto;
}

.site-header {
  padding: 4.4rem 0 1.1rem;
}

.eyebrow {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: inherit;
  font-weight: 700;
  margin: 0;
  line-height: 0.95;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}

h1 {
  margin-top: 0.7rem;
  font-size: clamp(2.8rem, 8.6vw, 7.1rem);
  font-weight: 700;
  max-width: 16ch;
}

.lead {
  margin: 1.1rem 0 0;
  max-width: 72ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--ink-soft);
}

.lead a {
  color: inherit;
}

.section {
  padding: 2.4rem 0 1.2rem;
}

#project-1.section {
  border-top: none;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.8rem;
  align-items: end;
  margin-bottom: 1.3rem;
}

h2 {
  font-size: clamp(1.7rem, 4.2vw, 3.6rem);
  font-weight: 700;
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
}

.project-subheading {
  margin: 4.2rem 0 0.8rem;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-copy {
  margin: 0 0 1.8rem;
  max-width: 88ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--ink-soft);
}

:is(#project-1, #project-2, #project-3) .project-hero-bg {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: clamp(440px, 68vw, 780px);
  margin-bottom: 1.8rem;
  overflow: hidden;
}

:is(#project-1, #project-2, #project-3) .project-hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(#project-1, #project-2, #project-3) .project-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}

:is(#project-1, #project-2, #project-3) .project-hero-bg-content {
  position: relative;
  z-index: 1;
  width: min(1220px, 94vw);
  margin-inline: auto;
  padding: clamp(1.6rem, 4vw, 3.2rem) 0;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

:is(#project-1, #project-2, #project-3) .project-hero-bg-content .section-heading {
  margin-bottom: 1rem;
}

:is(#project-1, #project-2, #project-3) .project-hero-bg-content h2,
:is(#project-1, #project-2, #project-3) .project-hero-bg-content .project-copy {
  color: #ffffff;
  mix-blend-mode: difference;
}

:is(#project-1, #project-2, #project-3) .project-hero-bg-content .project-copy {
  max-width: 95ch;
  margin-bottom: 0;
}

.masonry {
  column-count: 3;
  column-gap: 0.6rem;
}

#project-3 .masonry {
  column-count: 2;
}

.card {
  break-inside: avoid;
  margin: 0 0 0.6rem;
  background: #f7f7f4;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: card-in 520ms ease forwards;
}

.card:nth-child(2) {
  animation-delay: 80ms;
}

.card:nth-child(3) {
  animation-delay: 150ms;
}

.card:nth-child(4) {
  animation-delay: 220ms;
}

.card img,
.card video {
  width: 100%;
  display: block;
  background: #d4d4cf;
}

#project-1 .masonry.compact .card {
  overflow: hidden;
}

#project-1 .masonry.compact .card img,
#project-1 .masonry.compact .card video {
  --tile-ratio: 1 / 1;
  aspect-ratio: var(--tile-ratio);
  object-fit: cover;
}

#project-1 .masonry.compact .card:nth-child(8n + 1) img,
#project-1 .masonry.compact .card:nth-child(8n + 1) video {
  --tile-ratio: 16 / 9;
}

#project-1 .masonry.compact .card:nth-child(8n + 2) img,
#project-1 .masonry.compact .card:nth-child(8n + 2) video {
  --tile-ratio: 1 / 1;
}

#project-1 .masonry.compact .card:nth-child(8n + 3) img,
#project-1 .masonry.compact .card:nth-child(8n + 3) video {
  --tile-ratio: 9 / 16;
}

#project-1 .masonry.compact .card:nth-child(8n + 4) img,
#project-1 .masonry.compact .card:nth-child(8n + 4) video {
  --tile-ratio: 4 / 5;
}

#project-1 .masonry.compact .card:nth-child(8n + 5) img,
#project-1 .masonry.compact .card:nth-child(8n + 5) video {
  --tile-ratio: 3 / 2;
}

#project-1 .masonry.compact .card:nth-child(8n + 6) img,
#project-1 .masonry.compact .card:nth-child(8n + 6) video {
  --tile-ratio: 5 / 4;
}

#project-1 .masonry.compact .card:nth-child(8n + 7) img,
#project-1 .masonry.compact .card:nth-child(8n + 7) video {
  --tile-ratio: 2 / 3;
}

#project-1 .masonry.compact .card.natural-ratio img,
#project-1 .masonry.compact .card.natural-ratio video {
  aspect-ratio: auto;
  object-fit: initial;
}

.card p {
  margin: 0;
  padding: 0.78rem 0.84rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.compact .card p {
  display: none;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.45fr auto;
  gap: 1.2rem;
  width: min(1220px, 94vw);
  margin: 2.2rem auto 2.6rem;
  padding: 1.1rem 0 0;
  align-items: center;
}

.site-footer p {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--ink);
}

.site-footer p:last-child {
  justify-self: end;
}

.instagram-link {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--ink);
}

.instagram-link svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .section-heading {
    grid-template-columns: 1fr;
  }

  .masonry {
    column-count: 2;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding-top: 3.3rem;
  }

  .masonry {
    column-count: 1;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
}
