/* Motion — esprit Safe-doc : fade-in, float léger, ambiance */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.55s ease,
      transform 0.55s ease;
    transition-delay: var(--reveal-delay, 0s);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger > .reveal:nth-child(1) { --reveal-delay: 0s; }
  .reveal-stagger > .reveal:nth-child(2) { --reveal-delay: 0.08s; }
  .reveal-stagger > .reveal:nth-child(3) { --reveal-delay: 0.16s; }
  .reveal-stagger > .reveal:nth-child(4) { --reveal-delay: 0.24s; }
  .reveal-stagger > .reveal:nth-child(5) { --reveal-delay: 0.32s; }
  .reveal-stagger > .reveal:nth-child(6) { --reveal-delay: 0.4s; }
  .reveal-stagger > .reveal:nth-child(7) { --reveal-delay: 0.48s; }
  .reveal-stagger > .reveal:nth-child(8) { --reveal-delay: 0.56s; }

  @keyframes soft-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
  }

  @keyframes soft-float-alt {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(-0.4deg); }
  }

  @keyframes blob-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(18px, -22px) scale(1.05); }
    66% { transform: translate(-14px, 12px) scale(0.96); }
  }

  @keyframes pulse-soft {
    0%, 100% { box-shadow: 0 8px 24px rgba(139, 110, 90, 0.12); }
    50% { box-shadow: 0 12px 32px rgba(139, 110, 90, 0.22); }
  }

  /* Float uniquement après apparition (évite conflit avec le translate du reveal) */
  .float-block.is-visible {
    animation: soft-float 5.5s ease-in-out infinite;
    will-change: transform;
  }

  .float-block-alt.is-visible {
    animation: soft-float-alt 6.5s ease-in-out infinite;
    animation-delay: -2s;
    will-change: transform;
  }

  .float-block-slow.is-visible {
    animation: soft-float 7.5s ease-in-out infinite;
    animation-delay: -1.2s;
  }

  /* Au hover : pause le float et remonte un peu */
  .lift-card {
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  }

  .lift-card.is-visible:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(45, 36, 30, 0.08);
  }

  .float-block.lift-card.is-visible:hover,
  .float-block-alt.lift-card.is-visible:hover,
  .float-block-slow.lift-card.is-visible:hover {
    animation-play-state: paused;
    transform: translateY(-6px);
  }

  .btn-pulse {
    animation: pulse-soft 2.8s ease-in-out infinite;
  }

  .btn-pulse:hover {
    animation-play-state: paused;
  }

  /* Fond ambiant (home / produit) */
  body:has(> .ambient-bg) {
    background: transparent !important;
  }

  .ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: #fdfbf7;
  }

  .ambient-bg .blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(64px);
    mix-blend-mode: multiply;
    opacity: 0.55;
    animation: blob-drift 28s ease-in-out infinite;
  }

  .ambient-bg .blob-1 {
    width: 420px;
    height: 420px;
    background: rgba(188, 108, 37, 0.28);
    top: -80px;
    left: -60px;
  }

  .ambient-bg .blob-2 {
    width: 380px;
    height: 380px;
    background: rgba(139, 110, 90, 0.22);
    top: 20%;
    right: -80px;
    animation-delay: -8s;
  }

  .ambient-bg .blob-3 {
    width: 340px;
    height: 340px;
    background: rgba(96, 108, 56, 0.18);
    bottom: 10%;
    left: 25%;
    animation-delay: -14s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .float-block,
  .float-block-alt,
  .float-block-slow,
  .btn-pulse,
  .ambient-bg .blob {
    animation: none !important;
  }
}
