.trail {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #faf9f6;
}

.spawnLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.node {
  position: absolute;
  width: 6rem;
  height: 6rem;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--color-kolabora-neutral-dark) 20%, transparent);
  pointer-events: none;
}

.label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  margin: 0;
  padding: 0 1.5rem;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.fallbackGrid {
  display: none;
}

/*
 * Touch/no-hover devices get the exact same visual trail as desktop — the
 * JS side (`ImageTrail`'s `spawnMode`) switches from cursor-driven to a
 * self-running interval instead, since there's no cursor to react to. No
 * CSS branch needed for that case, only for `prefers-reduced-motion`
 * below, which turns spawning off entirely for anyone regardless of
 * pointer type.
 */

/*
 * Reduced motion: no spawning at all. The label moves out of the way (a
 * caption above the photos, not an overlay fighting them for attention)
 * and the photos render at full opacity — real content to look at, not a
 * dim decorative wash.
 */
@media (prefers-reduced-motion: reduce) {
  .trail {
    display: flex;
    flex-direction: column;
  }

  .spawnLayer {
    display: none;
  }

  .label {
    position: static;
    padding: 1.25rem 1.25rem 0.75rem;
    text-align: left;
  }

  .fallbackGrid {
    display: grid;
    flex: 1 1 0%;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 2px;

    img {
      display: block;
      width: 100%;
      height: 100%;
      min-height: 88px;
      object-fit: cover;

      /* An odd photo count leaves one orphan in the last row — let it span
         both columns instead of leaving an empty cell next to it. */
      &:last-child:nth-child(odd) {
        grid-column: 1 / -1;
      }
    }
  }
}
