/**
 * GSAP & Lenis foundation styles
 * Không đặt will-change / translateZ vĩnh viễn trên card (tốn VRAM -> giật khi scroll).
 * GSAP tự promote layer khi tween chạy.
 */

/* 1. LENIS */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* 2. WORD MASK (split text) - không làm đổi bố cục dòng */
.sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.swi {
  display: inline-block;
}

/* 3. HOVER ẢNH + LIGHTBOX: xem css/lightbox.css */

/* 4. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   5. CONVERSION: scroll progress, sticky CTA, shine, mascot
   Chỉ dùng transform/opacity (compositor) - không ảnh hưởng layout.
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #0030b2, #ec8100);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 10001;
  pointer-events: none;
}

.sticky-cta {
  position: fixed;
  left: 30px;
  bottom: 30px;
  z-index: 998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 9999px;
  background: #ec8100;
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(236, 129, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), visibility 0.4s, background-color 0.25s ease;
}

.sticky-cta.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sticky-cta:hover {
  background: #d87500;
  color: #fff;
}

.sticky-cta__arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.sticky-cta:hover .sticky-cta__arrow {
  transform: translateX(3px);
}

/* Vòng sóng thu hút ánh nhìn - chỉ chạy khi nút đang hiện */
.sticky-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid #ec8100;
  opacity: 0;
  pointer-events: none;
}

.sticky-cta.is-visible::after {
  animation: stickyRing 2.8s ease-out infinite;
}

@keyframes stickyRing {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(1.22, 1.5); opacity: 0; }
}

@media (max-width: 768px) {
  .sticky-cta {
    left: 16px;
    right: 76px;
    bottom: 16px;
    height: 48px;
    padding: 0 16px;
    justify-content: center;
    font-size: 13px;
  }
}

/* Vệt sáng quét qua nút "LIÊN HỆ NGAY", lặp thưa (~4.5s) */
.btn-cta-accent {
  position: relative;
  overflow: hidden;
}

.btn-cta-accent .shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-160%) skewX(-18deg);
  pointer-events: none;
  animation: btnShine 4.5s ease-in-out infinite;
}

@keyframes btnShine {
  0%, 62% { transform: translateX(-160%) skewX(-18deg); }
  100% { transform: translateX(380%) skewX(-18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta::after,
  .shine {
    animation: none !important;
  }
}
