/* ========================================
   BASE
   ======================================== */
:root {
  /* Colores */
  --color-primary: #667eea;
  --color-secondary: #764ba2;
  --color-accent: #1DA1F2;
  --color-text: #e0e0e0;
  --color-text-muted: #a3a3a3;
  --color-bg: #0B0B0B;
  --color-bg-card: #121212;
  --color-bg-input: #1a1a1a;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-success: #10b981;

   --accent-3: #00E6A8;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-button: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-button-hover: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  
  /* Sombras y efectos */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  --glow-soft: 0 0 40px rgba(102, 126, 234, 0.15);
  
  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transiciones */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.2s ease;
  --transition-slow: all 0.5s ease;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Animaciones */
  --animation-fade-in: fade-in 0.6s ease-out forwards;
  --animation-slide-up: slide-up 0.5s ease-out forwards;
  
  /* Fuentes */
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Playfair Display', Georgia, serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

input,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ========================================
   ANIMACIONES GLOBALES
   ======================================== */

/* Keyframes para fade-in */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Keyframes para slide-up */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Keyframes para slide-in desde los lados */
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Keyframes para scale-in suave */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Keyframes para gradientShift de botones */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Keyframes float para elementos del ecosystem */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ========================================
   CLASES DE ANIMACIÓN
   ======================================== */

/* Fade-in básico */
.animate-fade-in {
  animation: var(--animation-fade-in);
}

/* Slide-up para secciones */
.animate-slide-up {
  animation: var(--animation-slide-up);
}

/* Slide-in desde izquierda */
.animate-slide-in-left {
  animation: slide-in-left 0.5s ease-out forwards;
}

/* Slide-in desde derecha */
.animate-slide-in-right {
  animation: slide-in-right 0.5s ease-out forwards;
}

/* Scale-in suave */
.animate-scale-in {
  animation: scale-in 0.4s ease-out forwards;
}

/* ========================================
   TRANSICIONES GLOBALES
   ======================================== */

/* Transición suave para elementos interactivos */
.transition-base {
  transition: var(--transition-base);
}

.transition-fast {
  transition: var(--transition-fast);
}

.transition-smooth {
  transition: var(--transition-smooth);
}

/* ========================================
   EFECTOS HOVER FLUIDOS
   ======================================== */

/* Hover suave para botones */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Hover con escala sutil */
.hover-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
  transform: scale(1.03);
}

