.gallery-opening {
  min-height: 92svh;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 8vh 5vw;
  overflow: hidden;
  isolation: isolate;
}
.gallery-opening > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 78%;
  z-index: -2;
}
.gallery-opening-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #000d 0%, #0002 62%, #0006 100%);
}
.gallery-opening-copy { max-width: 740px; }
.gallery-opening h1 {
  font-size: clamp(68px, 10vw, 158px);
  font-weight: 400;
  line-height: .82;
  letter-spacing: -.08em;
  margin: 18px 0;
}
.gallery-opening p {
  font-size: 15px;
  line-height: 1.45;
  max-width: 420px;
  margin: 0;
}
.gallery-scroll {
  position: absolute;
  right: 5vw;
  bottom: 8vh;
  font: 10px 'DM Mono', monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gallery-filter-panel {
  background: var(--bone);
  color: var(--void);
  padding: 12vh 5vw 11vh;
}
.gallery-filter-panel header {
  display: grid;
  grid-template-columns: minmax(0, 34fr) minmax(0, 66fr);
  column-gap: 5vw;
  align-items: end;
}
.gallery-filter-panel header > .tag { grid-column: 1 / -1; }
.gallery-filter-panel header h2 {
  grid-column: 1;
  font-size: clamp(48px, 6vw, 90px);
  font-weight: 400;
  line-height: .87;
  letter-spacing: -.075em;
  margin: 18px 0 0;
}
.gallery-filter-panel header p {
  grid-column: 2;
  max-width: 360px;
  line-height: 1.5;
  margin: 0;
}

.gallery-results-shell {
  position: relative;
  background: var(--bone);
  color: var(--void);
}
.gallery-filter-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-left: 52px;
  width: calc(100% - 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  min-width: 0;
  padding: 14px 5vw 13px;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  background: rgba(238, 234, 226, .96);
}
.gallery-tag-cloud { min-width: 0; }
.gallery-tag-cloud > span {
  display: block;
  margin-bottom: 8px;
}
.gallery-tag-cloud > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gallery-tag-divider {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  color: var(--smoke);
  font: 11px 'DM Mono', monospace;
}
.gallery-tag-cloud button,
.gallery-filter-status button {
  min-height: 34px;
  border: 1px solid #777;
  background: transparent;
  color: var(--void);
  padding: 0 11px;
  font: 9px 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.gallery-tag-cloud button:hover,
.gallery-tag-cloud button:focus-visible,
.gallery-tag-cloud button[aria-pressed="true"] {
  background: var(--void);
  border-color: var(--void);
  color: var(--bone);
}
.gallery-tag-cloud button:focus-visible,
.gallery-filter-status button:focus-visible {
  outline: 2px solid var(--void);
  outline-offset: 3px;
}
.gallery-filter-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 2px;
  white-space: nowrap;
}
.gallery-filter-status p {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 9px 'DM Mono', monospace;
  text-transform: uppercase;
  margin: 0;
}
.gallery-filter-status i {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--void);
  border-radius: 50%;
  transition: background .2s, transform .2s;
}
.gallery-filter-status i.is-updated {
  background: var(--void);
  transform: scale(1.35);
}
.gallery-filter-status button {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  min-height: 28px;
}

.filter-gallery {
  position: relative;
  display: grid;
  gap: clamp(150px, 24vw, 360px);
  padding: clamp(120px, 15vw, 240px) 5vw clamp(160px, 20vw, 320px);
  background: var(--bone);
  overflow: clip;
}
.gallery-card {
  width: min(72vw, 1040px);
  min-width: 0;
  justify-self: start;
  background: transparent;
}
.gallery-card--sequence-1 {
  width: min(48vw, 700px);
  justify-self: end;
}
.gallery-card--sequence-2 {
  width: min(47.5vw, 700px);
  justify-self: center;
}
.gallery-card--video { width: min(34vw, 43.875svh, 500px); }
.gallery-card[hidden] { display: none; }
.gallery-card figure { margin: 0; }
.gallery-card img,
.gallery-card video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82svh;
  object-fit: cover;
  background: #050505;
}
.gallery-card--video figure {
  position: relative;
}
.gallery-card--video video {
  aspect-ratio: 9 / 16;
  height: auto;
  object-fit: cover;
  object-position: center;
  background: transparent;
}
.gallery-video-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(238, 234, 226, .72);
  background: rgba(9, 9, 9, .7);
  color: var(--bone);
  padding: 0 11px;
  font: 9px 'DM Mono', monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.gallery-video-toggle:hover,
