/* ================================================================
   BHARAT H2O — ANIMATIONS LAYER (Consolidated)
   Merged from animations.css, animations-v2.css, animations-premium.css
   Respects prefers-reduced-motion
   ================================================================ */

/* ---- CUSTOM CURSOR ---- */
#bh-cursor{
  position:fixed; left:0; top:0; pointer-events:none; z-index:9999;
  width:10px; height:10px; border-radius:50%;
  background:var(--teal,#1B8A8D);
  --x:-100px; --y:-100px;
  transform:translate3d(var(--x),var(--y),0) translate(-50%,-50%);
  transition:width .25s var(--ease-out), height .25s, opacity .25s, background .25s;
  will-change:transform,width,height;
}
#bh-cursor-ring{
  position:fixed; left:0; top:0; pointer-events:none; z-index:9998;
  width:36px; height:36px; border-radius:50%;
  border:1.5px solid rgba(27,138,141,0.55);
  --x:-100px; --y:-100px;
  transform:translate3d(var(--x),var(--y),0) translate(-50%,-50%);
  transition:width .32s, height .32s, border-color .3s, opacity .3s;
  will-change:transform,width,height;
}
#bh-cursor.hover{ width:20px; height:20px; background:rgba(27,138,141,0.85); }
#bh-cursor-ring.hover{ width:54px; height:54px; border-color:rgba(27,138,141,0.7); }
#bh-cursor.click{ transform:translate3d(var(--x),var(--y),0) translate(-50%,-50%) scale(.7); }
#bh-cursor-ring.click{ width:44px; height:44px; opacity:.5; }
#bh-cursor.hidden, #bh-cursor-ring.hidden{ opacity:0; }

/* ---- AMBIENT PARTICLES ---- */
#bh-particles{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  opacity:.6; mix-blend-mode:screen;
}

/* ---- PAGE LOAD PROGRESS ---- */
#bh-progress{
  position:fixed; top:0; left:0; height:2.5px; z-index:400;
  background:linear-gradient(90deg, #1B8A8D, #7CA24C, #1B8A8D);
  background-size:200% 100%;
  width:0%; animation:bh-progress-shimmer 1.5s linear infinite;
  transition:width .4s var(--ease-out);
  box-shadow:0 0 12px rgba(27,138,141,0.8);
}
@keyframes bh-progress-shimmer{
  0%{background-position:200% 0} 100%{background-position:-200% 0}
}

/* ---- CUSTOM SCROLLBAR ---- */
::-webkit-scrollbar{width:10px; height:10px;}
::-webkit-scrollbar-track{background:rgba(14,43,44,0.04);}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg, #1B8A8D, #7CA24C); border-radius:8px; border:2px solid rgba(251,250,247,0.9);}
::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg, #156f71, #688f41);}

/* ---- PAGE TRANSITION FADE ---- */
#bh-page-fade{position:fixed; inset:0; z-index:20000; pointer-events:none; background:#0E2B2C; opacity:0; transition:opacity .45s var(--ease-out);}
#bh-page-fade.active{opacity:1; pointer-events:all;}

/* ---- SECTION AMBIENT GLOW ---- */
.bh-glow-section{position:relative;}
.bh-glow-section::before{
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  opacity:0; transition:opacity .5s ease;
  background:radial-gradient(420px circle at var(--bh-mx, 50%) var(--bh-my, 50%), rgba(27,138,141,0.10), transparent 65%);
}
.bh-glow-section:hover::before{opacity:1;}

/* ---- BUTTON RIPPLE ---- */
.bh-ripple{
  position:absolute; border-radius:50%; pointer-events:none;
  background:rgba(255,255,255,0.55);
  transform:scale(0); animation:bh-ripple-anim .65s var(--ease-out);
}
@keyframes bh-ripple-anim{to{transform:scale(1); opacity:0;}}

