:root {
  --bg-deep: #05070c;
  --bg-surface: rgba(13, 17, 28, 0.75);
  --bg-surface-hover: rgba(22, 28, 45, 0.9);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 245, 212, 0.45);
  --cyan: #00f5d4;
  --cyan-glow: rgba(0, 245, 212, 0.35);
  --purple: #7b2cbf;
  --cobalt: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.no-select, body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.03em;
  font-weight: 700;
}

#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.wrapper {
  position: relative;
  z-index: 2;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* HEADER */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 7, 12, 0.9);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.85rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.logo-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-brand span strong {
  background: linear-gradient(135deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover { color: var(--cyan); }

.lang-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 99px;
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--cobalt), var(--purple));
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* HERO */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: 99px;
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  max-width: 95%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.hero-headline {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.18;
  max-width: 960px;
  margin: 0 auto 1.5rem;
}

.hero-gradient {
  background: linear-gradient(135deg, #ffffff 20%, #94a3b8 50%, var(--cyan) 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  max-width: 720px;
  margin: 0 auto 2.2rem;
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.85rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cobalt));
  color: #05070c;
  border: none;
  box-shadow: 0 4px 22px var(--cyan-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 245, 212, 0.55);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* TELEMETRY */
.telemetry-strip {
  margin: 3.5rem 0 3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  backdrop-filter: blur(14px);
}

.telemetry-val {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--cyan);
}

.telemetry-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* SECTIONS */
.section { padding: 5rem 0; }
.section-head { text-align: center; margin-bottom: 3.5rem; }
.section-head h2 { font-size: clamp(1.85rem, 4.2vw, 2.6rem); margin-bottom: 0.85rem; }
.section-head p { color: var(--text-muted); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  position: relative;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-focus);
  background: var(--bg-surface-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.card-num {
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--cyan);
  margin-bottom: 0.85rem;
}

.service-card h3 { font-size: 1.45rem; margin-bottom: 0.85rem; }
.service-card p { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.65; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tech-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
}

/* PORTFOLIO */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.55rem 1.25rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05070c;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.portfolio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s;
}

.portfolio-cat {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.portfolio-card h4 { font-size: 1.28rem; margin: 0.5rem 0 0.85rem; }
.portfolio-card p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* CALCULATOR */
.calc-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem;
  max-width: 860px;
  margin: 0 auto;
  backdrop-filter: blur(16px);
}

.calc-group { margin-bottom: 2rem; }
.calc-group label {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.calc-choice {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.calc-choice.active {
  background: rgba(0, 245, 212, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.calc-summary {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.calc-cost {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: 'Space Grotesk', sans-serif;
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 3.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem;
  backdrop-filter: blur(16px);
}

.contact-meta p { color: var(--text-muted); margin: 1rem 0 2rem; font-size: 1.05rem; }
.contact-channel { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.contact-channel svg { color: var(--cyan); margin-top: 0.25rem; flex-shrink: 0; }
.contact-channel a { color: var(--text-main); font-size: 1rem; text-decoration: none; }
.channel-lbl { font-size: 0.8rem; text-transform: uppercase; color: var(--text-dim); font-weight: 700; letter-spacing: 0.05em; }

.contact-form { display: flex; flex-direction: column; gap: 1.15rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }
.form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.2);
}

#formAlert {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
}

/* BOTÓN FLOTANTE WHATSAPP */
.whatsapp-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #25d366;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  z-index: 99;
  transition: transform 0.25s, box-shadow 0.25s;
}
.whatsapp-bubble:hover {
  transform: scale(1.08);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--cyan); }

footer.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 4.5rem;
}

/* =============================================================
   RESPONSIVE INTELIGENTE (iOS & ANDROID CALIBRADO)
   ============================================================= */
@media screen and (max-width: 1024px) {
  .nav-menu { display: none !important; }
  .wrapper { padding: 0 1.25rem; }

  .services-grid, 
  .portfolio-grid { 
    grid-template-columns: 1fr !important; 
    gap: 1.5rem; 
  }

  .telemetry-strip {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.25rem;
    padding: 1.4rem;
    margin: 2.5rem 0 2rem;
  }

  .calc-buttons { 
    grid-template-columns: 1fr !important; 
  }

  .contact-grid { 
    grid-template-columns: 1fr !important; 
    padding: 2rem 1.25rem; 
    gap: 2.5rem; 
  }

  /* Titular adaptable que evita cortes excesivos */
  .hero-headline {
    font-size: clamp(1.75rem, 6.2vw, 2.3rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -0.02em !important;
  }
  
  .hero-lead {
    font-size: 1.05rem !important;
    margin-bottom: 1.85rem !important;
    line-height: 1.6 !important;
  }

  .service-card h3 { font-size: 1.4rem !important; }
  .service-card p { font-size: 1rem !important; }

  .portfolio-card h4 { font-size: 1.3rem !important; }
  .portfolio-card p { font-size: 0.98rem !important; }

  .btn { 
    width: 100%; 
    justify-content: center; 
    font-size: 1rem !important; 
    padding: 0.95rem 1.4rem !important; 
  }

  .calc-choice { font-size: 0.98rem !important; padding: 0.95rem; }
  .calc-summary { flex-direction: column; text-align: center; }

  .form-field label { font-size: 0.95rem !important; }
  .form-control { font-size: 1rem !important; padding: 0.95rem !important; }
}

@media screen and (max-width: 480px) {
  .hero-section {
    padding: 3.5rem 0 2.5rem !important;
  }
  
  .hero-pill {
    font-size: 0.76rem !important;
    padding: 0.35rem 0.75rem !important;
  }
  
  .logo-brand {
    font-size: 1.15rem !important;
  }

  /* Botón de WhatsApp desplazado a la esquina inferior */
  .whatsapp-bubble {
    width: 46px !important;
    height: 46px !important;
    bottom: 1rem !important;
    right: 1rem !important;
  }
  
  .whatsapp-bubble svg {
    width: 24px !important;
    height: 24px !important;
  }
}
