/* ==========================================================================
   1. IMPORTACIONES & VARIABLES
   ========================================================================== */

:root {
  --color-primary: #2b6d0c;
  --color-primary-hover: #235a0a;
  --color-text: #1a1e15;
  --color-text-secondary: #474d41;
  --bg-light: #f2f4f0;
  --bg-white: #f9f9f5;
  --color-white: #ffffff;
  --color-border: rgba(26, 30, 21, 0.1);

  --font-heading: 'neue-haas-grotesk-display', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --text-h1: clamp(2.5rem, 5vw + 1rem, 4rem);
  --text-h2: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  --text-h3: clamp(1.25rem, 2vw + 0.25rem, 1.5rem);
  --text-h4: clamp(1.125rem, 1.5vw + 0.25rem, 1.25rem);
  --text-h5: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  --text-body: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  --text-body-large: clamp(1.125rem, 1.5vw + 0.5rem, 1.25rem);
  --text-small: clamp(0.875rem, 0.5vw + 0.5rem, 0.9375rem);
  --text-label: clamp(0.75rem, 0.5vw + 0.25rem, 0.8125rem);

  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(1rem, 2vw, 1.5rem);
  --space-md: clamp(1.5rem, 3vw, 2.5rem);
  --space-lg: clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(4rem, 8vw, 7rem);
  --space-2xl: clamp(6rem, 12vw, 10rem);
  
  --container-max: 1200px;
  --container-padding: clamp(1.25rem, 4vw, 3rem);
  --header-height: 80px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text);
  background-color: var(--bg-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

img, svg {
  display: block;
  max-width: 100%;
}

.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--bg-white); }
.bg-primary { background-color: var(--color-primary); }
.text-center { text-align: center; }
.text-white { color: var(--color-white); }
.text-white + p { color: rgba(255, 255, 255, 0.9); }
.text-primary { color: var(--color-primary);}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* ==========================================================================
   3. ESTRUCTURA & COMPONENTES COMUNES
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.section-header {
  max-width: 800px;
  margin: 0 auto var(--space-2xl);
  text-align: center;
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header p,
.section-header .subtitle,
.section-header .subheadline {
  font-size: var(--text-body-large);
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto;
  color: var(--color-text);
  opacity: 0.8; 
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-label);
  font-weight: 600;
}

.btn-inverted {
  background-color: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-white);
  font-weight: 600;
}

.btn-inverted:hover {
  background-color: transparent;
  color: var(--color-white);
}

.label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

/* ==========================================================================
   4. SECCIONES ESPECÍFICAS
   ========================================================================== */

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(242, 244, 240, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Estado al hacer scroll (Añadido por JS) */
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(26, 30, 21, 0.08), 0 4px 20px rgba(26, 30, 21, 0.06);
  background-color: rgba(242, 244, 240, 0.97);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-svg {
  height: 28px;
  width: auto;
}

/* --- HERO --- */
.section-hero {
  padding-top: calc(var(--space-2xl) + var(--header-height));
  position: relative;
  overflow: hidden; 
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.section-hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 1440px;
  margin: 0 auto var(--space-xl);
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credential {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

h1.hero-seo-label {
  text-transform: none;      
  letter-spacing: normal;    
  color: var(--color-text);  
  font-size: var(--text-h3); 
  margin-bottom: 1rem;       
}

.hero-display {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em; 
}

/* --- SLIDER LOGOS --- */
.logos-container {
  margin-top: var(--space-xl);
  text-align: center;
}

.logos-wrapper {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  align-items: center;
}

.logo-item {
  height: 32px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  filter: grayscale(100%);
}

.logo-item:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* --- PROBLEMA / SOLUCIÓN --- */
.section-problem-solution .section-header {
  max-width: 100%;
}

.split-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.split-card {
  background-color: var(--color-white);
  border: none; 
  border-radius: 1.5rem; 
  padding: var(--space-lg); 
  box-shadow: 0 20px 40px rgba(26, 30, 21, 0.06); 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.split-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(26, 30, 21, 0.08);
}

/* --- NUESTRO PROCESO --- */
.grid-4-cols.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl) var(--space-md); 
}

.process-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.step-number {
  font-family: var(--font-heading);
  font-size: 4.5rem; 
  font-weight: 700;
  line-height: 1;
  color: var(--color-border); 
  opacity: 0.5; 
  margin-bottom: var(--space-xs); 
  letter-spacing: -0.04em; 
  user-select: none; 
}

.step-title {
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.process-step p {
  color: var(--color-text); 
  font-size: var(--text-body); 
  line-height: 1.5;
}

/* --- QUÉ INCLUYE --- */
.grid-3-cols.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl) var(--space-lg);
}

