/* ============================================================
   Satyam Yogashramam — Advanced Animation System
   3D Icons · Scroll Animations · Particle Effects · Micro-interactions
   ============================================================ */

/* ---- Performance baseline ---- */
* { will-change: auto; }
.gpu { transform: translateZ(0); }

/* ============================================================
   SCROLL-DRIVEN REVEAL SYSTEM (enhanced)
   ============================================================ */
.reveal         { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible  { opacity: 1; transform: translateY(0); }
.reveal-left    { opacity: 0; transform: translateX(-40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-left.visible  { opacity: 1; transform: translateX(0); }
.reveal-right   { opacity: 0; transform: translateX(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale   { opacity: 0; transform: scale(0.95); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-scale.visible { opacity: 1; transform: scale(1); }
.reveal-rotate  { opacity: 0; transform: rotate(-5deg) scale(0.95); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-rotate.visible { opacity: 1; transform: rotate(0deg) scale(1); }
.reveal-delay-1 { transition-delay: 0.1s !important; }
.reveal-delay-2 { transition-delay: 0.2s !important; }
.reveal-delay-3 { transition-delay: 0.3s !important; }
.reveal-delay-4 { transition-delay: 0.4s !important; }
.reveal-delay-5 { transition-delay: 0.5s !important; }
.reveal-delay-6 { transition-delay: 0.6s !important; }

/* Stagger children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.54s; }
.stagger-children > *:nth-child(9) { transition-delay: 0.61s; }
.stagger-children > * { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.stagger-children.visible > * { opacity: 1; transform: translateY(0); }

/* ============================================================
   PARTICLE SYSTEM
   ============================================================ */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.hero-particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Floating leaves animation */
.floating-leaf {
  position: absolute;
  pointer-events: none;
  animation: leaf-fall linear infinite;
  opacity: 0;
}

@keyframes leaf-fall {
  0%   { transform: translateY(-20px) rotate(0deg) translateX(0); opacity: 0; }
  5%   { opacity: 0.6; }
  50%  { transform: translateY(50vh) rotate(180deg) translateX(40px); opacity: 0.4; }
  95%  { opacity: 0.2; }
  100% { transform: translateY(100vh) rotate(360deg) translateX(-20px); opacity: 0; }
}

/* ============================================================
   3D CARD TILT EFFECT
   ============================================================ */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
  cursor: pointer;
}

.tilt-card .tilt-inner {
  transform: translateZ(20px);
  transition: transform 0.1s ease;
}

.tilt-card:hover .tilt-shine {
  opacity: 0.15;
}

.tilt-shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.8) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 10;
}

/* ============================================================
   3D SVG ICON SYSTEM
   ============================================================ */
.icon-3d {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), filter 0.3s ease;
  cursor: pointer;
}

.icon-3d svg {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), filter 0.4s ease;
}

.icon-3d:hover svg {
  transform: translateY(-6px) scale(1.1) rotateY(20deg);
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.3));
}

.icon-3d:hover {
  transform: translateY(-4px);
}

/* Icon spin on hover */
.icon-spin:hover svg { animation: icon-spin-anim 0.6s ease; }
@keyframes icon-spin-anim {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(360deg) scale(1); }
}

