.photo-section { overflow: clip; }

.gallery-journey {
  position: relative;
  height: 680vh;
  background: #020509;
}

.gallery-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 560px;
  isolation: isolate;
  overflow: hidden;
  perspective: 1250px;
  background: radial-gradient(ellipse at 50% 67%, #0d1d2c 0%, #020509 62%);
}

.gallery-stage::before {
  content: '';
  position: absolute;
  inset: 63% -65% -75%;
  z-index: 0;
  background-image: linear-gradient(#64809a45 1px, transparent 1px), linear-gradient(90deg, #64809a45 1px, transparent 1px);
  background-size: 100px 100px;
  transform: perspective(390px) rotateX(69deg);
  transform-origin: top center;
  opacity: .62;
  pointer-events: none;
}

.gallery-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(#020509 0%, transparent 18%, transparent 65%, #02050988 100%);
  pointer-events: none;
}

.gallery-masthead {
  position: absolute;
  z-index: 25;
  top: 7%;
  left: 6vw;
  right: 6vw;
  display: flex;
  justify-content: space-between;
  color: #edf2f5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  pointer-events: none;
}

.gallery-masthead span:last-child { color: #8a9bac; }

.gallery-track {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}

.gallery-track:active { cursor: grabbing; }
.gallery-track:focus-visible { outline: 1px solid #9ccae6; outline-offset: -5px; }

.gallery-card {
  position: absolute;
  top: 49%;
  left: 50%;
  width: min(42vw, 590px);
  height: min(67vh, 645px);
  margin: 0;
  overflow: hidden;
  border-radius: 17px;
  background: #101b28;
  box-shadow: 0 30px 100px #000c, 0 0 0 1px #ffffff20;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
  user-select: none;
}

.gallery-art { position: absolute; inset: 0; overflow: hidden; }
.gallery-art::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: var(--gallery-image) center / cover;
  filter: blur(27px) brightness(.45);
  transform: scale(1.05);
}
.gallery-art img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.gallery-card[data-layout="portrait"] .gallery-art img { object-fit: contain; }

.gallery-card .gallery-caption {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 70px 25px 24px;
  background: linear-gradient(transparent, #000d);
  color: #fff;
  font-size: clamp(13px, 1.5vw, 21px);
  font-weight: 600;
  letter-spacing: -.03em;
}
.gallery-caption a {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #020509dc;
  color: #fff;
  font-size: 18px;
}
.gallery-caption a:hover { background: #fff; color: #07101b; }

.gallery-overlay {
  position: absolute;
  z-index: 25;
  right: 6vw;
  bottom: 6%;
  left: 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: #f1f5f6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  pointer-events: none;
}
.gallery-hint { margin-left: auto; color: #9aabba; font-size: 10px; }
.gallery-progress {
  display: block;
  width: 110px;
  height: 1px;
  background: #ffffff4d;
}
.gallery-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: #d5eefa;
}

@media (max-width: 850px) {
  .gallery-card { width: 57vw; height: min(61vh, 590px); }
}
@media (max-width: 600px) {
  .gallery-journey { height: 540vh; }
  .gallery-stage { min-height: 0; height: 100svh; }
  .gallery-stage::before { inset: 59% -130% -70%; background-size: 60px 60px; }
  .gallery-masthead { top: 7%; font-size: 8px; }
  .gallery-masthead span:last-child { display: none; }
  .gallery-card { top: 48%; width: 77vw; height: 58svh; border-radius: 11px; }
  .gallery-card .gallery-caption { padding: 60px 16px 16px; font-size: 12px; }
  .gallery-caption a { width: 32px; height: 32px; font-size: 15px; }
  .gallery-overlay { bottom: 5%; font-size: 9px; }
  .gallery-hint { display: none; }
  .gallery-progress { width: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card { will-change: auto; }
}