/* ---- CONIC BORDER ON CARDS ---- */
@property --bh-angle{syntax:'<angle>'; inherits:false; initial-value:0deg;}
.why-card, .fork-card, .logo-card{--bh-angle:0deg;}
.why-card::before, .fork-card::before{
  content:''; position:absolute; inset:-1.5px; border-radius:inherit; z-index:-1;
  padding:1.5px; background:conic-gradient(from var(--bh-angle), transparent 0%, rgba(27,138,141,0.55) 12%, transparent 24%);
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  opacity:0; transition:opacity .4s; animation:bh-rotate-border 3.5s linear infinite paused;
}
.why-card:hover::before, .fork-card:hover::before{opacity:1; animation-play-state:running;}
@keyframes bh-rotate-border{to{--bh-angle:360deg;}}

/* ---- HERO GLOBE FLOAT ---- */
.hero-globe{animation:bh-globe-float 7s ease-in-out infinite;}
@keyframes bh-globe-float{0%,100%{transform:translateY(0) translateZ(0);} 50%{transform:translateY(-14px) translateZ(0);}}
@keyframes globeSpin{to{transform:rotate(360deg);}}
@keyframes globeTilt{from{transform:rotate(-15deg);} to{transform:rotate(15deg);}}

/* ---- HERO STAT GLOW ---- */
.hero-stat .num{text-shadow:0 0 0 rgba(27,138,141,0); transition:text-shadow .6s ease;}
.hero-stat:hover .num{text-shadow:0 0 22px rgba(27,138,141,0.45);}

