/* ================================================
   NORTHGATE MORTGAGE — animations.css
   ================================================ */


/* ------------------------------------------------
   1. GLOBAL THEME TRANSITION
   ------------------------------------------------ */
body,
.navbar,
.mobile-nav,
.loan-card,
.who-card,
.who-section,
.faq-item,
.faq-section,
.footer,
.contact-section,
.next-section,
.marquee-section,
.t-stat-card,
.stat-card {
  transition:
    background-color 300ms cubic-bezier(0.4,0,0.2,1),
    background      300ms cubic-bezier(0.4,0,0.2,1),
    color           300ms cubic-bezier(0.4,0,0.2,1),
    border-color    300ms cubic-bezier(0.4,0,0.2,1),
    box-shadow      300ms cubic-bezier(0.4,0,0.2,1),
    filter          300ms cubic-bezier(0.4,0,0.2,1);
}


/* ------------------------------------------------
   2. PAGE LOAD — body fade in
   ------------------------------------------------ */
body {
  animation: pageLoad 0.5s ease both;
}
@keyframes pageLoad {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ------------------------------------------------
   3. NAVBAR ENTRANCE
   ------------------------------------------------ */
.navbar {
  animation: navSlideDown 0.7s cubic-bezier(0.16,1,0.3,1) 0.1s both;
}
@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ------------------------------------------------
   4. HERO — staggered entrance with blur
   ------------------------------------------------ */
.hero-eyebrow {
  animation: heroFadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.3s both;
}
.hero-heading {
  animation: heroFadeUp 1s cubic-bezier(0.16,1,0.3,1) 0.48s both;
}
.hero-body {
  animation: heroFadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.64s both;
}
.hero-btns {
  animation: heroFadeUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.80s both;
}
/* ------------------------------------------------
   0. TRUST BAR — stat slide-up entrance
   ------------------------------------------------ */
.trust-stat {
  transition:
    opacity  0.7s cubic-bezier(0.16,1,0.3,1),
    transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.js-ready .trust-stat { opacity: 0; transform: translateY(28px); }
.trust-stat.visible   { opacity: 1 !important; transform: none !important; }


/* Hero slideshow crossfade — 4 images × 8s each = 32s cycle */
@keyframes imgCycle {
  0%   { opacity: 1;  transform: scale(1.0)  translate(0%,    0%);    }
  22%  { opacity: 1;  transform: scale(1.12) translate(-2%,  -1.5%);  }
  28%  { opacity: 0;  transform: scale(1.13) translate(-2.5%, -2%);   }
  94%  { opacity: 0;  transform: scale(1.0)  translate(0%,    0%);    }
  100% { opacity: 1;  transform: scale(1.0)  translate(0%,    0%);    }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(36px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}


/* ------------------------------------------------
   5. SCROLL REVEAL — progressive enhancement
   Content is ALWAYS visible by default.
   js-ready class on <html> enables hidden state.
   ------------------------------------------------ */

/* Only hide when JS has confirmed it's running */
.js-ready .reveal {
  opacity: 0;
  transform: translateY(32px);
}
.js-ready .reveal-left {
  opacity: 0;
  transform: translateX(-38px);
}
.js-ready .reveal-right {
  opacity: 0;
  transform: translateX(38px);
}
.js-ready .reveal-scale {
  opacity: 0;
  transform: scale(0.94);
}

/* Transitions on all variants */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  transition:
    opacity   0.8s cubic-bezier(0.16,1,0.3,1),
    transform 0.8s cubic-bezier(0.16,1,0.3,1);
}

/* Visible state — same for all */
.reveal.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Stagger delays */
[data-delay="0"] { transition-delay: 0s; }
[data-delay="1"] { transition-delay: 0.13s; }
[data-delay="2"] { transition-delay: 0.26s; }
[data-delay="3"] { transition-delay: 0.39s; }
[data-delay="4"] { transition-delay: 0.52s; }


/* ------------------------------------------------
   6. SECTION LABEL LINE — wipe in
   ------------------------------------------------ */
.section-label {
  position: relative;
  overflow: hidden;
}


/* ------------------------------------------------
   7. MARQUEE
   ------------------------------------------------ */
@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}


/* ------------------------------------------------
   8. PROCESS CARD HOVER
   ------------------------------------------------ */
.process-item {
  transition:
    transform      0.4s cubic-bezier(0.16,1,0.3,1),
    box-shadow     0.4s ease,
    border-color   0.4s ease,
    background     0.4s ease;
}


/* ------------------------------------------------
   9. FAQ ICON SPRING
   ------------------------------------------------ */
.faq-icon {
  transition:
    transform    0.4s cubic-bezier(0.34,1.56,0.64,1),
    background   0.25s ease,
    border-color 0.25s ease;
}


/* ------------------------------------------------
   10. TESTIMONIAL SLIDER
   ------------------------------------------------ */
.t-track {
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
}
.t-dot {
  transition: background 0.25s ease, width 0.3s cubic-bezier(0.34,1.56,0.64,1);
}


/* ------------------------------------------------
   11. NEXT STEP CARDS — zoom on hover
   ------------------------------------------------ */
.next-card-bg {
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.next-card:hover .next-card-bg {
  transform: scale(1.07);
}


/* ------------------------------------------------
   12. WHO CARDS
   ------------------------------------------------ */
.who-card {
  transition:
    transform    0.35s cubic-bezier(0.16,1,0.3,1),
    box-shadow   0.35s ease,
    border-color 0.25s ease;
}


/* ------------------------------------------------
   13. BACK TO TOP FLOAT
   ------------------------------------------------ */
@keyframes floatBtn {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-5px); }
}
.back-top.visible {
  animation: floatBtn 3s ease-in-out infinite;
}
.back-top:hover { animation: none; }


