/* =========================================
   VARIABLES & SETUP (GLASSMORPHISM PREMIUM)
========================================= */
:root {
  --bg-base: #030712; 
  --surface: rgba(15, 23, 42, 0.4);
  --surface-hover: rgba(30, 41, 59, 0.6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #2dd4bf; 
  --accent-glow: rgba(45, 212, 191, 0.15);
  --purple-glow: rgba(124, 58, 237, 0.1);
  --border-light: rgba(255, 255, 255, 0.08);
  
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  /* Colores de Marca Proyectos */
  --mega-green: #009639;
  --mega-yellow: #FFD100;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Mesh para profundidad */
.bg-mesh {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -1;
  background: 
    radial-gradient(circle at 15% 50%, var(--purple-glow), transparent 35%),
    radial-gradient(circle at 85% 20%, var(--accent-glow), transparent 35%);
  filter: blur(80px);
}

/* =========================================
   HEADER & NAVEGACIÓN
========================================= */
.site-header {
  position: fixed;
  top: 0; width: 100%;
  z-index: 100;
  padding: 20px 0;
  background: linear-gradient(to bottom, rgba(3,7,18,0.9) 0%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.main-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.logo-bracket { color: var(--accent); }

.nav-group { display: flex; align-items: center; gap: 20px; }

.lang-toggle button {
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.lang-toggle button:hover, .lang-toggle button.active { color: var(--accent); }

.btn-quote {
  padding: 8px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-quote:hover {
  background: var(--text-primary);
  color: var(--bg-base);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* =========================================
   ASIDE (REDES SOCIALES FLOTANTES)
========================================= */
.social-sidebar {
  position: fixed;
  left: 40px; top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 50;
}
@media (max-width: 1024px) { .social-sidebar { display: none; } }

.social-sidebar a {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  writing-mode: vertical-rl;
  transition: var(--transition);
}
.social-sidebar a:hover { color: var(--accent); transform: translateY(-4px); }
.sidebar-line { width: 1px; height: 60px; background: var(--border-light); }

/* =========================================
   CONTENEDOR PRINCIPAL
========================================= */
.content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 140px 24px 40px;
}

/* =========================================
   HERO SECTION
========================================= */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
  min-height: 65vh;
}
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; text-align: center; gap: 40px; }
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 100px;
  background: rgba(45, 212, 191, 0.05);
  border: 1px solid rgba(45, 212, 191, 0.2);
  font-size: 13px; color: var(--accent);
  margin-bottom: 24px;
  font-family: var(--font-heading);
  font-weight: 500;
}
.pulse-dot { 
    width: 8px; 
    height: 8px; 
    background: var(--accent); 
    border-radius: 50%; 
    box-shadow: 0 0 10px var(--accent); 
    animation: pulse 2s infinite; 
}

.glitch-text {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.hero-desc { font-size: 1.125rem; color: var(--text-secondary); max-width: 550px; margin-bottom: 32px; }
@media (max-width: 900px) { .hero-desc { margin: 0 auto 32px; } }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 900px) { .hero-actions { justify-content: center; } }

.btn-primary, .btn-secondary {
  display: inline-flex; justify-content: center; align-items: center;
  padding: 12px 28px; border-radius: 12px; font-weight: 600; text-decoration: none; font-size: 15px; transition: var(--transition);
}
.btn-primary { background: var(--text-primary); color: var(--bg-base); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(255,255,255,0.1); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-secondary:hover { border-color: var(--accent); }

/* FOTOGRAFÍA HERO */
.hero-visual { position: relative; display: flex; justify-content: center; }
.image-container {
  width: 100%; max-width: 320px; aspect-ratio: 4/5;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, var(--border-light), var(--accent-glow));
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8);
  animation: float 6s ease-in-out infinite;
}
.profile-img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; z-index: 2; position: relative; }
.image-fallback {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b); border-radius: 22px;
}

.visual-badge {
  position: absolute;
  bottom: -15px; right: 10%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  padding: 10px 18px;
  border-radius: 100px;
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  display: flex; gap: 8px; align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* =========================================
   BENTO GRID (About & Skills)
========================================= */
.bento-section { margin-top: 100px; }
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .bento-grid { grid-template-columns: 1fr; } }

.bento-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.bento-box:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.15); transform: translateY(-4px); }

.span-2 { grid-column: span 2; }
@media (max-width: 768px) { .span-2 { grid-column: span 1; } }

