/* Outdoor atmosphere polish v2.
 * Keeps the existing scene art intact while varying the firefly motion and
 * grounding the dog on the summit meadow. Moon integration lives in the
 * dedicated weather/moon stylesheet so old scene-fixed offsets cannot leak
 * back into the shared real-time path.
 */

/* The six lights now have different sizes, loops and pauses. */
.scene-forest .ambient-specks i,
.scene-creek .ambient-specks i {
  --fly-size: 3px;
  --fly-color: #f4d77d;
  --fly-x1: 7px;
  --fly-y1: -9px;
  --fly-x2: -5px;
  --fly-y2: -3px;
  width: var(--fly-size);
  height: var(--fly-size);
  background: var(--fly-color);
  box-shadow:
    0 0 7px rgb(255 239 159 / 92%),
    0 0 15px rgb(245 215 113 / 38%);
  animation-name: petstar-firefly-meander;
  animation-duration: 7.1s;
  animation-timing-function: cubic-bezier(0.45, 0.02, 0.38, 1);
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

.scene-creek .ambient-specks i {
  --fly-color: #efd889;
}

.scene-forest .ambient-specks i:nth-child(1),
.scene-creek .ambient-specks i:nth-child(1) {
  --fly-size: 2px;
  --fly-x1: 5px;
  --fly-y1: -8px;
  --fly-x2: -4px;
  --fly-y2: -13px;
  animation-duration: 6.2s;
  animation-delay: -1.1s;
}

.scene-forest .ambient-specks i:nth-child(2),
.scene-creek .ambient-specks i:nth-child(2) {
  --fly-size: 4px;
  --fly-x1: 9px;
  --fly-y1: -4px;
  --fly-x2: 2px;
  --fly-y2: 8px;
  animation-duration: 8.8s;
  animation-delay: -6.4s;
}

.scene-forest .ambient-specks i:nth-child(3),
.scene-creek .ambient-specks i:nth-child(3) {
  --fly-size: 3px;
  --fly-x1: -8px;
  --fly-y1: -7px;
  --fly-x2: -12px;
  --fly-y2: 3px;
  animation-duration: 7.4s;
  animation-delay: -3.7s;
}

.scene-forest .ambient-specks i:nth-child(4),
.scene-creek .ambient-specks i:nth-child(4) {
  --fly-size: 5px;
  --fly-x1: 6px;
  --fly-y1: -12px;
  --fly-x2: 13px;
  --fly-y2: -5px;
  animation-duration: 10.2s;
  animation-delay: -7.8s;
}

.scene-forest .ambient-specks i:nth-child(5),
.scene-creek .ambient-specks i:nth-child(5) {
  --fly-size: 2px;
  --fly-x1: -5px;
  --fly-y1: 7px;
  --fly-x2: 7px;
  --fly-y2: 10px;
  animation-duration: 6.9s;
  animation-delay: -4.5s;
}

.scene-forest .ambient-specks i:nth-child(6),
.scene-creek .ambient-specks i:nth-child(6) {
  --fly-size: 3px;
  --fly-x1: -10px;
  --fly-y1: -2px;
  --fly-x2: -2px;
  --fly-y2: -11px;
  animation-duration: 9.5s;
  animation-delay: -2.6s;
}

@keyframes petstar-firefly-meander {
  0%,
  100% {
    opacity: 0.08;
    transform: translate3d(0, 0, 0) scale(0.62);
  }
  17% {
    opacity: 0.74;
  }
  34% {
    opacity: 0.96;
    transform: translate3d(var(--fly-x1), var(--fly-y1), 0) scale(1.08);
  }
  52% {
    opacity: 0.18;
    transform: translate3d(var(--fly-x2), var(--fly-y2), 0) scale(0.74);
  }
  71% {
    opacity: 0.82;
    transform: translate3d(var(--fly-x2), var(--fly-y1), 0) scale(1);
  }
  86% {
    opacity: 0.22;
  }
}

.period-evening .scene-forest .ambient-specks,
.period-evening .scene-creek .ambient-specks {
  opacity: 0.46;
}

.period-night .scene-forest .ambient-specks,
.period-night .scene-creek .ambient-specks {
  opacity: 0.84;
}

/* Lift the meadow line and compensate for transparent padding in low poses so
 * paws, belly and their contact shadow meet the foreground instead of floating. */
.room-scene.scene-summit .window::after {
  background-position: 50% 56%;
}

.room-scene.scene-summit.scene-action-sleep .dog-art-sleep {
  bottom: -12%;
}

.room-scene.scene-summit.scene-action-run .dog-art-run {
  bottom: -14%;
}

.room-scene.scene-summit.scene-action-swim .dog-art-swim {
  bottom: -11%;
}

.room-scene.scene-summit.scene-action-chew .dog-art-chew,
.room-scene.scene-summit.scene-action-roll .dog-art-roll {
  bottom: -7%;
}

.room-scene.scene-summit.scene-action-eat .dog-art-eat {
  bottom: -5%;
}

.room-scene.scene-summit.scene-action-playbow .dog-art-playbow,
.room-scene.scene-summit.scene-action-sphinx .dog-art-sphinx {
  bottom: -3%;
}

.room-scene.scene-summit.scene-action-frisbee .dog-art-frisbee {
  bottom: -2%;
}

.room-scene.scene-summit.scene-action-sleep .dog-shadow {
  bottom: 3.5%;
  height: 8%;
  opacity: 0.68;
}

@media (min-aspect-ratio: 43 / 20) {
  .room-scene.scene-summit .window::after {
    background-position: 50% 53%;
  }
}

@media (width <= 860px) {
  .room-scene.scene-summit .window::after,
  .time-page.wallpaper-mode .room-scene.scene-summit .window::after {
    background-position: 50% 58%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-forest .ambient-specks i,
  .scene-creek .ambient-specks i {
    animation: none !important;
    opacity: 0.58;
  }
}
