/* BHP Motion Layer
   Adds subtle, professional scroll-in animations and a slow hero pan.
   Respects prefers-reduced-motion. */

@keyframes bhp-fade-up {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes bhp-hero-pan {
  0%   { transform: scale(1.06) translate3d(-1%, 0, 0); }
  100% { transform: scale(1.1)  translate3d(1%, -0.5%, 0); }
}

@keyframes bhp-gold-shimmer {
  0%   { opacity: 0.55; }
  50%  { opacity: 0.9; }
  100% { opacity: 0.55; }
}

/* Homepage hero image: very slow Ken Burns */
main > section:first-child img[src*="hero.jpg"],
main > section:first-child img[alt*="hero"],
main > section:first-child img[fetchpriority="high"] {
  animation: bhp-hero-pan 22s ease-in-out infinite alternate;
  will-change: transform;
}

/* Gold accent glow on homepage hero: pulsing ambient light */
main > section:first-child [style*="radial-gradient"],
main > section:first-child [class*="from-gold"] {
  animation: bhp-gold-shimmer 8s ease-in-out infinite;
}

/* Service/listing page hero image: slow pan */
main > section:nth-child(1)[aria-hidden="false"] img {
  animation: bhp-hero-pan 24s ease-in-out infinite alternate;
  will-change: transform;
}

/* Scroll-triggered fade-up (applied via IntersectionObserver in JS) */
.bhp-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.bhp-reveal.bhp-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Stagger children when applied to a container with .bhp-stagger */
.bhp-stagger.bhp-in > * {
  animation: bhp-fade-up 700ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.bhp-stagger.bhp-in > *:nth-child(1) { animation-delay: 0ms; }
.bhp-stagger.bhp-in > *:nth-child(2) { animation-delay: 90ms; }
.bhp-stagger.bhp-in > *:nth-child(3) { animation-delay: 180ms; }
.bhp-stagger.bhp-in > *:nth-child(4) { animation-delay: 270ms; }
.bhp-stagger.bhp-in > *:nth-child(5) { animation-delay: 360ms; }
.bhp-stagger.bhp-in > *:nth-child(6) { animation-delay: 450ms; }

/* Subtle underline animation on nav links */
nav a[href*="index.html"]:not(.inline-flex):hover::after,
header nav a:not(.inline-flex):hover::after {
  transform: scaleX(1);
}
header nav a:not(.inline-flex) {
  position: relative;
}
header nav a:not(.inline-flex)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Card lift on hover: service cards */
a[href*="/index.html"][class*="group"]:hover,
a[href*="/index.html"][class*="rounded"]:hover {
  transform: translate3d(0, -4px, 0);
}
a[href*="/index.html"][class*="rounded"] {
  transition: transform 400ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

/* Reduced motion: kill all decorative animation */
@media (prefers-reduced-motion: reduce) {
  main > section:first-child img,
  main > section:nth-child(1)[aria-hidden="false"] img {
    animation: none !important;
  }
  .bhp-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .bhp-stagger.bhp-in > * {
    animation: none !important;
  }
  header nav a:not(.inline-flex)::after {
    display: none;
  }
}
