.tera-motion-stage { position: relative; overflow: hidden; --motion-duration: 10s; }
.tera-motion-route { position: absolute; left: 50%; bottom: -3%; width: min(72%, 32rem); aspect-ratio: 1;
  transform: translateX(-50%); }
.tera-motion-stage[data-branch] .tera-motion-route { bottom: 8%; }
.tera-motion-route::before, .tera-motion-pose { position: absolute; inset: 0;
  background: var(--motion-atlas) var(--pose-position) / 300% 200% no-repeat; }
.tera-motion-route::before { content: ''; --pose-position: center bottom; }
.tera-motion-sprite { position: absolute; inset: 0; isolation: isolate; }
.tera-motion-pose { mix-blend-mode: plus-lighter; animation: var(--pose-animation) var(--motion-duration) ease-in-out infinite; }
.tera-motion-pose:nth-child(1) { --pose-position: left top; --pose-animation: tera-pose-rest; }
.tera-motion-pose:nth-child(2) { --pose-position: center top; --pose-animation: tera-pose-look-ahead; }
.tera-motion-pose:nth-child(3) { --pose-position: right top; --pose-animation: tera-pose-look-right; }
.tera-motion-pose:nth-child(4) { --pose-position: left bottom; --pose-animation: tera-pose-lie; }
[data-motion-paused] .tera-motion-pose { animation-play-state: paused; }
.animal-motion { margin-block: 1rem; }
.animal-motion figure { width: min(100%, 38rem); margin: 0 0 .65rem; }
.animal-motion .tera-motion-stage { aspect-ratio: 3 / 2; border-radius: .65rem;
  background: #193329 url('./terrarium_web.jpg') center / cover; }
.animal-motion figcaption { margin-top: .55rem; }
.animal-motion .generation-progress { margin-top: .65rem; }
.tera-motion-progress-track { display: none; height: .45rem; margin-top: .85rem;
  overflow: hidden; border-radius: 1rem; background: #293c5b; }
[data-active] > .tera-motion-progress-track { display: block; }
.tera-motion-progress-track::before { content: ''; display: block; width: 35%; height: 100%; border-radius: inherit;
  background: #a6c8ff; animation: tera-motion-progress 1.4s ease-in-out infinite; }
.scene .tera-motion-stage { position: absolute; z-index: -1; inset: 0; pointer-events: none; display: none; --motion-duration: 34s; }
.scene[data-animal-motion]:not([data-sleeping],[data-night]) .tera-motion-stage { display: block; }
.scene[data-animal-motion]:not([data-sleeping],[data-night]) :is(#scene-animal,#preview-animal) { visibility: hidden; animation: none; }
@keyframes tera-motion-progress { from { transform: translateX(-100%); } to { transform: translateX(286%); } }
@keyframes tera-pose-rest {
  0%, 21%, 100% { opacity: 1; }
  26%, 95% { opacity: 0; }
}
@keyframes tera-pose-look-ahead {
  0%, 21%, 47%, 100% { opacity: 0; }
  26%, 42% { opacity: 1; }
}
@keyframes tera-pose-look-right {
  0%, 42%, 69%, 100% { opacity: 0; }
  47%, 64% { opacity: 1; }
}
@keyframes tera-pose-lie {
  0%, 64%, 100% { opacity: 0; }
  69%, 95% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tera-motion-progress-track::before { animation: none; transform: translateX(92%); }
  .scene[data-animal-motion]:not([data-sleeping],[data-night]) .tera-motion-stage { display: none; }
  .scene[data-animal-motion]:not([data-sleeping],[data-night]) :is(#scene-animal,#preview-animal) { visibility: visible; }
}
