/* ==========================================================================
   Bellicose Atelier — Scroll Animations
   GSAP ScrollTrigger + data attributes
   ========================================================================== */

/* Initial hidden states — only when GSAP stack is loaded (body.ba-has-motion).
   Otherwise footer/header and other shared chrome stay visible on shop/product pages. */
body.ba-has-motion [data-ba-animate] {
  opacity: 0;
  will-change: transform, opacity;
}

/* Never hide site chrome — header/footer must stay readable even if JS fails */
body.ba-has-motion .site-header,
body.ba-has-motion .site-header [data-ba-animate],
body.ba-has-motion .site-footer,
body.ba-has-motion .site-footer [data-ba-animate],
body.ba-has-motion .site-footer .footer-col {
  opacity: 1 !important;
  transform: none !important;
  will-change: auto;
}

/* Making Of steps are staggered in JS — keep them ready without CSS hide conflict */
body.ba-has-motion .ba-making-steps-overlay .ba-making-step {
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

body.ba-has-motion .ba-making-steps-overlay .ba-making-step.ba-animated {
  opacity: 1;
  transform: none;
  will-change: auto;
}

body.ba-has-motion [data-ba-animate="fade-up"] {
  transform: translateY(28px);
}

body.ba-has-motion [data-ba-animate="fade-down"] {
  transform: translateY(-20px);
}

body.ba-has-motion [data-ba-animate="fade-left"] {
  transform: translateX(-28px);
}

body.ba-has-motion [data-ba-animate="fade-right"] {
  transform: translateX(28px);
}

body.ba-has-motion [data-ba-animate="scale-up"] {
  transform: scale(0.96);
}

body.ba-has-motion [data-ba-animate="fade-in"] {
  transform: none;
}

/* Making media: opacity only (never translate — fights step stagger) */
body.ba-has-motion .ba-making-media[data-ba-animate] {
  transform: none;
}

/* Animated state — opacity lock only; leave transform to GSAP clearProps */
.ba-animated {
  opacity: 1 !important;
  will-change: auto;
}

.ba-animated:not(.ba-hero-bg) {
  transform: none;
}

/* Stagger children */
body.ba-has-motion [data-ba-stagger] > * {
  opacity: 0;
  transform: translateY(22px);
}

/* Parallax layers */
[data-ba-parallax] {
  will-change: transform;
}

/* Text reveal split */
.ba-text-reveal {
  overflow: hidden;
}

.ba-text-reveal .ba-text-line {
  display: block;
  transform: translateY(100%);
}

/* Horizontal scroll section */
.ba-horizontal-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.ba-horizontal-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Counter animation */
.ba-counter {
  font-variant-numeric: tabular-nums;
}

/* Magnetic button effect */
.ba-magnetic {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Line draw animation */
.ba-line-draw {
  position: relative;
}

.ba-line-draw::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ba-gold, #c9a962);
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ba-line-draw.ba-animated::after {
  width: 100%;
}

/* Image clip reveal */
.ba-clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ba-clip-reveal.ba-animated {
  clip-path: inset(0 0 0 0);
}

/* Glow pulse for CTA */
@keyframes baGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 169, 98, 0.3); }
  50% { box-shadow: 0 0 40px rgba(201, 169, 98, 0.6); }
}

.ba-glow-pulse {
  animation: baGlow 3s ease-in-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-ba-animate],
  [data-ba-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ba-scroll-indicator {
    animation: none;
  }
}

/* Mobile: avoid horizontal translate causing page overflow */
@media (max-width: 768px) {
  body.ba-has-motion [data-ba-animate="fade-left"],
  body.ba-has-motion [data-ba-animate="fade-right"] {
    transform: translateY(28px);
  }

  body.ba-has-motion [data-ba-animate="fade-up"] {
    transform: translateY(28px);
  }

  body.ba-has-motion [data-ba-animate="fade-down"] {
    transform: translateY(-20px);
  }
}
