/* ============================================================
   ANIMATIONS & TRANSITIONS
   ============================================================ */

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */

@keyframes floatBook {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(0.5deg); }
  66%       { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(12px); opacity: 0.4; }
}

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

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

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

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.4; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes underlineGrow {
  from { width: 0; }
  to   { width: 100%; }
}

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

@keyframes loaderBar {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-120vh) translateX(40px) rotate(360deg); opacity: 0; }
}

@keyframes heroTextReveal {
  0%   { clip-path: inset(100% 0 0 0); transform: translateY(20px); opacity: 0; }
  100% { clip-path: inset(0% 0 0 0); transform: translateY(0); opacity: 1; }
}

@keyframes borderExpand {
  from { width: 0; }
  to   { width: 48px; }
}

@keyframes numberCount {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   SCROLL-TRIGGERED CLASSES (applied via JS)
══════════════════════════════════════════ */

/* Initial hidden state */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--t-slower), transform var(--t-slower);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity var(--t-slower), transform var(--t-slower);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity var(--t-slower), transform var(--t-slower);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--t-slower), transform var(--t-slower);
}

/* Visible state (added by IntersectionObserver) */
.reveal.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays */
.delay-1  { transition-delay: 0.1s; }
.delay-2  { transition-delay: 0.2s; }
.delay-3  { transition-delay: 0.3s; }
.delay-4  { transition-delay: 0.4s; }
.delay-5  { transition-delay: 0.5s; }
.delay-6  { transition-delay: 0.6s; }

/* ══════════════════════════════════════════
   PAGE LOAD ANIMATIONS
══════════════════════════════════════════ */

.hero-title {
  animation: fadeUp 0.9s var(--ease-out) both;
}

.hero-subtitle {
  animation: fadeUp 0.9s var(--ease-out) 0.15s both;
}

.hero-tagline {
  animation: fadeUp 0.9s var(--ease-out) 0.25s both;
}

.hero-cta {
  animation: fadeUp 0.9s var(--ease-out) 0.4s both;
}

.hero-scroll {
  animation: fadeIn 1s ease 0.8s both;
}

.hero-book {
  animation: scaleIn 1.2s var(--ease-out) 0.2s both;
}

.hero-book .float-anim {
  animation: floatBook 4s ease-in-out 1.4s infinite;
}

/* ══════════════════════════════════════════
   HOVER ANIMATIONS
══════════════════════════════════════════ */

/* Link underline slide */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width var(--t-base);
}

.link-underline:hover::after { width: 100%; }

/* Scale on hover */
.hover-scale {
  transition: transform var(--t-base);
}

.hover-scale:hover { transform: scale(1.05); }

/* Lift on hover */
.hover-lift {
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Image zoom */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.img-zoom-wrap img {
  transition: transform var(--t-slow);
}

.img-zoom-wrap:hover img {
  transform: scale(1.04);
}

/* Glow on hover */
.hover-glow:hover {
  box-shadow: var(--glow-sage);
}

/* ══════════════════════════════════════════
   HERO PARTICLES
══════════════════════════════════════════ */

.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: var(--radius-full);
  background: rgba(245,243,240,0.12);
  animation: particleFloat linear infinite;
}

/* ══════════════════════════════════════════
   3D BOOK PERSPECTIVE
══════════════════════════════════════════ */

.perspective-wrap {
  perspective: 1200px;
  perspective-origin: center center;
}

.book-3d {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

/* ══════════════════════════════════════════
   ANIMATED DIVIDER
══════════════════════════════════════════ */

.divider-animated {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--sage), var(--sage-light));
  transition: width 0.8s var(--ease-out) 0.3s;
  border-radius: var(--radius-full);
}

.divider-animated.visible { width: 48px; }
.divider-animated--center { margin: var(--sp-3) auto; }
.divider-animated--wide.visible { width: 80px; }

/* ══════════════════════════════════════════
   BACKGROUND PATTERNS
══════════════════════════════════════════ */

.bg-pattern-dots {
  background-image: radial-gradient(circle, rgba(107,142,127,0.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-pattern-grid {
  background-image:
    linear-gradient(rgba(107,142,127,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107,142,127,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-pattern-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(107,142,127,0.04) 20px,
    rgba(107,142,127,0.04) 21px
  );
}

/* ══════════════════════════════════════════
   BOOK RATING STARS
══════════════════════════════════════════ */

.stars-display {
  display: flex;
  gap: 2px;
  align-items: center;
}

.stars-display .star {
  font-size: var(--text-xl);
  color: var(--gold);
  display: inline-block;
  animation: scaleIn 0.3s var(--ease-out) both;
}

.stars-display .star:nth-child(1) { animation-delay: 0.0s; }
.stars-display .star:nth-child(2) { animation-delay: 0.06s; }
.stars-display .star:nth-child(3) { animation-delay: 0.12s; }
.stars-display .star:nth-child(4) { animation-delay: 0.18s; }
.stars-display .star:nth-child(5) { animation-delay: 0.24s; }

/* ══════════════════════════════════════════
   SCROLL PROGRESS BAR
══════════════════════════════════════════ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  z-index: calc(var(--z-nav) + 1);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* ══════════════════════════════════════════
   TESTIMONIAL SLIDER
══════════════════════════════════════════ */

.slider-track {
  display: flex;
  transition: transform 0.5s var(--ease-out);
}

.slider-track .testimonial-card {
  flex: 0 0 100%;
}
