/* =====================================================================
   MoonGPS — Design System "Digital Constellation"
   Paleta navy profundo + acento teal (del logo) · tipografía técnica · aire amplio
   ===================================================================== */

:root {
  /* --- Color tokens (del DESIGN.md) --- */
  --primary: #0a2540;            /* navy del logo (luna / "Moon") */
  --primary-container: #143655;  /* navy un punto más claro */
  --secondary: #157a8c;          /* teal del logo / "activo" (sobre fondo claro) */
  --tertiary-fixed-dim: #22a0b5; /* teal luminoso (acento sobre fondo oscuro) */
  --secondary-soft: rgba(21, 122, 140, 0.30); /* teal translúcido para detalles */
  --on-primary: #ffffff;
  --on-surface: #191c1e;
  --on-surface-variant: #44474c;
  --outline: #74777c;
  --outline-variant: #c4c6cc;

  --surface: #f7f9fc;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f2f4f7;
  --surface-container: #eceef1;
  --surface-container-high: #e6e8eb;
  --surface-variant: #e0e3e6;
  --primary-fixed-dim: #b8c8dc;

  /* --- Radios (sistema preciso: sm / md) --- */
  --r-sm: 0.125rem;
  --r-md: 0.375rem;
  --r-lg: 0.75rem;

  /* --- Tipografía --- */
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-label: "Space Grotesk", ui-monospace, monospace;

  /* --- Sombra ambiental tintada (nunca negro puro) --- */
  --shadow-amb: 0 12px 24px rgba(6, 21, 36, 0.06);
  --shadow-lg: 0 18px 40px rgba(6, 21, 36, 0.10);
}

/* =================================================== MODO OSCURO (.dark) */
/* Redefine los tokens de superficie y texto; el acento teal se mantiene.
   Como todo el CSS usa estas variables, el tema cambia sin tocar cada regla. */
