/* ==========================================================================
   KARU SOFT SpA — ESTILOS GLOBALES & SISTEMA DE DISEÑO AWWWARDS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Syne:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Paleta cromática corporativa Karu Soft */
  --bg-deep: #050811;
  --bg-surface: #0a1122;
  --bg-surface-elevated: #101c36;
  --bg-card: rgba(16, 28, 54, 0.65);
  
  --primary: #00d2ff;
  --primary-glow: rgba(0, 210, 255, 0.35);
  --primary-hover: #38bdf8;
  
  --cobalt: #0052cc;
  --cobalt-dark: #003380;
  
  --emerald: #00f5a0;
  --emerald-glow: rgba(0, 245, 160, 0.3);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 210, 255, 0.3);
  --border-glow: rgba(0, 210, 255, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Curvas y transiciones fluidas Awwwards */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-normal: 0.4s var(--ease-expo);
  --transition-slow: 0.8s var(--ease-expo);
  
  /* Fuentes */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-deep);
}

/* Selector universal accesible :focus-visible (Defecto 1 resuelto) */
a:focus-visible, 
button:focus-visible, 
select:focus-visible, 
input:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

/* Fondo decorativo con gradiente de malla (Defecto 5 resuelto: inset 0; 100%) */
.mesh-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle at 15% 15%, rgba(0, 82, 204, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.09) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(0, 245, 160, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, #050811 0%, #060c18 100%);
}

/* Rejilla de fondo sutil con máscara radial */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

/* Tipografía especializada */
.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   TAMAÑO EXACTO DEL TITULAR H1 (Página Index)
   Ajusta aquí el tamaño: puedes usar rem (ej: 3.2rem) o píxeles (ej: 52px)
   ========================================================================== */
.hero-headline {
  /* Tamaño en pantallas medianas y grandes (Desktop): */
  font-size: 3.3rem;           /* 👈 CAMBIA AQUÍ el tamaño (ej: 3.2rem, 3.6rem, 54px) */
  line-height: 1.12;           /* Espaciado entre líneas (1.08 a 1.20) */
  letter-spacing: -0.03em;     /* Espaciado entre letras */
}

/* Tamaño adaptado automáticamente para celulares */
@media (max-width: 768px) {
  .hero-headline {
    font-size: 2.15rem;        /* 👈 CAMBIA AQUÍ el tamaño en celulares (ej: 2.0rem, 34px) */
    line-height: 1.18;
  }
}

/* Textos con gradiente vivo */
.text-gradient-cyan {
  background: linear-gradient(135deg, #ffffff 10%, #00d2ff 60%, #0052cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #ffffff 20%, #00f5a0 70%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Contenedor central de contenido */
.container-custom {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Tarjetas Glassmorphic con micro-interacción hover física (Defecto 7 resuelto) */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 30px -10px var(--primary-glow);
}

/* Botones interactivos Awwwards */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #00d2ff 0%, #0084ff 100%);
  color: #030712;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 1.8rem;
  border-radius: 9999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(0, 210, 255, 0.6);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 1.8rem;
  border-radius: 9999px;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  box-shadow: 0 0 35px rgba(37, 211, 102, 0.55);
}

/* Badge con pulso de luz */
.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(0, 245, 160, 0.08);
  border: 1px solid rgba(0, 245, 160, 0.25);
  color: var(--emerald);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 245, 160, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 160, 0); }
}

/* Animaciones de Scroll Reveal nativo */
.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Retardos escalonados para listas de tarjetas */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Acordeón interactivo */
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
}

.faq-icon {
  transition: transform var(--transition-normal);
  color: var(--primary);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-expo), opacity 0.4s var(--ease-expo);
  opacity: 0;
}

.faq-item.open .faq-content {
  max-height: 400px;
  opacity: 1;
  padding-bottom: 1.5rem;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Estilos de pestañas (Tabs) interactivas con transición fluida (Defecto 3 resuelto) */
.tab-btn {
  padding: 0.8rem 1.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: rgba(0, 210, 255, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease-expo), transform 0.35s var(--ease-expo);
}

.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Barra de progreso de lectura superior */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0052cc, #00d2ff, #00f5a0);
  z-index: 100;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 210, 255, 0.4);
}

/* ==========================================================================
   CANVAS DE CIRCUITOS VIVOS & ESCENARIO 3D TILT AWWWARDS
   ========================================================================== */

/* Canvas interactivo de raíces y circuitos del Hero */
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

#hero-circuit-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
}

/* Escenario en perspectiva 3D (Parallax Tilt estilo Linear/Stripe) */
.perspective-stage {
  perspective: 1400px;
  transform-style: preserve-3d;
}

.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease-out;
  will-change: transform;
}

/* Flotación sutil en 3D cuando el usuario no está interactuando con el ratón */
@keyframes tilt-idle-float {
  0%, 100% {
    transform: perspective(1400px) rotateX(2deg) rotateY(-3deg) translateY(0px);
  }
  50% {
    transform: perspective(1400px) rotateX(-2deg) rotateY(3deg) translateY(-8px);
  }
}

.tilt-card.idle-float {
  animation: tilt-idle-float 7s ease-in-out infinite;
}

/* Capas con profundidad Z independiente dentro de la tarjeta 3D */
.tilt-depth-back {
  transform: translateZ(12px);
  transform-style: preserve-3d;
}

.tilt-depth-mid {
  transform: translateZ(30px);
  transform-style: preserve-3d;
}

.tilt-depth-front {
  transform: translateZ(52px);
  transform-style: preserve-3d;
}

/* Resplandor dinámico de superficie (Glare sheen) */
.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(0, 210, 255, 0.18) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  mix-blend-mode: overlay;
  z-index: 10;
}

