.site-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--page);
  opacity: 1;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.site-loader.is-loaded {
  visibility: hidden;
  opacity: 0;
}

.site-loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-loader__character {
  display: block;
  width: 6rem;
  height: 6rem;
  background-image: var(--character-sprite-sheet);
  background-repeat: no-repeat;
  background-size: 30rem 18rem;
  animation: loaderCharacterRun 480ms step-end infinite;
}

.character-runner {
  position: absolute;
  top: 110px;
  left: -120px;
  width: 80px;
  height: 80px;
  z-index: 100;
  pointer-events: none;
  animation: characterRunOverMenu 2.3s linear forwards;
  animation-play-state: paused;
  background-size: 400px 240px;
  background-repeat: no-repeat;
  background-position: center;
}

.character-runner.is-ready {
  animation-play-state: running;
  cursor: pointer;
}

.effects-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 90;
  width: 100%;
  height: 220px;
  overflow: hidden;
  pointer-events: none;
}

.move-indicator {
  position: fixed;
  left: 10px;
  bottom: 105px;
  z-index: 110;
  width: min(230px, 58vw);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 18%));
  animation: indicatorAppear 250ms ease-out, indicatorBlink 900ms ease-in-out 300ms 2;
}

.dust {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0;
  pointer-events: none;
}

.dust-particle {
  animation: dustFloat 0.8s ease-out forwards;
}

.falling-star {
  position: fixed;
  top: -2rem;
  z-index: 90;
  color: #f5b700;
  text-shadow: 0 0 8px rgb(245 183 0 / 70%);
  pointer-events: none;
  animation: starFall linear forwards;
}

@keyframes characterRunOverMenu {
  from { left: -120px; }
  to { left: 100vw; }
}

@keyframes loaderCharacterRun {
  0%, 100% { background-position: 0 0; }
  25% { background-position: -6rem 0; }
  50% { background-position: -12rem 0; }
  75% { background-position: -18rem 0; }
}

@keyframes dustFloat {
  from { opacity: 1; transform: translate(0, 0); }
  to { opacity: 0; transform: translate(10px, -30px); }
}

@keyframes starFall {
  from {
    opacity: 0;
    transform: translateY(-2rem) rotate(0deg);
  }

  15% { opacity: 1; }

  92% { opacity: 1; }

  to {
    opacity: 0;
    transform: translateY(calc(100vh - 1rem)) rotate(270deg);
  }
}

@keyframes contentAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes indicatorAppear {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes indicatorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .character-runner {
    left: 20px;
    bottom: 20px;
    top: auto;
    position: fixed;
    animation: none;
  }

  .site-loader__character {
    visibility: hidden;
  }

  .menu {
    opacity: 1;
    animation: none;
  }

  .content-panel {
    animation: none;
  }

  .move-indicator {
    animation: none;
  }
}
