/* Opt in only after the script has measured the cards. Without JavaScript,
   the gallery retains its normal, fully visible appearance. */
#portfolio .gallery-grid .gallery-item.gallery-scroll-active {
  opacity: var(--gallery-scroll-opacity, 1);
  transform: translate3d(0, var(--gallery-scroll-y, 0px), 0);
  /* The legacy nth-child reveal delay must not delay frame or focus updates. */
  transition: none;
}

/* A keyboard user must never have to interact with an invisible card. */
#portfolio .gallery-grid .gallery-item.gallery-scroll-active:focus-visible {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #portfolio .gallery-grid .gallery-item.gallery-scroll-active {
    opacity: 1 !important;
    transform: none !important;
  }
}
