/* Site extras — matches Next.js globals.css behavior */

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(45, 212, 191, 0.3);
  color: inherit;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes scrollDown {
  0% { transform: translateY(-16px); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(48px); opacity: 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.hero-particle {
  animation: float 10s ease-in-out infinite;
}

.scroll-line {
  animation: scrollDown 1.5s ease-in-out infinite;
}

.loading-ring {
  animation: spin 1s linear infinite;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero slide transitions */
.hero-slide-content {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-slide-content.is-transitioning {
  opacity: 0;
  transform: translateY(1rem);
}

/* Loading screen */
#loading-screen.is-complete {
  opacity: 0;
  pointer-events: none;
}

#loading-screen.is-hidden {
  display: none;
}

/* Mobile menu */
#mobile-menu-backdrop.open,
#mobile-menu-panel.open {
  pointer-events: auto;
  opacity: 1;
}

#mobile-menu-panel.open {
  transform: translateY(0) scale(1);
}

/* Book grid stagger */
.book-grid-item {
  animation: fadeInUp 0.5s ease-out both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.book-grid-item:nth-child(1) { animation-delay: 0ms; }
.book-grid-item:nth-child(2) { animation-delay: 100ms; }
.book-grid-item:nth-child(3) { animation-delay: 200ms; }
.book-grid-item:nth-child(4) { animation-delay: 300ms; }

/* Hardcover images */
.hardcover-front > li:first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
