.gallery-page-hero {
  position: relative;
  min-height: min(84svh, 58rem);
  overflow: hidden;
  color: var(--color-white);
  background: var(--color-marq);
}

.gallery-page-hero__media,
.gallery-page-hero__media img,
.gallery-page-hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-page-hero__media img { object-fit: cover; object-position: center 57%; }
.gallery-page-hero__veil { background: linear-gradient(90deg, rgb(31 5 7 / 82%), rgb(31 5 7 / 20%) 62%, transparent); }
.gallery-page-hero__content { position: relative; z-index: 1; display: grid; min-height: min(84svh, 58rem); padding-block: clamp(4rem, 10vw, 8rem); align-content: end; }
.gallery-page-hero__content .eyebrow { color: var(--color-champagne); }
.gallery-page-hero h1 { max-width: 10ch; margin-top: var(--space-4); font-size: clamp(4.6rem, 10vw, 11rem); font-weight: 400; line-height: .84; }
.gallery-page-hero__intro { max-width: 34rem; margin-top: var(--space-5); color: rgb(255 255 255 / 80%); }

.project-gallery { background: var(--color-paper); }
.project-gallery__head { display: grid; margin-bottom: clamp(3rem, 7vw, 7rem); grid-template-columns: minmax(10rem, .3fr) minmax(0, 1fr); gap: var(--space-7); }
.project-gallery__head h2 { max-width: 12ch; font-size: clamp(3.5rem, 7vw, 8rem); font-weight: 400; line-height: .9; }
.project-gallery__note { max-width: 40rem; margin-top: var(--space-5); color: var(--color-muted); }

.project-gallery__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); align-items: start; }
.project-gallery__item { grid-column: span 4; padding: 0; border: 0; color: var(--color-ink); text-align: left; cursor: zoom-in; background: transparent; }
.project-gallery__item:nth-child(7n + 1),
.project-gallery__item:nth-child(7n + 5) { grid-column: span 8; }
.project-gallery__item:nth-child(7n + 3) { margin-top: clamp(2rem, 6vw, 7rem); }
.project-gallery__item figure { margin: 0; }
.project-gallery__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: scale 700ms var(--ease-standard); }
.project-gallery__item:nth-child(7n + 1) img,
.project-gallery__item:nth-child(7n + 5) img { aspect-ratio: 16 / 9; }
.project-gallery__item figure > span { display: flex; padding-top: var(--space-3); justify-content: space-between; gap: var(--space-3); border-top: 1px solid rgb(17 17 19 / 28%); margin-top: var(--space-3); color: var(--color-muted); font-size: var(--text-micro); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.project-gallery__item:hover img,
.project-gallery__item:focus-visible img { scale: 1.018; }

.gallery-page .gallery-dialog { position: fixed; z-index: var(--z-modal); inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; padding: 0; border: 0; background: rgb(10 8 7 / 96%); color: var(--color-white); }
.gallery-page .gallery-dialog::backdrop { background: rgb(10 8 7 / 94%); }
.gallery-page .gallery-dialog figure { display: grid; width: 100%; height: 100%; padding: var(--space-8) var(--space-9) var(--space-6); grid-template-rows: 1fr auto; gap: var(--space-4); }
.gallery-page .gallery-dialog figure img { width: 100%; height: 100%; object-fit: contain; }
.gallery-page .gallery-dialog figcaption { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--text-micro); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.gallery-page .gallery-dialog__close { position: absolute; z-index: 2; top: var(--space-5); right: var(--space-5); padding: var(--space-3); border: 0; color: var(--color-white); cursor: pointer; background: rgb(0 0 0 / 48%); font-size: var(--text-micro); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.gallery-page .gallery-dialog__nav { position: absolute; z-index: 2; top: 50%; display: grid; width: 3.25rem; height: 3.25rem; border: 1px solid rgb(255 255 255 / 55%); border-radius: 50%; place-items: center; color: var(--color-white); cursor: pointer; background: rgb(0 0 0 / 40%); font-size: 1.2rem; translate: 0 -50%; }
.gallery-page .gallery-dialog__nav--prev { left: var(--space-5); }
.gallery-page .gallery-dialog__nav--next { right: var(--space-5); }

@media (max-width: 64rem) {
  .project-gallery__item,
  .project-gallery__item:nth-child(7n + 1),
  .project-gallery__item:nth-child(7n + 5) { grid-column: span 6; }
}

@media (max-width: 48rem) {
  .gallery-page-hero { min-height: 72svh; }
  .gallery-page-hero__content { min-height: 72svh; }
  .gallery-page-hero__media img { object-position: 62% center; }
  .gallery-page-hero__veil { background: linear-gradient(0deg, rgb(31 5 7 / 88%), rgb(31 5 7 / 8%) 80%); }
  .gallery-page-hero h1 { font-size: clamp(4.2rem, 20vw, 6.2rem); }
  .project-gallery__head { grid-template-columns: 1fr; }
  .project-gallery__item,
  .project-gallery__item:nth-child(7n + 1),
  .project-gallery__item:nth-child(7n + 5) { grid-column: 1 / -1; margin-top: 0; }
  .project-gallery__item img,
  .project-gallery__item:nth-child(7n + 1) img,
  .project-gallery__item:nth-child(7n + 5) img { aspect-ratio: 4 / 3; }
  .gallery-page .gallery-dialog figure { padding: var(--space-9) var(--space-4) 6.5rem; }
  .gallery-page .gallery-dialog__nav { top: auto; bottom: var(--space-5); translate: 0; }
  .gallery-page .gallery-dialog__nav--prev { left: var(--space-4); }
  .gallery-page .gallery-dialog__nav--next { right: var(--space-4); }
}
