/* Motion changes presentation only: existing sizes, grids and positions stay intact. */
:root { --motion-ease: cubic-bezier(.16, 1, .3, 1); }

@media (prefers-reduced-motion: no-preference) {
  .brand-lockup { animation: music-soft-reveal 800ms var(--motion-ease) both; }
  .entry-grid { animation: music-soft-reveal 800ms 100ms var(--motion-ease) backwards; }
  .playlist-modal:not(.hidden), .mobile-more-overlay:not(.hidden),
  .now-playing-screen:not(.hidden) { animation: music-opacity-in 280ms ease-out; }
  .playlist-modal:not(.hidden) .playlist-modal-box,
  .mobile-song-action-sheet:not(.hidden) { animation: music-soft-reveal 420ms var(--motion-ease); }
  .queue-sidebar:not(.hidden) { animation: music-queue-reveal 420ms var(--motion-ease); }
  .now-playing-screen:not(.hidden) .now-playing-art,
  .now-playing-screen:not(.hidden) .now-playing-main,
  .now-playing-screen:not(.hidden) .now-playing-up-next {
    animation: music-soft-reveal 650ms var(--motion-ease) backwards;
  }
  .now-playing-screen:not(.hidden) .now-playing-main { animation-delay: 70ms; }
  .now-playing-screen:not(.hidden) .now-playing-up-next { animation-delay: 130ms; }
  .toast { animation: music-soft-reveal 360ms var(--motion-ease); }

  .playlist-card, .artist-library-card, .song-card, .recent-track, .quick-action {
    transition: translate 300ms var(--motion-ease), box-shadow 300ms ease,
      border-color 220ms ease, background-color 220ms ease;
  }
  button { transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 220ms ease; }
  button:active:not(:disabled) { scale: .97; }
  .song-item-row, .queue-item { transition: background-color 180ms ease, border-color 180ms ease; }
  .playlist-card-play { transition: opacity 220ms ease, transform 300ms var(--motion-ease), box-shadow 220ms ease; }
  .now-playing-art-glow { transition: opacity 450ms ease, transform 600ms var(--motion-ease), background-color 800ms ease; }
  .now-playing-screen::before { transition: opacity 600ms ease, transform 800ms ease; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .playlist-card:hover, .artist-library-card:hover, .song-card:hover,
  .quick-action:hover { translate: 0 -3px; }
  .recent-track:hover { translate: 0 -2px; }
}

/* Keyboard users receive the same visible play affordance as pointer users. */
.playlist-card:focus-within .playlist-card-play { opacity: 1; transform: translateY(0); }
button:disabled { cursor: default; }

@keyframes music-soft-reveal {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes music-opacity-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes music-queue-reveal {
  from { opacity: 0; translate: 16px 0; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-lockup, .entry-grid, .playlist-modal, .playlist-modal-box,
  .mobile-more-overlay, .mobile-song-action-sheet, .queue-sidebar,
  .now-playing-screen, .now-playing-art, .now-playing-main, .now-playing-up-next,
  .toast { animation: none !important; }
  button:active { scale: none; }
}
