/* NEXUSHOST — effets « wow » globaux (toutes pages) */

/* --- Fond vivant derrière le <main> --- */
main {
  position: relative;
  isolation: isolate;
}

main::before {
  content: "";
  position: absolute;
  inset: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 70% 45% at 15% 20%, rgba(124, 58, 237, 0.14), transparent 50%),
    radial-gradient(ellipse 55% 40% at 88% 35%, rgba(34, 211, 238, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 95%, rgba(232, 121, 249, 0.07), transparent 55%);
  animation: site-aurora-drift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

main > * {
  position: relative;
  z-index: 1;
}

@keyframes site-aurora-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.75;
  }
  100% {
    transform: translate(-2%, 1%) scale(1.03);
    opacity: 1;
  }
}

/* --- Grille fantôme sur sections & hero (sans toucher .shield-hero du CSS protection) --- */
.section:not(.pricing),
.hero {
  position: relative;
}

.section:not(.pricing)::after,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(124, 58, 237, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 88% 72% at 50% 42%, black 0%, transparent 78%);
  animation: site-section-grid 32s linear infinite;
  z-index: 0;
  opacity: 0.9;
}

.section:not(.pricing) > *,
.hero > * {
  position: relative;
  z-index: 1;
}

.page-tarifs .section.pricing::after {
  display: none;
}

/* Page Protection : grille légère (sans toucher au ::before animé existant) */
.shield-hero {
  position: relative;
}

.shield-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(rgba(124, 58, 237, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 15%, transparent 72%);
  animation: site-section-grid 36s linear infinite;
  opacity: 0.65;
}

.shield-hero > * {
  position: relative;
  z-index: 1;
}

.shield-hero .mega-stat {
  z-index: 2;
}

@keyframes site-section-grid {
  to {
    background-position: 64px 64px;
  }
}

/* --- Reveal scroll --- */
[data-reveal] {
  transition-duration: 0.85s !important;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-reveal]:not(.is-visible) {
  transform: translateY(30px) scale(0.988);
}

/* --- Spotlight souris (--sx / --sy) : pas les hub-cards (déjà --hx/--hy dans protection.css) --- */
.spec-card.glass,
.bento.glass,
.layer-card.glass,
.radar-card.glass,
.faq-item.glass,
.faq-intro.glass,
.cta-inner.glass,
.hero-card.glass {
  position: relative;
  overflow: hidden;
}

.spec-card.glass::after,
.bento.glass::after,
.layer-card.glass::after,
.radar-card.glass::after,
.faq-item.glass::after,
.faq-intro.glass::after,
.cta-inner.glass::after,
.hero-card.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    520px circle at var(--sx, 50%) var(--sy, 50%),
    rgba(124, 58, 237, 0.22),
    rgba(34, 211, 238, 0.08) 38%,
    transparent 58%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  z-index: 0;
}

.spec-card.glass:hover::after,
.bento.glass:hover::after,
.layer-card.glass:hover::after,
.radar-card.glass:hover::after,
.faq-item.glass:hover::after,
.faq-intro.glass:hover::after,
.cta-inner.glass:hover::after,
.hero-card.glass:hover::after {
  opacity: 1;
}

.spec-card > *,
.bento > *,
.layer-card > *,
.radar-card .radar-inner,
.faq-item > *,
.faq-intro > *,
.cta-inner > *,
.hero-card > * {
  position: relative;
  z-index: 1;
}

/* --- Halo bordure doux sur cartes --- */
.spec-card.glass,
.bento.glass,
.layer-card.glass,
.faq-item.glass {
  animation: wow-glass-border 6.5s ease-in-out infinite;
}

.spec-card.glass:nth-child(2),
.bento.glass:nth-child(2) {
  animation-delay: 0.45s;
}

.spec-card.glass:nth-child(3),
.bento.glass:nth-child(3) {
  animation-delay: 0.9s;
}

.layer-card:nth-child(2) {
  animation-delay: 0.35s;
}

.layer-card:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes wow-glass-border {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0), 0 12px 40px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 38px rgba(124, 58, 237, 0.14), 0 18px 52px rgba(0, 0, 0, 0.3);
  }
}

