html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; }

/* ===================== Utilidades base ===================== */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* WhatsApp floating button pulse */
@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  50%       { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
}
.wa-float { animation: pulse-wa 2.2s infinite; }

/* ===================== Barra de progreso de scroll ===================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #1da851, #25D366, #b7f5d3);
  z-index: 70;
  box-shadow: 0 0 8px rgba(37,211,102,0.6);
}

/* ===================== Halo que sigue al cursor ===================== */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 620px; height: 620px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(37,211,102,0.16), rgba(37,211,102,0.05) 45%, transparent 72%);
  mix-blend-mode: screen;
  transform: translate(-9999px, -9999px);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 30;
}
#cursor-glow.active { opacity: 1; }
@media (prefers-reduced-motion: reduce), (hover: none) {
  #cursor-glow { display: none; }
}

/* Navbar: transparente hasta hacer scroll */
#mainNav.scrolled { background: rgba(15,32,68,0.92); backdrop-filter: blur(6px); border-bottom-color: rgba(255,255,255,0.1); }

/* Sello del logo: respira suavemente */
@keyframes seal-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(37,211,102,0); }
}
.seal { animation: seal-pulse 3.2s ease-in-out infinite; }

/* Links de nav: subrayado que crece */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: #25D366;
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }

/* Menú móvil: se desliza en vez de aparecer de golpe */
#mobileMenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
}
#mobileMenu.mm-open {
  max-height: 24rem;
  opacity: 1;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

/* ===================== Marcas de registro (esquinas de plano) ===================== */
.reg-frame { position: relative; }
.reg-frame::before,
.reg-frame::after,
.reg-frame > .reg-corner-tl,
.reg-frame > .reg-corner-br {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.reg-frame::before {
  top: -1px; left: -1px;
  border-top: 2px solid rgba(37,211,102,0.6);
  border-left: 2px solid rgba(37,211,102,0.6);
}
.reg-frame::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid rgba(37,211,102,0.6);
  border-right: 2px solid rgba(37,211,102,0.6);
}

/* ===================== Hero 3D ===================== */
#hero-canvas { display: block; touch-action: pan-y; }

.hero-scrim {
  background:
    linear-gradient(180deg, rgba(15,32,68,0.25) 0%, rgba(15,32,68,0.05) 28%, rgba(15,32,68,0.55) 68%, rgba(15,32,68,0.92) 100%),
    linear-gradient(90deg, rgba(15,32,68,0.88) 0%, rgba(15,32,68,0.4) 52%, rgba(15,32,68,0) 82%);
}

.hero-stage-label { opacity: 0; pointer-events: none; }
.hero-stage-label.active { opacity: 1; pointer-events: auto; }

/* ===================== Servicios: filas numeradas ===================== */
.service-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.15);
  transition: background 0.25s ease, transform 0.25s ease;
}
.service-row:hover { background: rgba(255,255,255,0.03); transform: translateX(6px); }
.service-row__num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: rgba(255,255,255,0.12);
  transition: color 0.25s ease;
  min-width: 4.5rem;
}
.service-row:hover .service-row__num { color: rgba(37,211,102,0.5); }
.service-row__body { min-width: 0; }
.service-row__leader {
  display: none;
  flex: 1;
  height: 1px;
  margin: 0 1.5rem;
  align-self: center;
  background-image: repeating-linear-gradient(90deg, rgba(37,211,102,0.35) 0 6px, transparent 6px 13px);
  background-size: 26px 1px;
  transition: background-position 0s;
}
.service-row:hover .service-row__leader { animation: leader-march 0.7s linear infinite; }
@keyframes leader-march { from { background-position: 0 0; } to { background-position: -26px 0; } }
.service-row__metric {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #25D366;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (min-width: 768px) {
  .service-row { grid-template-columns: auto 1fr auto auto; }
  .service-row__leader { display: block; }
  .service-row__metric { display: inline-block; }
}

/* ===================== Beneficios: hoja de datos ===================== */
.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px dotted rgba(255,255,255,0.18);
}
.spec-row:last-child { border-bottom: none; }
.spec-row dt { color: rgba(191,219,254,0.65); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.spec-row dd { color: #ffffff; font-weight: 600; text-align: right; }

/* ===================== Proceso: ruta topográfica ===================== */
.route { position: relative; display: grid; gap: 3rem; }
.route__line { display: none; }
.route__stop { position: relative; text-align: center; }
.route__marker {
  width: 3.5rem; height: 3.5rem;
  margin: 0 auto;
  border: 2px solid #25D366;
  border-radius: 9999px;
  background: #0f2044;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: #25D366;
  position: relative;
  z-index: 1;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.route__stop.visible .route__marker { transform: scale(1); }

@media (min-width: 768px) {
  .route { grid-template-columns: repeat(3, 1fr); }
  .route__line {
    display: block;
    position: absolute;
    top: 1.75rem;
    left: 16.6%;
    right: 16.6%;
    border-top: 2px dashed rgba(255,255,255,0.25);
    z-index: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 1.1s cubic-bezier(0.45, 0, 0.2, 1) 0.15s;
  }
  .route.visible .route__line { transform: scaleX(1); }
}

/* ===================== Testimonios: expediente de casos ===================== */
.case-entry {
  position: relative;
  padding: 2rem 0 2rem 2.5rem;
  border-bottom: 1px dashed rgba(255,255,255,0.15);
  transition: padding-left 0.3s ease;
}
.case-entry:last-child { border-bottom: none; }
.case-entry::before {
  content: '\201C';
  position: absolute;
  left: -0.5rem;
  top: 1.2rem;
  font-family: Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
  color: rgba(37,211,102,0.15);
  transition: color 0.3s ease;
}
.case-entry:hover { padding-left: 3rem; }
.case-entry:hover::before { color: rgba(37,211,102,0.35); }

/* ===================== CTA: panel con brillo pulsante ===================== */
@keyframes cta-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.12), inset 0 0 30px rgba(37,211,102,0.03); }
  50%      { box-shadow: 0 0 40px 4px rgba(37,211,102,0.14), inset 0 0 30px rgba(37,211,102,0.06); }
}
.cta-panel { animation: cta-glow 3.6s ease-in-out infinite; }

/* ===================== Formulario: inputs tipo ficha ===================== */
.field { position: relative; }
.field::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 2px;
  background: #25D366;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}
.field:focus-within::after { width: 100%; }

.field-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding: 0.6rem 0.1rem;
  color: #ffffff;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.field-input::placeholder { color: rgba(191,219,254,0.35); }
.field-input:focus { outline: none; border-bottom-color: transparent; }
.field-input option { background: #0f2044; color: #ffffff; }
