.photo-wall {
  --hero-gap: clamp(6px, .72vw, 12px);
  --hero-tile-width: clamp(207px, 18vw, 360px);
  position: relative;
  display: grid;
  min-height: clamp(390px, 56svh, 594px);
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--ink);
}

.hero-photo-strips {
  position: absolute;
  inset: var(--hero-gap) 0;
  display: grid;
  gap: var(--hero-gap);
  grid-template-rows: 1fr .96fr 1.04fr 1fr;
}

.hero-photo-row {
  --pan-duration: 89s;
  --pan-offset: -7s;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.hero-photo-row:nth-child(2) { --pan-duration: 97s; --pan-offset: -23s; }
.hero-photo-row:nth-child(3) { --pan-duration: 82s; --pan-offset: -29s; }
.hero-photo-row:nth-child(4) { --pan-duration: 92s; --pan-offset: -47s; }

.hero-photo-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: hero-photo-pan var(--pan-duration) linear var(--pan-offset) infinite;
}

.hero-photo-row:nth-child(even) .hero-photo-track { animation-direction: reverse; }
.photo-wall:is(.is-paused, .is-outside-viewport) .hero-photo-track { animation-play-state: paused; }

@keyframes hero-photo-pan {
  to { transform: translate3d(-50%, 0, 0); }
}

.hero-photo-group {
  display: flex;
  flex: none;
  gap: var(--hero-gap);
  padding-inline-end: var(--hero-gap);
}

.hero-photo-group img {
  flex: none;
  width: var(--hero-tile-width);
  height: 100%;
  min-width: 0;
  max-width: none;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: clamp(4px, .55vw, 8px);
  background: var(--stage);
  object-fit: cover;
  object-position: 50% 41%;
}

.hero-photo-group img:nth-child(4n + 2) { width: calc(var(--hero-tile-width) * .72); }
.hero-photo-group img:nth-child(4n + 3) { width: calc(var(--hero-tile-width) * .88); }
.hero-photo-group img.hero-photo-ensemble { width: calc(var(--hero-tile-width) * 1.22); object-position: 50% 34%; }

@media (prefers-reduced-motion: reduce) {
  .hero-photo-track { animation: none; }
}

.photo-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 31% at 50% 50%, color-mix(in srgb, var(--ink) 90%, transparent) 0%, color-mix(in srgb, var(--ink) 73%, transparent) 54%, transparent 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--ink) 44%, transparent), transparent 25%, transparent 89%, color-mix(in srgb, var(--ink) 18%, transparent));
}

.photo-wall h1 {
  z-index: 1;
  margin-inline: 18px;
  color: var(--white);
  text-align: center;
  font-size: clamp(2rem, 4.9vw, 5.05rem);
  font-weight: 800;
  letter-spacing: -.044em;
  line-height: 1.13;
  white-space: normal;
  word-break: keep-all;
  text-shadow: 0 2px 8px #000e, 0 6px 22px #000e;
}

.hero-title-lead,
.hero-title-emphasis {
  --title-color: var(--paper);
  --title-highlight: var(--blue-selected);
  --title-sweep: hero-title-shine-lead;
  --title-entrance: hero-title-arrive .86s cubic-bezier(.2, .7, .25, 1) var(--title-entrance-delay, 0s) both;
  display: inline-block;
  color: var(--title-color);
}

.hero-title-emphasis {
  --title-color: var(--accent);
  --title-highlight: var(--accent-hover);
  --title-sweep: hero-title-shine-emphasis;
  --title-entrance-delay: .13s;
  font-weight: 890;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title-lead,
  .hero-title-emphasis {
    animation: var(--title-entrance);
  }

  .photo-wall:is(.is-paused, .is-outside-viewport) :is(.hero-title-lead, .hero-title-emphasis) {
    animation-play-state: paused;
  }
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-title-lead,
    .hero-title-emphasis {
      color: transparent;
      background-image: linear-gradient(110deg, var(--title-color) 34%, var(--title-highlight) 43%, var(--white) 50%, var(--title-highlight) 57%, var(--title-color) 66%);
      background-size: 340% 100%;
      background-position: 100% 50%;
      -webkit-background-clip: text;
      background-clip: text;
      text-shadow: none;
      filter: drop-shadow(0 2px 4px #000d) drop-shadow(0 5px 11px #000b);
      animation: var(--title-entrance), var(--title-sweep) 1.65s 180ms ease-out both;
    }
  }
}

@keyframes hero-title-arrive {
  from { opacity: .8; transform: translateY(.22em); }
  to { opacity: 1; transform: translateY(0); }
}

/* The opening light passes from the first line to the second. */
@keyframes hero-title-shine-lead {
  0%, 4% { background-position: 100% 50%; }
  46%, 100% { background-position: 0% 50%; }
}

@keyframes hero-title-shine-emphasis {
  0%, 34% { background-position: 100% 50%; }
  76%, 100% { background-position: 0% 50%; }
}

@media (forced-colors: active) {
  .hero-title-lead,
  .hero-title-emphasis {
    color: CanvasText;
    background: none;
    filter: none;
    animation: none;
  }
}

.hero-motion-toggle {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rule);
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.hero-motion-toggle:hover { color: var(--lilac); }
.hero-motion-toggle:focus-visible { outline-color: var(--accent); }

@media (min-width: 2500px) {
  .photo-wall { --hero-tile-width: 16vw; }
}

@media (max-width: 800px) {
  .photo-wall {
    --hero-tile-width: clamp(128px, 40vw, 221px);
    min-height: clamp(330px, 48svh, 485px);
  }

  .photo-wall h1 { font-size: clamp(2rem, 6.65vw, 3.15rem); }
  .photo-wall::after {
    background:
      radial-gradient(ellipse 90% 33% at 50% 50%, color-mix(in srgb, var(--ink) 92%, transparent) 0%, color-mix(in srgb, var(--ink) 74%, transparent) 54%, transparent 100%),
      linear-gradient(0deg, color-mix(in srgb, var(--ink) 47%, transparent), transparent 24%, transparent 88%, color-mix(in srgb, var(--ink) 19%, transparent));
  }
}

@media (max-width: 700px) {
  .photo-wall h1 {
    display: grid;
    justify-items: center;
    gap: .1em;
    font-size: clamp(2.1875rem, 8.4vw, 3.5rem);
    line-height: 1.1;
  }

  .hero-title-lead { font-size: .86em; }
}