/* --- Header : ligne animée --- */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(124, 58, 237, 0.45),
    rgba(34, 211, 238, 0.55),
    rgba(232, 121, 249, 0.45),
    transparent
  );
  background-size: 200% 100%;
  animation: wow-line-sweep 8s linear infinite;
  opacity: 0.9;
  pointer-events: none;
}

@keyframes wow-line-sweep {
  to {
    background-position: 200% 0;
  }
}

/* --- Footer --- */
.site-footer {
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.5), transparent);
  background-size: 180% 100%;
  animation: wow-line-sweep 11s linear infinite reverse;
  opacity: 0.75;
}

/* --- Titres de section --- */
.section-head h2 {
  animation: wow-title-glow 5.5s ease-in-out infinite;
}

@keyframes wow-title-glow {
  0%,
  100% {
    text-shadow: none;
  }
  50% {
    text-shadow: 0 0 48px rgba(124, 58, 237, 0.2);
  }
}

/* --- Hero badge --- */
.hero-badge {
  animation: wow-badge-pop 3.2s ease-in-out infinite;
}

@keyframes wow-badge-pop {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(34, 211, 238, 0);
  }
  50% {
    box-shadow: 0 0 26px rgba(34, 211, 238, 0.18);
  }
}

/* --- Gradient texte hero : cumule hue-shift + brillance --- */
.gradient-text {
  animation: hue-shift 8s ease infinite alternate, wow-gradient-shine 4s ease-in-out infinite !important;
}

@keyframes wow-gradient-shine {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

/* --- Boutons primaires --- */
.btn-primary {
  animation: wow-btn-pulse 3.5s ease-in-out infinite;
}

@keyframes wow-btn-pulse {
  0%,
  100% {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35), 0 0 0 0 rgba(124, 58, 237, 0.18);
  }
  50% {
    box-shadow: 0 12px 44px rgba(124, 58, 237, 0.48), 0 0 0 7px rgba(124, 58, 237, 0.1);
  }
}

.btn-primary:hover {
  animation: none;
}

/* --- Nav desktop : soulignement --- */
@media (min-width: 900px) {
  .nav a:not(.nav-shield)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.35rem;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-2), var(--violet-400));
    transform: translateX(-50%);
    transition: width 0.35s var(--ease-out-expo);
  }

  .nav a:not(.nav-shield) {
    position: relative;
  }

  .nav a:not(.nav-shield):hover::after,
  .nav a.is-active:not(.nav-shield)::after {
    width: 70%;
  }
}

/* --- Logo hover --- */
.logo {
  transition: transform 0.35s var(--ease-out-expo), filter 0.35s ease;
}

.logo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 14px rgba(167, 139, 250, 0.45));
}

/* --- Footer links --- */
.footer-links a {
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--violet-400));
  transition: width 0.35s var(--ease-out-expo);
}

.footer-links a:hover::after {
  width: 100%;
}

/* --- Marquee : double animation --- */
.marquee-inner {
  animation: marquee 28s linear infinite, wow-marquee-glow 4s ease-in-out infinite;
}

@keyframes wow-marquee-glow {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

/* --- Ticker menaces (page protection) --- */
.ticker-threat .marquee-inner {
  animation: marquee 22s linear infinite reverse, wow-marquee-glow 3.5s ease-in-out infinite;
}

/* --- Mega chiffre protection --- */
.mega-number-value {
  animation: wow-gradient-shine 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  main::before,
  .section:not(.pricing)::after,
  .hero::after,
  .shield-hero::after,
  .spec-card.glass,
  .bento.glass,
  .layer-card.glass,
  .faq-item.glass,
  .section-head h2,
  .hero-badge,
  .gradient-text,
  .btn-primary,
  .site-header::after,
  .site-footer::before,
  .marquee-inner,
  .ticker-threat .marquee-inner,
  .mega-number-value {
    animation: none !important;
  }

  [data-reveal]:not(.is-visible) {
    transform: translateY(16px);
  }

  [data-reveal] {
    transition-duration: 0.4s !important;
  }

  .spec-card.glass::after,
  .bento.glass::after,
  .layer-card.glass::after,
  .radar-card.glass::after,
  .faq-item.glass::after,
  .faq-intro.glass::after,
  .cta-inner.glass::after,
  .hero-card.glass::after {
    display: none;
  }
}
