/* === ANIMATIONS: Keyframes, Entrance Effects, Scroll Triggers === */

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== FLOATING / AMBIENT ANIMATIONS ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes drift-slow {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(20px, -10px) rotate(2deg);
  }
}

@keyframes drift-medium {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-30px, 15px) rotate(-2deg);
  }
}

@keyframes drift-fast {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(40px, -20px) rotate(3deg);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 139, 87, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(46, 139, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 139, 87, 0);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(46, 139, 87, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(46, 139, 87, 0.6);
  }
}

/* ===== COUNTER ANIMATIONS ===== */
@keyframes counterUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== LOADING & STATES ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* ===== FLIP ANIMATIONS ===== */
@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

@keyframes flipReverse {
  0% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

/* ===== CLIP-PATH ANIMATIONS ===== */
@keyframes clipPathLeft {
  from {
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
  }
  to {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

@keyframes clipPathRight {
  from {
    clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
  }
  to {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* ===== WORD SPLIT ANIMATION ===== */
@keyframes wordFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ANIMATION CLASSES ===== */

/* Entrance animations - staggered */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Scroll-triggered visibility class */
.is-visible {
  opacity: 1;
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Floating elements */
.float {
  animation: float 3s ease-in-out infinite;
}

.drift-slow {
  animation: drift-slow 8s ease-in-out infinite;
}

.drift-medium {
  animation: drift-medium 6s ease-in-out infinite;
}

.drift-fast {
  animation: drift-fast 4s ease-in-out infinite;
}

.pulse {
  animation: pulse-ring 2s ease-in-out infinite;
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

.spin {
  animation: spin 1s linear infinite;
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* Stagger delays for grid items */
.stagger-1  { animation-delay: 0ms; }
.stagger-2  { animation-delay: 100ms; }
.stagger-3  { animation-delay: 200ms; }
.stagger-4  { animation-delay: 300ms; }
.stagger-5  { animation-delay: 400ms; }
.stagger-6  { animation-delay: 500ms; }
.stagger-7  { animation-delay: 600ms; }
.stagger-8  { animation-delay: 700ms; }

/* Hero section specific */
.hero-title {
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

.hero-subtitle {
  animation: fadeInUp 0.8s ease-out 0.5s forwards;
  opacity: 0;
}

.hero-cta {
  animation: fadeInUp 0.8s ease-out 0.8s forwards;
  opacity: 0;
}

.hero-trust-bar {
  animation: fadeInUp 0.8s ease-out 1.1s forwards;
  opacity: 0;
}

/* Parallax layers */
.hero-layer-back {
  animation: none;
}

.hero-layer-mid {
  animation: none;
}

.hero-layer-front {
  animation: none;
}

/* 3D Transforms - No animation, used with JS */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Form states */
.form-success {
  animation: fadeIn 0.6s ease-out forwards;
}

.success-checkmark {
  animation: checkmark 0.8s ease-out forwards;
}

/* Team card flip */
.card-flip {
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
}

.card-flip.flipped {
  transform: rotateY(180deg);
}

/* Underline animation for nav */
@keyframes underlineExpand {
  from {
    width: 0;
    left: 0;
  }
  to {
    width: 100%;
    left: 0;
  }
}

/* Button hover lift */
.btn:hover {
  animation: none; /* handled by transform in components.css */
}

/* Smooth transitions for theme changes */
* {
  transition-property: background-color, color, border-color, box-shadow;
  transition-timing-function: var(--transition-normal);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===== LUXURY GLASS ANIMATIONS ===== */
@keyframes heroOrbShift {
  0% {
    background:
      radial-gradient(ellipse 35% 25% at 30% 65%, rgba(201,168,76,0.07) 0%, transparent 60%),
      radial-gradient(ellipse 25% 20% at 72% 18%, rgba(46,139,87,0.09) 0%, transparent 50%);
  }
  100% {
    background:
      radial-gradient(ellipse 40% 30% at 22% 72%, rgba(201,168,76,0.10) 0%, transparent 60%),
      radial-gradient(ellipse 30% 25% at 80% 25%, rgba(46,139,87,0.07) 0%, transparent 50%);
  }
}

@keyframes shimmerSlide {
  0% { opacity: 0.3; transform: scaleX(0.6); }
  50% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0.3; transform: scaleX(0.6); }
}

@keyframes goldGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(201,168,76,0.15), 0 0 40px rgba(201,168,76,0.05);
  }
  50% {
    box-shadow: 0 0 35px rgba(201,168,76,0.3), 0 0 70px rgba(201,168,76,0.12);
  }
}

/* ===== PAGE TRANSITION ANIMATIONS ===== */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageEnter 0.4s ease-out;
}