html.dark {
  --primary: #e8eef6;            /* el "navy" pasa a claro: títulos legibles en oscuro */
  --primary-container: #1d3450;
  --secondary: #2bb6cc;          /* teal un poco más luminoso para contraste en oscuro */
  --tertiary-fixed-dim: #2bb6cc;
  --secondary-soft: rgba(43, 182, 204, 0.30);
  --on-primary: #06121f;
  --on-surface: #e6edf5;
  --on-surface-variant: #9fb0c3;
  --outline: #5f6b7a;
  --outline-variant: #2a3a4d;

  --surface: #081625;            /* fondo general navy muy oscuro */
  --surface-container-lowest: #0c1d30;
  --surface-container-low: #0a1a2b;
  --surface-container: #112740;
  --surface-container-high: #163050;
  --surface-variant: #1d3650;
  --primary-fixed-dim: #8aa0bb;

  --shadow-amb: 0 12px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
}
/* Transición suave al cambiar de tema */
body, .navbar, .footer, .service-card, .feature, .bento-cell,
.testimonial, .contact-card, .map-shell, .float-card {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Ajustes de elementos con color fijo cuando está en oscuro */
html.dark .services,
html.dark .tracking,
html.dark .testimonials { background: var(--surface-container-low); }
html.dark .platform { background: var(--surface-container); }
html.dark .contact { background: #050f1a; }
html.dark .contact-card { background: #0e2236; border: 1px solid var(--outline-variant); }
html.dark .field input,
html.dark .field textarea { background: #0a1a2b; border-color: #2a3a4d; color: var(--on-surface); }
html.dark .field input::placeholder,
html.dark .field textarea::placeholder { color: #6b7d91; }
html.dark .float-card,
html.dark .map-counter { background: rgba(12, 29, 48, 0.88); }
html.dark .map-counter { border-color: var(--outline-variant); color: var(--on-surface-variant); }
html.dark .fc-value,
html.dark .fc-coords { color: var(--on-surface); }
html.dark .btn-outline { color: var(--on-surface); }
/* Bento en oscuro: celdas con fondo navy elevado (no negro plano) + borde sutil */
html.dark .bento-cell {
  background: #112740;
  border-color: #21384f;
}
html.dark .bento-cell h5 { color: #e6edf5; }
html.dark .bento-cell:hover { border-color: var(--secondary); }
html.dark .bc-icon { background: rgba(43, 182, 204, 0.18); }
html.dark .bento-feature {
  background: linear-gradient(135deg, #0c2236 0%, #103a52 60%, #145e76 100%);
  border: none;
}
html.dark .bento-feature p { color: #b8d4e0; }
html.dark .grid-bg {
  background-image: radial-gradient(circle, rgba(159,176,195,0.10) 1px, transparent 1px);
}
/* Marca de agua "GPS": en dark se aclara levemente para que apenas se intuya */
html.dark .watermark { color: rgba(226, 237, 245, 0.035); }
/* Sombras de tarjetas: en dark un borde sutil ayuda a separarlas del fondo */
html.dark .service-card,
html.dark .feature,
html.dark .testimonial { border: 1px solid var(--outline-variant); }
html.dark .feature-grid { background: var(--outline-variant); }
/* El botón primario del hero (gradiente navy) seguiría oscuro; lo aclaramos a teal */
html.dark .btn-primary {
  background: linear-gradient(135deg, var(--secondary), #0f5e6d);
}
/* Acceso Cliente y toggle: bordes visibles en dark */
html.dark .btn-ghost-nav { color: #e6edf5; }
/* navbar/footer ya son oscuros en ambos modos: se mantienen */

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--on-surface);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: #b9dde3; color: #0a2540; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.accent { color: var(--secondary); }

/* Textura: rejilla de puntos al 10% */
.grid-bg {
  background-image: radial-gradient(circle, var(--outline-variant) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Iconos */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ============================================================== NAVBAR */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 50;
  background: rgba(6, 12, 22, 0.80);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
  transition: background 0.3s ease;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}
.brand {
  display: flex;
  align-items: center;
}
/* Logo oficial (SVG). El viewBox es ancho (1024×448) con el ícono a la izquierda;
   recortamos el aire vertical con la altura fija y dejamos que el ancho fluya. */
.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #cbd5e1;
  padding-bottom: 0.25rem;
  transition: color 0.2s ease;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
  color: var(--tertiary-fixed-dim);
  border-bottom: 2px solid var(--tertiary-fixed-dim);
}

.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* Botón de cambio de tema (sol / luna) */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.25);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: #e2e8f0;
  position: relative;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.theme-toggle:hover { border-color: var(--tertiary-fixed-dim); background: rgba(255,255,255,0.06); }
.theme-toggle .material-symbols-outlined { font-size: 1.25rem; position: absolute; transition: opacity 0.25s ease, transform 0.4s ease; }
/* En claro mostramos la luna (para pasar a oscuro); en oscuro, el sol */
.icon-moon { opacity: 1; transform: rotate(0); }
.icon-sun  { opacity: 0; transform: rotate(-90deg); }
.dark .icon-moon { opacity: 0; transform: rotate(90deg); }
.dark .icon-sun  { opacity: 1; transform: rotate(0); color: var(--tertiary-fixed-dim); }

.btn-ghost-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(21, 122, 140, 0.45);
  padding: 0.55rem 1.4rem;
  border-radius: var(--r-sm);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease, transform 0.1s ease;
}
.btn-ghost-nav .material-symbols-outlined {
  font-size: 1rem;
  color: var(--tertiary-fixed-dim);
  transition: color 0.25s ease;
}
.btn-ghost-nav:hover {
  background: var(--tertiary-fixed-dim);
  color: var(--primary);
  border-color: var(--tertiary-fixed-dim);
  box-shadow: 0 6px 18px rgba(21, 122, 140, 0.35);
}
.btn-ghost-nav:hover .material-symbols-outlined { color: var(--primary); }
.btn-ghost-nav:active { transform: scale(0.96); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================ HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 7rem 0 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 10;
}
.hero-copy { display: flex; flex-direction: column; gap: 2rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  background: rgba(27, 42, 57, 0.08);
  border: 1px solid rgba(196, 198, 204, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-sm);
}
.badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
}
.badge-text {
  font-family: var(--font-label);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--on-surface-variant);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--primary);
}
.hero-lead {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  max-width: 32rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Botones */
.btn-primary {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: #fff;
  border-radius: var(--r-sm);
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  box-shadow: var(--shadow-amb);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}
.btn-primary:hover { box-shadow: 0 18px 40px rgba(6, 21, 36, 0.25); }
.btn-primary:active { transform: scale(0.96); }

.btn-outline {
  display: inline-block;
  padding: 1rem 2rem;
  border: 1px solid rgba(196, 198, 204, 0.5);
  color: var(--primary);
  border-radius: var(--r-sm);
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}
.btn-outline:hover { background: var(--surface-container); }

/* Visual del hero: globo de puntos (cobe) + satélites orbitando */
.hero-visual {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit-system {
  position: relative;
  /* Se ajusta al ancho de su columna para que el globo se vea COMPLETO,
     sin desbordar ni quedar recortado por el overflow del hero */
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

/* ---- Globo cobe (canvas WebGL) ---- */
.globe-canvas {
  /* Cuadrado perfecto: el ancho manda y la altura se iguala vía aspect-ratio.
     Sin height:100% para no deformar el canvas (eso descentraba el globo). */
  width: 100%;
  aspect-ratio: 1 / 1;
  grid-area: 1 / 1;
  display: block;
  opacity: 0;
  transition: opacity 1s ease;
  touch-action: pan-y; /* permite scroll vertical de la página al tocar */
}
/* El JS marca el canvas como listo; si el JS falla, igual lo mostramos */
.globe-canvas.is-ready { opacity: 1; }
.no-js .globe-canvas,
.globe-canvas.is-ready { opacity: 1; }

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

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .status-dot, .badge .dot, .float-card,
  .fc-ping::after, .fc-bars span { animation: none !important; }
}

/* Tarjetas flotantes de telemetría (glassmorphism) */
.float-card {
  position: absolute;
  width: 168px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(21, 122, 140, 0.18);
  border-left: 2px solid var(--secondary);
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.14);
  animation: float-bob 6s ease-in-out infinite;
}
.float-tl { top: 8%; right: 0%; animation-delay: 0s; }
.float-br { bottom: 12%; left: -4%; animation-delay: 2s; }
.float-tr { top: 48%; right: -2%; animation-delay: 4s; }

@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fc-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.fc-ico { font-size: 0.95rem; color: var(--secondary); }
.fc-label {
  font-family: var(--font-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}
/* Punto que late (señal activa) */
.fc-ping {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
}
.fc-ping::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--secondary);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3); opacity: 0; }
}

.fc-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.fc-unit { font-size: 0.9rem; color: var(--secondary); margin-left: 1px; }

/* Coordenadas (mono, técnicas) */
.fc-coords {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.fc-dim { color: var(--outline); font-size: 0.75rem; }

/* Barras de señal */
.fc-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-top: 0.6rem;
}
.fc-bars span {
  flex: 1;
  background: var(--secondary);
  border-radius: 1px;
  opacity: 0.85;
  animation: bars 1.4s ease-in-out infinite;
}
.fc-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.fc-bars span:nth-child(2) { height: 60%; animation-delay: 0.15s; }
.fc-bars span:nth-child(3) { height: 80%; animation-delay: 0.3s; }
.fc-bars span:nth-child(4) { height: 100%; animation-delay: 0.45s; }
.fc-bars span:nth-child(5) { height: 70%; animation-delay: 0.6s; }
@keyframes bars {
  0%, 100% { transform: scaleY(0.55); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Mini-gráfico de líneas (sparkline) */
.fc-spark {
  width: 100%;
  height: 24px;
  margin-top: 0.55rem;
}
.fc-spark polyline {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 3px rgba(21, 122, 140, 0.4));
}

/* Barra de progreso (activos) */
.fc-track {
  height: 4px;
  background: rgba(21, 122, 140, 0.15);
  border-radius: 2px;
  margin-top: 0.7rem;
  overflow: hidden;
}
.fc-track-fill {
  display: block;
  height: 100%;
  width: 82%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

/* Resumen de datos para móvil (oculto en desktop) */
.stats-mobile { display: none; }
.sm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.sm-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.sm-unit { color: var(--secondary); font-size: 1rem; }
.sm-label {
  margin-top: 0.4rem;
  font-family: var(--font-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-surface-variant);
}

/* Watermark gigante */
.watermark {
  position: absolute;
  bottom: -3rem; right: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(8rem, 22vw, 20rem);
  color: rgba(6, 21, 36, 0.03);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ============================================================ SERVICIOS */
.section-head { margin-bottom: 5rem; display: flex; flex-direction: column; gap: 1rem; }
.section-head.center { text-align: center; align-items: center; }

.eyebrow {
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--secondary);
}
.eyebrow.underlined {
  text-decoration: underline;
  text-decoration-color: rgba(21, 122, 140, 0.35);
  text-underline-offset: 8px;
  align-self: flex-start;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.04em;
  color: var(--primary);
}
.section-lead {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  max-width: 42rem;
}

.services { padding: 8rem 0; background: var(--surface-container-low); position: relative; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.service-card {
  position: relative;
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(196, 198, 204, 0.2);
  box-shadow: var(--shadow-amb);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.vcode {
  position: absolute;
  top: 1.5rem; right: 2rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(21, 122, 140, 0.7);
}
.sc-icon {
  font-size: 2.25rem;
  color: var(--primary);
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}
.service-card:hover .sc-icon { color: var(--secondary); }
.service-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.service-card p { font-size: 0.9rem; color: var(--on-surface-variant); margin-bottom: 2rem; flex-grow: 1; }
.sc-rule {
  display: block;
  width: 6rem; height: 1px;
  background: linear-gradient(to right, rgba(21, 122, 140,0.4), transparent);
}

/* =========================================================== PLATAFORMA */
.platform { padding: 8rem 0; background: var(--surface-container); }
.platform-head { margin-bottom: 4rem; }
.eyebrow-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.eyebrow-line { width: 2rem; height: 1px; background: var(--secondary); }
.platform-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--primary);
  max-width: 48rem;
}

/* Rejilla "no-line": separación por líneas de fondo (gap teñido) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(196, 198, 204, 0.25);
  border: 1px solid rgba(196, 198, 204, 0.25);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-amb);
  isolation: isolate; /* contiene el z-index del hover sin recortar la sombra */
}
/* Redondea solo las esquinas exteriores de la rejilla (4 columnas) */
.feature:first-child { border-top-left-radius: var(--r-lg); }
.feature:nth-child(4) { border-top-right-radius: var(--r-lg); }
.feature:nth-child(5) { border-bottom-left-radius: var(--r-lg); }
.feature:last-child { border-bottom-right-radius: var(--r-lg); }
.feature {
  position: relative;
  background: var(--surface-container-lowest);
  padding: 2rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, box-shadow 0.3s ease, z-index 0s;
}
/* Hover: la tarjeta se aclara, se eleva sobre las vecinas y aparece una guía cian arriba */
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.feature:hover {
  background: var(--surface-container-lowest);
  z-index: 2;
  box-shadow: var(--shadow-lg);
}
.feature:hover::before { transform: scaleX(1); }
.f-icon {
  color: var(--secondary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}
.feature:hover .f-icon { transform: translateY(-4px) scale(1.1); }
.feature h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.feature p { font-size: 0.875rem; color: var(--on-surface-variant); margin-bottom: 1.5rem; }
.fcode {
  margin-top: auto;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--outline);
  transition: color 0.3s ease;
}
.feature:hover .fcode { color: var(--secondary); }

/* ============================================================ RASTREO/MAPA */
.tracking { padding: 8rem 0; background: var(--surface-container-low); }
.map-shell {
  position: relative;
  margin-top: 3rem;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(21, 122, 140, 0.15);
}
.map {
  width: 100%;
  height: 480px;
  background: var(--surface-container);
  z-index: 1;
}
/* En oscuro: suaviza/tiñe los tiles para integrarlos al navy de la marca */
.map.map-dark .leaflet-tile {
  filter: brightness(0.78) contrast(1.05) saturate(0.85);
}

/* Contador discreto de equipos en línea (esquina superior derecha) */
.map-counter {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(21, 122, 140, 0.2);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.8rem;
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.14);
  font-family: var(--font-label);
  font-size: 0.72rem;
  color: var(--on-surface-variant);
}
.map-counter strong { color: var(--primary); font-weight: 700; }
.mc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 0 rgba(21, 122, 140, 0.5);
  animation: mc-ping 1.8s ease-out infinite;
}
@keyframes mc-ping {
  0% { box-shadow: 0 0 0 0 rgba(21, 122, 140, 0.5); }
  100% { box-shadow: 0 0 0 9px rgba(21, 122, 140, 0); }
}

/* Marcador de equipo con icono según tipo (camión/auto/moto) */
.map-veh {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.4);
}
.map-veh .material-symbols-outlined { font-size: 15px; line-height: 1; }
/* Color por tipo para distinguirlos de un vistazo */
.veh-camion { background: #157a8c; }   /* teal marca */
.veh-auto   { background: #0a2540; }   /* navy marca */
.veh-moto   { background: #c2770a; }   /* ámbar para contraste */

/* Globito de velocidad flotando junto al equipo */
.veh-speed {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -3px);
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.25);
  pointer-events: none;
}
.veh-speed small { font-size: 7px; font-weight: 500; opacity: 0.7; margin-left: 1px; }
/* Triangulito que apunta al vehículo */
.veh-speed::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 3px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.94);
}
html.dark .veh-speed {
  background: rgba(18, 39, 64, 0.95);
  color: #e6edf5;
}
html.dark .veh-speed::after { border-top-color: rgba(18, 39, 64, 0.95); }