/* Icon bounce on hover */
.icon-bounce:hover svg { animation: icon-bounce-anim 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes icon-bounce-anim {
  0%   { transform: scale(1) translateY(0); }
  40%  { transform: scale(1.25) translateY(-10px); }
  60%  { transform: scale(0.95) translateY(2px); }
  80%  { transform: scale(1.1) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}

/* ============================================================
   THERAPY CARD 3D FLIP
   ============================================================ */
.flip-card {
  perspective: 800px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(8deg) rotateX(-3deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: inherit;
}

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

/* ============================================================
   MAGNETIC BUTTON EFFECT
   ============================================================ */
.btn-magnetic {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-magnetic:hover::before { opacity: 1; }

/* Ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,0.4);
  animation: ripple-expand 0.6s linear;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes ripple-expand {
  0%   { width: 5px; height: 5px; opacity: 1; }
  100% { width: 400px; height: 400px; opacity: 0; }
}

/* ============================================================
   CHAKRA SPINNING ANIMATION
   ============================================================ */
.chakra-spin-anim {
  animation: chakra-rotate 12s linear infinite;
  transform-origin: center;
}

.chakra-spin-anim:hover {
  animation-duration: 3s;
}

@keyframes chakra-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.chakra-pulse-glow {
  animation: chakra-glow-pulse 3s ease-in-out infinite;
}

@keyframes chakra-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 20px currentColor); opacity: 0.8; }
  50%       { filter: drop-shadow(0 0 20px currentColor) drop-shadow(0 0 50px currentColor); opacity: 1; }
}

/* ============================================================
   LOTUS FLOWER ANIMATION
   ============================================================ */
.lotus-bloom {
  animation: lotus-open 2s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes lotus-open {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.lotus-float {
  animation: lotus-floating 6s ease-in-out infinite;
}

@keyframes lotus-floating {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25%       { transform: translateY(-12px) rotate(3deg); }
  75%       { transform: translateY(6px) rotate(-2deg); }
}

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter-num {
  display: inline-block;
  transition: transform 0.3s ease;
}

.counter-num.counting {
  animation: counter-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ============================================================
   PARALLAX SYSTEM
   ============================================================ */
.parallax-element {
  will-change: transform;
  transition: transform 0.1s linear;
}

.parallax-slow   { --parallax-speed: 0.3; }
.parallax-medium { --parallax-speed: 0.5; }
.parallax-fast   { --parallax-speed: 0.8; }

/* ============================================================
   HERO TYPING ANIMATION
   ============================================================ */
.typing-cursor::after {
  content: '|';
  animation: cursor-blink 0.8s step-end infinite;
  color: var(--clr-gold-light);
  margin-left: 2px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   PROGRESS BAR ANIMATIONS
   ============================================================ */
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 50px;
  background: var(--grad-gold);
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 20px;
  background: rgba(255,255,255,0.5);
  border-radius: 50px;
  animation: progress-shimmer 1.5s ease infinite;
}

@keyframes progress-shimmer {
  0%   { opacity: 0; transform: scaleX(0); }
  50%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0); }
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-gold), var(--clr-saffron), var(--clr-forest-light));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ============================================================
   FLOATING ELEMENTS
   ============================================================ */
.float-1 { animation: float-anim 4s ease-in-out infinite; }
.float-2 { animation: float-anim 5s ease-in-out infinite 1s; }
.float-3 { animation: float-anim 6s ease-in-out infinite 2s; }

@keyframes float-anim {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-16px); }
}

/* ============================================================
   SHIMMER LOADING EFFECT
   ============================================================ */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer-slide 2.5s ease-in-out infinite;
}

@keyframes shimmer-slide {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ============================================================
   ACTIVE NAV LINK INDICATOR
   ============================================================ */
.nav-link.active::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: var(--clr-gold);
  border-radius: 2px;
  margin-top: 2px;
  animation: nav-indicator 0.3s ease;
}

@keyframes nav-indicator {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ============================================================
   3D SECTION DIVIDERS — SVG WAVE
   ============================================================ */
.wave-divider {
  position: relative;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -2px;
}

/* ============================================================
   GLASSMORPHISM CARDS
   ============================================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* ============================================================
   SECTION ENTRANCE ANIMATIONS
   ============================================================ */
@keyframes section-slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

.pulse-ring-element::before,
.pulse-ring-element::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: pulse-ring 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-ring-element::after {
  animation-delay: 1s;
}

/* ============================================================
   CURSOR TRAIL
   ============================================================ */
.cursor-trail {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-gold-light), var(--clr-gold));
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: screen;
  transition: transform 0.1s ease, opacity 0.3s ease;
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(212,160,23,0.5);
  pointer-events: none;
  z-index: 99998;
  transition: transform 0.15s ease, border-color 0.3s ease;
}

