/* ============================================
   Praxia Premium — couche d'animations 3D
   Inspiré 21st.dev / Aceternity / Magic UI
   100% vanilla, zéro dépendance
   ============================================ */

/* === 1. Background Beams (rayons lumineux inclinés sur le hero) === */
.hero {
  position: relative;
  overflow: hidden;
}
.beams {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.beam {
  position: absolute;
  width: 2px;
  height: 200%;
  top: -50%;
  background: linear-gradient(180deg, transparent 0%, rgba(196, 90, 47, 0.7) 30%, rgba(225, 129, 90, 0.9) 50%, rgba(196, 90, 47, 0.7) 70%, transparent 100%);
  transform: rotate(15deg);
  filter: blur(1px);
  animation: beam-drift 14s linear infinite;
  box-shadow: 0 0 8px rgba(196, 90, 47, 0.5);
}
.beam:nth-child(1) { left: 8%;  animation-delay: 0s;   opacity: 0.7; }
.beam:nth-child(2) { left: 28%; animation-delay: -3s;  opacity: 0.9; height: 250%; top: -75%; width: 3px; }
.beam:nth-child(3) { left: 52%; animation-delay: -7s;  opacity: 0.6; }
.beam:nth-child(4) { left: 75%; animation-delay: -11s; opacity: 0.85; height: 280%; top: -90%; width: 2.5px; }
.beam:nth-child(5) { left: 93%; animation-delay: -5s;  opacity: 0.55; }
@keyframes beam-drift {
  0%   { transform: rotate(15deg) translateY(0); }
  50%  { transform: rotate(15deg) translateY(-20px); }
  100% { transform: rotate(15deg) translateY(0); }
}

/* === 2. Particles flottantes === */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 129, 90, 1) 0%, rgba(196, 90, 47, 0.6) 40%, rgba(196, 90, 47, 0) 70%);
  animation: float-particle var(--duration, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
  left: var(--x, 50%);
  top: 100%;
  filter: blur(0.5px);
  box-shadow: 0 0 6px rgba(196, 90, 47, 0.6);
  opacity: 0;
}
@keyframes float-particle {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 30px)); opacity: 0; }
}

/* === 3. Meteors (étoiles filantes diagonales) === */
.meteors { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.meteor {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(196, 90, 47, 0.9);
  box-shadow: 0 0 4px rgba(196, 90, 47, 0.6);
  animation: meteor 10s linear infinite;
  animation-delay: var(--delay, 0s);
  top: -10%;
  left: var(--x, 80%);
}
.meteor::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, rgba(196, 90, 47, 0.7), transparent);
}
@keyframes meteor {
  0% { transform: translateX(0) translateY(0) rotate(215deg); opacity: 1; }
  100% { transform: translateX(-700px) translateY(700px) rotate(215deg); opacity: 0; }
}

/* === 4. 3D Card tilt sur les agent-cards === */
.agent-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}
.agent-card .avatar-card,
.agent-card .agent-info {
  transform-style: preserve-3d;
}
.agent-card .avatar-card {
  transform: translateZ(30px);
  transition: transform 0.3s ease;
}
.agent-card:hover {
  box-shadow: 0 25px 60px -20px rgba(196, 90, 47, 0.35), 0 10px 40px -15px rgba(26, 26, 26, 0.25);
}
.agent-card:hover .avatar-card {
  transform: translateZ(50px);
}
/* Spotlight glow qui suit la souris */
.agent-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(196, 90, 47, 0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.agent-card:hover::before { opacity: 1; }

/* === 5. Border Beam sur les cards hero floating === */
.hero-float .avatar-card {
  position: relative;
  isolation: isolate;
}
.hero-float .avatar-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0deg, rgba(196, 90, 47, 0.9) 60deg, transparent 120deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: rotate-border 4s linear infinite;
  pointer-events: none;
  z-index: -1;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotate-border {
  to { --angle: 360deg; }
}

/* === 6. Stat counters reveal === */
.hero-meta-item .num em,
.hero-meta-item .num {
  display: inline-block;
}
.hero-meta-item .num.animating em,
.hero-meta-item .num.animating {
  animation: pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes pop-in {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* === 7. Glow ambient subtil sur le hero === */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(196, 90, 47, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: ambient-pulse 8s ease-in-out infinite;
}
@keyframes ambient-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}

/* === 12. Beams partout sur le site (couches successives entre sections) === */
section, footer {
  position: relative;
  isolation: isolate;
}

/* Section #agents : grille subtile en background + glow points */
#agents::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(196, 90, 47, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 95, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: drift-bg 20s ease-in-out infinite;
}
@keyframes drift-bg {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(20px, -15px); }
}

/* Section #how : timeline animée avec ligne qui se trace */
#how .steps {
  position: relative;
}
#how .steps::before {
  content: "";
  position: absolute;
  top: 50px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(196, 90, 47, 0.6) 20%,
    rgba(196, 90, 47, 0.9) 50%,
    rgba(196, 90, 47, 0.6) 80%,
    transparent 100%);
  z-index: -1;
  animation: line-shimmer 3s ease-in-out infinite;
}
@keyframes line-shimmer {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
#how .step .num {
  position: relative;
}
#how .step .num::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 90, 47, 0.4) 0%, transparent 70%);
  animation: pulse-ring 2.5s ease-in-out infinite;
  z-index: -1;
}
#how .step:nth-child(2) .num::after { animation-delay: -0.8s; }
#how .step:nth-child(3) .num::after { animation-delay: -1.6s; }
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.7; }
  50%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Section #pricing : background mesh gradient animé */
