/* ========== RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: #1a1a2e;
  overflow-y: scroll;
}

body {
  font-family: "JetBrains Mono", "Fira Code", "Ubuntu Mono", monospace;
  background: transparent;
  color: #fff;
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ========== CANVAS ========== */
#neural-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: #1e1e1e;
}

/* ========== LOGO ========== */
.logo {
  position: absolute;
  left: 4rem;
  top: 2rem;
  width: 200px;
  height: auto;
}

/* ========== HERO ========== */
.hero {
  background-color: rgba(19, 19, 19, 0.1);
  color: #fff;
  text-align: center;
  padding: 3rem 2rem 1rem 2rem;
  margin: 0 auto;
  max-width: 100%;
  border: none;
  border-bottom: 1px solid #2ecc71;
  backdrop-filter: blur(2px);
  position: relative;
  z-index: 1;
  min-height: 259px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitulo {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* ========== TÍTULO MATRIX ========== */
.matrix-text {
  font-size: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  color: #2ecc71;
  text-shadow: 0 0 10px #2ecc71;
  border-right: 3px solid #2ecc71;
  white-space: nowrap;
  height: 64px;
  display: block;
  animation: blink-caret 0.8s step-end infinite;
  text-align: center;
  margin: 0 auto;
  width: fit-content;
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #2ecc71;
  }
}

/* ========== BOTONES ========== */
.boton {
  display: inline-block;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid #2ecc71;
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  width: 200px;
  text-align: center;
  box-sizing: border-box;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}

.boton-servicios {
  display: inline-block;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid #2ecc71;
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  width: 215px;
  text-align: center;
  box-sizing: border-box;
}

.boton-servicios:hover,
.boton:hover {
  border-color: #00ff41;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
  transform: translateY(-3px);
  color: #00ff41;
  background: rgba(46, 204, 113, 0.2);
  transition: all 0.3s ease;
}

.botones-hero {
  display: flex;
  justify-content: flex-start;
  gap: 2cm;
  padding-left: 17rem;
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

.modal.activo {
  display: flex;
}

.modal-contenido {
  background: rgba(19, 19, 19, 0.95);
  border: 1px solid #2ecc71;
  border-radius: 10px;
  padding: 0 2rem 2rem 2rem;
  max-width: 900px;
  max-height: 85vh;
  width: 90%;
  color: #fff;
  position: relative;
  box-shadow: 0 0 30px rgba(46, 204, 113, 0.3);
  animation: aparecer 0.3s ease;
  overflow-y: auto;
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-contenido h2 {
  color: #2ecc71;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-contenido p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.modal-contenido strong {
  color: #2ecc71;
}

.cerrar {
  position: sticky;
  top: 1px;
  float: right;
  margin-right: -28px;
  margin-top: -60px;
  font-size: 2rem;
  color: #2ecc71;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.3s ease;
  z-index: 1100;
}

.cerrar:hover {
  color: #00ff41;
  text-shadow: 0 0 30px #00ff41;
}

/* ========== MAPA ========== */
.mapa-contenedor {
  position: relative;
  width: 100%;
  height: 400px;
  border: 1px solid #2ecc71;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(46, 204, 113, 0.4);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.mapa-contenedor iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ========== SECCIONES ========== */
section {
  padding: 3rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #fff;
}

/* ========== TARJETAS ========== */
.tarjeta {
  background: rgba(19, 19, 19, 0.5);
  backdrop-filter: blur(2px);
  color: #fff;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #2ecc71;
  transition: all 0.3s ease;
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.tarjeta:hover {
  border-color: #00ff41;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
  transform: translateY(-3px);
  color: #00ff41;
}

.tarjetas {
  display: grid;
  gap: 20px;
  cursor: pointer;
}

.tarjeta h3 {
  color: #27ae60;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.tarjeta:hover h3 {
  color: #00ff41;
}

.tarjeta-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.tarjeta-link:visited,
.tarjeta-link:hover,
.tarjeta-link:active,
.tarjeta-link:focus {
  text-decoration: none;
  color: inherit;
}

/* ========== ICONOS ========== */
.icono {
  width: 50px;
  height: 50px;
  vertical-align: middle;
}

/* ========== CONTACTO ========== */
.contacto {
  text-align: center;
  background-color: rgba(19, 19, 19, 0.5);
  color: #fff;
  width: 100%;
  padding: 3rem 2rem;
  font-size: 1.5rem;
  border-top: 1px solid #2ecc71;
  max-width: 100%;
  margin-top: 5rem;
}

.contacto a {
  color: #2ecc71;
  text-decoration: none;
  font-size: 2rem;
  margin: 1rem 1rem;
  display: inline-block;
}

.contacto a:hover {
  border-color: #00ff41;
  transform: translateY(-3px);
  color: #00ff41;
  text-shadow: 0 0 10px #00ff41;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 0.5rem;
  background-color: #191919;
  color: #888;
  font-size: 0.9rem;
  border-top: 1px solid #2ecc71;
}

/* ========== LISTA DE SERVICIOS ========== */
.lista-servicios {
  background-color: rgba(19, 19, 19, 0.25);
  font-size: 1.15rem;
  padding: 2rem 2rem;
  border: 1px solid #2ecc71;
  border-radius: 30px;
}

.menu-servicios li {
  padding: 1rem 0;
}

/* ============================================ */
/* ========== RESPONSIVE ========== */
/* ============================================ */

/* Pantallas grandes: centrar botones del hero */
@media (min-width: 1024px) {
  .botones-hero {
    justify-content: center;
    padding-left: 0;
    gap: 2rem;
    flex-wrap: wrap;
  }
}

/* Tablets (601px a 1023px) */
@media (max-width: 1023px) {
  .botones-hero {
    justify-content: center;
    padding-left: 0;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .logo {
    width: 150px;
    left: 2rem;
    top: 1.5rem;
  }

  .hero .matrix-text {
    font-size: 1.8rem;
    height: 50px;
  }
}

/* Móvil (600px o menos) */
@media (max-width: 600px) {
  .logo {
    position: static;
    display: block;
    width: 150px; /* más pequeño */
    margin: 1rem auto 0.5rem;
  }

  .hero {
    padding: 1.5rem 1rem;
    min-height: auto;
    position: relative;
  }

  .hero .matrix-text {
    font-size: 2rem;
    height: 1.6em;
    min-height: 1.6em;
    white-space: nowrap;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    margin: 1rem auto 0.5rem;
  }

  .subtitulo {
    font-size: 1rem;
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
  }

  .botones-hero {
    flex-direction: column;
    align-items: center;
    padding-left: 0;
    gap: 1rem;
  }

  .boton,
  .boton-servicios {
    width: 100%;
    max-width: 280px;
  }

  .tarjetas {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  section {
    padding: 2rem 1rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .lista-servicios {
    font-size: 0.95rem;
    padding: 1.5rem 1rem;
    border-radius: 15px;
    width: 90%; /* antes: 500px, causaba scroll horizontal */
  }

  .menu-servicios li {
    padding: 0.75rem 0;
  }

  .modal-contenido {
    width: 95%;
    padding: 0 1.5rem 1.5rem;
  }

  .cerrar {
    font-size: 1.5rem;
    margin-right: -15px;
    margin-top: -45px;
  }

  .contacto {
    font-size: 1.1rem;
    padding: 2rem 1rem;
    margin-top: 3rem;
  }

  .contacto a {
    font-size: 1.1rem;
  }

  .icono {
    width: 32px;
    height: 32px;
  }
}

/* Móviles muy pequeños (400px o menos) */
@media (max-width: 400px) {
  .logo {
    width: 140px;
  }

  .hero .matrix-text {
    font-size: 1.3rem; /* aún más pequeño */
  }

  .boton,
  .boton-servicios {
    font-size: 0.85rem;
    padding: 0.6rem;
  }

  .tarjetas {
    grid-template-columns: 1fr;
    font-size: 0.88rem;
  }

  .lista-servicios {
    font-size: 0.85rem;
  }
  .tarjeta br {
    display: none;
  }
  .contacto a {
    font-size: 1.1rem;
    margin: 1rem 0;
    display: inline-block;
  }

  footer {
    font-size: 0.55rem;
  }
}

/* Celulares y tablets, vertical y horizontal */
@media (max-width: 1200px) {
  .logo {
    position: static;
    display: block;
    width: 150px;
    margin: 1rem auto 0.5rem;
  }
  .lista-servicios {
    width: 90%;
  }
}
