/* Reset y Variables */
:root {
  --primary: hsl(15, 65%, 55%);
  --secondary: hsl(120, 15%, 75%);
  --accent: hsl(10, 70%, 65%);
  --background: hsl(35, 20%, 98%);
  --foreground: hsl(25, 15%, 20%);
  --card: hsl(35, 25%, 96%);
  --border: hsl(35, 15%, 85%);
  --text-muted: hsl(25, 20%, 45%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  hyphens: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  hyphens: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: relative;
  z-index: 1001;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--foreground);
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.logo-codigo {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 1.25rem;
}

.logo-abierto {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 1rem;
}

.nav-menu {
  display: none;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1001;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  opacity: 0.8;
  position: relative;
  z-index: 1002;
  cursor: pointer;
  pointer-events: auto;
}

.nav-link:hover {
  color: var(--primary);
  opacity: 1;
}

.btn-contact {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.btn-contact:hover {
  background: hsl(15, 65%, 50%);
  transform: scale(1.05);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--foreground);
  transition: all 0.3s ease;
}

/* Hero */
.hero {
  padding: 120px 0 80px;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.text-primary {
  color: var(--primary);
}

.flip {
  display: inline-block;
  transform: scaleX(-1);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-image {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  height: 350px;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .hero-image {
    height: 450px;
  }
}

@media (min-width: 768px) {
  .hero-image {
    height: 500px;
  }
}

@media (min-width: 1024px) {
  .hero-image {
    height: 600px;
    margin-top: 0;
    border-radius: 1.75rem;
  }
}

@media (min-width: 1280px) {
  .hero-image {
    height: 700px;
  }
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background: hsl(15, 65%, 50%);
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-primary svg {
  transition: transform 0.3s ease;
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

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

/* Sections */
section {
  padding: 80px 0;
  position: relative;
}

.section-title {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.section-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Ventaja Técnica */
.ventaja-tecnica {
  background: var(--background);
  color: white;
  padding: 60px 0;
}

.ventaja-card {
  position: relative;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--foreground) 100%);
  color: var(--background);
  padding: 3rem;
  border-radius: 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ventaja-content {
  position: relative;
  z-index: 20;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(15, 65%, 55%, 0.2);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 2px solid rgba(15, 65%, 55%, 0.3);
}

.ventaja-card h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--background);
  margin: 0 0 2rem 0;
  font-weight: 600;
  line-height: 1.3;
}

.ventaja-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.ventaja-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--background);
  opacity: 0.9;
  font-size: 0.875rem;
  font-weight: 500;
}

.feature-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Iconos flotantes */
.floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 2rem;
}

.floating-icon {
  position: absolute;
  opacity: 0.4;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blob {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.floating-icon svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 10;
}

/* Posiciones de los iconos */
.icon-1 {
  top: 8%;
  left: 5%;
  width: 64px;
  height: 64px;
  animation: float1 5s ease-in-out infinite;
}

.icon-2 {
  top: 55%;
  right: 3%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  animation: float2 5.5s ease-in-out infinite 0.4s;
}

.icon-3 {
  bottom: 12%;
  left: 8%;
  width: 64px;
  height: 64px;
  animation: float3 5.2s ease-in-out infinite 0.8s;
}

.icon-4 {
  top: 25%;
  right: 15%;
  width: 64px;
  height: 64px;
  animation: float4 5.3s ease-in-out infinite 1.2s;
}

/* Animaciones flotantes */
@keyframes float1 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(8px, -15px) rotate(4deg);
  }
  66% {
    transform: translate(0, -15px) rotate(-4deg);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translateY(-50%) translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translateY(-50%) translate(-8px, -12px) rotate(-5deg);
  }
  66% {
    transform: translateY(-50%) translate(0, -12px) rotate(5deg);
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(6px, -10px) rotate(3deg);
  }
  66% {
    transform: translate(0, -10px) rotate(-3deg);
  }
}

@keyframes float4 {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(-5px, -13px) rotate(-4.5deg);
  }
  66% {
    transform: translate(0, -13px) rotate(4.5deg);
  }
}

/* Responsive para iconos flotantes */
@media (min-width: 640px) {
  .floating-icon {
    width: 96px;
    height: 96px;
  }
  
  .icon-1, .icon-2, .icon-3, .icon-4 {
    width: 96px;
    height: 96px;
  }
}

