.gallery-reference {
  --gallery-cyan: #00f3ff;
  --gallery-violet: #6852b2;
  --gallery-metric-violet: #795dc9;
  --gallery-text: #432477;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 0;
}

.gallery-stage {
  position: relative;
  z-index: 2;
  width: min(90%, 2260px);
  margin-inline: auto;
  padding-block: clamp(46px, 8vw, 162px) clamp(42px, 4vw, 94px);
}

.gallery-heading {
  margin-inline: clamp(0px, 2.7vw, 64px);
}

.gallery-title {
  display: inline-block;
  margin: 0 0 clamp(7px, .65vw, 16px);
  padding: .26em .51em .18em;
  color: var(--gallery-cyan);
  background: var(--gallery-violet);
  font: 400 clamp(28px, 3vw, 72px)/1.04 Luckiest, sans-serif;
  text-transform: uppercase;
}

.gallery-intro {
  max-width: min(64ch, 76%);
  margin: 0;
  color: var(--gallery-text);
  font: 400 clamp(14px, 1.35vw, 31px)/1.26 'Archivo Black', sans-serif;
  text-transform: uppercase;
}

.gallery-intro span {
  padding: .04em .22em .11em;
  background: var(--gallery-cyan);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: clamp(18px, 2.4vw, 58px);
  margin-block-start: clamp(23px, 2.1vw, 52px);
}

.gallery-still {
  margin: 0;
  background: var(--gallery-text);
  box-shadow: var(--gallery-shadow-x, clamp(4px, .44vw, 11px)) clamp(5px, .54vw, 13px) var(--gallery-cyan);
}

@media (min-width: 901px) {
  .gallery-still:first-of-type {
    --gallery-shadow-x: clamp(-11px, -.44vw, -4px);
    transform: rotate(-2.5deg);
  }

  .gallery-still--lower {
    margin-block-start: clamp(24px, 3.8vw, 90px);
    transform: rotate(2.5deg);
  }

  .gallery-still--lower:last-child { margin-block-start: clamp(31px, 4.8vw, 115px); }

  .gallery-metrics {
    aspect-ratio: 1 / 1.1;
    transform: rotate(-2.5deg);
  }
}

.gallery-still img {
  display: block;
  width: 100%;
  height: auto;
}

[data-gallery-fade] {
  position: relative;
  aspect-ratio: 1;
}

[data-gallery-fade] > img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: contain;
}

.gallery-still-next { opacity: 0; }

[data-fade-ready][data-fade-visible] > .gallery-still-next {
  animation: gallery-fade 12s ease-in-out infinite;
}

@keyframes gallery-fade {
  0%, 41%, 100% { opacity: 0; }
  49%, 92% { opacity: 1; }
}

.motion-off [data-gallery-fade] > .gallery-still-next { animation: none; }

@media (prefers-reduced-motion: reduce) {
  body:not(.motion-enabled) [data-gallery-fade] > .gallery-still-next { animation: none; }
}

.gallery-metrics {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(9px, .8vw, 20px);
  min-width: 0;
}

.gallery-metric {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(3px, .28vw, 8px);
  min-width: 0;
  min-height: clamp(98px, 8vw, 198px);
  padding: clamp(9px, 1vw, 25px) 7px;
  border: clamp(2px, .16vw, 4px) solid var(--gallery-cyan);
  border-radius: clamp(9px, .9vw, 22px);
  background: var(--gallery-metric-violet);
  box-shadow: clamp(3px, .36vw, 9px) clamp(3px, .38vw, 10px) var(--gallery-cyan);
  color: white;
  text-align: center;
}

.gallery-metric--cyan {
  border-color: var(--gallery-violet);
  background: var(--gallery-cyan);
  box-shadow: clamp(3px, .36vw, 9px) clamp(3px, .38vw, 10px) #9277ff;
  color: var(--gallery-text);
}

.gallery-metric strong {
  color: var(--gallery-cyan);
  font: 400 clamp(27px, 4vw, 94px)/.97 Luckiest, sans-serif;
}

.gallery-metric--cyan strong {
  color: var(--gallery-violet);
}

.gallery-metric span {
  font: 400 clamp(11px, 1.05vw, 26px)/1.16 'Archivo Black', sans-serif;
  text-transform: uppercase;
}

.gallery-metric small {
  font: 600 clamp(12px, .87vw, 22px)/1.22 var(--body, sans-serif);
  overflow-wrap: anywhere;
}

.gallery-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(26px, 3vw, 74px);
}

.gallery-instagram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 44px;
  padding: .7em .95em .62em;
  border: clamp(2px, .18vw, 4px) solid #fff8fe;
  border-radius: clamp(10px, .9vw, 22px);
  background: linear-gradient(108deg, #7654bf, #08769a);
  box-shadow: 0 0 clamp(8px, .8vw, 19px) .09em #5ef8ff;
  color: white;
  font: 400 clamp(13px, 1.2vw, 29px)/1.2 'Archivo Black', sans-serif;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.gallery-instagram:hover {
  text-decoration: underline;
  text-underline-offset: .15em;
}

.gallery-stage a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .gallery-stage {
    width: 87%;
    padding-block-start: clamp(42px, 6vw, 62px);
  }

  .gallery-heading {
    margin-inline: 0;
  }

  .gallery-intro { max-width: 64ch; }

  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(13px, 2.3vw, 20px);
  }

  .gallery-metrics {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template: auto / repeat(2, minmax(0, 1fr));
    margin-bottom: 4px;
  }

  .gallery-metric {
    min-height: clamp(102px, 15vw, 140px);
  }

  .gallery-metric strong {
    font-size: clamp(28px, 6vw, 44px);
  }
}

@media (max-width: 600px) {
  .gallery-title {
    font-size: clamp(23px, 6.6vw, 30px);
  }

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