/* Close foreground rows sit above a dense, slower layer of small photographs. */
.hero-photo-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  animation: hero-photo-resolve 3.3s both;
}
.hero-photo-source {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 30px;
}
.hero-photo-scene.is-resolved {
  animation: none;
  filter: none;
  opacity: 1;
  transform: none;
}
.hero-photo-source .photo-gallery-frame {
  position: relative;
  width: 260px;
}
.hero-photo-space {
  position: absolute;
  inset: 0;
  z-index: 1;
  will-change: transform;
}
.hero-photo-space--background {
  z-index: 0;
  opacity: .52;
}
.hero-photo-space--background .photo-gallery-frame {
  filter: blur(.18px);
  box-shadow: 0 2px 5px rgb(30 50 70 / .08);
}
.hero-photo-position {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.photo-gallery-frame {
  position: absolute;
  box-sizing: border-box;
  flex: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 5px 12px rgb(30 50 70 / .15);
}
.hero-photo-position .photo-gallery-frame {
  translate: -50% -50%;
}
.photo-gallery-button {
  pointer-events: auto;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}
.photo-gallery-button:focus-visible {
  outline: 3px solid #2455bc;
  outline-offset: 4px;
}
.photo-gallery-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--photo-ratio, 1.333333);
  object-fit: contain;
  -webkit-user-drag: none;
}
.hero-photo-position .photo-gallery-frame img {
  height: 100%;
}
.entry-pending .hero-photo-scene,
.hero-photo-scene[data-paused="true"] {
  animation-play-state: paused;
}
.motion-paused .hero-photo-scene {
  animation: none;
}
/* Keep the page and gallery width fixed while the native modal owns scrolling. */
html:has(.gallery-photo-dialog[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}
.gallery-photo-dialog {
  width: min(1240px, calc(100% - 32px));
  height: calc(100dvh - 32px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 60px 16px 16px;
  border: 1px solid #ffffff55;
  border-radius: 8px;
  background: #151515;
  color: #fff;
  overflow: hidden;
  overscroll-behavior: contain;
}
.gallery-photo-dialog[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  animation: gallery-photo-appear 180ms ease-out;
}
.gallery-photo-dialog::backdrop {
  background: rgb(0 0 0 / .8);
}
.gallery-photo-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffff77;
  border-radius: 50%;
  background: #151515;
  color: #fff;
  cursor: pointer;
}
.gallery-photo-close .icon {
  width: 24px;
  height: 24px;
}
.gallery-photo-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.gallery-photo-view {
  min-width: 0;
  min-height: 0;
}
.gallery-photo-view img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}
@keyframes gallery-photo-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hero-photo-resolve {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(12%, 0, 0);
    animation-timing-function: cubic-bezier(.55, .06, .25, 1);
  }
  28% {
    opacity: 1;
    filter: blur(.35px);
    transform: translate3d(-.6%, 0, 0);
    animation-timing-function: cubic-bezier(.16, 1, .3, 1);
  }
  100% {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce), print {
  .hero-photo-scene,
  .gallery-photo-dialog[open] {
    animation: none;
  }
}