@media (min-width: 768px) {
  .floating-icon {
    width: 128px;
    height: 128px;
  }
  
  .icon-1, .icon-2, .icon-3, .icon-4 {
    width: 128px;
    height: 128px;
  }
}

@media (min-width: 1024px) {
  .floating-icon {
    width: 160px;
    height: 160px;
  }
  
  .icon-1, .icon-2, .icon-3, .icon-4 {
    width: 160px;
    height: 160px;
  }
}

/* Desafío */
.desafio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .desafio-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.desafio-card {
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: var(--card);
  border: 2px solid var(--border);
  position: relative;
  transition: transform 0.3s ease;
}

/* La carga actual - Pesada y dolorosa */
.desafio-card.carga {
  background: linear-gradient(135deg, hsl(25, 15%, 15%) 0%, hsl(25, 15%, 20%) 100%);
  border: 3px solid hsl(25, 15%, 30%);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.2);
  transform: perspective(1000px) rotateX(2deg);
  border-radius: 1rem;
}

.desafio-card.carga::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
  border-radius: 1rem;
  pointer-events: none;
}

.desafio-card.carga h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: hsl(25, 15%, 85%);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.desafio-card.carga ul {
  list-style: none;
}

.desafio-card.carga li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: hsl(25, 15%, 70%);
  font-weight: 500;
  line-height: 1.6;
}

.desafio-card.carga li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: hsl(10, 70%, 55%);
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* La liberación - Libre y esponjosa */
.desafio-card.liberacion {
  background: linear-gradient(135deg, hsl(35, 25%, 98%) 0%, hsl(35, 20%, 96%) 100%);
  border: 2px solid hsl(15, 65%, 55%, 0.2);
  box-shadow: 
    0 10px 40px rgba(15, 65%, 55%, 0.15),
    0 4px 12px rgba(15, 65%, 55%, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: perspective(1000px) rotateX(-1deg);
  border-radius: 2rem;
  animation: floatLiberacion 6s ease-in-out infinite;
}

@keyframes floatLiberacion {
  0%, 100% {
    transform: perspective(1000px) rotateX(-1deg) translateY(0px);
  }
  50% {
    transform: perspective(1000px) rotateX(-1deg) translateY(-8px);
  }
}

.desafio-card.liberacion::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, hsl(15, 65%, 55%, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: pulseLiberacion 4s ease-in-out infinite;
  pointer-events: none;
}

.desafio-card.liberacion::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: -15px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, hsl(120, 15%, 75%, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(35px);
  animation: pulseLiberacion 5s ease-in-out infinite 1s;
  pointer-events: none;
}

@keyframes pulseLiberacion {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.desafio-card.liberacion h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 600;
  background: linear-gradient(135deg, hsl(15, 65%, 55%) 0%, hsl(10, 70%, 65%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.desafio-card.liberacion ul {
  list-style: none;
}

.desafio-card.liberacion li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--foreground);
  line-height: 1.7;
  transition: transform 0.2s ease, color 0.2s ease;
}

.desafio-card.liberacion li:hover {
  transform: translateX(4px);
  color: var(--primary);
}

.desafio-card.liberacion li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: hsl(120, 40%, 50%);
  font-size: 1.3rem;
  font-weight: bold;
  animation: checkBounce 0.5s ease;
}

@keyframes checkBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
}

/* Problema */
.problema {
  background: var(--background);
}

.problema-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .problema-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.problema-card {
  padding: 2rem;
  background: var(--card);
  border-radius: 1.5rem;
  border: 2px solid var(--border);
  text-align: center;
  transition: all 0.3s ease;
}

.problema-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.problema-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.problema-icon svg {
  width: 100%;
  height: 100%;
}

.problema-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.problema-card p {
  color: var(--text-muted);
}

/* Mercado - Diseño Orgánico */
.estadisticas-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 3rem;
  position: relative;
  min-height: 600px;
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) {
  .estadisticas-grid {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    min-height: 500px;
    padding: 3rem 0;
    gap: 2.5rem;
  }
}

.estadistica-card {
  padding: 2rem;
  background: var(--card);
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 300px;
}

