/* ═══════════════════════════════════════════════════════
   AVERON BROKERS — 21ST.DEV-INSPIRED EFFECTS (v4)
   Premium motion, depth, and visual distinction layer
   ═══════════════════════════════════════════════════════ */

/* ── SPLIT-TEXT HERO TITLE REVEAL ── */
.hero-split-reveal .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: 0.25em;
}
.hero-split-reveal .word .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%) rotateX(-80deg);
  animation: charReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* ── HERO IMAGE PARALLAX (subtle depth) ── */
.hero-bg-img.parallax-active img {
  will-change: transform;
  transition: none;
}

/* ── ENHANCED GRADIENT MESH — Larger, more vivid ── */
.hero-mesh-overlay .mesh-shape {
  opacity: 0.2;
}
@keyframes meshPulse {
  0%, 100% { opacity: 0.15; filter: blur(100px); }
  50% { opacity: 0.25; filter: blur(120px); }
}
.hero-mesh-overlay .mesh-shape:nth-child(1) {
  animation: meshFloat 20s ease-in-out infinite, meshPulse 8s ease-in-out infinite;
}
.hero-mesh-overlay .mesh-shape:nth-child(2) {
  animation: meshFloat 20s ease-in-out infinite, meshPulse 10s ease-in-out infinite;
  animation-delay: -7s, -3s;
}
.hero-mesh-overlay .mesh-shape:nth-child(3) {
  animation: meshFloat 20s ease-in-out infinite, meshPulse 12s ease-in-out infinite;
  animation-delay: -14s, -6s;
}

/* ── SCROLL-TRIGGERED CLIP-PATH SECTION REVEALS ── */
.section-clip-reveal {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.section-clip-reveal.revealed {
  clip-path: inset(0 0 0% 0);
}

/* ── ENHANCED FADE-UP WITH SPRING ── */
.reveal-spring {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
  filter: blur(4px);
}
.reveal-spring.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* ── TRUST BAR MARQUEE (infinite horizontal scroll) ── */
.trust-bar-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.trust-bar-marquee .trust-bar-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marqueeScroll 50s linear infinite;
}
.trust-bar-marquee .trust-bar-track:hover {
  animation-play-state: paused;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── GLASSMORPHISM PRODUCT CARDS ── */
.p-card-glass {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 1px 2px rgba(27, 42, 74, 0.03),
    0 4px 12px rgba(27, 42, 74, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: all 0.45s var(--ease);
}
.p-card-glass:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(197, 165, 90, 0.3);
  box-shadow:
    0 2px 4px rgba(27, 42, 74, 0.03),
    0 12px 32px rgba(197, 165, 90, 0.1),
    0 28px 56px rgba(27, 42, 74, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-8px);
}

/* ── ANIMATED GRADIENT BORDER ON CARDS ── */
.card-gradient-border {
  position: relative;
  z-index: 0;
}
.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    var(--terra),
    var(--sage-lt),
    var(--terra-lt),
    var(--sage),
    var(--terra)
  );
  background-size: 100% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  animation: borderSpin 4s linear infinite;
  z-index: -1;
}
.card-gradient-border:hover::before {
  opacity: 1;
}
@keyframes borderSpin {
  to { --border-angle: 360deg; }
}
/* Conic gradient rotation via transform */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.card-gradient-border::before {
  background: conic-gradient(
    from var(--border-angle),
    var(--terra),
    var(--sage-lt),
    var(--terra-lt),
    var(--sage),
    var(--terra)
  );
  animation: borderSpin 4s linear infinite;
}

/* ── TEXT GRADIENT ON KEY HEADLINES ── */
.headline-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--terra-lt) 40%, var(--terra) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── STAT NUMBER GLOW ── */
.stat-num-glow {
  text-shadow: 0 0 20px rgba(197, 165, 90, 0.3),
               0 0 40px rgba(197, 165, 90, 0.1);
}

/* ── COUNTER SPRING ANIMATION ── */
.stat-num.counting {
  animation: countPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── FLOATING CTA (appears on scroll) ── */
.floating-cta {
  position: fixed;
  bottom: -80px;
  right: 1.5rem;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--terra);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 20px rgba(197, 165, 90, 0.4), 0 8px 32px rgba(27, 42, 74, 0.15);
  transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.floating-cta.visible {
  bottom: 1.5rem;
}
.floating-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(197, 165, 90, 0.5), 0 12px 40px rgba(27, 42, 74, 0.2);
}
.floating-cta svg {
  width: 18px;
  height: 18px;
}
/* Hide when cookie banner or callback is showing */
.floating-cta.hidden-by-banner {
  bottom: -80px !important;
}

/* ── NAV LINK UNDERLINE SLIDE-IN FROM LEFT ── */
.nav-link::after {
  transform-origin: left !important;
}

/* ── TESTIMONIAL INFINITE MARQUEE (optional) ── */
.testimonial-marquee-wrap {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.testimonial-marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marqueeScroll 45s linear infinite;
}
.testimonial-marquee-track:hover {
  animation-play-state: paused;
}

/* ── SECTION ENTRY: STAGGERED SCALE-IN ── */
.stagger-scale-in > * {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.stagger-scale-in.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-scale-in.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-scale-in.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-scale-in.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-scale-in.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-scale-in.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-scale-in.visible > * {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
}
.stagger-scale-in.visible > * {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── HERO CTA PULSE RING ── */
.btn-pulse-ring {
  position: relative;
}
.btn-pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--terra);
  opacity: 0;
  animation: pulseRing 2.5s ease-out infinite;
  pointer-events: none;
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ── VALUE CARD GLASSMORPHISM VARIANT ── */
.value-card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ── SECTION REVEAL: HORIZONTAL WIPE ── */
.wipe-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.wipe-reveal.revealed {
  clip-path: inset(0 0% 0 0);
}

/* ── ENHANCED SCROLL PROGRESS ── */
.scroll-progress {
  background: linear-gradient(90deg, var(--terra), var(--terra-lt), var(--sage-lt), var(--terra));
  background-size: 200% 100%;
  animation: progressShimmer 3s linear infinite;
}
@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: 0% 0; }
}

/* ── RESPONSIVE: DISABLE HEAVY EFFECTS ON MOBILE ── */
@media (max-width: 768px) {
  .floating-cta {
    right: 1rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
  }
  .hero-split-reveal .word .char {
    animation-duration: 0.5s;
  }
}

/* ── REDUCED MOTION: DISABLE ALL EFFECTS ── */
@media (prefers-reduced-motion: reduce) {
  .hero-split-reveal .word .char {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .section-clip-reveal {
    clip-path: none;
    transition: none;
  }
  .reveal-spring {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .trust-bar-marquee .trust-bar-track {
    animation: none;
  }
  .floating-cta {
    bottom: 1.5rem;
    transition: none;
  }
  .card-gradient-border::before {
    animation: none;
    display: none;
  }
  .hero-mesh-overlay .mesh-shape {
    animation: none;
  }
  .btn-pulse-ring::before {
    animation: none;
    display: none;
  }
  .scroll-progress {
    animation: none;
  }
}
