/* Site-wide silky scroll reveal
   Hide only after JS marks .sr; .sr-in must always win visibility. */
html.js-sr .sr:not(.sr-in) {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
}
html.js-sr .sr {
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-sr .sr.sr-in,
html.js-sr .sr-in {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* Homepage works / artists — keep fade-up even if page CSS overrides transition */
html.js-sr #works a.works-tile.sr,
html.js-sr #artists > .grid > a.sr {
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
html.js-sr #works a.works-tile.sr:not(.sr-in),
html.js-sr #artists > .grid > a.sr:not(.sr-in) {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
}
html.js-sr #works a.works-tile.sr-in,
html.js-sr #artists > .grid > a.sr-in {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}

/* Stats cards use their own .is-in counter animation */
html.js-sr #stats .stat-card.is-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Footer copyright / ICP row — stay visible, but NOT the license preview popup */
footer .mt-20.pt-8.border-t {
  opacity: 1 !important;
  transform: none !important;
}
footer .mt-20.pt-8.border-t > * {
  opacity: 1 !important;
  transform: none !important;
}
/* Footer must not clip license preview (CSS fallback when JS off) */
footer {
  overflow: visible !important;
}
footer .mt-20.pt-8.border-t .group > span.pointer-events-none[hidden] {
  display: none !important;
}
footer .mt-20.pt-8.border-t .group > span.pointer-events-none img {
  opacity: 0 !important;
  transform: scale(0.95) !important;
  max-width: min(92vw, 880px) !important;
  max-height: 85vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s !important;
}
footer .mt-20.pt-8.border-t .group:hover > span.pointer-events-none img {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Body-level license preview portal (JS) */
.license-preview-portal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0);
  /* Never capture mouse — otherwise leaving the trigger still "hovers" the overlay */
  pointer-events: none !important;
  opacity: 0;
  visibility: hidden;
  /* Close slower */
  transition: background-color 0.75s ease, opacity 0.75s ease, visibility 0.75s ease;
}
.license-preview-portal.is-open {
  background: rgba(0, 0, 0, 0.6);
  opacity: 1;
  visibility: visible;
  /* Open a bit quicker */
  transition: background-color 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
}
.license-preview-portal img {
  max-width: min(92vw, 880px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  transform: scale(0.96);
  opacity: 0;
  /* Close slower */
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.license-preview-portal.is-open img {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease 0.06s, transform 0.4s ease 0.06s;
}

@media (prefers-reduced-motion: reduce) {
  html.js-sr .sr:not(.sr-in),
  html.js-sr .sr,
  html.js-sr .sr-in,
  html.js-sr #works a.works-tile.sr,
  html.js-sr #artists > .grid > a.sr {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
