/* Native, same-origin exhibit continuity. Normal anchors remain the router. */
@view-transition {
  navigation: auto;
}

:root {
  --exhibit-transition-duration: 760ms;
  --exhibit-transition-ease: cubic-bezier(.22, 1, .36, 1);
  /* Only the selected artwork moves; the page never cross-fades as a sheet. */
  view-transition-name: none;
}

/* JavaScript selects exactly one rendered candidate at capture time. */
[data-transition] {
  view-transition-name: none !important;
}

[data-transition][data-vt-active="true"] {
  view-transition-name: project-visual !important;
}

[hidden] [data-transition],
[data-transition][hidden],
[aria-hidden="true"] [data-transition] {
  view-transition-name: none !important;
}

::view-transition {
  pointer-events: none;
}

::view-transition-group(project-visual) {
  z-index: 1;
  animation-duration: var(--exhibit-transition-duration);
  animation-timing-function: var(--exhibit-transition-ease);
}

::view-transition-image-pair(project-visual) {
  isolation: isolate;
  overflow: hidden;
  border-radius: 0;
}

/* Keep the actual project image opaque. The group’s native width, height and
   transform animation carries the source plane into the destination hero. */
::view-transition-old(project-visual) {
  display: none;
  animation: none;
}

::view-transition-new(project-visual) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  mix-blend-mode: normal;
  animation: none;
}

/* Defensive rules when the visitor changes the in-site preference during a
   navigation. The script also calls skipTransition; links never wait for it. */
:root[data-motion="reduced"] [data-transition] {
  view-transition-name: none !important;
}

:root[data-motion="reduced"]::view-transition-group(*),
:root[data-motion="reduced"]::view-transition-old(*),
:root[data-motion="reduced"]::view-transition-new(*) {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  [data-transition] {
    view-transition-name: none !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