/* Forzar que los controles de Leaflet respeten la marca */
.leaflet-container { font-family: var(--font-body); }

/* ============================================================= ESTÁNDAR */
.standard { padding: 8rem 0; }
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.bento-cell {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  padding: 2rem;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Línea de acento que se despliega al hover */
.bento-cell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--tertiary-fixed-dim));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.bento-cell:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
}
.bento-cell:hover::before { transform: scaleX(1); }
.bento-cell h5 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.bento-cell p { font-size: 0.9rem; color: var(--on-surface-variant); line-height: 1.6; }
.bc-icon {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  background: var(--secondary-soft);
  border-radius: var(--r-md);
  transition: transform 0.3s ease;
}
.bento-cell:hover .bc-icon { transform: scale(1.08) rotate(-4deg); }

/* Celda destacada (gradiente navy→teal, con textura) */
.bento-feature {
  grid-column: span 2;
  background: linear-gradient(135deg, #0a2540 0%, #0f3a52 60%, #14607a 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  padding: 2.5rem;
  border: none;
}
.bento-feature::before { display: none; }
/* Textura de puntos sutil dentro de la celda destacada */
.bento-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
  pointer-events: none;
}
.bento-feature:hover { transform: translateY(-4px); }
.bento-feature h5 { font-size: 1.875rem; color: #fff; }
.bento-feature p { color: #b8d4e0; max-width: 22rem; }
.bf-copy { position: relative; z-index: 2; }
.bf-icon {
  position: absolute;
  top: 1.75rem; right: 1.75rem;
  font-size: 5rem;
  color: var(--tertiary-fixed-dim);
  opacity: 0.35;
  z-index: 1;
}

.bento-wide {
  grid-column: span 3;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
}
.bento-wide h5 { font-size: 1.75rem; }
.bento-wide p { max-width: 30rem; }
.bw-icon {
  font-size: 3.25rem;
  color: var(--secondary);
  opacity: 0.85;
  flex-shrink: 0;
}

/* ============================================================== CONTACTO */
.contact {
  padding: 8rem 0;
  background: var(--primary);
  position: relative;
}
/* Layout dos columnas: mensaje a la izquierda, formulario a la derecha */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: center;
}

/* --- Columna izquierda (sobre fondo navy) --- */
.contact-aside .eyebrow { color: var(--tertiary-fixed-dim); }
.contact-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 1rem 0 1.25rem;
}
.contact-sub {
  color: var(--primary-fixed-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 30rem;
}
.contact-points {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.contact-points li { display: flex; align-items: flex-start; gap: 1rem; }
.contact-points .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 1.4rem;
  color: var(--tertiary-fixed-dim);
  background: rgba(43, 182, 204, 0.12);
  padding: 0.6rem;
  border-radius: var(--r-md);
}
.contact-points div { display: flex; flex-direction: column; }
.contact-points strong { color: #fff; font-family: var(--font-display); font-size: 1rem; }
.contact-points span { color: var(--primary-fixed-dim); font-size: 0.85rem; }

/* --- Columna derecha: tarjeta del formulario --- */
.contact-card {
  background: var(--surface-container-lowest);
  padding: 2.5rem;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
/* Nombre, detalle y botón ocupan toda la fila; email y teléfono van lado a lado */
.field-full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}
/* Inputs con borde visible (no subrayado tosco) */
.field input,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 0.8rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--outline); opacity: 1; }
.field input:focus,
.field textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-soft);
  background: var(--surface-container-lowest);
}

