/* ==========================================================================
   SRI SATYA SAI DENTAL CARE — Premium scroll animations
   Pairs with js/animations.js. Does not modify style.css.

   How it works
   - JS adds  .fx  (hidden state)  to every animatable element.
   - When the element enters the viewport JS adds  .fx-in  -> animation plays.
   - When it leaves the viewport .fx-in is removed -> element resets, so the
     animation replays the next time the section is scrolled into view.
   - Only the individual properties  translate / scale / rotate / opacity /
     filter / clip-path  are animated (never `transform`), so existing hover
     effects and floating animations in style.css keep working untouched.
   ========================================================================== */

:root{
  --fx-ready:1;
  --fx-y:38px;
  --fx-x:60px;
  --fx-dur:.95s;
  --fx-ease:cubic-bezier(.22,.9,.3,1);
  --fx-spring:cubic-bezier(.34,1.56,.64,1);
}
@media (max-width:640px){
  :root{ --fx-y:24px; --fx-x:30px; }
}

/* ---------- Core states ---------- */
.fx{ opacity:0; }
.fx.fx-in{ opacity:1; }
.fx.fx-in:not(.fx-t){
  animation:var(--fx-name,fx-up) var(--fx-dur) var(--fx-ease) var(--fx-delay,0s) backwards;
}

/* Variant -> keyframe name */
.fx-v-up{    --fx-name:fx-up; }
.fx-v-down{  --fx-name:fx-down; }
.fx-v-left{  --fx-name:fx-left; }
.fx-v-right{ --fx-name:fx-right; }
.fx-v-rise{  --fx-name:fx-rise; }
.fx-v-zoom{  --fx-name:fx-zoom; }
.fx-v-blur{  --fx-name:fx-blur; }
.fx-v-fade{  --fx-name:fx-fade; }
.fx-v-mask{  --fx-name:fx-mask; --fx-dur:1.25s; }
.fx-v-blur{  --fx-dur:1.05s; }

/* Transition-based variant: for elements that already own an
   `animation` in style.css (the floating hero cards). */
.fx-t{ translate:0 28px; scale:.86; }
.fx-t.fx-in{
  translate:0 0; scale:1;
  transition:
    opacity .9s ease var(--fx-delay,0s),
    translate 1s var(--fx-spring) var(--fx-delay,0s),
    scale 1s var(--fx-spring) var(--fx-delay,0s);
}

/* ---------- Keyframes ---------- */
@keyframes fx-up{    from{ opacity:0; translate:0 var(--fx-y); } }
@keyframes fx-down{  from{ opacity:0; translate:0 calc(var(--fx-y) * -.6); } }
@keyframes fx-left{  from{ opacity:0; translate:calc(var(--fx-x) * -1) 0; } }
@keyframes fx-right{ from{ opacity:0; translate:var(--fx-x) 0; } }
@keyframes fx-rise{  from{ opacity:0; translate:0 var(--fx-y); scale:.94; } }
@keyframes fx-zoom{  from{ opacity:0; scale:.86; translate:0 calc(var(--fx-y) * .5); } }
@keyframes fx-blur{  from{ opacity:0; translate:0 calc(var(--fx-y) * .8); filter:blur(12px); } }
@keyframes fx-fade{  from{ opacity:0; scale:.985; } }
@keyframes fx-pop{   from{ opacity:0; scale:.4; rotate:-16deg; } }
@keyframes fx-mask{
  from{ opacity:0; clip-path:inset(-60px -60px 100% -60px); scale:.97; }
  to{   opacity:1; clip-path:inset(-60px); scale:1; }
}
@keyframes fx-settle{ from{ scale:1.32; } }
@keyframes fx-ring{
  0%{ transform:scale(1); opacity:.55; }
  100%{ transform:scale(1.7); opacity:0; }
}
@keyframes fx-drift-a{ to{ transform:translate(-40px,30px) scale(1.08); } }
@keyframes fx-drift-b{ to{ transform:translate(46px,-28px) scale(1.1); } }

/* ---------- Eyebrow: gold line draws itself ---------- */
.eyebrow.fx::before{ transform:scaleX(0); transform-origin:left center; }
.eyebrow.fx.fx-in::before{
  transform:scaleX(1);
  transition:transform .8s var(--fx-ease) calc(var(--fx-delay,0s) + .35s);
}

/* ---------- Card icons pop in after the card ---------- */
.card.fx-in .icon{
  animation:fx-pop .8s var(--fx-spring) calc(var(--fx-delay,0s) + .3s) backwards;
}

/* ---------- Stat strip: numbers stagger in ---------- */
.stat-strip.fx-in .stat{ animation:fx-up .8s var(--fx-ease) backwards; }
.stat-strip.fx-in .stat:nth-child(1){ animation-delay:calc(var(--fx-delay,0s) + .15s); }
.stat-strip.fx-in .stat:nth-child(2){ animation-delay:calc(var(--fx-delay,0s) + .27s); }
.stat-strip.fx-in .stat:nth-child(3){ animation-delay:calc(var(--fx-delay,0s) + .39s); }
.stat-strip.fx-in .stat:nth-child(4){ animation-delay:calc(var(--fx-delay,0s) + .51s); }
.stat-strip.fx-in .stat:nth-child(5){ animation-delay:calc(var(--fx-delay,0s) + .63s); }
.stat-strip.fx-in .stat:nth-child(6){ animation-delay:calc(var(--fx-delay,0s) + .75s); }

/* ---------- Hero / page images: settle + parallax ---------- */
.fx-img{
  scale:1.1;
  translate:0 var(--py,0px);
  will-change:translate;
}
.fx-in .fx-img{
  animation:fx-settle 1.6s var(--fx-ease) calc(var(--fx-delay,0s) + .1s) backwards;
}

/* ---------- Page-load: navbar entrance ---------- */
.site-nav{ animation:fx-nav .9s var(--fx-ease) backwards; }
@keyframes fx-nav{ from{ opacity:0; translate:0 -30px; } }
.nav-links a{ animation:fx-down .6s var(--fx-ease) backwards; }
.nav-links a:nth-child(1){ animation-delay:.25s; }
.nav-links a:nth-child(2){ animation-delay:.31s; }
.nav-links a:nth-child(3){ animation-delay:.37s; }
.nav-links a:nth-child(4){ animation-delay:.43s; }
.nav-links a:nth-child(5){ animation-delay:.49s; }
.nav-links a:nth-child(6){ animation-delay:.55s; }
.nav-links a:nth-child(7){ animation-delay:.61s; }
.nav-actions > *{ animation:fx-down .6s var(--fx-ease) .5s backwards; }

/* ---------- WhatsApp button: entrance + soft pulse ring ---------- */
.fab-wa{
  position:relative;
  animation:fx-pop .9s var(--fx-spring) 1.4s backwards;
}
.fab-wa::after{
  content:""; position:absolute; inset:0; border-radius:50%;
  border:2px solid #25D366; pointer-events:none;
  animation:fx-ring 2.6s ease-out 2.4s infinite;
}

/* ---------- Ambient: slow drifting background glows ---------- */
.hero::before,
.page-head::before{ animation:fx-drift-a 16s ease-in-out infinite alternate; }
.hero::after{ animation:fx-drift-b 19s ease-in-out infinite alternate; }

/* ---------- Safety: never hide content when printing ---------- */
@media print{
  .fx{ opacity:1 !important; translate:none !important; scale:none !important;
       filter:none !important; clip-path:none !important; animation:none !important; }
}