#pricing::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(196, 90, 47, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 75% 60%, rgba(225, 129, 90, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(30, 58, 95, 0.08) 0%, transparent 45%);
  pointer-events: none;
  z-index: -1;
  animation: mesh-drift 18s ease-in-out infinite;
}
@keyframes mesh-drift {
  0%, 100% { transform: translate(0,0)  scale(1); }
  33%      { transform: translate(-30px, 20px) scale(1.05); }
  66%      { transform: translate(25px, -15px) scale(0.97); }
}

/* Pricing card featured : levitate */
#pricing .price-card.is-featured {
  animation: card-levitate 4s ease-in-out infinite;
}
@keyframes card-levitate {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Section #why : checks qui s'allument */
#why li {
  position: relative;
  transition: color 0.3s ease;
}
#why::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      transparent 60px,
      rgba(196, 90, 47, 0.04) 60px,
      rgba(196, 90, 47, 0.04) 61px
    );
  pointer-events: none;
  z-index: -1;
}

/* Section #cta : grand glow pulsant */
#cta {
  position: relative;
  overflow: hidden;
}
#cta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(196, 90, 47, 0.20) 0%,
    rgba(196, 90, 47, 0.10) 30%,
    transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  animation: cta-pulse 6s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.6; }
  50%      { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
}
#cta .btn-primary {
  position: relative;
  overflow: hidden;
}
#cta .btn-primary::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shine 3s ease-in-out infinite;
}
@keyframes shine {
  0%   { left: -100%; }
  60%  { left: 100%; }
  100% { left: 100%; }
}

/* === 13. Reveal — le filet de sécurité Claude Design (safetyShow 2.5s) gère déjà
   l'apparition. On AJOUTE simplement la classe .visible/.is-in pour révéler plus tôt
   au scroll (avant 2.5s) sans rien casser. */
.reveal.visible,
.reveal.is-in {
  opacity: 1 !important;
  transform: none !important;
}

/* === 14. Floating orbs (3 grosses bulles colorées qui flottent en BG global) === */
body::after {
  content: "";
  position: fixed;
  top: 30%;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(196, 90, 47, 0.18) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: orb-float 25s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(-200px, 200px); }
  66%      { transform: translate(-100px, 400px); }
}

/* === 15. Section "Comment vous pilotez" === */
#control {
  padding: 80px 0 60px;
  position: relative;
  background: var(--cream-2, #EDE6D7);
}
#control::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(196, 90, 47, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(30, 58, 95, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: drift-bg 22s ease-in-out infinite;
}
#control > .container { position: relative; z-index: 1; }

#control .control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 40px;
}
#control .control-card {
  position: relative;
  background: var(--paper, #FBF7EE);
  border: 1px solid var(--line, rgba(26,26,26,0.10));
  border-radius: 22px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
#control .control-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -25px rgba(196, 90, 47, 0.30);
  border-color: var(--orange, #C45A2F);
}
#control .control-ico {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(196, 90, 47, 0.10);
  color: var(--orange, #C45A2F);
  display: flex;
  align-items: center;
  justify-content: center;
}
#control .control-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 500;
  margin: 0;
  line-height: 1.1;
}
#control .control-card p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft, #2E2C29);
  margin: 0;
}
#control .control-feat {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
#control .control-feat li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 20px;
  position: relative;
}
#control .control-feat li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}
#control .control-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 14px;
  background: var(--cream);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  align-self: flex-start;
}
#control .control-note {
  text-align: center;
  margin-top: 32px;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1024px) {
  #control .control-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 600px) {
  #control { padding: 60px 0 40px; }
  #control .control-card { padding: 26px 22px 24px; }
}

/* Hero pill : ajouter mention WhatsApp */
.hero-pill {
  position: relative;
}

/* === Performance : disable on small / reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .beam, .particle, .meteor, .agent-card, .hero-float .avatar-card::after, .hero::before {
    animation: none !important;
  }
}
@media (max-width: 768px) {
  .meteors, .beams { opacity: 0.4; }
  .agent-card:hover { transform: none !important; }
}

.hero-copy, .hero-stage {
  position: relative;
  z-index: 2;
}

/* === 8. Glow accent sous les hero cards (lévitation déjà gérée par "bob") === */
.hero-float .avatar-card {
  position: relative;
}
.hero-float .avatar-card::before {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(196, 90, 47, 0.5) 0%, transparent 70%);
  filter: blur(8px);
  z-index: -1;
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scaleX(0.9); }
  50%      { opacity: 1;   transform: translateX(-50%) scaleX(1.15); }
}

/* === 10. Grille perspective au footer === */
footer {
  position: relative;
  overflow: hidden;
}
footer::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background-image:
    linear-gradient(to right, rgba(196, 90, 47, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(196, 90, 47, 0.15) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(400px) rotateX(60deg);
  transform-origin: bottom;
  pointer-events: none;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

/* === 11. Section pricing — accent box subtle glow === */
#pricing .price-card {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#pricing .price-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -25px rgba(196, 90, 47, 0.35);
}
#pricing .price-card.featured::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0deg, rgba(196, 90, 47, 0.9) 60deg, transparent 120deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: rotate-border 5s linear infinite;
  pointer-events: none;
  z-index: -1;
}