/* Hover con brillo */
.hover-glow {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hover-glow:hover {
  box-shadow: var(--glow-soft);
}

/* Hover para tarjetas */
.hover-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Hover para enlaces con underline animado */
.hover-underline {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.hover-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.hover-underline:hover::after {
  width: 100%;
}

/* ========================================
   ANIMACIONES PARA SECCIONES (SCROLL)
   ======================================== */

/* Secciones con fade-in al aparecer */
section {
  animation: fade-in 0.8s ease-out;
}

/* Stagger para elementos hijos (delay escalonado) */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ========================================
   UTILIDADES DE OPACIDAD
   ======================================== */

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ========================================
   MEJORAS DE RENDIMIENTO
   ======================================== */

/* Acelerar hardware para animaciones */
.will-animate {
  will-change: transform, opacity;
}

/* Reducir movimiento para usuarios sensibles */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   UTILIDADES
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================================
   RESPONSIVE GLOBAL - MOBILE FIRST
   ======================================== */
@media (max-width: 768px) {
  /* Mejoras de legibilidad en mobile */
  body {
    font-size: 0.9375rem; /* 15px base */
    line-height: 1.65;
  }

  /* Contenedor responsivo */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Ajustar márgenes entre secciones */
  section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Títulos de sección más legibles */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 2.5rem;
    line-height: 1.25;
  }

  /* Párrafos con mejor spacing */
  p {
    line-height: 1.7;
    margin-bottom: 1rem;
  }

  /* ========================================
     BOTONES - Tamaño táctil mínimo 44px
     ======================================== */
  .btn {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }

  .btn--primary,
  .btn--secondary {
    min-height: 48px;
  }

  /* Botones de enlace en cards */
  .card__link {
    min-height: 44px;
    padding: 0.625rem 1.25rem;
  }

  /* Botón de contacto */
  .contact__button {
    min-height: 48px;
  }

  /* ========================================
     MEJORAS ADICIONALES DE TOQUE
     ======================================== */
  
  /* Inputs táctiles */
  .contact__input,
  .contact__textarea {
    min-height: 48px;
    font-size: 1rem; /* Evita zoom en iOS */
  }

  /* Links con área táctil adecuada */
  a,
  .contact__email a {
    min-height: 44px;
    padding: 0.25rem 0;
  }

  /* Badges táctiles */
  .hero__badge,
  .card__type {
    padding: 0.375rem 0.875rem;
  }

  /* ========================================
     MEJORAS DE SPACING
     ======================================== */
  
  /* Reducir spacing en hero */
  .hero {
    padding: 5rem 1rem 3rem;
  }

  /* Ajustar servicios */
  .services {
    padding: 3.5rem 1rem 3rem;
  }

  .services__grid {
    gap: 1.25rem;
  }

  /* Ajustar portafolio */
  .portfolio {
    padding: 3rem 1rem;
  }

  .portfolio__grid {
    gap: 1.25rem;
  }

  /* Ajustar contacto */
  .contact {
    padding: 3rem 1rem;
  }

  .contact__description {
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 2rem;
  }
}

.section-title {
  font-family: var(--font-primary);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

/* ========================================
   BOTONES
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  min-height: 52px;
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-button);
  background-size: 200% 200%;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  animation: gradientShift 5s ease infinite;
}

.btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4), var(--glow-soft);
  filter: brightness(1.1);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn__text {
  position: relative;
  z-index: 1;
}

.btn__icon {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
  position: relative;
  z-index: 1;
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

.btn__shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
  z-index: 0;
}

.btn:hover .btn__shine {
  left: 100%;
}

/* ========================================
   ECOSYSTEM - Distribución Circular
   ======================================== */

.ecosystem {
  padding: 5rem 1rem;
}

.ecosystem-container {
  position: relative;
  width: 420px;
  height: 420px;
  margin: 0 auto;
}

.ecosystem-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ecosystem-center {
  animation: pulse 4s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.ecosystem-center img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.ecosystem-item {
  position: absolute;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecosystem-item img {
  filter: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
  animation: float-vertical 3s ease-in-out infinite;
  
}

/* Posicionamiento de cada item - manteniendo solo animación base float */
.ecosystem-item.item-1 {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.ecosystem-item.item-1 img {
  animation-delay: 0s;
}

.ecosystem-item.item-2 {
  top: 70px;
  right: 55px;
}

.ecosystem-item.item-2 img {
  animation-delay: 0.3s;
}

.ecosystem-item.item-3 {
  bottom: 70px;
  right: 55px;
}

.ecosystem-item.item-3 img {
  animation-delay: 0.6s;
}

.ecosystem-item.item-4 {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.ecosystem-item.item-4 img {
  animation-delay: 0.9s;
}

.ecosystem-item.item-5 {
  bottom: 70px;
  left: 55px;
}

.ecosystem-item.item-5 img {
  animation-delay: 1.2s;
}

.ecosystem-item.item-6 {
  top: 70px;
  left: 55px;
}

.ecosystem-item.item-6 img {
  animation-delay: 1.5s;
}

/* Animación de aparición para líneas SVG */
.ecosystem-lines line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  stroke-opacity: 0.6;
  filter: drop-shadow(0 0 4px var(--color-accent));
  animation: 
    line-draw 2.5s ease-out forwards,
    line-glow 4s ease-in-out infinite;
}

.ecosystem-lines line:nth-child(1) { 
  animation-delay: 0.1s, 0s; 
}
.ecosystem-lines line:nth-child(2) { 
  animation-delay: 0.2s, 0.2s; 
}
.ecosystem-lines line:nth-child(3) { 
  animation-delay: 0.4s, 0.4s; 
}
.ecosystem-lines line:nth-child(4) { 
  animation-delay: 0.4s, 0.6s; 
}
.ecosystem-lines line:nth-child(5) { 
  animation-delay: 0.8s, 0.8s; 
}
.ecosystem-lines line:nth-child(6) { 
  animation-delay: 1s, 1s; 
}

@keyframes line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Animación de glow pulsante para líneas SVG */
@keyframes line-glow {
  0%, 100% {
    stroke-opacity: 0.4;
    filter: drop-shadow(0 0 2px var(--color-accent));
  }
  50% {
    stroke-opacity: 1;
    filter: drop-shadow(0 0 8px var(--color-accent)) drop-shadow(0 0 12px var(--color-accent));
  }
}

/* Keyframe específico para ecosystem - solo translateY para no sobrescribir transform del posicionamiento */
@keyframes float-vertical {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* ============================================
   MICRO-ANIMACIONES GLOBALES — INNOVA TEAM
   Pega este bloque al final de tu base.css
   ============================================ */

/* ── Scroll Reveal — estado inicial ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal="left"]  { transform: translateX(-24px); }
[data-reveal="right"] { transform: translateX(24px); }
[data-reveal="scale"] { transform: scale(0.93) translateY(12px); }
[data-reveal="fade"]  { transform: none; }

/* Estado visible */
[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Respeta preferencias del usuario */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Cursor personalizado ── */
#innova-cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: #00E6A8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.cursor-ring {
  position: absolute;
  width: 28px; height: 28px;
  border: 1.5px solid rgba(102, 126, 234, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width  0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease,
    background   0.3s ease;
}

#innova-cursor.is-hovering .cursor-ring {
  width: 44px; height: 44px;
  border-color: rgba(102, 126, 234, 0.7);
  background: rgba(102, 126, 234, 0.06);
}

#innova-cursor.is-hovering .cursor-dot {
  transform: translate(-50%, -50%) scale(0);
}

/* Ocultar cursor nativo cuando el custom está activo */
body:has(#innova-cursor) {
  cursor: none;
}
body:has(#innova-cursor) a,
body:has(#innova-cursor) button {
  cursor: none;
}

/* ── Navbar link activo ── */
.navbar__link.is-active {
  color: #00E6A8 !important;
}

/* ── Hover en cards — micro-lift ── */
.card--service {
  transition:
    transform   0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease,
    box-shadow   0.3s ease !important;
}

/* ── Smooth scroll global ── */
html {
  scroll-behavior: smooth;
}

/* ── Focus visible mejorado ── */
:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Transición suave en links ── */
a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* ── Page transition — fade in al cargar ── */
body {
  animation: pageLoad 0.4s ease both;
}

@keyframes pageLoad {
  from { opacity: 0; }
  to   { opacity: 1; }
}