/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL 3D
   ========================================================================== */
@font-face {
  font-family: 'Klaxon';
  src: local('Klaxon'), local('Klaxon-Regular');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg-dark-base: #0b0c10;
  --bg-light: #F5F5F7;
  --primary-color: #5D7BE9;
  --primary-glow: rgba(93, 123, 233, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.6);
  --text-dark: #111113;
  --text-muted: #52525A;
  --text-white: #FFFFFF;
  --text-white-muted: #E2E8F0;

  --font-heading: 'Klaxon', 'Poppins', 'Helvetica Neue', sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-code: 'Fira Code', 'Courier New', monospace;
}

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

body {
  font-family: var(--font-body);
  overflow-x: hidden;
  background-color: var(--bg-light);
  color: var(--text-dark);
  perspective: 1000px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

.relative-section {
  position: relative;
  overflow: hidden;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ==========================================================================
   2. ESCENA 3D DE FONDO & CURSOR GLOW
   ========================================================================== */
.bg-3d-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: floatOrb 14s ease-in-out infinite alternate;
  will-change: transform;
}

.orb-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #5D7BE9 0%, rgba(93, 123, 233, 0) 70%);
  top: -80px;
  left: -80px;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #8A2BE2 0%, rgba(138, 43, 226, 0) 70%);
  bottom: -120px;
  right: -80px;
  animation-delay: -4s;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #00D2FF 0%, rgba(0, 210, 255, 0) 70%);
  top: 40%;
  left: 50%;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 123, 233, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 99;
  mix-blend-mode: multiply;
  will-change: left, top;
}

/* ==========================================================================
   3. ESTILOS GLASSMORPHISM (OPTIMIZADOS)
   ========================================================================== */
.glass-card {
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(93, 123, 233, 0.15),
    transparent 40%
  ), rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.25s ease;
  transform-style: preserve-3d;
  position: relative;
  z-index: 2;
  will-change: transform;
}

.glass-card-blue {
  background: linear-gradient(135deg, rgba(93, 123, 233, 0.88), rgba(70, 95, 210, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 15px 35px rgba(93, 123, 233, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  color: #FFFFFF;
  transform-style: preserve-3d;
  position: relative;
  z-index: 2;
}

.glass-btn {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.7);
}

.glass-text-title {
  font-size: 4.2rem;
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(17, 17, 19, 0.98) 0%, rgba(93, 123, 233, 0.8) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0px 6px 12px rgba(255, 255, 255, 0.8));
}

.glass-text-title .highlight {
  background: linear-gradient(135deg, #5D7BE9 0%, #8A2BE2 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glass-text-slogan {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 30px;
  background: linear-gradient(135deg, rgba(17, 17, 19, 0.9) 0%, rgba(82, 82, 90, 0.7) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   4. HERO & ÁREA DE CÓDIGO A PANTALLA COMPLETA
   ========================================================================== */
.hero-fullscreen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 8% 60px;
  overflow: hidden;
}

.navbar-hero {
  position: absolute;
  top: 25px;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  padding: 12px 25px;
}

.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 48px; width: auto; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; line-height: 1; color: var(--text-dark); letter-spacing: 0.5px; }
.brand-sub { font-family: var(--font-heading); font-size: 0.62rem; color: var(--primary-color); letter-spacing: 1.5px; margin-top: 3px; }

.vertical-code-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  padding: 80px 20px 20px 20px;
  z-index: 1;
  pointer-events: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  transform: translateZ(0);
}

.code-editor-stream {
  width: 100vw;
  max-width: none;
  height: 100vh;
  overflow-y: hidden;
  font-family: var(--font-code);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-dark);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  contain: layout style;
}

.code-stream-line {
  white-space: pre;
  display: flex;
  flex-wrap: wrap;
}

.typing-cursor {
  display: inline-block;
  font-weight: 800;
  color: var(--primary-color);
  animation: blinkCursor 0.7s infinite alternate;
  margin-left: 2px;
}

@keyframes blinkCursor {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
  text-align: center;
  margin: 0 auto;
  padding: 40px 30px;
  border-radius: 36px;
  pointer-events: auto;
}

.hero-glass-blur {
  /* Al subir el último número (0.85), el blanco se vuelve más sólido y tapa más lo de atrás */
  background: rgba(245, 245, 247, 0.85) !important; 
  
  /* Con 30px o 40px es más que suficiente para el efecto cristal */
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--primary-color);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tech-tag .dot { width: 6px; height: 6px; background: var(--primary-color); border-radius: 50%; }
.hero-btns { display: flex; justify-content: center; gap: 15px; }

.btn {
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
  cursor: pointer;
  position: relative;
  will-change: transform;
}

.btn-primary {
  background: var(--primary-color);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 10px 25px rgba(93, 123, 233, 0.5);
}

.btn-outline {
  border: 1.5px solid var(--primary-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: #FFFFFF;
}

.code-char {
  display: inline-block;
  cursor: pointer;
  user-select: none;
  will-change: transform, opacity;
  position: relative;
  padding: 0;
  margin: 0;
  pointer-events: auto;
}

.code-char.scattered {
  z-index: 50;
}

/* ==========================================================================
   5. ESCÁNER CIBERNÉTICO EN IMÁGENES DEL PORTAFOLIO
   ========================================================================== */
.project-img-wrapper {
  width: 100%;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.3);
  position: relative;
}

