/* Collage Flythrough — scroll-driven 3D flight through cut-out collage pieces.
   Zero dependencies. Pair with collage-flythrough.js */

.cfx {
  --cfx-length: 700vh;      /* scroll distance the flight is spread over */
  --cfx-bg: #0d0d0f;
  --cfx-fog: transparent;
  position: relative;
  display: block;
}

.cfx__track {
  position: relative;
  height: var(--cfx-length);
}

.cfx__viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--cfx-bg);
}

.cfx__stage {
  position: absolute;
  inset: 0;
  perspective: var(--cfx-perspective, 900px);
  perspective-origin: 50% 50%;
}

.cfx__world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.cfx__piece {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  display: block;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  /* zzn patch: 'filter' removed. It kept a filter render surface alive on
     all 80 pieces for the whole session, while only a handful are ever
     blurred at once — the blur is applied on demand as a piece dissolves. */
  will-change: transform, opacity;
  /* pieces are pre-cut PNG-style alpha; keep edges crisp when scaled down */
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

/* soft vignette so pieces dissolve into the background at the edges */
.cfx__fog {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--cfx-fog);
}

.cfx__viewport[data-loading='true'] .cfx__world {
  opacity: 0;
}

.cfx__world {
  transition: opacity 600ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .cfx__piece {
    transition: none !important;
  }
}