.focus-box h2 { font-family: var(--font-heading); font-size: 24px; margin-bottom: 16px; }
.focus-box p { color: var(--text-secondary); margin-bottom: 24px; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { 
  font-family: var(--font-heading); font-size: 12px; font-weight: 600; 
  padding: 6px 14px; border-radius: 100px; 
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-light); 
  color: var(--text-primary);
}

.stat-box { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.stat-number { font-family: var(--font-heading); font-size: 3.5rem; font-weight: 900; color: var(--text-primary); line-height: 1; margin-bottom: 12px; }
.stat-box p { color: var(--accent); font-family: var(--font-heading); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;}

/* =========================================
   PROYECTOS (SECCIÓN & GRID)
========================================= */
.projects-section { margin-top: 120px; }
.section-header { display: flex; align-items: center; gap: 30px; margin-bottom: 50px; }
.section-header h2 { font-family: var(--font-heading); font-size: 2.5rem; white-space: nowrap; }
.header-line { height: 1px; width: 100%; background: linear-gradient(90deg, var(--border-light), transparent); }

.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
  gap: 30px; 
}

.project-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 24px;
  transition: var(--transition);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-6px); background: var(--surface-hover); }

/* GALERÍA 3D FLOTANTE */
.gallery-scene {
  width: 100%;
  height: 240px;
  margin-bottom: 24px;
  perspective: 1000px;
  position: relative;
}

.gallery-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 16px;
  background-color: var(--bg-base);
}

.project-card:hover .gallery-wrapper {
  transform: rotateX(8deg) rotateY(-12deg) scale(1.05) translateY(-5px);
}

.mockup-fallback {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  z-index: 1;
}

/* Fallbacks Específicos */
.ga3-bg { background: linear-gradient(135deg, #022c22, #059669); }
.mongo-bg { background: linear-gradient(135deg, #1e1b4b, #4338ca); }
.mega-bg { background: linear-gradient(135deg, var(--mega-green), var(--mega-yellow)); }

.mockup-desktop, .mockup-mobile {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  object-fit: cover;
  object-position: top;
  border: 1px solid rgba(255,255,255,0.1);
}

/* CONFIGURACIÓN WEB (Default) */
.mockup-desktop {
  width: 85%;
  height: 85%;
  top: 5%;
  right: 5%;
  transform: translateZ(20px);
}

.mockup-mobile {
  width: 25%;
  height: 90%;
  bottom: -5%;
  left: 5%;
  transform: translateZ(50px);
  border-radius: 12px;
}

/* CONFIGURACIÓN APP (Cuando solo hay capturas móviles) 
   Usamos :has() para detectar si la imagen principal es un móvil vertical */
.project-card:has(img[src*="megaflujo"]) .mockup-desktop {
    width: 45%; 
    height: 90%;
    right: 15%; 
    object-position: center;
}
.project-card:has(img[src*="megaflujo"]) .mockup-mobile {
    width: 42%;
    left: 15%;
    bottom: -10%;
    transform: translateZ(80px);
}

.project-card:hover .mockup-desktop { transform: translateZ(30px); }
.project-card:hover .mockup-mobile { transform: translateZ(90px); }

/* ESTADOS DE PROYECTO */
.project-status {
    margin: 15px 0;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(45, 212, 191, 0.05);
    border: 1px solid rgba(45, 212, 191, 0.2);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.project-tags .tag { font-size: 10px; color: var(--text-secondary); border-color: transparent; background: rgba(0,0,0,0.3); }

.project-info h3 { font-family: var(--font-heading); font-size: 20px; margin-bottom: 12px; }
.project-info p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; flex-grow: 1; }
.project-link { 
  display: inline-flex; align-items: center; font-family: var(--font-heading); 
  color: var(--text-primary); text-decoration: none; font-weight: 700; font-size: 14px; transition: var(--transition); 
}
.project-link:hover { color: var(--accent); padding-left: 5px; }

/* =========================================
   COTIZADOR (QUOTE SECTION)
========================================= */
.quote-section { margin-top: 120px; }
.section-header.center { flex-direction: column; align-items: center; gap: 16px; text-align: center; margin-bottom: 40px; }
.section-header.center .header-line { display: none; }
.section-header.center p { color: var(--text-secondary); font-size: 1.1rem; }

.quote-app-container {
  padding: 2px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  border-radius: 32px;
}
.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 30px;
  min-height: 400px;
  display: flex; justify-content: center; align-items: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.quote-app { width: 100%; padding: 40px; }
@media (max-width: 600px) { .quote-app { padding: 20px; } }

.quote-app h3 { font-family: var(--font-heading); font-size: 24px; margin-bottom: 24px; color: var(--text-primary); }

.progress-container { background: rgba(255,255,255,0.05); height: 6px; border-radius: 10px; margin-bottom: 24px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.4s ease; box-shadow: 0 0 10px var(--accent-glow); }

.subtotal-header { text-align: right; margin-bottom: 30px; font-family: var(--font-heading); color: var(--text-secondary); font-size: 16px; border-bottom: 1px solid var(--border-light); padding-bottom: 15px;}
.subtotal-amount { color: var(--accent); font-size: 24px; font-weight: 700; margin-left: 10px; }

.step { display: none; animation: fadeInUp 0.5s ease forwards; }
.step.active { display: block; }

.quote-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 20px;}
.quote-option { 
  background: rgba(15, 23, 42, 0.5); border: 1px solid var(--border-light); 
  border-radius: 20px; padding: 24px; cursor: pointer; transition: var(--transition); 
  position: relative;
}
.quote-option h4 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 8px; }
.quote-option p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.4;}
.quote-option .price { font-family: var(--font-heading); font-weight: 700; color: var(--accent); font-size: 15px;}

.quote-option:hover { transform: translateY(-4px); background: var(--surface-hover); border-color: rgba(45, 212, 191, 0.3); }
.quote-option.active { border-color: var(--accent); background: rgba(45, 212, 191, 0.08); box-shadow: 0 0 0 1px var(--accent); }

/* Contadores y Nav */
.counter { display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 30px; }
.btn-counter { 
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--border-light); 
  background: var(--surface); color: var(--text-primary); font-size: 24px; cursor: pointer; transition: var(--transition);
}
.btn-counter:hover { background: var(--text-primary); color: var(--bg-base); }
.counter-number { font-family: var(--font-heading); font-size: 32px; font-weight: 700; color: var(--accent); }

