/* ==========================================================================
   JASPR MARKETING — Premium Animations Layer
   Loaded after style.css — overrides and extends.
   ========================================================================== */

/* ─── OVERRIDE: premium fade easing ──────────────────────────────────────── */
.fade {
  opacity: 0;
  transform: translateY(38px);
  transition:
    opacity   0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fade.animate-in {
  opacity: 1;
  transform: translateY(0);
}
/* Slightly wider stagger gaps for a more cinematic feel */
.fade.d-1 { transition-delay: 0.12s !important; }
.fade.d-2 { transition-delay: 0.26s !important; }
.fade.d-3 { transition-delay: 0.40s !important; }
.fade.d-4 { transition-delay: 0.56s !important; }

/* ─── NAV ENTRANCE ────────────────────────────────────────────────────────── */
.nav {
  animation: navDrop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes navDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ─── LOGO ────────────────────────────────────────────────────────────────── */
/* Spin-in on page load */
.nav-brand img,
.footer-brand img {
  animation: logoEntry 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter    0.45s ease;
}
@keyframes logoEntry {
  from {
    opacity: 0;
    transform: scale(0.35) rotate(-25deg);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

/* Hover: glow + slight tilt */
.nav-brand:hover img {
  transform: scale(1.1) rotate(8deg);
  filter: drop-shadow(0 0 14px rgba(230, 57, 70, 0.7));
}
.footer-brand:hover img {
  transform: scale(1.05) rotate(5deg);
  filter: drop-shadow(0 0 10px rgba(230, 57, 70, 0.5));
}

/* Burst ring radiates outward on load */
.nav-brand { position: relative; }
.nav-brand::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid rgba(230, 57, 70, 0.75);
  pointer-events: none;
  animation: logoBurst 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}
@keyframes logoBurst {
  0%   { opacity: 1; transform: scale(1);   border-color: rgba(230,57,70,0.75); }
  100% { opacity: 0; transform: scale(3.0); border-color: rgba(230,57,70,0); }
}

/* ─── HERO BACKGROUND LAYER ───────────────────────────────────────────────── */
/* Injected by animations.js: .hero-bg > .orb-1 + .orb-2 + .hero-grid + canvas */

.hero--enhanced::before { display: none !important; } /* hide old pseudo */
.page-hero--enhanced::before { display: none !important; }

.hero-bg,
.page-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Floating gradient orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.hero-orb.orb-1 {
  width: 750px; height: 750px;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(230,57,70,0.15) 0%, transparent 65%);
  animation: orb1Float 9s ease-in-out infinite alternate;
}
.hero-orb.orb-2 {
  width: 520px; height: 520px;
  bottom: -120px; right: -120px;
  background: radial-gradient(circle, rgba(230,57,70,0.08) 0%, transparent 65%);
  animation: orb2Float 12s ease-in-out infinite alternate;
}
@keyframes orb1Float {
  from { transform: translateX(-60%) translateY(0px) scale(1); }
  to   { transform: translateX(-42%) translateY(50px) scale(1.12); }
}
@keyframes orb2Float {
  from { transform: translate(0px, 0px) scale(1); }
  to   { transform: translate(-40px, -60px) scale(1.18); }
}

/* Grid lines */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 88% 88% at 50% 50%, #000 0%, transparent 100%);
          mask-image: radial-gradient(ellipse 88% 88% at 50% 50%, #000 0%, transparent 100%);
  animation: gridDrift 28s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 80px 80px; }
}

/* Particles canvas */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 1;
}

/* ─── WORD-BY-WORD REVEAL ──────────────────────────────────────────────────── */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
}
.word-wrap .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform, opacity;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.word-wrap .word.show {
  transform: translateY(0%);
  opacity: 1;
}

/* ─── CURSOR GLOW ────────────────────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,0.055) 0%, transparent 65%);
  pointer-events: none;
  z-index: 9990;
  will-change: transform;
  transition: opacity 0.5s ease;
}
@media (hover: none), (max-width: 768px) {
  .cursor-glow { display: none !important; }
}

/* ─── ENHANCED BUTTONS ────────────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition:
    transform  0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background-color 0.2s ease !important;
}
/* Shine sweep on hover */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::before { left: 150%; }

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow:
    0 0 20px rgba(230,57,70,0.5),
    0 0 60px rgba(230,57,70,0.18),
    0 18px 40px rgba(230,57,70,0.22) !important;
}
.btn-primary:active {
  transform: translateY(0px) scale(0.97) !important;
  transition-duration: 0.08s !important;
}