@media (min-width: 640px) {
  .estadistica-card {
    width: auto;
    min-width: 280px;
  }
  
  .estadistica-card:nth-child(1) {
    width: 290px;
  }
  
  .estadistica-card:nth-child(2) {
    width: 300px;
  }
  
  .estadistica-card:nth-child(3) {
    width: 285px;
  }
  
  .estadistica-card:nth-child(4) {
    width: 295px;
  }
}

/* Formas blob orgánicas para cada tarjeta de estadísticas */
.estadistica-card:nth-child(1) {
  border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
  transform: rotate(-1.5deg);
  animation: floatCard1 6s ease-in-out infinite;
}

@media (min-width: 640px) {
  .estadistica-card:nth-child(1) {
    margin-top: 0;
    margin-right: 0;
    transform: rotate(-1deg);
    align-self: flex-start;
  }
}

.estadistica-card:nth-child(2) {
  border-radius: 45% 55% 55% 45% / 55% 45% 55% 45%;
  transform: rotate(1.5deg);
  animation: floatCard2 6.5s ease-in-out infinite 0.5s;
}

@media (min-width: 640px) {
  .estadistica-card:nth-child(2) {
    margin-top: -1rem;
    margin-left: 0;
    transform: rotate(1.5deg);
    align-self: flex-start;
  }
}

.estadistica-card:nth-child(3) {
  border-radius: 50% 50% 55% 45% / 45% 55% 50% 50%;
  transform: rotate(-1deg);
  animation: floatCard3 6.2s ease-in-out infinite 1s;
}

@media (min-width: 640px) {
  .estadistica-card:nth-child(3) {
    margin-top: 1rem;
    margin-left: 0;
    transform: rotate(-0.5deg);
    align-self: flex-end;
  }
}

.estadistica-card:nth-child(4) {
  border-radius: 60% 40% 45% 55% / 50% 50% 50% 50%;
  transform: rotate(1deg);
  animation: floatCard4 6.3s ease-in-out infinite 1.5s;
}

@media (min-width: 640px) {
  .estadistica-card:nth-child(4) {
    margin-top: 0.5rem;
    margin-left: 0;
    transform: rotate(1deg);
    align-self: flex-end;
  }
}

.estadistica-card:hover {
  animation-play-state: paused;
  transform: translateY(-8px) rotate(0deg) scale(1.02) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.estadistica-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.estadistica-icon svg {
  width: 100%;
  height: 100%;
}

.estadistica-valor {
  font-size: 3rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.estadistica-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.estadistica-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Cómo Ayudamos */
.ayuda-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .ayuda-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ayuda-card {
  padding: 2.5rem;
  background: var(--card);
  border-radius: 1.5rem;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.ayuda-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.ayuda-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.ayuda-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.ayuda-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.ayuda-card ul {
  list-style: none;
}

.ayuda-card li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
}

.ayuda-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.25rem;
}

.open-source-badge {
  margin-top: 4rem;
  padding: 3rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: 2rem;
  text-align: center;
}

.open-source-badge h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
}

.open-source-badge p {
  font-size: 1.125rem;
  opacity: 0.95;
}

/* Servicios - Diseño Orgánico */
.servicios-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
  position: relative;
  min-height: 600px;
  justify-content: center;
  align-items: center;
}

@media (min-width: 768px) {
  .servicios-grid {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    min-height: 500px;
    padding: 3rem 0;
    gap: 3rem;
  }
}

.servicio-card {
  padding: 2.5rem;
  background: var(--card);
  border: none;
  text-align: left;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 380px;
}

@media (min-width: 768px) {
  .servicio-card {
    width: auto;
    min-width: 320px;
  }
  
  .servicio-card:nth-child(1) {
    width: 340px;
  }
  
  .servicio-card:nth-child(2) {
    width: 360px;
  }
  
  .servicio-card:nth-child(3) {
    width: 350px;
  }
}

/* Formas blob orgánicas para cada tarjeta - estilo más humano y asimétrico */
.servicio-card:nth-child(1) {
  border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
  transform: rotate(-2deg);
  animation: floatCard1 6s ease-in-out infinite;
}

@media (min-width: 768px) {
  .servicio-card:nth-child(1) {
    margin-top: 0;
    margin-right: 0;
    transform: rotate(-1.5deg);
    align-self: flex-start;
  }
}