/* ---- NAV ANIMATED UNDERLINE ---- */
.navlinks a::after{
  height:2px !important;
  background:linear-gradient(90deg, #1B8A8D, #7CA24C) !important;
}
.navlinks a span{display:inline-block; transition:transform .4s var(--ease-out);}
.navlinks a:hover span{transform:translateY(-2px);}

/* ---- LOGO SHIMMER ---- */
.logo-card{position:relative; overflow:hidden;}
.logo-card::after{
  content:''; position:absolute; top:0; left:-140%; width:60%; height:100%;
  background:linear-gradient(115deg, transparent, rgba(255,255,255,0.10), transparent);
  animation:bh-logo-sweep 6s ease-in-out infinite;
}
@keyframes bh-logo-sweep{0%,85%,100%{left:-140%;} 92%{left:140%;}}

/* ---- IMAGE HOVER SCALE ---- */
.machine-photo-frame img, .founder-photo img, .ptc-media img, .schematic-wrap img{
  transition:transform .8s var(--ease-out), filter .8s ease;
}
.machine-photo-frame:hover img, .founder-photo:hover img, .ptc-media:hover img, .schematic-wrap:hover img{
  transform:scale(1.06);
}

/* ---- STICKY HEADER LOGO SCALE ---- */
header.scrolled .logo{transform:scale(0.94); transition:transform .4s var(--ease-out);}

/* ---- CTA ICON SLIDE ---- */
.btn-primary .icon, .btn-ghost .icon{display:inline-block; transition:transform .35s var(--ease-out);}
.btn-primary:hover .icon, .btn-ghost:hover .icon{transform:translateX(4px);}

/* ---- WHY CARD ICON POP ---- */
.why-card .icon, .why-card svg{transition:transform .5s var(--ease-spring);}
.why-card:hover .icon, .why-card:hover svg{transform:scale(1.15) rotate(-6deg);}

/* ---- HERO MEDIA PARALLAX ---- */
.hero-media{transition:transform .1s linear;}

/* ---- HERO CONTENT IN ---- */
.hero-grid{animation:heroContentIn 1.1s var(--ease-out) both .15s;}
@keyframes heroContentIn{from{opacity:0; transform:translateY(18px);} to{opacity:1; transform:translateY(0);}}

/* ---- HERO GRADIENT TEXT ---- */
.hero h1 em{
  background:linear-gradient(90deg, #7FC9CB, #1B8A8D, #7CA24C, #7FC9CB);
  background-size:300% 100%;
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:bh-text-gradient 5s linear infinite;
}
@keyframes bh-text-gradient{0%{background-position:0% 50%} 100%{background-position:300% 50%}}

/* ---- HEADER SCROLL GLASS ---- */
header.scrolled{
  background:rgba(251,250,247,0.78) !important;
  backdrop-filter:blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter:blur(24px) saturate(180%) !important;
  box-shadow:0 2px 40px rgba(14,43,44,0.08) !important;
}

/* ---- SCROLL PROGRESS ---- */
#bh-scroll-gauge{position:fixed; right:0; top:0; bottom:0; z-index:90; width:3px; pointer-events:none; background:rgba(14,43,44,0.06);}
#bh-scroll-gauge-fill{width:100%; background:linear-gradient(180deg, #1B8A8D, #7CA24C); height:0%; transition:height .1s linear; box-shadow:0 0 8px rgba(27,138,141,0.6);}

/* ---- PARALLAX BLOBS ---- */
.bh-blob{position:fixed; border-radius:50%; pointer-events:none; z-index:0; filter:blur(80px); animation:bh-blob-float 20s ease-in-out infinite; opacity:0; transition:opacity 2s ease; will-change:transform; contain:paint;}
.bh-blob.ready{opacity:1;}
.bh-blob-1{width:480px; height:480px; background:radial-gradient(circle, rgba(27,138,141,0.12), transparent 70%); top:-15%; left:-10%; animation-duration:22s;}
.bh-blob-2{width:380px; height:380px; background:radial-gradient(circle, rgba(124,162,76,0.10), transparent 70%); bottom:-10%; right:-8%; animation-duration:28s; animation-delay:-9s;}
.bh-blob-3{width:300px; height:300px; background:radial-gradient(circle, rgba(27,138,141,0.08), transparent 70%); top:40%; left:60%; animation-duration:19s; animation-delay:-5s;}
@keyframes bh-blob-float{0%,100%{transform:translate(0,0) scale(1);} 33%{transform:translate(40px,-30px) scale(1.06);} 66%{transform:translate(-30px,40px) scale(0.94);}}

/* ---- TILT SHINE ---- */
.bh-tilt-shine{position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:2; background:radial-gradient(circle at 50% 50%, rgba(255,255,255,0.22) 0%, transparent 70%); opacity:0; transition:opacity .4s;}
.why-card:hover .bh-tilt-shine, .fork-card:hover .bh-tilt-shine, .logo-card:hover .bh-tilt-shine{opacity:1;}

/* ---- BUTTON GLOW ---- */
.btn-primary:hover{box-shadow:0 0 0 4px rgba(27,138,141,0.18), 0 12px 28px rgba(27,138,141,0.35) !important;}

/* ---- CERT SHIMMER ---- */
.cert-item{position:relative; overflow:hidden;}
.cert-item::before{content:''; position:absolute; top:0; left:-100%; width:60%; height:100%; background:linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent); transform:skewX(-20deg); transition:left 0s;}
.cert-item:hover::before{left:140%; transition:left .55s ease;}

/* ---- FOOTER LINE ANIMATION ---- */
footer::before{content:''; position:absolute; top:0; left:0; right:0; height:1px; background:linear-gradient(90deg, transparent, rgba(127,201,203,0.5), transparent); animation:bh-footer-line 4s ease-in-out infinite;}
@keyframes bh-footer-line{0%,100%{transform:scaleX(0.3) translateX(-100%);} 50%{transform:scaleX(1) translateX(0);}}

/* ---- CURTAIN UPGRADE ---- */
.curtain{background:linear-gradient(135deg, #0E2B2C 0%, #122F30 60%, #183D3E 100%) !important;}
.curtain-mark{filter:drop-shadow(0 0 18px rgba(127,201,203,0.7));}

/* ---- LOGO HOVER ---- */
.logo:hover .logo-mark-img{transform:scale(1.22) rotate(-3deg) !important; filter:drop-shadow(0 8px 22px rgba(27,138,141,0.32)) !important;}

/* ---- FOCUS RING GLOW ---- */
:focus-visible{box-shadow:0 0 0 5px rgba(27,138,141,0.18) !important;}

/* ---- LOADING DOTS ---- */
#bh-page-fade .bh-dots{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:flex; gap:8px;}
#bh-page-fade .bh-dots span{width:8px; height:8px; border-radius:50%; background:rgba(127,201,203,0.9); animation:bh-dot-bounce 1s ease-in-out infinite;}
#bh-page-fade .bh-dots span:nth-child(2){animation-delay:.15s;}
#bh-page-fade .bh-dots span:nth-child(3){animation-delay:.3s;}
@keyframes bh-dot-bounce{0%,80%,100%{transform:scale(.6); opacity:.4;} 40%{transform:scale(1); opacity:1;}}

/* ---- HERO STAT POP ---- */
.hero-stat .num{animation:statPop .5s var(--ease-spring) both; animation-play-state:paused;}
.hero-stat.counted .num{animation-play-state:running;}
@keyframes statPop{0%{transform:scale(1);} 60%{transform:scale(1.08);} 100%{transform:scale(1);}}

/* ---- HERO CURSOR GLOW ---- */
.hero::after{content:''; position:absolute; inset:0; z-index:1; pointer-events:none; opacity:0; transition:opacity .6s ease; background:radial-gradient(480px circle at var(--hx,50%) var(--hy,40%), rgba(124,201,203,0.14), transparent 60%);}
.hero:hover::after{opacity:1;}

/* ---- REDUCE MOTION ---- */
@media(prefers-reduced-motion:reduce){
  #bh-cursor, #bh-cursor-ring, #bh-particles, .bh-blob, .scroll-hint{display:none !important;}
  .hero h1 em{-webkit-text-fill-color:inherit !important; background:none !important; animation:none !important;}
  #bh-progress{animation:none !important;}
  .hero-media video, .hero-media img, .hero-globe, .logo-card::after, .hero-meta, .hero-actions, .hero-stats, .why-card::before, .fork-card::before{animation:none !important;}
  #bh-page-fade{transition:none !important;}
}

/* ---- MOBILE OVERRIDES ---- */
@media (max-width: 768px), (hover: none) {
  #bh-cursor, #bh-cursor-ring, #bh-particles, .bh-blob{display:none !important;}
  .why-card{backdrop-filter:blur(6px) !important; -webkit-backdrop-filter:blur(6px) !important;}
  .hero-media video{animation:none !important; transform:translate(-50%,-50%) !important;}
  .hero-media img{animation:none !important; transform:none !important;}
  .hero-globe{animation:none !important;}
  .why-card::before, .fork-card::before{display:none !important;}
  .bh-blob{display:none !important;}
  footer::before{animation:none !important;}
  .hero h1 em{animation:none !important; background-position:0% 50% !important;}
  #bh-progress{animation:none !important;}
  .hero-media, .bh-blob, .hero-globe{will-change:auto !important;}
  /* Keep scene-fallback visible on mobile for reliable background */
  .scene-fallback{opacity:1 !important;}
  .scene-fallback.dimmed{opacity:0.55 !important; transition:opacity 1.2s ease;}
  /* Ensure hero background color is always rendered */
  .hero-media{background:var(--teal-deep) !important;}
  /* Poster images should display reliably */
  .hero-clip.poster-first{opacity:1 !important;}
}

/* ---- TOUCH DEVICE HOVER FIX ---- */
@media (hover:none), (pointer:coarse) {
  .why-card:hover, .fork-card:hover, .card:hover, .logo-card:hover img, .cert-item:hover, .btn:hover,
  .machine-photo-frame:hover img, .pin-tech-card:hover, .etp-machine-card:hover{transform:none !important;}
  .btn:hover{box-shadow:none !important; filter:none !important;}
  a, button{-webkit-tap-highlight-color:rgba(27,138,141,0.15);}
}
