/* ============================================
   PREMIUM ANIMATIONS & EFFECTS
   ============================================ */

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#preloader.loaded {
  opacity: 0;
  visibility: hidden;
}
.loader-logo {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--charcoal);
  animation: pulse 1.5s infinite alternate;
  letter-spacing: 0.05em;
}
@keyframes pulse {
  0% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Custom Cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
@media (min-width: 1024px) {
  .cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--charcoal);
    transition: transform 0.1s ease;
  }
  .cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(122, 114, 104, 0.4);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  }
  .cursor-hover.cursor-dot {
    transform: translate(-50%, -50%) scale(0);
  }
  .cursor-hover.cursor-ring {
    width: 54px;
    height: 54px;
    background: rgba(201, 185, 154, 0.2);
    border-color: transparent;
  }
  body, a, button, input, textarea, select {
    cursor: none !important;
  }
}

/* Text Splitting */
.text-reveal-active .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) rotate(5deg);
  animation: charUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes charUp {
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

/* Hero Entrance */
.hero-eyebrow, .hero-sub, .hero-btns, .hero-visual {
  opacity: 0;
  transform: translateY(30px);
}
.hero-title { opacity: 0; }
.hero-in {
  animation: heroInAnim 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.hero-title.hero-in { opacity: 1; }
@keyframes heroInAnim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card 3D Shine */
.card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}
.service-card:hover .card-shine,
.pricing-card:hover .card-shine,
.infl-card:hover .card-shine {
  opacity: 1;
}

/* Magnetic Buttons base transitions handled in JS, just need smooth transform */
.btn-primary, .btn-ghost, .nav-cta {
  will-change: transform;
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--tan);
  z-index: 9999;
  width: 0%;
  pointer-events: none;
  transition: width 0.1s ease-out;
}

/* Floating Particles */
.particle {
  position: absolute;
  background: var(--tan);
  border-radius: 50%;
  pointer-events: none;
  animation: floatParticle linear infinite;
  z-index: 0;
}
@keyframes floatParticle {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: var(--part-opacity, 0.5); }
  90% { opacity: var(--part-opacity, 0.5); }
  100% { transform: translateY(-100px) scale(0.5); opacity: 0; }
}

/* Form Shake */
.shake {
  animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
  border-color: #E57373 !important;
}
@keyframes shakeAnim {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Form Focused Group (Label float) */
.form-group {
  position: relative;
}
.form-group label {
  transition: color 0.3s ease;
}
.form-group.focused label {
  color: var(--charcoal);
  font-weight: 600;
}

/* Better Glassmorphism for Navbar */
#navbar.scrolled {
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Counter */
.stat-num {
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s ease;
}

/* Global Fixes */
.tab-panel {
  transition: opacity 0.4s ease;
}
