/* ===================================================================
   ON DATA — hoja de estilos única
   Reemplaza a cdn.tailwindcss.com (126 KB de JS que bloqueaban el render
   y compilaban el CSS en el navegador de cada visitante).
   Este archivo no necesita compilarse: se sube por FTP y listo.
   =================================================================== */

/* ---------- Tipografía autoalojada ----------
   Antes se cargaba desde Google Fonts, lo que implicaba dos conexiones a
   servidores externos (fonts.googleapis.com y fonts.gstatic.com) antes de
   poder dibujar texto, y enviaba la IP de cada visitante a Google.
   Es una fuente VARIABLE: un solo archivo de 27 KB cubre todos los pesos.
   Licencia SIL Open Font License, que permite el autoalojamiento. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/plusjakartasans.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Variables ---------- */
:root {
  --bg: #000000;
  --bg-alt: #050505;
  --brand: #3b82f6;
  --brand-soft: #93c5fd;      /* 9.4:1 sobre negro */
  --text: #ffffff;
  --muted: #9ca3af;           /* 8.27:1 sobre negro — cumple WCAG AA */
  --border: rgba(255, 255, 255, 0.10);
  --surface: rgba(255, 255, 255, 0.03);
  --wa: #128c4a;              /* verde WhatsApp oscurecido: 4.6:1 con texto blanco */
  --wa-hover: #0f7a40;
  --radius: 1.25rem;
  --radius-lg: 2rem;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.sin-scroll { overflow: hidden; }

img, video { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

/* Respeta a quien pidió menos movimiento en su sistema */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Foco visible y consistente (WCAG 2.2 §2.4.13) ---------- */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Enlace de salto ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 1rem 1.5rem;
  background: #fff;
  color: #000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- Utilidades ---------- */
.muted { color: var(--muted); }
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 48rem; }

/* Campo trampa antispam: oculto sin usar display:none, que algunos bots detectan */
.hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;              /* muy por encima del mínimo de 24px de WCAG 2.2 */
  padding: 0.85rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: #e2e8f0; }

.btn--ghost { border-color: rgba(255,255,255,0.25); color: #fff; background: transparent; }
.btn--ghost:hover { background: rgba(255,255,255,0.07); }

.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-hover); }

