/* The setup portrait uses the same seated frame as the live fox. */
.pet-fox {
  width: 100%;
  aspect-ratio: 1;
  background: url("/pets/violin-fox/loiter.webp") 0% 100% / 400% 300% no-repeat;
}

.pet-habitat {
  position: relative;
  width: 100%;
  height: 100%;
  container-type: size;
  overflow: hidden;
}

/* A destination at either end leaves a whole sprite and a little clear space. */
.pet-trail {
  --fox-size: min(64cqw, 78cqh, 26rem);
  position: absolute;
  left: 2%;
  bottom: 4%;
  width: calc(96% - var(--fox-size));
  height: var(--fox-size);
  overflow: visible;
}

.pet-trail__viewport { display: block; overflow: visible; }
/* The nested SVG's explicit square viewport clips exactly one atlas cell. */
.pet-actor { overflow: hidden; }

.pet-actor__loiter, .pet-actor--loiter .pet-actor__performance { visibility: hidden; }
.pet-actor--loiter .pet-actor__loiter { visibility: visible; }

@media (prefers-reduced-motion: no-preference) {
  .pet-trail {
    transform-origin: center bottom;
    animation: pet-breathe 3.2s ease-in-out infinite;
  }
  @keyframes pet-breathe {
    50% { transform: scaleY(0.992); }
  }
}
