/* ==========================================================================
   Page Load & Scroll Reveal Animations - SBFITT
   ========================================================================== */

/* Timing variables */
:root {
  --anim-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --anim-duration-base: 0.85s;
  --anim-duration-slow: 1.1s;
}

/* Ensure smooth scrolling and prevent horizontal animation spill */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Page Load Entrance Animations (Hero & Header)
   -------------------------------------------------------------------------- */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatSoft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Header animation */
header.py-sml, header, .header-mobile {
  position: relative;
  z-index: 1000;
  animation: fadeInDown 0.8s var(--anim-ease-out) forwards;
}

/* About image stacking priority */
.about-img,
.about-section .about-img,
.about-img img,
.about-section .about-img img {
  position: relative;
  z-index: 20;
}

/* Hero Section immediate page load animation */
.home-hero h1 {
  animation: fadeInUp 0.9s var(--anim-ease-out) 0.15s both;
}

.home-hero p {
  animation: fadeInUp 0.9s var(--anim-ease-out) 0.3s both;
}

.home-hero .hero-img img {
  animation: fadeInScale 1s var(--anim-ease-out) 0.25s both;
  transition: transform 0.6s var(--anim-ease-out);
}

.home-hero .hero-img:hover img {
  transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   Scroll Reveal Base Classes (Only hidden once JS is initialized)
   -------------------------------------------------------------------------- */

html.js-ready .reveal,
html.js-ready .reveal-up,
html.js-ready .reveal-down,
html.js-ready .reveal-left,
html.js-ready .reveal-right,
html.js-ready .reveal-scale,
html.js-ready .reveal-fade {
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity var(--anim-duration-base) var(--anim-ease-out),
              transform var(--anim-duration-base) var(--anim-ease-out);
}

html.js-ready .reveal-up,
html.js-ready .reveal {
  transform: translateY(36px);
}

html.js-ready .reveal-down {
  transform: translateY(-36px);
}

html.js-ready .reveal-left {
  transform: translateX(-40px);
}

html.js-ready .reveal-right {
  transform: translateX(40px);
}

html.js-ready .reveal-scale {
  transform: scale(0.92);
}

html.js-ready .reveal-fade {
  transform: none;
}

/* Active / Entered States */
html.js-ready .reveal.is-visible,
html.js-ready .reveal-up.is-visible,
html.js-ready .reveal-down.is-visible,
html.js-ready .reveal-left.is-visible,
html.js-ready .reveal-right.is-visible,
html.js-ready .reveal-scale.is-visible,
html.js-ready .reveal-fade.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* --------------------------------------------------------------------------
   Stagger Delays
   -------------------------------------------------------------------------- */

.stagger-1 { transition-delay: 0.08s !important; }
.stagger-2 { transition-delay: 0.16s !important; }
.stagger-3 { transition-delay: 0.24s !important; }
.stagger-4 { transition-delay: 0.32s !important; }
.stagger-5 { transition-delay: 0.40s !important; }
.stagger-6 { transition-delay: 0.48s !important; }

/* --------------------------------------------------------------------------
   Interactive Micro-Animations
   -------------------------------------------------------------------------- */

/* Coaching Cards */
.coaching-card {
  transition: transform 0.4s var(--anim-ease-out), box-shadow 0.4s var(--anim-ease-out);
  border-radius: 6px;
  overflow: hidden;
}

.coaching-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.coaching-card img.w100 {
  transition: transform 0.5s var(--anim-ease-out);
}

.coaching-card:hover img.w100 {
  transform: scale(1.04);
}

.coaching-card a img {
  transition: transform 0.3s ease;
}

.coaching-card:hover a img {
  transform: translateX(6px);
}

/* Buttons and Links */
.sign-up, .btn-1, .btn-2, .begin-journey a {
  transition: transform 0.3s var(--anim-ease-out), box-shadow 0.3s var(--anim-ease-out), background-color 0.3s ease;
}

.sign-up:hover, .btn-1:hover, .btn-2:hover, .begin-journey a:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Team Card Hover Effects */
.team-card-img {
  overflow: hidden;
  border-radius: 4px;
}

.team-card-img img {
  transition: transform 0.5s var(--anim-ease-out);
}

.team-card-img:hover img {
  transform: scale(1.05);
}

/* Testimonial Quote Graphic */
.home-hero-quote img,
.testimonial-head img.quote {
  animation: floatSoft 4s ease-in-out infinite;
}

/* Journey CTA button glow */
.begin-journey a {
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.begin-journey a::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.8s ease;
}

.begin-journey a:hover::after {
  transform: rotate(30deg) translateX(100%);
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion Preference
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  
  html.js-ready .reveal,
  html.js-ready .reveal-up,
  html.js-ready .reveal-down,
  html.js-ready .reveal-left,
  html.js-ready .reveal-right,
  html.js-ready .reveal-scale,
  html.js-ready .reveal-fade {
    opacity: 1 !important;
    transform: none !important;
  }
}
