/*
 * Bharath Jewellery — scroll motion layer.
 * Only active when bharath-motion.js has run (it adds .bj-motion to <html>)
 * and the visitor has not asked for reduced motion.
 */

:root {
  --bj-ease: cubic-bezier(.2, .7, .2, 1);
  --bj-ease-curtain: cubic-bezier(.77, 0, .18, 1);
}

/* ---------- Reveal: fade + rise ---------- */
.bj-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 42px, 0);
  transition: opacity .9s var(--bj-ease), transform 1.1s var(--bj-ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.bj-motion [data-reveal="fade"] { transform: none; }
.bj-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Images inside cards/tiles zoom out as the card appears */
.bj-motion [data-reveal]:not(.is-in) img.object-cover { transform: scale(1.14); }
.bj-motion [data-reveal] img.object-cover { transition-property: transform, translate, scale, rotate; transition-duration: 1.6s; transition-timing-function: var(--bj-ease); }

/* ---------- Reveal: image curtain ---------- */
.bj-motion [data-reveal="img"] {
  opacity: 1;
  transform: scale(1.08);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.3s var(--bj-ease-curtain), transform 1.8s var(--bj-ease);
  transition-delay: var(--d, 0s);
}
.bj-motion [data-reveal="img"].is-in { clip-path: inset(0 0 0 0); transform: none; }

/* ---------- Headings: word-by-word mask ---------- */
.bj-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.bj-wi { display: inline-block; }
.bj-motion .bj-split .bj-wi {
  transform: translate3d(0, 110%, 0);
  transition: transform 1.05s var(--bj-ease);
  transition-delay: calc(var(--d, 0s) + var(--i, 0) * 55ms);
}
.bj-motion .bj-split.is-in .bj-wi { transform: none; }
/* Gold gradient words keep their gradient while moving */
.bj-wi > em { display: inline-block; padding-right: .06em; }

/* ---------- Gold rule draws in ---------- */
.bj-motion .gold-rule { transform: scaleX(0); transition: transform 1.6s var(--bj-ease); }
.bj-motion .gold-rule.is-in { transform: scaleX(1); }

/* ---------- Parallax background images ---------- */
.bj-motion img.bj-par { top: -12%; bottom: auto; height: 124%; will-change: translate; }

/* ---------- Header: compact on scroll + progress line ---------- */
.bj-header > div:first-child { transition: height .45s var(--bj-ease); }
.bj-header img { transition: height .45s var(--bj-ease); }
.bj-header { transition: box-shadow .45s var(--bj-ease), background-color .45s var(--bj-ease); }
.bj-header.is-scrolled > div:first-child { height: 4rem; }
.bj-header.is-scrolled img { height: 2.6rem; }
.bj-header.is-scrolled { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55); }
.bj-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background-image: var(--gradient-gold);
  transform-origin: 0 50%; transform: scaleX(var(--bj-progress, 0));
  pointer-events: none;
}

/* ---------- Floating WhatsApp: soft pulse ---------- */
.bj-motion .bj-wa-float::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--whatsapp) 55%, transparent);
  animation: bj-pulse 2.8s var(--bj-ease) 2s infinite;
}
@keyframes bj-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--whatsapp) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 18px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .bj-motion [data-reveal], .bj-motion .bj-split .bj-wi, .bj-motion .gold-rule { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .bj-motion .bj-wa-float::after { animation: none; }
}
