/* ============================================================
   ANIMATIONS.CSS — Mine de rien CT
   ============================================================ */

/* ---- Keyframes ---- */

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

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

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

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

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

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

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

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

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

@keyframes borderPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

/* ---- Hero entrance sequence ---- */

.hero-eyebrow {
  animation: heroFadeUp 0.7s ease both;
  animation-delay: 0.1s;
}

.hero-title {
  animation: heroFadeUp 0.7s ease both;
  animation-delay: 0.25s;
}

.hero-subtitle {
  animation: heroFadeUp 0.7s ease both;
  animation-delay: 0.4s;
}

.hero-actions {
  animation: heroFadeUp 0.7s ease both;
  animation-delay: 0.55s;
}

.hero-scroll-hint {
  animation: heroFadeIn 1s ease both, scrollPulse 2.5s ease-in-out infinite;
  animation-delay: 1s, 1.8s;
}

/* ---- Scroll reveal (IntersectionObserver driven) ---- */

.reveal {
  opacity: 0;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.from-up {
  transform: translateY(50px);
}

.reveal.from-left {
  transform: translateX(-50px);
}

.reveal.from-right {
  transform: translateX(50px);
}

.reveal.from-scale {
  transform: scale(0.92);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* stagger delays for siblings */
.reveal:nth-child(1) { transition-delay: 0s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal:nth-child(6) { transition-delay: 0.5s; }

/* ---- Float utility ---- */

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

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

.float-delay {
  animation: float 4s ease-in-out 1s infinite;
}

/* ---- Loading spinner ---- */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ---- Shimmer skeleton ---- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--muted) 25%,
    var(--secondary) 50%,
    var(--muted) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius);
}

/* ---- Border pulse on CTA ---- */

.btn-pulse {
  animation: borderPulse 2s ease infinite;
}

/* ---- Hamburger menu transition ---- */

.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Star widget ---- */

.star-btn {
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn:hover,
.star-btn.active {
  transform: scale(1.25);
}

/* ---- Avis card reveal ---- */

.avis-card {
  animation: scaleIn 0.4s ease both;
}

/* ---- Cookie banner slide ---- */

.cookie-banner {
  transition: bottom 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Tooltip fade ---- */

[data-tooltip]::after {
  opacity: 0;
  transition: opacity 0.2s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ---- Focus ring animation ---- */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius);
  transition: outline-offset 0.15s ease;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .float,
  .float-slow,
  .float-delay {
    animation: none;
  }
}