.project-img-wrapper::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(93, 123, 233, 0.35),
    rgba(255, 255, 255, 0.8),
    rgba(93, 123, 233, 0.35),
    transparent
  );
  opacity: 0;
  pointer-events: none;
}

.portfolio-card:hover .project-img-wrapper::after {
  opacity: 1;
  animation: scanBeam 1.5s ease-in-out infinite;
}

@keyframes scanBeam {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ==========================================================================
   6. CÓDIGO AMBIENTAL DESENFOCADO EN DEMÁS SECCIONES (VELOCIDAD EN 90s)
   ========================================================================== */
.ambient-code-bg {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  filter: blur(4px);
  overflow: hidden;
}

.code-ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  font-family: var(--font-code);
  will-change: transform;
}

.ticker-block {
  display: flex;
  white-space: nowrap;
}

.ambient-ticker {
  font-size: 3.5rem;
  font-weight: 700;
  animation: seamlessTicker 90s linear infinite;
}

.reverse-ticker {
  animation-direction: reverse;
}

@keyframes seamlessTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* SYNTAX HIGHLIGHTING */
.token-kwd { color: #9A3412; font-weight: bold; }   
.token-cls { color: #854D0E; font-weight: bold; }   
.token-str { color: #15803D; }                      
.token-var { color: #4338CA; }                      
.token-prop { color: #0284C7; }                     
.token-num { color: #B45309; }                      
.token-bool { color: #B45309; font-weight: bold; }  
.token-fn { color: #1D4ED8; font-weight: bold; }    
.token-punct { color: #475569; }                   
.token-comment { color: #64748B; font-style: italic; }

/* ==========================================================================
   7. SECCIONES Y CONTENIDOS
   ========================================================================== */
.section-blue-glass {
  background: linear-gradient(135deg, rgba(93, 123, 233, 0.9), rgba(70, 95, 210, 0.95));
  backdrop-filter: blur(16px);
  padding: 90px 8%;
  color: #FFFFFF;
}

.section-header { position: relative; z-index: 2; }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.stat-item { padding: 30px 25px; }
.stat-number { font-size: 1.4rem; color: var(--primary-color); font-weight: 800; margin-bottom: 8px; }

/* SECCIÓN PORTAFOLIO */
.portfolio-section { padding: 90px 8%; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.portfolio-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.portfolio-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 20px 45px rgba(93, 123, 233, 0.22);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.35s ease;
}

.portfolio-card:hover .project-img { transform: scale(1.05); }

.project-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary-color);
  background: rgba(93, 123, 233, 0.12);
  padding: 5px 12px;
  border-radius: 15px;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  border: 1px solid rgba(93, 123, 233, 0.2);
}

.project-title { font-size: 1.45rem; margin-bottom: 10px; color: var(--text-dark); }
.project-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 22px; }

.project-btn {
  width: 100%;
  text-align: center;
  font-weight: 700;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.project-btn:hover { background: var(--primary-color); color: #FFFFFF; }

/* SECCIÓN COTIZADOR */
.configurator-section { padding: 90px 8%; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-tag { font-size: 0.75rem; letter-spacing: 2px; color: var(--primary-color); font-weight: 700; display: block; margin-bottom: 8px; }
.section-title { font-size: 2.3rem; }
.section-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 6px; }

.configurator-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
  position: relative;
  z-index: 2;
}

.step-box { padding: 25px; margin-bottom: 25px; }
.step-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 15px; }
.step-title span { color: var(--primary-color); margin-right: 6px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }

.chip-btn {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover { background: rgba(93, 123, 233, 0.15); transform: translateY(-2px); }

.chip-btn.selected {
  background: var(--primary-color);
  color: #FFFFFF;
  border-color: var(--primary-color);
  box-shadow: 0 6px 16px rgba(93, 123, 233, 0.4);
}

.config-card { padding: 35px 28px; position: sticky; top: 40px; }
.card-top { display: flex; justify-content: space-between; font-size: 0.75rem; color: rgba(255, 255, 255, 0.8); font-weight: 700; letter-spacing: 1px; margin-bottom: 15px; }

.progress-bar-container { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.25); border-radius: 3px; margin-bottom: 25px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: #FFFFFF; transition: width 0.3s ease; }

.summary-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.85rem; border-bottom: 1px dashed rgba(255, 255, 255, 0.25); padding-bottom: 8px; }
.summary-row .lbl { color: rgba(255, 255, 255, 0.8); font-weight: 600; }
.summary-row .val { color: #FFFFFF; font-weight: 700; text-align: right; max-width: 60%; }

.quote-result-box { background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); padding: 14px; border-radius: 12px; text-align: center; margin-bottom: 20px; }
.quote-result-box small { color: rgba(255, 255, 255, 0.8); font-size: 0.7rem; display: block; margin-bottom: 4px; }
#quoteStatusText { font-weight: 700; font-size: 0.9rem; color: #FFFFFF; }

.btn-whatsapp-card {
  width: 100%;
  background: #FFFFFF;
  color: var(--primary-color);
  padding: 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp-card:hover { transform: scale(1.02); box-shadow: 0 10px 25px rgba(255, 255, 255, 0.4); }
.card-features-mini { display: flex; justify-content: space-around; font-size: 0.72rem; color: rgba(255, 255, 255, 0.85); margin-top: 15px; }

/* SECCIÓN PAQUETES */
.pricing-section { padding: 90px 8%; }
.table-container { padding: 25px; overflow: hidden; position: relative; z-index: 2; }
.table-wrapper { width: 100%; overflow-x: auto; }

.comparison-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.92rem; color: var(--text-dark); }
.comparison-table th, .comparison-table td { padding: 16px 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); vertical-align: middle; }
.comparison-table thead th { border-bottom: 2px solid rgba(93, 123, 233, 0.3); padding-bottom: 20px; }

.col-feature { width: 25%; font-weight: 800; color: var(--text-dark); font-size: 1rem; }
.col-plan { width: 25%; text-align: center; }

.plan-badge { font-size: 0.8rem; font-weight: 800; padding: 8px 16px; border-radius: 20px; display: inline-block; letter-spacing: 0.5px; }
.badge-green { background: rgba(0, 168, 107, 0.15); color: #00A86B; }
.badge-blue { background: rgba(93, 123, 233, 0.15); color: var(--primary-color); }
.badge-purple { background: rgba(138, 43, 226, 0.15); color: #8A2BE2; }

.col-popular-bg { background-color: rgba(93, 123, 233, 0.06); }
.col-popular { background-color: rgba(93, 123, 233, 0.06); border-top-left-radius: 12px; border-top-right-radius: 12px; }

.feat-title { font-weight: 700; color: var(--text-dark); }
.comparison-table tbody tr:hover { background-color: rgba(93, 123, 233, 0.05); }

.icon-check { color: #00A86B; font-weight: bold; font-size: 1.1rem; }
.icon-cross { color: #E53E3E; font-weight: bold; font-size: 1.1rem; }

.btn-outline-table {
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: all 0.25s ease;
}

.btn-outline-table:hover { background: var(--primary-color); color: #FFFFFF; }
.comparison-table tfoot td { border-bottom: none; padding-top: 25px; text-align: center; }

/* ==========================================================================
   8. BOTÓN FLOTANTE Y ANIMACIONES
   ========================================================================== */
.pulse-glow { animation: pulseGlow 3s infinite alternate; }

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px var(--primary-glow); }
  100% { box-shadow: 0 0 25px rgba(93, 123, 233, 0.8); }
}

.whatsapp-float { position: fixed; bottom: 25px; right: 25px; z-index: 999; text-decoration: none; }

.whatsapp-icon-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(93, 123, 233, 0.35);
  transition: transform 0.25s ease;
}

.whatsapp-float:hover .whatsapp-icon-wrapper { transform: scale(1.08); }
.whatsapp-svg { width: 28px; height: 28px; fill: #FFFFFF; }
.online-indicator { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; background: #00FF88; border: 2px solid #FFFFFF; border-radius: 50%; }

.footer { text-align: center; padding: 40px 8%; color: var(--text-muted); margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 15px; position: relative; z-index: 2; }
.footer-brand { justify-content: center; }

/* ==========================================================================
   9. OPTIMIZACIÓN MÓVIL
   ========================================================================== */
@media (max-width: 768px) {
  .hero-fullscreen { padding: 90px 5% 60px; }
  .navbar-hero { top: 15px; left: 5%; right: 5%; }
  .brand-logo { height: 34px; }
  .brand-name { font-size: 0.95rem; }
  .brand-sub { font-size: 0.52rem; }
  .nav-btn { padding: 8px 16px; font-size: 0.78rem; }
  .glass-text-title { font-size: 2.3rem; }
  .glass-text-slogan { font-size: 1rem; }
  .hero-btns { flex-direction: column; gap: 10px; }
  .btn { padding: 11px 20px; font-size: 0.85rem; }
  .code-editor-stream { font-size: 1.3rem; }
  .hero-content { padding: 25px 15px; }
  .portfolio-section, .configurator-section, .section-blue-glass, .pricing-section { padding: 50px 5%; }
  .section-title { font-size: 1.6rem; }
  .portfolio-card { padding: 20px; min-height: auto; }
  .project-img-wrapper { height: 160px; }
  .configurator-container { grid-template-columns: 1fr; gap: 20px; }
  .step-box { padding: 18px 15px; }
  .step-title { font-size: 0.95rem; }
  .chip-btn { padding: 8px 14px; font-size: 0.8rem; }
  .config-card { position: static; padding: 25px 20px; }
  .comparison-table th, .comparison-table td { padding: 12px 10px; font-size: 0.82rem; }
  .col-feature { min-width: 130px; }
  .whatsapp-float { bottom: 18px; right: 18px; }
  .whatsapp-icon-wrapper { width: 44px; height: 44px; }
  .whatsapp-svg { width: 22px; height: 22px; }
}