/* =========================================
   Global Variables & Base Styles
========================================= */
:root {
  --primary: #0c783c;
  --secondary: #15304e;
}

* {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

.font-serif {
  font-family: "Montserrat", sans-serif;
  letter-spacing: -0.02em; /* Added slight negative tracking for a tighter, premium look on headings */
}

/* =========================================
   Custom Scrollbar
========================================= */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* =========================================
   Glass Effects & Shadows
========================================= */
.glass {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass-dark {
  background: rgba(21, 48, 78, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-shadow {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* =========================================
   Buttons & Links
========================================= */
.text-gradient {
  background: linear-gradient(135deg, #0c783c 0%, #15304e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(12, 120, 60, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, #0c783c 0%, #0a6330 100%);
  transition: all 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(12, 120, 60, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #15304e 0%, #0f1f33 100%);
  transition: all 0.3s ease;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(21, 48, 78, 0.3);
}

.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #0c783c;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.active-link::after {
  width: 100%;
}

/* =========================================
   Mobile Menu
========================================= */
.mobile-menu-wrapper {
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease-in-out;
}
.mobile-menu-wrapper.open {
  visibility: visible;
  opacity: 1;
}
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu-wrapper.open .mobile-menu {
  transform: translateX(0);
}

/* =========================================
   UI Elements & Forms
========================================= */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}
.accordion-content.open {
  max-height: 500px;
}

.form-input:focus {
  border-color: #0c783c;
  box-shadow: 0 0 0 3px rgba(12, 120, 60, 0.1);
}

.image-overlay {
  position: relative;
  overflow: hidden;
}
.image-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(12, 120, 60, 0.2) 0%,
    rgba(21, 48, 78, 0.4) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}
.image-overlay:hover::after {
  opacity: 1;
}

/* =========================================
   Animations & Components
========================================= */
.stat-number {
  font-variant-numeric: tabular-nums;
}

#scroll-progress {
  width: 0%;
  transition: width 0.1s ease-out;
}

.spinner {
  border: 3px solid rgba(12, 120, 60, 0.3);
  border-radius: 50%;
  border-top: 3px solid #0c783c;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.blob {
  position: absolute;
  filter: blur(60px);
  opacity: 0.4;
  animation: move 20s infinite alternate;
}
@keyframes move {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(50px, -50px) scale(1.1);
  }
}

/* =========================================
   Sliders (Hero & Testimonials)
========================================= */

/* HERO SLIDER */
.hero-slide {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 1s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.ken-burns {
  transform: scale(1.05);
  transition: transform 10s ease-out;
}
.hero-slide.active .ken-burns {
  transform: scale(1);
}

.slide-content > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide.active .slide-content > * {
  opacity: 1;
  transform: translateY(0);
}
.hero-slide.active .slide-content > *:nth-child(1) {
  transition-delay: 0.2s;
}
.hero-slide.active .slide-content > *:nth-child(2) {
  transition-delay: 0.4s;
}
.hero-slide.active .slide-content > *:nth-child(3) {
  transition-delay: 0.6s;
}
.hero-slide.active .slide-content > *:nth-child(4) {
  transition-delay: 0.8s;
}

/* TESTIMONIAL SLIDER: Z-Index Timing Fix */
.testimonial-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: stretch;
}
.testimonial-slide {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98) translateY(10px);
  z-index: 0;
  /* Magic Fix: Holds the z-index for 0.6s until the opacity fade finishes */
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    z-index 0s 0.6s;
}
.testimonial-slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
  z-index: 2;
  /* Applies z-index instantly upon becoming active */
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    z-index 0s 0s;
}
/* =========================================
   Cinematic Editorial Styles
========================================= */
/* SplitType requires lines to have hidden overflow for the slide-up effect */
.line {
  overflow: hidden;
  padding-bottom: 0.1em; /* Prevents descenders like 'y' and 'g' from being cut off */
}
.word {
  transform: translateY(110%);
}

/* Ensure smooth scrolling works globally */
html.lenis {
  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;
}
