/**
 * The Berhe Group — Cutting-Edge Effects Stylesheet
 * Companion to effects.js
 */

/* ════════════════════════════════════════
   1. LENIS SMOOTH SCROLL
   ════════════════════════════════════════ */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* ════════════════════════════════════════
   2. SCROLL-TRIGGERED TEXT REVEALS
   ════════════════════════════════════════ */
.scroll-reveal {
  opacity: 0;
  clip-path: inset(8% 0 0 0);
  transition: 
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
    clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
  will-change: opacity, clip-path;
}

.scroll-reveal.revealed {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

/* Ensure no layout shift — elements keep their space */
.scroll-reveal {
  transform: translateZ(0);
}

/* Reduced motion fallback */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    clip-path: none;
    transition: none;
  }
}


/* ════════════════════════════════════════
   3. PARALLAX HERO
   ════════════════════════════════════════ */
.hero {
  overflow: hidden;
  position: relative;
}

.hero__bg {
  will-change: transform;
  transition: none; /* JS controls directly */
}

/* Disable parallax transforms on mobile */
@media (max-width: 767px) {
  .hero__bg {
    will-change: auto;
    transform: none !important;
  }
}


/* ════════════════════════════════════════
   4. MAGNETIC CURSOR BUTTONS
   ════════════════════════════════════════ */
.magnetic {
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Only on devices with hover capability */
@media (hover: none) {
  .magnetic {
    will-change: auto;
  }
}


/* ════════════════════════════════════════
   5. COUNTER ANIMATIONS
   ════════════════════════════════════════ */
.stat__value,
.stat-number,
.impact__number,
[data-count] {
  font-variant-numeric: tabular-nums lining-nums;
}


/* ════════════════════════════════════════
   6. IMAGE REVEAL CURTAINS
   ════════════════════════════════════════ */
.img-reveal-wrap {
  position: relative;
  overflow: hidden;
}

.img-reveal-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-primary, #6B1527);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.1s;
  z-index: 2;
}

.img-reveal-wrap.img-revealed::after {
  transform: scaleX(0);
}

.img-reveal-wrap img {
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
  transform: scale(1.15);
}

.img-reveal-wrap.img-revealed img {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .img-reveal-wrap::after {
    display: none;
  }
  .img-reveal-wrap img {
    transform: none;
    transition: none;
  }
}


/* ════════════════════════════════════════
   7. PARTNER MARQUEE
   ════════════════════════════════════════ */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }
}


/* ════════════════════════════════════════
   8. PAGE TRANSITIONS (View Transitions API)
   ════════════════════════════════════════ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-fade-out 0.25s cubic-bezier(0.4, 0, 1, 1);
}

::view-transition-new(root) {
  animation: page-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes page-fade-out {
  from { opacity: 1; filter: none; }
  to { opacity: 0; filter: blur(4px); }
}

@keyframes page-fade-in {
  from { opacity: 0; filter: blur(4px); }
  to { opacity: 1; filter: none; }
}


/* ════════════════════════════════════════
   9. HOVER-EXPAND CARDS
   ════════════════════════════════════════ */
.hover-card {
  transition: 
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .hover-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 
      0 20px 60px rgba(107, 21, 39, 0.08),
      0 8px 24px rgba(26, 23, 20, 0.06);
    border-color: var(--color-primary, #6B1527);
    z-index: 2;
    position: relative;
  }

  .hover-card:active {
    transform: translateY(-2px) scale(1.005);
    transition-duration: 0.15s;
  }
}

/* Mobile: subtle active state */
@media (hover: none) {
  .hover-card:active {
    transform: scale(0.98);
    transition-duration: 0.15s;
  }
}


/* ════════════════════════════════════════
   10. SCROLL PROGRESS INDICATOR
   ════════════════════════════════════════ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--color-primary, #6B1527), #B5394D);
  z-index: 9999;
  transition: none;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* Subtle glow effect on the leading edge */
.scroll-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(181, 57, 77, 0.4));
  border-radius: 0 2px 2px 0;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    display: none;
  }
}