.servicio-card:nth-child(2) {
  border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
  transform: rotate(1.5deg);
  animation: floatCard2 6.5s ease-in-out infinite 0.5s;
}

@media (min-width: 768px) {
  .servicio-card:nth-child(2) {
    margin-top: -2rem;
    margin-left: 0;
    transform: rotate(2deg);
    align-self: flex-start;
  }
}

.servicio-card:nth-child(3) {
  border-radius: 50% 50% 60% 40% / 40% 60% 50% 50%;
  transform: rotate(-1deg);
  animation: floatCard3 6.2s ease-in-out infinite 1s;
}

@media (min-width: 768px) {
  .servicio-card:nth-child(3) {
    margin-top: 1.5rem;
    margin-left: 0;
    transform: rotate(-0.5deg);
    align-self: flex-end;
  }
}

.servicio-card:hover {
  animation-play-state: paused;
  transform: translateY(-8px) rotate(0deg) scale(1.02) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.servicio-icon {
  width: 56px;
  height: 56px;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.servicio-icon i {
  display: block;
}

.servicio-card h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--foreground);
  text-align: left;
}

.servicio-card p {
  color: var(--text-muted);
  line-height: 1.7;
  text-align: left;
}

/* Casos de Uso - Carrusel */
.casos-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 2rem 0 4rem 0;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-left: calc(50vw - 600px + 2rem);
  padding-right: calc(50vw - 600px + 2rem);
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  touch-action: pan-y; /* Vertical: scroll página. Horizontal: lo maneja JS */
}

@media (max-width: 1200px) {
  .casos-scroll {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.casos-scroll::-webkit-scrollbar {
  display: none;
}

.casos-carousel {
  display: flex;
  gap: 0; /* Sin gap para evitar espacios visibles */
  width: max-content;
  padding-left: 1rem;
  padding-right: 1rem;
}

.caso-card {
  flex-shrink: 0;
  width: clamp(280px, 85vw, 380px);
  margin-right: 1.5rem; /* Gap como margin para evitar espacios visibles */
  padding: 2rem;
  background: var(--card);
  border-radius: 1.5rem;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.caso-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  z-index: 10;
  position: relative;
}

.caso-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.caso-icon svg {
  width: 100%;
  height: 100%;
}

.caso-sector {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.caso-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.caso-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.caso-card ul {
  list-style: none;
}

.caso-card li {
  padding: 0.5rem 0;
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.caso-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.25rem;
}

/* Timeline */
.timeline-section {
  background: #faf8f5;
  padding: 80px 0;
}

.timeline {
  max-width: 800px;
  margin: 3rem auto 0;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 3rem;
}

.timeline-number {
  position: absolute;
  left: -1.5rem;
  top: 0;
  width: 3rem;
  height: 3rem;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  border: 4px solid var(--background);
}

/* Formas orgánicas para cada timeline-number (similar a conciencia de mercado) */
.timeline-item:nth-child(1) .timeline-number {
  border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
  transform: rotate(-1.5deg);
}

.timeline-item:nth-child(2) .timeline-number {
  border-radius: 45% 55% 55% 45% / 55% 45% 55% 45%;
  transform: rotate(1.5deg);
}

.timeline-item:nth-child(3) .timeline-number {
  border-radius: 50% 50% 55% 45% / 45% 55% 50% 50%;
  transform: rotate(-1deg);
}

.timeline-item:nth-child(4) .timeline-number {
  border-radius: 60% 40% 45% 55% / 50% 50% 50% 50%;
  transform: rotate(1deg);
}

.timeline-content h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.timeline-date {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-content p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Contacto */
.contacto {
  background: var(--background);
}

.contact-form {
  max-width: 600px;
  margin: 3rem auto 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--foreground);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 65%, 55%, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  width: 100%;
  margin-top: 1rem;
}

.loader {
  display: inline-block;
}

/* Footer: por encima de la process line */
.footer {
  position: relative;
  z-index: 3; /* Por encima de la línea (z-index: 1) y contenido (z-index: 2) */
  background: var(--foreground);
  color: white;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-col h3,
.footer-col h4 {
  margin-bottom: 1rem;
  color: white;
}

.footer-col p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 1.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
  width: 100%;
  max-width: 500px;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toast-icon {
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-weight: 500;
  color: var(--foreground);
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.toast-close:hover {
  color: var(--foreground);
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animaciones de flotación para tarjetas orgánicas */
@keyframes floatCard1 {
  0%, 100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-12px) rotate(-1deg);
  }
}

@keyframes floatCard2 {
  0%, 100% {
    transform: translateY(0) rotate(2deg);
  }
  50% {
    transform: translateY(-15px) rotate(1.5deg);
  }
}

@keyframes floatCard3 {
  0%, 100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-10px) rotate(-0.2deg);
  }
}

@keyframes floatCard4 {
  0%, 100% {
    transform: translateY(0) rotate(1deg);
  }
  50% {
    transform: translateY(-13px) rotate(0.8deg);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 767px) {
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  
  section {
    padding: 60px 0;
  }
  
  .hero {
    padding: 100px 0 60px;
    min-height: auto;
  }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  transform: translateY(calc(100% + 1rem));
  transition: transform 0.5s cubic-bezier(0.43, 0.13, 0.23, 0.96);
  pointer-events: none;
}

.cookie-banner.show {
  transform: translateY(0);
  pointer-events: all;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--foreground);
  color: var(--background);
  padding: 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 2px solid hsl(15, 65%, 55%, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  position: relative;
}

.cookie-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  position: relative;
}

.cookie-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
  background-color: hsl(15, 65%, 55%, 0.1);
}

.cookie-icon svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.cookie-text {
  flex: 1;
}

.cookie-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--background);
}