.btn--icon { padding: 0.75rem; min-width: 48px; }
.btn--block { width: 100%; margin-top: 0.75rem; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav__logo { height: 44px; width: auto; object-fit: contain; }
.nav__name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.nav__menu { display: none; }
.nav__menu ul { display: flex; gap: 2rem; }
.nav__menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav__menu a:hover { color: #fff; }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }
.nav__wa-text { display: none; }

/* Botón hamburguesa: antes no existía y el menú simplemente desaparecía en móvil */
.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
}
.nav__burger,
.nav__burger::before,
.nav__burger::after {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav__burger { position: relative; }
.nav__burger::before,
.nav__burger::after { content: ""; position: absolute; left: 0; }
.nav__burger::before { top: -6px; }
.nav__burger::after { top: 6px; }

.nav__toggle[aria-expanded="true"] .nav__burger { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__burger::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__burger::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Menú móvil ---------- */
.menu-movil {
  position: fixed;
  inset: 76px 0 0 0;
  z-index: 99;
  padding: 2rem 1.5rem;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}
.menu-movil[hidden] { display: none; }
.menu-movil ul { display: flex; flex-direction: column; gap: 0.25rem; }
.menu-movil a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.menu-movil a:hover { color: var(--brand-soft); }

/* ---------- Hero ----------
   Antes era solo texto sobre negro: la primera pantalla no mostraba nada
   del trabajo. Ahora lleva de fondo una foto real de obra (caja NAP con
   conectores SC/APC), oscurecida con un velo para que el texto se lea.

   isolation: isolate crea un contexto de apilado propio, así los
   pseudoelementos con z-index negativo quedan dentro del hero y no se
   escapan detrás del fondo de la página. */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;     /* svh evita el salto por la barra del navegador móvil */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}

/* Capa 1: la fotografía. En móvil se sirve una versión recortada y más liviana. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('/hero-900.webp');
  background-size: cover;
  background-position: center;
}

/* Capa 2: el velo. El degradado es más oscuro arriba y abajo, donde está el
   texto, y más transparente en el medio, donde se ve la foto. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(0,0,0,0.92) 0%,
      rgba(0,0,0,0.72) 45%,
      rgba(0,0,0,0.88) 80%,
      rgba(0,0,0,1)   100%),
    linear-gradient(90deg,
      rgba(37,99,235,0.10) 0%,
      transparent 60%);
}

/* En pantallas anchas se cambia por la versión apaisada de mayor resolución.
   En móvil nunca se descarga: el navegador solo pide la que corresponde. */
@media (min-width: 900px) {
  .hero::before { background-image: url('/hero-1600.webp'); }
}

.hero__glow { display: none; }   /* reemplazado por la fotografía de fondo */

.eyebrow {
  display: inline-block;
  margin-bottom: 1.75rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  color: var(--brand-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.5;
}

.hero h1 {
  font-size: clamp(2rem, 6.4vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  max-width: 20ch;
}

.hero__sub {
  max-width: 46ch;
  margin: 0 auto 2.5rem;
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  color: #cbd5e1;          /* 12.6:1 sobre negro */
}

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 26rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 3rem;
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.trust-strip strong {
  display: block;
  font-size: 1.75rem;
  color: #fff;
  line-height: 1.2;
}

.fiber-glow {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.5;
}

/* ---------- Secciones ---------- */
.section { padding: 5rem 0; }
.section--alt { background: var(--bg-alt); }

.section__title {
  font-size: clamp(1.6rem, 4.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 1rem;
}
.section__title--left { text-align: left; }

.section__lead {
  max-width: 44rem;
  margin: 0 auto 3.5rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Grillas ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: 1fr; }

/* ---------- Tarjetas de servicio ---------- */
.card {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.card:hover { border-color: rgba(59, 130, 246, 0.4); transform: translateY(-3px); }

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem; height: 3.5rem;
  margin-bottom: 1.5rem;
  background: rgba(37, 99, 235, 0.12);
  border-radius: var(--radius);
  color: var(--brand);
}
.card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
.card p { margin-bottom: 1.25rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--brand-soft);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.link-arrow::after { content: "→"; transition: transform 0.2s ease; }
.link-arrow:hover { color: #fff; }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Beneficios ---------- */
.benefit { padding: 1.5rem 0; }
.benefit h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  padding-left: 1rem;
  border-left: 3px solid var(--brand);
}
.benefit p { padding-left: 1rem; }

/* ---------- Video y galería de obras ---------- */
/* Contenedor del video.
   Antes imitaba un marco de celular (borde grueso y esquinas muy redondeadas).
   Ese recurso es de app de consumo y le restaba seriedad a un contenido de
   ingeniería dirigido a municipios e ISPs. Ahora es un contenedor sobrio. */
.video-wrap {
  max-width: 340px;
  margin: 0 auto 3.5rem;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }

/* Grilla pareja de miniaturas cuadradas.
   Son 15 fotos: entran exactas en 3 columnas (5 filas) y en 5 columnas (3 filas),
   así nunca queda una foto suelta al final.
   Si algún día agregás o sacás fotos, mantené la cantidad múltiplo de 3 y de 5
   (15, 30…) o ajustá las columnas, o vuelve a aparecer el hueco. */
.obras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

/* El cuadrado lo define el <li>, no la imagen.
   IMPORTANTE: los <img> llevan width y height como atributos HTML para evitar
   saltos de maquetación mientras cargan, y esos atributos funcionan como una
   altura fija en píxeles. Si acá no se fuerza height, la foto conserva esa
   altura y quedan huecos disparejos. Por eso el height: 100% es obligatorio. */
.obras-grid li {
  margin: 0;
  aspect-ratio: 1 / 1;
}
/* Cada foto es un botón: se abre con clic, con Tab + Enter, y un lector de
   pantalla la anuncia usando el texto alternativo de la imagen. */
.obras-grid .obra-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
}
.obras-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  background: #0a0a0a;     /* evita el destello blanco mientras carga */
  transition: transform 0.35s ease, opacity 0.25s ease;
}
.obras-grid .obra-btn:hover img,
.obras-grid .obra-btn:focus-visible img { transform: scale(1.06); opacity: 0.85; }

.obras-nota {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
}

/* ---------- Visor de fotos ----------
   Antes las obras solo se veían como miniaturas de 210 px. La foto del OTDR
   marcando -15,88 dBm, que es la mejor prueba técnica del sitio, era ilegible. */
.visor {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.visor[hidden] { display: none; }

.visor__fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 100%;
}
.visor__img {
  max-width: 100%;
  max-height: calc(100svh - 7rem);  /* deja lugar al pie y al botón de cerrar */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
}
.visor__pie {
  max-width: 58ch;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  /* Se limita a 2 líneas para no robarle altura a la foto */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.visor__cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}
.visor__cerrar:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 0.75rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--brand);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.25rem 1.25rem; }

/* ---------- Contacto ---------- */
.contacto { display: grid; gap: 3rem; }
.contacto__lead { margin-bottom: 2.5rem; max-width: 34rem; }

.contacto__datos { font-style: normal; display: flex; flex-direction: column; gap: 1.25rem; }
.contacto__row { display: flex; align-items: center; gap: 1rem; }
.contacto__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3rem; height: 3rem;
  background: rgba(37, 99, 235, 0.12);
  border-radius: var(--radius);
  color: var(--brand);
}
.contacto__icon--ig {
  background: linear-gradient(to top right, #bc1888, #dc2743, #f09433);
  color: #fff;
}
.contacto__dato {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}
a.contacto__dato:hover { color: var(--brand-soft); }
.contacto__dato--plain { font-weight: 400; color: var(--muted); }

/* ---------- Formulario ---------- */
.form-card {
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}
.form-card form { display: flex; flex-direction: column; gap: 1.15rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.8rem; font-weight: 600; color: #cbd5e1; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.05rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;          /* 16px: por debajo, iOS hace zoom automático al enfocar */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { min-height: 120px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: #94a3b8; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* El select nativo hereda el fondo del sistema: forzamos legibilidad del desplegable */
.field select option { background: #0a0a0a; color: #fff; }

.form-note { font-size: 0.75rem; color: var(--muted); }

/* ---------- Pie ---------- */
.footer {
  padding: 3.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;
}
.footer__brand { display: flex; align-items: center; gap: 0.85rem; }
.footer__logo { height: 38px; width: auto; opacity: 0.85; }
.footer__name { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.footer__legal { font-size: 0.8rem; line-height: 1.7; }
.footer__copy { font-size: 0.75rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--brand-soft); }

/* ===================================================================
   Puntos de quiebre — mobile first: todo lo de arriba es la vista móvil
   =================================================================== */

@media (min-width: 480px) {
  .hero__cta { flex-direction: row; justify-content: center; }
  .nav__wa-text { display: inline; }
}

@media (min-width: 768px) {
  .section { padding: 7rem 0; }
  .nav { padding: 0.85rem 2rem; }
  .nav__logo { height: 56px; }
  .nav__name { font-size: 1.75rem; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 2.5rem; }
  .form-card { padding: 2.75rem; }
  .obras-grid { gap: 0.75rem; }
  .footer__inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .footer__legal { text-align: center; }
}

@media (min-width: 1024px) {
  .nav__menu { display: block; }
  .nav__toggle { display: none; }
  .nav__call { display: none; }        /* en escritorio el teléfono está en Contacto */
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .contacto { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
  .hero { padding-top: 9rem; }
  .obras-grid { grid-template-columns: repeat(5, 1fr); gap: 0.85rem; }
}

/* ---------- Impresión ---------- */
@media print {
  .nav, .menu-movil, .video-wrap, .hero__glow, .btn--wa { display: none; }
  body { background: #fff; color: #000; }
  .muted { color: #333; }
}