.quote-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.btn-quote-nav { padding: 12px 30px; border-radius: 12px; font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: var(--transition); font-size: 15px;}
.btn-quote-nav.primary { background: var(--accent); color: #000; border: none; }
.btn-quote-nav.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px var(--accent-glow); }
.btn-quote-nav.ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-quote-nav.ghost:hover { border-color: var(--text-primary); }

.resumen-box { background: rgba(0,0,0,0.3); border: 1px dashed var(--border-light); border-radius: 20px; padding: 30px; font-size: 15px; color: var(--text-secondary); line-height: 1.8;}
.resumen-box span { color: var(--text-primary); font-weight: 600; }
.resumen-box .precio-final-text { font-family: var(--font-heading); font-size: 32px; font-weight: 900; color: var(--accent); margin-top: 20px; display: block; }

.btn-whatsapp {
  display: inline-block; padding: 14px 40px; border-radius: 100px; font-weight: 700; font-family: var(--font-heading);
  background: linear-gradient(90deg, #25d366, #1ebe57); color: #000; text-decoration: none; transition: var(--transition);
}
.btn-whatsapp:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(37,211,102,0.2); }

/* =========================================
   ANIMACIONES & FOOTER
========================================= */
@keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0px); } }

.fade-in { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.8s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

.site-footer { margin-top: 100px; border-top: 1px solid var(--border-light); padding: 40px 0; text-align: center; }
.footer-content p { font-family: var(--font-heading); color: var(--text-secondary); font-size: 14px; }

/* 1. Hace que MegaFlujo ocupe las dos columnas */
.span-2 {
    grid-column: span 2;
}

/* 2. Ajusta el escenario para que sea más alto y luzca imponente */
.project-wide-scene {
    height: 380px !important;
}

/* 3. Mantiene el tamaño real de los celulares en el modo ancho */
.span-2 .mockup-desktop {
    width: 215px; 
    height: auto;
    aspect-ratio: 9/19;
    right: 28%; /* Lo centramos más al medio */
    top: 5%;
}

.span-2 .mockup-mobile {
    width: 205px;
    height: auto;
    aspect-ratio: 9/19;
    left: 28%; /* Lo centramos más al medio */
    bottom: -8%;
    transform: translateZ(80px);
}

/* 4. Responsive: En celulares volvemos a una sola columna */
@media (max-width: 768px) {
    .span-2 {
        grid-column: span 1;
    }
    .project-wide-scene {
        height: 240px !important;
    }
    .span-2 .mockup-desktop, 
    .span-2 .mockup-mobile {
        width: 42%;
        left: auto;
        right: auto;
    }
    .span-2 .mockup-desktop { right: 5%; }
    .span-2 .mockup-mobile { left: 5%; }
}
