.gloss-photo {position:relative;display:block;isolation:isolate}
.ml-look .gloss-photo {--gloss-radius:4px}

.gloss-light {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  overflow: hidden;                         /* mask the highlight to the photo box */
  border-radius: var(--gloss-radius, inherit);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  mix-blend-mode: var(--gloss-blend, screen);
}

/* The highlight itself: a narrow, slanted band with a soft specular core.
   Invisible at rest, so reduced-motion users and idle galleries see nothing. */
.gloss-light::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 42%;
  opacity: 0;
  transform: translate3d(-160%, 0, 0) skewX(-12deg);
  background-image:
    radial-gradient(ellipse 1.4px 9px at 50% 54%, #fff 8%, transparent 100%),
    radial-gradient(ellipse 9px 1.4px at 50% 54%, #fff 8%, transparent 100%),
    /* wet specular core — small, slightly above centre */
    radial-gradient(
      ellipse 30% 22% at 50% 54%,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 250, 252, 0.28) 45%,
      rgba(255, 255, 255, 0) 100%
    ),
    /* pearly sheen — warm rose leading edge, cool trailing edge */
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 226, 236, 0.08) 22%,
      rgba(255, 244, 248, 0.3) 43%,
      rgba(255, 255, 255, 0.46) 50%,
      rgba(234, 243, 255, 0.26) 58%,
      rgba(255, 230, 240, 0.07) 78%,
      rgba(255, 255, 255, 0) 100%
    );
  background-repeat: no-repeat;
  /* fade the band toward top and bottom so it reads as a glint, not a bar */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 4%,
    #000 30%,
    #000 62%,
    transparent 96%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 4%,
    #000 30%,
    #000 62%,
    transparent 96%
  );
}

@media (prefers-reduced-motion: no-preference) {
  .is-sweeping .gloss-light::after {
    animation-name: gloss-pass;
    animation-duration: var(--gloss-duration, 480ms);
    animation-timing-function: cubic-bezier(0.4, 0.1, 0.5, 0.95);
    animation-delay: calc(var(--gloss-index, 0) * var(--gloss-step, 220ms));
    animation-iteration-count: 1;
    animation-fill-mode: both;
    will-change: transform, opacity;
  }
}

/* Travel is in % of the band's own width (42% of the box):
   -160% starts fully off the left edge, 300% ends fully off the right. */
@keyframes gloss-pass {
  0% {
    opacity: 0;
    transform: translate3d(-160%, 0, 0) skewX(-12deg);
  }
  20% {
    opacity: var(--gloss-strength, 0.9);
  }
  74% {
    opacity: var(--gloss-strength, 0.9);
  }
  100% {
    opacity: 0;
    transform: translate3d(300%, 0, 0) skewX(-12deg);
  }
}

@media (forced-colors: active) {
  .gloss-light {
    display: none;
  }
}
