/* ==========================================================================
   Global Variables & Reset
   ========================================================================== */
:root {
  /* Color Palette: Green + White + Earth Tones */
  --primary-green: #2ecc71;
  --dark-green: #27ae60;
  --light-green: #e9f7ef;
  --earth-brown: #8d6e63;
  --earth-tan: #d7ccc8;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --white: #ffffff;
  --bg-light: #f9fbf9;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Layout */
  --container-width: 1200px;
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--primary-green);
  border-radius: 2px;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

.section-light {
  background-color: var(--white);
}

.section-dark {
  background-color: var(--bg-light);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--primary-green);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--dark-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.btn-outline:hover {
  background-color: var(--primary-green);
  color: var(--white);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
header {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-green);
}

.logo span {
  color: var(--text-dark);
}

.logo i {
  color: var(--primary-green);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-dark);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-green);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-green);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  background: none;
  border: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background-color: #E9F7EF;
  color: var(--text-dark);
  padding: 5rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer-col h3::after {
  background-color: var(--primary-green);
  bottom: -8px;
  height: 2px;
  width: 40px;
}

.footer-col p {
  color: #7d7d7d;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #7d7d7d;
}

.footer-links a:hover {
  color: var(--primary-green);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--light-green);
  border-radius: 50%;
  color: var(--primary-green);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-green);
  color: var(--white);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-bottom p {
  margin-bottom: 0;
  color: #7d7d7d;
  font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 250px;
    height: 100vh;
    background-color: var(--white);
    flex-direction: column;
    padding-top: 5rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    align-items: flex-start;
    padding-left: 2rem;
    z-index: 999;
  }

  .mobile-menu-btn {
    position: relative;
    z-index: 1001;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links li {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 100px;
    align-items: flex-start;
    background-attachment: scroll;
    /* Fix for iOS background-attachment: fixed bug that scales image incorrectly */
  }

  .intro-grid,
  .ecosystem-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .intro-features {
    grid-template-columns: 1fr;
  }

  /* Prevent horizontal translateX animations from creating page-wide scroll */
  .reveal-left {
    transform: translateY(40px);
  }

  .reveal-right {
    transform: translateY(40px);
  }

  #crop-cycle {
    display: none;
  }
}

/* ───── Small phones (≤ 480px) ───── */
@media (max-width: 480px) {
  .hero {
    padding-top: 110px;
    padding-bottom: 60px;
  }

  .hero-badges {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .container {
    padding: 0 1rem;
    margin-top: 30px;
  }

  /* Keep horizontal animations vertical-only on smallest screens */
  .reveal-left {
    transform: translateY(40px);
  }

  .reveal-right {
    transform: translateY(40px);
  }
}

/* ==========================================================================
   Page Specific: Home
   ========================================================================== */
/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 90px;
  /* Offset for header */
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?q=80&w=2064&auto=format&fit=crop') center/cover no-repeat;
  background-attachment: fixed;
  color: var(--white);
  position: relative;
}

.hero-content {
  max-width: 800px;
  animation: fadeUp 1s ease forwards;
}

.hero h1,
.hero p {
  color: var(--white);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.badge {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  backdrop-filter: blur(5px);
}

.badge i {
  color: var(--primary-green);
}

/* Intro Section */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.intro-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.intro-image::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 100px;
  height: 100px;
  background-color: var(--light-green);
  border-radius: 50%;
  z-index: -1;
}

.intro-image img {
  border-radius: 20px;
  transition: transform 0.5s ease;
}

.intro-image:hover img {
  transform: scale(1.05);
}

.intro-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.intro-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.intro-feature-icon {
  width: 50px;
  height: 50px;
  background-color: var(--light-green);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-green);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.intro-feature h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.intro-feature p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Categories Section */
.categories-header {
  text-align: center;
  margin-bottom: 4rem;
}

.categories-header h2::after {
  left: 50%;
  transform: translateX(-50%);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.category-card {
  background-color: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  top: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.category-icon-wrapper {
  height: 160px;
  background-color: var(--light-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--primary-green);
  transition: var(--transition);
}

.category-card:hover .category-icon-wrapper {
  background-color: var(--primary-green);
  color: var(--white);
}

.category-content {
  padding: 2rem;
  text-align: center;
}

.category-content h3 {
  margin-bottom: 1rem;
}

.category-content p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--dark-green) 0%, var(--primary-green) 100%);
  color: var(--white);
  text-align: center;
  padding: 6rem 0;
}

.cta-section h2,
.cta-section p {
  color: var(--white);
}

.cta-section h2::after {
  background-color: var(--white);
  left: 50%;
  transform: translateX(-50%);
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
}

/* ==========================================================================
   New Sections (Ecosystem & Crop Cycle)
   ========================================================================== */
.ecosystem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.ecosystem-text h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.ecosystem-steps {
  margin-top: 2rem;
  position: relative;
}

.ecosystem-steps::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: var(--light-green);
  z-index: 1;
}

.eco-step {
  position: relative;
  padding-left: 4rem;
  margin-bottom: 2rem;
  z-index: 2;
}

.eco-step::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 5px;
  width: 20px;
  height: 20px;
  background-color: var(--white);
  border: 3px solid var(--primary-green);
  border-radius: 50%;
  z-index: 3;
  transition: var(--transition);
}

.eco-step:hover::before {
  background-color: var(--primary-green);
  box-shadow: 0 0 0 5px rgba(46, 204, 113, 0.2);
}

.eco-step h4 {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.timeline-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2rem;
  padding: 2rem 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* Firefox */
  scroll-behavior: smooth;
}

.timeline-grid::-webkit-scrollbar {
  display: none;
  /* Safari and Chrome */
}

.carousel-wrapper {
  position: relative;
  padding: 0 40px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--white);
  color: var(--primary-green);
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.carousel-btn:hover {
  background-color: var(--primary-green);
  color: var(--white);
}

.prev-btn {
  left: 0;
}

.next-btn {
  right: 0;
}

.timeline-card {
  flex: 0 0 320px;
  background: var(--white);
  border-radius: 20px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  scroll-snap-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.timeline-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.timeline-content {
  padding: 2rem;
  flex-grow: 1;
}

.timeline-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--dark-green), var(--primary-green));
}

.timeline-icon {
  font-size: 2.5rem;
  color: var(--primary-green);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */
.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Delay modifiers */
.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

.delay-400 {
  transition-delay: 400ms;
}

.delay-500 {
  transition-delay: 500ms;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {

  .intro-grid,
  .ecosystem-grid {
    grid-template-columns: 1fr;
  }

  .intro-image {
    order: -1;
  }
}

/* --- LENIS SMOOTH SCROLLING --- */
html.lenis,
html.lenis body {
  height: auto;
  overflow-x: hidden;
}

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

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

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

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