.feature-item {
  display: flex;
  flex-direction: column;
}

.feature-title {
  display: flex;
  align-items: flex-start; 
  gap: 0.75rem; 
  font-size: var(--text-h5); 
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.feature-title::before {
  content: '';
  display: block;
  width: 6px;
  height: 12px;
  border-bottom: 2px solid var(--color-primary); 
  border-right: 2px solid var(--color-primary);
  transform: rotate(45deg);
  margin-top: 4px; 
  flex-shrink: 0; 
}

.feature-item p {
  color: var(--color-text); 
  font-size: var(--text-body);
  line-height: 1.5;
  margin-left: 1.25rem; 
}

/* --- CTA FINAL --- */
.section-cta {
  padding-top: calc(var(--space-2xl) * 1.5);
  padding-bottom: calc(var(--space-2xl) * 1.5);
  /* El nuevo gradiente con profundidad real */
  background: linear-gradient(
    to bottom,
    var(--color-primary) 0%,
    var(--color-primary-hover) 100%
  ); 
}

.section-cta h2, 
.section-cta .subtitle {
  color: #ffffff;
}

.section-cta h2 {
  margin-bottom: var(--space-sm);
}

.section-cta .subtitle {
  max-width: 600px;
  margin: 0 auto var(--space-xl); 
  font-size: var(--text-h5); 
  opacity: 0.9; 
}

/* --- FOOTER --- */
.site-footer {
  padding: var(--space-xl) 0 var(--space-lg);
  border-top: 1px solid rgba(0, 0, 0, 0.05); 
  background-color: var(--bg-light); 
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end; 
}

.footer-logo {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-logo .logo-svg {
  height: 24px; 
  width: auto;
  display: block;
  margin: 0 0 var(--space-sm) 0;
}

.copyright {
  font-size: 0.875rem; 
  color: var(--color-text);
  opacity: 0.6;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-text);
  opacity: 0.6;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 1; 
}

/* ==========================================================================
   5. RESPONSIVE COMPONENTES
   ========================================================================== */

@media (max-width: 991px) {
  .grid-4-cols.process-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
  .grid-3-cols.features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

@media (max-width: 767px) {
  .logos-wrapper {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
    padding-bottom: var(--space-sm);
  }
  .logos-wrapper::-webkit-scrollbar {
    display: none; 
  }
  .logos-wrapper .logo-item {
    flex-shrink: 0;
    scroll-snap-align: center;
    margin-right: var(--space-md); 
  }
  .split-cards {
    grid-template-columns: 1fr;
  }
  .grid-4-cols.process-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .step-number {
    font-size: 3.5rem; 
  }
  .grid-3-cols.features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .section-cta {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xl);
  }
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .footer-logo .logo-svg {
    margin: 0; 
  }
}

@media (min-width: 1440px) {
  :root {
    --container-max: 1400px;
  }
}

/* ==========================================================================
   6. ANIMACIONES SCROLL (NUEVO BLOQUE SEGURO)
   ========================================================================== */

/* Estado inicial: invisible sin will-change (Nivel Senior) */
[data-anim] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tipos de entrada */
[data-anim="fade-up"]       { transform: translateY(40px); }
[data-anim="fade-left"]     { transform: translateX(-40px); }
[data-anim="fade-right"]    { transform: translateX(40px); }
[data-anim="scale-up"]      { transform: scale(0.92); }
[data-anim="fade"]          { transform: none; }

/* Cuando es visible */
[data-anim].is-visible {
  opacity: 1;
  transform: none;
}

/* Duraciones configurables */
[data-duration="slow"]   { transition-duration: 900ms; }
[data-duration="normal"] { transition-duration: 650ms; }
[data-duration="fast"]   { transition-duration: 400ms; }

/* Animaciones específicas de elementos */
.step-number {
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header::before {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  margin: 0 auto var(--space-md);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header.is-visible::before {
  width: 40px;
}