/* -------- Lerota — landing pré-inscription -------- */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-feature-settings: "cv11", "ss01", "ss03";
}

/* Sélection typographique plus élégante pour les titres serif */
.font-serif {
  font-optical-sizing: auto;
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
}

/* Bruit texturé subtil */
.noise {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* --- Reveal au scroll --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Décalage naturel enfant par enfant dans les grilles */
.grid > [data-reveal]:nth-child(2) {
  transition-delay: 80ms;
}
.grid > [data-reveal]:nth-child(3) {
  transition-delay: 160ms;
}
.grid > [data-reveal]:nth-child(4) {
  transition-delay: 240ms;
}

/* Cartes produit — petite respiration flottante */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(var(--r, 0deg));
  }
  50% {
    transform: translateY(-6px) rotate(var(--r, 0deg));
  }
}

[data-card] {
  animation: floaty 6s ease-in-out infinite;
}
[data-card]:nth-child(1) {
  --r: -3deg;
  animation-delay: 0s;
}
[data-card]:nth-child(2) {
  --r: 2deg;
  animation-delay: 0.8s;
}
[data-card]:nth-child(3) {
  --r: -1deg;
  animation-delay: 1.4s;
}
[data-card]:nth-child(4) {
  --r: 3deg;
  animation-delay: 2.1s;
}

[data-card]:hover {
  animation-play-state: paused;
}

/* Détails FAQ — transition douce d'ouverture */
details[open] > summary ~ * {
  animation: fadein 0.35s ease-out;
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bouton submit — pulse léger au hover */
button[data-submit]:focus-visible {
  outline: 2px solid #3e7d46;
  outline-offset: 3px;
}

/* État erreur du formulaire */
#form-wrap.is-error {
  border-color: #c0503f;
  box-shadow: 0 0 0 4px rgba(192, 80, 63, 0.08);
}

/* État succès du formulaire */
#form-wrap.is-success {
  border-color: #3e7d46;
  box-shadow: 0 0 0 4px rgba(62, 125, 70, 0.1);
}

/* Toast visible */
#toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Réduction d'animations pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    transition: none;
    opacity: 1;
    transform: none;
  }
  [data-card] {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}