/* ============================================================
   STAT CIRCLE PROGRESS
   ============================================================ */
.stat-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-circle svg {
  transform: rotate(-90deg);
}

.stat-circle-track {
  fill: none;
  stroke: rgba(0,0,0,0.08);
  stroke-width: 6;
}

.stat-circle-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0 283;
  transition: stroke-dasharray 1.5s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   HOVER CARD LIFT
   ============================================================ */
.hover-lift {
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease;
}

.hover-lift:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 24px 60px rgba(26,74,46,0.2);
}

/* ============================================================
   GRADIENT TEXT ANIMATION
   ============================================================ */
.gradient-text-anim {
  background: linear-gradient(90deg, var(--clr-forest), var(--clr-gold), var(--clr-saffron), var(--clr-forest));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   IMAGE REVEAL ON SCROLL
   ============================================================ */
.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.visible {
  clip-path: inset(0 0% 0 0);
}

/* ============================================================
   NUMBER COUNTER ANIMATION
   ============================================================ */
@keyframes number-pop {
  0%   { transform: scale(0.5) translateY(10px); opacity: 0; }
  60%  { transform: scale(1.1) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.stat-num.animated {
  animation: number-pop 0.8s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--clr-forest);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SECTION TRANSITIONS
   ============================================================ */
.section-transition-up {
  position: relative;
}

.section-transition-up::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 80px;
  background: inherit;
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 1;
}

/* ============================================================
   ANIMATED BACKGROUND GRADIENT
   ============================================================ */
.animated-bg {
  background: linear-gradient(-45deg, #0d1f0d, #1a3a1a, #0d1f2a, #1a1a0d);
  background-size: 400% 400%;
  animation: gradient-bg-shift 15s ease infinite;
}

@keyframes gradient-bg-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   SCROLL INDICATOR DOT NAV
   ============================================================ */
.scroll-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.scroll-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212,160,23,0.4);
  border: 1.5px solid rgba(212,160,23,0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.scroll-nav-dot.active {
  background: var(--clr-gold);
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(212,160,23,0.5);
}

.scroll-nav-dot:hover {
  background: var(--clr-gold);
  transform: scale(1.3);
}

/* ============================================================
   INTERACTIVE THERAPY ICON GLOW
   ============================================================ */
.therapy-icon-3d {
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

.therapy-icon-3d::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: radial-gradient(ellipse, rgba(212,160,23,0.4) 0%, transparent 70%);
  filter: blur(4px);
  transition: all 0.4s ease;
  opacity: 0;
}

.therapy-icon-3d:hover {
  transform: translateY(-12px) scale(1.1);
}

.therapy-icon-3d:hover::after {
  opacity: 1;
  width: 80%;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--clr-forest);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.loader-lotus {
  width: 80px;
  height: 80px;
  animation: loader-spin 1.5s linear infinite;
}

@keyframes loader-spin {
  from { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.1); }
  to   { transform: rotate(360deg) scale(1); }
}

.loader-text {
  color: var(--clr-gold-light);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  animation: loader-pulse 1.5s ease-in-out infinite;
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: var(--clr-gold);
  border-radius: 50px;
  animation: loader-fill 1.8s ease-in-out infinite;
}

@keyframes loader-fill {
  0%   { width: 0%; }
  60%  { width: 85%; }
  100% { width: 100%; }
}

@keyframes loader-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ============================================================
   SECTION COLOR TRANSITION (Scroll-based)
   ============================================================ */
.section-observer {
  --section-progress: 0;
}

/* ============================================================
   MEDIA QUERIES for animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-rotate {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .cursor-trail, .cursor-ring { display: none; }
  .scroll-nav { display: none; }
  #particle-canvas { opacity: 0.2; }
}