/* ------------------------------------------------
   14. BUTTON PULSE on focus
   ------------------------------------------------ */
@keyframes btnPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.45); }
  50%     { box-shadow: 0 0 0 12px rgba(201,168,76,0); }
}
.primary-btn:focus-visible {
  animation: btnPulse 1.6s infinite;
}


/* ------------------------------------------------
   15. SOCIAL LINK SPRING
   ------------------------------------------------ */
.social-link {
  transition:
    background   0.25s ease,
    border-color 0.25s ease,
    color        0.25s ease,
    transform    0.3s cubic-bezier(0.34,1.56,0.64,1);
}


/* ------------------------------------------------
   16. GOLD SHIMMER on section labels
   ------------------------------------------------ */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}


/* ------------------------------------------------
   18. AMBIENT PASSIVE ANIMATIONS
   Everything below runs automatically — no hover
   ------------------------------------------------ */

/* A) CTA buttons — no animation, clean static style */

/* B) Floating bob — cards gently rise & fall */
@keyframes floatBob {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-8px); }
}
.process-item:nth-child(1) { animation: floatBob 5.0s ease-in-out infinite; }
.process-item:nth-child(2) { animation: floatBob 5.4s ease-in-out 0.4s infinite; }
.process-item:nth-child(3) { animation: floatBob 5.2s ease-in-out 0.8s infinite; }
.process-item:nth-child(4) { animation: floatBob 5.6s ease-in-out 1.2s infinite; }

/* C) Gold shimmer sweep across trust numbers */
@keyframes goldSweep {
  0%   { background-position: -300% center; }
  60%  { background-position:  300% center; }
  100% { background-position:  300% center; }
}
.trust-num {
  background: linear-gradient(
    90deg,
    var(--gold) 20%,
    #fff8d6     45%,
    var(--gold) 55%,
    #e8a020     80%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldSweep 4s ease-in-out infinite;
}
/* stagger each stat */
.trust-stat:nth-child(1) .trust-num { animation-delay: 0s;    }
.trust-stat:nth-child(3) .trust-num { animation-delay: 0.6s;  }
.trust-stat:nth-child(5) .trust-num { animation-delay: 1.2s;  }
.trust-stat:nth-child(7) .trust-num { animation-delay: 1.8s;  }

/* D) Hero heading — soft glow pulse on the gold italic */
@keyframes textGlow {
  0%, 100% { filter: drop-shadow(0 0  6px rgba(201,168,76,0.0)); }
  50%       { filter: drop-shadow(0 0 20px rgba(201,168,76,0.6)); }
}
.hero-heading em {
  /* no display:inline-block — avoids extra line-height gap */
  animation: textGlow 3.5s ease-in-out 1.5s infinite;
}

/* E) Section label — left-to-right gold line wipe */
@keyframes labelWipe {
  from { background-size:   0% 2px; }
  to   { background-size: 100% 2px; }
}
.section-label {
  background-image: linear-gradient(90deg, var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0% 2px;
}
.section-label.visible {
  animation: labelWipe 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s forwards;
}

/* F) Who-cards subtle breathing border glow */
@keyframes borderBreath {
  0%, 100% { box-shadow: 0 0  0px rgba(201,168,76,0.0), var(--sh-sm); }
  50%       { box-shadow: 0 0 18px rgba(201,168,76,0.2), var(--sh-md); }
}
.who-card:nth-child(1) { animation: borderBreath 4.0s ease-in-out infinite; }
.who-card:nth-child(2) { animation: borderBreath 4.0s ease-in-out 1.3s infinite; }
.who-card:nth-child(3) { animation: borderBreath 4.0s ease-in-out 2.6s infinite; }

/* G) Next-step cards — soft scale breath */
@keyframes cardBreath {
  0%, 100% { transform: scale(1.000); }
  50%       { transform: scale(1.015); }
}
.next-card:nth-child(1) { animation: cardBreath 5.0s ease-in-out infinite; }
.next-card:nth-child(2) { animation: cardBreath 5.0s ease-in-out 1.6s infinite; }
.next-card:nth-child(3) { animation: cardBreath 5.0s ease-in-out 3.2s infinite; }


/* ------------------------------------------------
   17. KEN BURNS — slow animated background images
   Each variant has a slightly different zoom + drift
   direction so images feel alive, not robotic
   ------------------------------------------------ */

/* Hero: visible slow zoom + drift */
@keyframes kenBurnsHero {
  0%   { transform: scale(1.0)  translate(0%,  0%);  }
  100% { transform: scale(1.18) translate(-3%, -3%); }
}

/* About photo: zoom + pan right */
@keyframes kenBurnsA {
  0%   { transform: scale(1.0)  translate(0%,  0%);  }
  100% { transform: scale(1.15) translate(4%,  -3%); }
}

/* FAQ photo: zoom + drift down */
@keyframes kenBurnsB {
  0%   { transform: scale(1.0)  translate(0%,  0%);  }
  100% { transform: scale(1.15) translate(-3%, 4%);  }
}

/* Next step cards */
@keyframes kenBurnsC {
  0%   { transform: scale(1.0)  translate(0%,  0%);  }
  100% { transform: scale(1.14) translate(3%,  -3%); }
}
