/* ============================================================
   MyPartner.lk — Custom Styles
   Serendib Heritage Design System
   ============================================================ */

/* ── Scroll progress bar ────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, #962f16 0%, #b8ab70 60%, #fcbb51 100%);
  border-radius: 0 9999px 9999px 0;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── Desktop nav link — active & base state ─────────────── */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -2px;
  width: 0; height: 2px;
  background: #962f16;
  border-radius: 9999px;
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.5, 0, 0, 1);
}
.nav-link:hover::after,
.nav-link.nav-active::after {
  width: 100%;
}
.nav-link.nav-active {
  color: #962f16 !important;
}

/* ── Nav link click ripple ──────────────────────────────── */
.nav-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(150, 47, 22, 0.18);
  pointer-events: none;
  animation: nav-ripple-anim 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes nav-ripple-anim {
  to { transform: scale(3.5); opacity: 0; }
}

/* ── Section arrival flash ──────────────────────────────── */
@keyframes section-arrive {
  0%   { outline: 3px solid rgba(150, 47, 22, 0); outline-offset: 0px; }
  25%  { outline: 3px solid rgba(150, 47, 22, 0.15); outline-offset: 8px; }
  100% { outline: 3px solid rgba(150, 47, 22, 0); outline-offset: 20px; }
}
.section-arrived {
  animation: section-arrive 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Section heading arrival ────────────────────────────── */
@keyframes heading-pop {
  0%   { text-shadow: 0 0 0px rgba(150, 47, 22, 0); }
  30%  { text-shadow: 0 0 24px rgba(150, 47, 22, 0.25); }
  100% { text-shadow: 0 0 0px rgba(150, 47, 22, 0); }
}
.heading-pop {
  animation: heading-pop 0.8s ease-out forwards;
}

/* ── Stat figure counter animation ─────────────────────── */
.stat-figure {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
}
.stat-figure.counted {
  opacity: 1;
  transform: translateY(0) scale(1);
}



/* ── Glassmorphism card ─────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(216, 201, 195, 0.4);
}

/* ── Elevation shadows ──────────────────────────────────── */
.premium-shadow {
  box-shadow: 0 10px 30px rgba(38, 30, 26, 0.04);
}

/* ── Hover lift effect ──────────────────────────────────── */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-scale:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 20px 40px rgba(38, 30, 26, 0.08);
}

/* ── Keyframe animations ────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ── Hero entry animations ──────────────────────────────── */
.animate-fade-in-up {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ── Floating card / badge animations (respects prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .float-card         { animation: float 6s ease-in-out infinite; }
  .float-card-reverse { animation: float 8s ease-in-out infinite reverse; }
  .float-badge        { animation: float 7s ease-in-out infinite; }

  /* Scroll-reveal base state */
  .reveal {
    opacity: 0;
    transform: translateY(35px) scale(0.97);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up                        { animation: none; opacity: 1; }
  .float-card, .float-card-reverse, .float-badge { animation: none; }
  .reveal                                    { opacity: 1; transform: none; }
}

/* ── WebGL shader canvas ────────────────────────────────── */
#shader-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Carousel ───────────────────────────────────────────── */
.carousel-container {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-item { scroll-snap-align: center; }

/* ── FAQ accordion ──────────────────────────────────────── */
.faq-item {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(38, 30, 26, 0.07);
}
.faq-item.active-item {
  border-color: rgba(150, 47, 22, 0.4) !important;
  box-shadow: 0 16px 36px rgba(150, 47, 22, 0.08);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              transform 0.35s ease;
}
.faq-answer.open {
  max-height: 300px;
  opacity: 1;
  transform: translateY(0);
}

.faq-icon {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.faq-icon.rotated {
  transform: rotate(180deg);
  color: #962f16 !important;
}

/* ── Form inputs ────────────────────────────────────────── */
input,
textarea {
  border: 1px solid rgba(216, 201, 195, 0.5);
  outline: none;
  transition: border-color 0.2s;
}
input:focus,
textarea:focus {
  border-color: #962f16;
  box-shadow: 0 0 0 2px rgba(150, 47, 22, 0.12);
}