/* Hero CTA perpetual glow pulse */
.btn-glow {
  animation: btnPulse 2.8s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% {
    box-shadow:
      0 0 16px rgba(230,57,70,0.30),
      0 0 36px rgba(230,57,70,0.10);
  }
  50% {
    box-shadow:
      0 0 28px rgba(230,57,70,0.55),
      0 0 65px rgba(230,57,70,0.20),
      0 0 100px rgba(230,57,70,0.06);
  }
}
/* Pause pulse while hovered (magnetic takes over) */
.btn-glow:hover { animation: none; }

/* Secondary button hover lift */
.btn-secondary:hover {
  transform: translateY(-2px) !important;
}

/* ─── CARD ENHANCEMENTS ────────────────────────────────────────────────────── */
/* Spotlight tracking via --mx / --my set by JS */
.card,
.svc-card {
  --mx: 50%; --my: 50%;
  transition:
    transform  0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease,
    background  0.3s ease !important;
}
.card::after,
.svc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(230,57,70,0.08) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-8px) scale(1.012) !important;
  box-shadow:
    0 0 0 1px rgba(230,57,70,0.18),
    0 24px 64px rgba(0,0,0,0.52),
    0 0 40px rgba(230,57,70,0.08) !important;
}
.svc-card:hover {
  transform: translateY(-8px) scale(1.012) !important;
  box-shadow:
    0 0 40px rgba(230,57,70,0.12),
    0 28px 64px rgba(0,0,0,0.52) !important;
}
.card:hover::after,
.svc-card:hover::after { opacity: 1; }

/* Stat boxes */
.overview .stat-box {
  transition:
    transform  0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease !important;
}
.overview .stat-box:hover {
  transform: translateY(-6px) !important;
}

/* Contact cards */
.contact-card {
  transition:
    transform  0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease !important;
}
.contact-card:hover { transform: translateY(-6px) !important; }

/* Funnel boxes */
.funnel-box {
  transition:
    transform  0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease !important;
}
.funnel-box:not(.highlight):hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4) !important;
}

/* ─── TRUSTED LOGOS MARQUEE ───────────────────────────────────────────────── */
.trusted-track-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
}
.trusted-track {
  display: inline-flex;
  gap: 60px;
  align-items: center;
  width: max-content;
  animation: marquee 24s linear infinite;
}
.trusted-track-wrap:hover .trusted-track {
  animation-play-state: paused;
}
.trusted-track span {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-light);
  letter-spacing: -0.01em;
  opacity: 0.65;
  transition: opacity 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}
.trusted-track span:hover { opacity: 1; color: var(--white); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── SECTION HEADING REVEAL ─────────────────────────────────────────────── */
/* h2 elements get .fade added via JS; this adds a clip reveal feel */
.section-head h2.fade,
.page-hero h1.fade {
  /* Slightly slower for big headings */
  transition:
    opacity   1.0s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.0s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ─── MOCKUP HOVER ────────────────────────────────────────────────────────── */
.mockup {
  transition:
    transform  0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease !important;
}
.mockup:hover {
  transform: translateY(-6px) rotateX(2deg) !important;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 40px rgba(230,57,70,0.08) !important;
}

/* ─── PRICING CARD ────────────────────────────────────────────────────────── */
.pricing-card {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease !important;
}
.pricing-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 50px rgba(230,57,70,0.1) !important;
}

/* ─── SMOOTH NAV LINKS ────────────────────────────────────────────────────── */
.nav-links a {
  transition: color 0.25s ease !important;
}
.nav-links a::after {
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ─── FOOTER LINK HOVER ───────────────────────────────────────────────────── */
.footer-col a {
  transition: color 0.25s ease, transform 0.25s ease !important;
}
.footer-col a:hover {
  transform: translateX(4px);
}

/* ─── MOBILE: reduce / disable heavy effects ──────────────────────────────── */
@media (max-width: 768px) {
  #hero-canvas        { display: none !important; }
  .hero-orb.orb-2     { display: none; }
  .hero-grid          { opacity: 0.35; animation: none !important; }
  .btn-glow           { animation: none !important; }

  /* Tighten stagger on mobile — no delay */
  .fade.d-1, .fade.d-2, .fade.d-3, .fade.d-4 {
    transition-delay: 0s !important;
  }

  /* Simpler card hover */
  .card:hover, .svc-card:hover {
    transform: translateY(-4px) !important;
  }
}

/* ─── REDUCED MOTION: kill everything ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-brand img,
  .footer-brand img,
  .nav-brand::after,
  .hero-orb,
  .hero-grid,
  .trusted-track,
  .btn-glow {
    animation: none !important;
    transition: none !important;
  }
  .nav-brand::after { opacity: 0 !important; }
  .nav-brand img, .footer-brand img { opacity: 1 !important; }
  .word-wrap .word {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .fade {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
