:root {
  --gallery-pad: clamp(1rem, 2.5vw, 2.75rem);
}

.gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 0.75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
  min-height: 68svh;
  padding: clamp(5rem, 11vw, 10rem) var(--gallery-pad);
  border-bottom: 1px solid var(--line);
}

.gallery-hero h1 {
  max-width: 11ch;
  margin: clamp(2rem, 5vw, 5rem) 0 0;
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.gallery-hero__side {
  display: grid;
  gap: 2rem;
  justify-items: start;
}

.gallery-hero__side p {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.45;
}

.gallery-browser {
  padding: clamp(5rem, 10vw, 9rem) var(--gallery-pad);
}

.gallery-browser__heading {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.gallery-browser__heading h2 {
  max-width: 10ch;
  margin: 1rem 0 0;
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.gallery-total,
.gallery-status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-controls {
  position: sticky;
  z-index: 12;
  top: 0;
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.gallery-search {
  display: grid;
  grid-template-columns: minmax(8rem, 0.25fr) 1fr;
  gap: 1rem;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-search input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0 0 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink);
  background: #fff;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
}

.gallery-status {
  display: flex;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 1.5rem 0;
}

.text-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 6rem) clamp(0.8rem, 1.5vw, 1.5rem);
  align-items: start;
}

.project-card[hidden],
.empty-state[hidden],
.gallery-more[hidden],
.text-button[hidden] {
  display: none;
}

.project-image-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
}

.project-image-link img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 350ms ease;
}

.project-image-link:hover img {
  transform: scale(1.015);
}

.project-caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.project-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.25rem, 1.7vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.project-meta,
.project-number {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.project-detail-link {
  display: inline-block;
  margin-top: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-more {
  display: flex;
  justify-content: center;
  padding: clamp(3.5rem, 7vw, 6rem) 0 0;
}

.empty-state {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding: clamp(4rem, 9vw, 8rem) 0;
  border-top: 1px solid var(--line);
}

.empty-state p {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.gallery-cta {
  display: grid;
  gap: 2.5rem;
  justify-items: start;
  padding: clamp(5rem, 11vw, 10rem) var(--gallery-pad);
  color: #fff;
  background: var(--ink);
}

.gallery-cta h2 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.93;
}

.gallery-cta .button {
  border-color: #fff;
  color: #fff;
}

@media (max-width: 900px) {
  .gallery-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gallery-hero h1 {
    font-size: clamp(3.2rem, 15vw, 5.5rem);
  }

  .gallery-browser__heading {
    display: grid;
  }

  .gallery-search {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 3.75rem;
  }

  .gallery-status {
    gap: 1rem;
    align-items: flex-start;
  }

  .project-caption {
    padding-top: 0.85rem;
  }
}
