/* ---------------------------------------------------------------------------
   Egglaxy Arcade — the game's own rocks, drifting past the landing page.

   Loaded after styles.css, which the two sites share: everything here is the
   arcade's alone, so the timer's pages cannot pick it up by accident. The
   privacy pages do not load it either — something crossing the page is the
   wrong kind of movement on a document somebody is reading.

   The rocks are the four sprites `SpaceBackdrop` uses behind the title screen,
   at the same tilt and the same low contrast. They rise rather than fall, which
   is what the shaft looks like from inside the egg.
--------------------------------------------------------------------------- */

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

/* Everything the hero draws sits above the sky rather than under it — every
   child but the sky itself, which is what the `:not()` is for: `.hero--app > *`
   and `.sky` carry the same specificity, so without it the later rule set the
   sky to `position: relative`, `inset` stopped applying, and the layer collapsed
   to no height at all with every rock folded onto its top edge. */
.hero--app > *:not(.sky) { position: relative; z-index: 1; }
.hero--app { position: relative; }

.rock {
  position: absolute;
  bottom: -30vh;
  width: 96px;
  height: auto;
  opacity: 0.4;
  will-change: transform;
  animation: rock-drift 34s linear infinite;
}

/* Four sizes and four speeds, because a field where everything is the same size
   and moves at one pace reads as a pattern rather than as distance. The small
   ones are dimmer and slower: they are the far ones. */
.rock.r1 { left: 4%;  width: 120px; opacity: 0.42; animation-duration: 38s; }
.rock.r2 { left: 68%; width: 86px;  opacity: 0.32; animation-duration: 52s; animation-delay: -12s; }
.rock.r3 { left: 22%; width: 64px;  opacity: 0.26; animation-duration: 64s; animation-delay: -30s; }
.rock.r4 { left: 84%; width: 140px; opacity: 0.38; animation-duration: 44s; animation-delay: -22s; }

/* A long rise with a slow turn on the way. The negative delays above start each
   one part-way through, so the page opens with rocks already in the air rather
   than with an empty sky filling up. */
@keyframes rock-drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to   { transform: translate3d(4vw, -150vh, 0) rotate(140deg); }
}

/* A loop that never ends is exactly what this setting exists to stop. The rocks
   stay where they are — still a sky, just a still one. */
@media (prefers-reduced-motion: reduce) {
  .rock {
    animation: none;
    bottom: auto;
    top: 12%;
  }

  .rock.r2 { top: 44%; }
  .rock.r3 { top: 68%; }
  .rock.r4 { top: 30%; }
}