.cookie-text p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.cookie-text a {
  color: hsl(15, 65%, 55%);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-text a:hover {
  color: hsl(15, 65%, 50%);
}

.cookie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--background);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

.cookie-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cookie-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--background);
}

.cookie-close svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    padding: 1.25rem;
  }
  
  .cookie-close {
    top: 0.75rem;
    right: 0.75rem;
  }
  
  .cookie-text h3 {
    font-size: 1.125rem;
  }
  
  .cookie-text p {
    font-size: 0.8125rem;
  }
}

/* Process Line: SIEMPRE visible y presente con el scroll */
.process-line {
  z-index: 1 !important; /* Visible, pero por debajo de contenido (z-index: 2+) */
  /* position: absolute viene del HTML inline, necesario para que se mueva con scroll */
}

/* Asegurar que el SVG y el path sean visibles y se rendericen */
#processSVG {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#processPath {
  pointer-events: none;
}

/* Main sin z-index para que la línea sea visible en el mismo contexto */
main {
  position: relative;
  /* Sin z-index para que la línea sea visible */
}

/* Móvil: línea muy discreta, pegada al borde, no molesta */
@media (max-width: 767px) {
  #processPath {
    stroke-width: 4 !important;
    opacity: 0.6 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08)) !important;
  }
}

/* Tablet: línea discreta, alejada de contenido */
@media (min-width: 768px) and (max-width: 1024px) {
  #processPath {
    stroke-width: 5 !important;
    opacity: 0.7 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
  }
}

/* Tarjetas, imágenes y contenido: SIEMPRE por encima de la línea */
.ventaja-card,
.desafio-card,
.problema-card,
.estadistica-card,
.ayuda-card,
.servicio-card,
.hero-image,
.hero-img {
  position: relative;
  z-index: 2; /* Por encima de la línea (z-index: 1) */
}

.casos-scroll,
.casos-carousel,
.caso-card {
  position: relative;
  z-index: 2;
}

.section-title,
.section-subtitle,
.hero-text,
.timeline-section .container > h2,
.timeline-section .container > p,
.timeline,
.timeline-item,
.contacto .section-title,
.contacto .section-subtitle,
.contact-form,
.open-source-badge,
.desafio .container > h2,
.problema .container > h2,
.problema .container > p,
.mercado .container > h2,
.mercado .container > p,
.como-ayudamos .container > h2,
.servicios .container > h2,
.casos-uso .container > h2,
.casos-uso .container > p {
  position: relative;
  z-index: 3; /* Por encima de la línea (z-index: 1) */
}

/* Títulos especialmente por encima de la línea */
.section-title {
  z-index: 4 !important;
}