/* Honeypot anti-spam */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.submit-row { padding-top: 0.5rem; }
.btn-submit {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--secondary), #0f5e6d);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  box-shadow: 0 10px 24px rgba(21, 122, 140, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: var(--r-md);
  transition: transform 0.15s ease, box-shadow 0.3s ease, filter 0.2s ease;
}
.btn-submit:hover { filter: brightness(1.08); box-shadow: 0 14px 30px rgba(21, 122, 140, 0.45); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit .material-symbols-outlined { font-size: 1.1rem; transition: transform 0.2s ease; }
.btn-submit:hover .material-symbols-outlined { transform: translateX(6px); }

.form-status {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-label);
  font-size: 0.8rem;
  min-height: 1.2rem;
}
.form-status.ok { color: var(--secondary); }
.form-status.err { color: #e2574c; }

/* ================================================================ FOOTER */
.footer { background: #040a12; color: #fff; padding: 3rem 0 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-logo { margin-bottom: 1.5rem; }
.footer-logo .brand-logo { height: 42px; }
.footer-brand p { color: #64748b; font-size: 0.75rem; max-width: 200px; }
.footer-col { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col h6 {
  font-family: var(--font-label);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: #cbd5e1; }

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p {
  color: #64748b;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.status-pill { display: flex; align-items: center; gap: 0.6rem; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tertiary-fixed-dim);
  animation: blink 1.8s ease-in-out infinite;
}
.status-pill span:last-child {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============================================================ TESTIMONIOS */
.testimonials { padding: 8rem 0; background: var(--surface-container-low); }
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.testimonial {
  position: relative;
  background: var(--surface-container-lowest);
  padding: 2.5rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-amb);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.quote-mark {
  font-size: 2.5rem;
  color: rgba(21, 122, 140, 0.30);
}
.testimonial blockquote {
  margin: 0;
  font-size: 1rem;
  color: var(--on-surface);
  line-height: 1.7;
  flex-grow: 1;
}
.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.t-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--tertiary-fixed-dim);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.t-meta { display: flex; flex-direction: column; line-height: 1.3; }
.t-meta strong { font-family: var(--font-display); color: var(--primary); font-size: 0.95rem; }
.t-meta small { color: var(--on-surface-variant); font-size: 0.78rem; }

.client-logos {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem 3.5rem;
}
.client-logos span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--outline);
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.client-logos span:hover { opacity: 1; color: var(--primary); }

/* =========================================================== ANIMACIÓN */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================ RESPONSIVE */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual {
    order: -1;
    flex-direction: column;
    aspect-ratio: auto;       /* deja sitio a la fila de datos debajo */
    max-width: 380px;
    margin: 0 auto;
  }
  .orbit-system { width: 280px; }
  /* En una columna las tarjetas flotantes se salen: las ocultamos y mostramos
     la fila de datos compacta debajo del globo */
  .float-card { display: none; }
  .stats-mobile {
    display: flex;
    gap: 1rem;
    margin: 1.75rem auto 0;
    max-width: 420px;
    padding: 1.1rem 1rem;
    background: var(--surface-container-lowest);
    border: 1px solid rgba(21, 122, 140, 0.18);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-amb);
  }
  .sm-item:not(:last-child) { border-right: 1px solid rgba(21, 122, 140, 0.15); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-feature, .bento-wide { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  /* Contacto: apila mensaje y formulario */
  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; max-width: 600px; margin: 0 auto; }
  .contact-points { flex-direction: row; flex-wrap: wrap; }
  .contact-points li { flex: 1 1 30%; }
}

@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }
  .nav-links {
    position: fixed;
    top: 64px; left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(6, 12, 22, 0.97);
    backdrop-filter: blur(12px);
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
  }
  .nav-links.open { max-height: 340px; padding: 1rem 2rem 1.5rem; }
  .nav-link { padding: 0.75rem 0; width: 100%; }
  .nav-link.active { border-bottom: none; }
  .btn-ghost-nav { display: none; }
  .nav-toggle { display: flex; }

  .service-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento-feature, .bento-wide { grid-column: span 1; }
  .bento-wide { flex-direction: column; align-items: flex-start; }

  /* Contacto en móvil: campos a una columna, tarjeta más compacta */
  .contact-form { grid-template-columns: 1fr; gap: 1.1rem; }
  .field-full { grid-column: 1 / -1; }
  .contact-card { padding: 1.5rem 1.25rem; }
  .contact-points { flex-direction: column; }
  .contact-points li { flex: none; }

  .footer-grid { grid-template-columns: 1fr; text-align: left; }
  .float-card { display: none; }
  .services, .platform, .standard, .contact, .testimonials, .tracking { padding: 4.5rem 0; }
  .section-head { margin-bottom: 2.5rem; }

  /* Mapa en móvil: alto cómodo */
  .map { height: 340px; }
  .map-counter { top: 0.6rem; right: 0.6rem; font-size: 0.65rem; padding: 0.4rem 0.65rem; }

  /* Tipografía un punto más contenida en móvil */
  .section-title { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  .hero-title { font-size: clamp(2.5rem, 12vw, 3.5rem); }
}