.gallery-video-toggle:focus-visible {
  background: var(--bone);
  color: var(--void);
}
.gallery-video-toggle:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
}
.gallery-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-top: 12px;
  background: var(--bone);
  color: var(--void);
}
.gallery-card figcaption p {
  order: -1;
  font: 10px 'DM Mono', monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.4;
  margin: 0;
}
.gallery-card figcaption .tag {
  color: #666;
  text-align: right;
}
.gallery-results--updated .gallery-card:not([hidden]) {
  animation: gallery-view-updated .55s ease both;
}
@keyframes gallery-view-updated {
  0% { opacity: .62; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.gallery-close {
  min-height: 60svh;
  background: var(--bone);
  color: var(--void);
  padding: 9vh 5vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.gallery-close h2 {
  font-size: clamp(54px, 8vw, 120px);
  font-weight: 400;
  line-height: .86;
  letter-spacing: -.08em;
  margin: 16px 0 28px;
}
.gallery-close a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(420px, 100%);
  min-height: 66px;
  padding: 0 20px;
  background: var(--void);
  color: var(--bone);
  font: 11px 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.gallery-close a b {
  font: 28px 'Instrument Sans', sans-serif;
  font-weight: 400;
}
.gallery-close a:hover {
  background: #292929;
  transform: translateX(6px);
}
.gallery-close a:focus-visible {
  outline: 2px solid var(--void);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .gallery-filter-panel header {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  }
  .gallery-filter-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .gallery-filter-status {
    justify-content: space-between;
  }
}

@media (max-width: 700px) {
  .gallery-opening {
    min-height: 82svh;
    padding: 96px 20px 38px;
  }
  .gallery-opening h1 { font-size: 19vw; }
  .gallery-opening p {
    font-size: 14px;
    max-width: 310px;
  }
  .gallery-scroll {
    left: 20px;
    right: auto;
    bottom: 22px;
  }
  .gallery-filter-panel { padding: 68px 20px 64px; }
  .gallery-filter-panel header { display: block; }
  .gallery-filter-panel header h2 { font-size: 15vw; }
  .gallery-filter-panel header p {
    margin-top: 28px;
    max-width: 310px;
  }
  .gallery-filter-controls {
    margin-left: 0;
    width: 100%;
    top: 58px;
    padding: 11px 20px 10px;
    gap: 9px;
  }
  .gallery-tag-cloud > span { margin-bottom: 7px; }
  .gallery-tag-cloud > div {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    padding: 1px 1px 5px;
  }
  .gallery-tag-cloud > div::-webkit-scrollbar { display: none; }
  .gallery-tag-cloud button {
    flex: 0 0 auto;
    min-height: 38px;
  }
  .gallery-filter-status {
    gap: 14px;
    padding: 0 1px;
  }
  .gallery-filter-status p { font-size: 8px; }
  .filter-gallery {
    display: grid;
    gap: 110px;
    padding: 90px 20px 130px;
  }
  .gallery-card,
  .gallery-card--sequence-1,
  .gallery-card--sequence-2,
  .gallery-card--video {
    width: 100%;
    justify-self: stretch;
  }
  .gallery-card img {
    max-height: none;
  }
  .gallery-card--video video {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 9 / 16;
  }
  .gallery-card figcaption {
    gap: 14px;
    padding-top: 11px;
  }
  .gallery-card figcaption p,
  .gallery-card figcaption .tag {
    font-size: 9px;
  }
  .gallery-close {
    min-height: 52svh;
    padding: 70px 20px;
  }
  .gallery-close h2 { font-size: 17vw; }
  .gallery-close a { min-height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-results--updated .gallery-card:not([hidden]) { animation: none; }
  .gallery-filter-status i { transition: none; }
  .gallery-close a { transition: none; }
}


/* Shown when a combination of tags matches nothing. The previous OR filter
   could never produce an empty result, so this state did not exist. */
.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: clamp(40px, 8vw, 90px) 0;
  text-align: center;
  font: 10px 'DM Mono', monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--void);
  opacity: .65;
}
