/* ==========================================================
   w3ndi Soluciones Informáticas — landing
   Dirección 1: claridad técnica
   Azul = estructura · Coral = solo acciones · Lavanda = apoyo
   ========================================================== */

:root {
  /* Marca (tomados del logo) */
  --azul: #0a4fb0;
  --coral: #f85252;
  --lavanda: #8494f8;

  /* Apoyo */
  --azul-profundo: #0b2a5b;
  --texto: #1b2a41;
  --texto-suave: #4d5b73;
  --fondo: #ffffff;
  --fondo-suave: #f0f3ff;
  --linea: #d9e0f5;
  --texto-sobre-coral: #07183a;

  /* Tipografía */
  --fuente: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Espaciado y forma */
  --ancho: 68rem;
  --radio: 0.75rem;
  --seccion: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--azul-profundo);
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.3;
}

a {
  color: var(--azul);
}

:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 3px;
  border-radius: 4px;
}

.contenedor {
  width: min(100% - 2.5rem, var(--ancho));
  margin-inline: auto;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--azul-profundo);
  color: #fff;
  border-radius: var(--radio);
  text-decoration: none;
}

.saltar:focus {
  top: 1rem;
}

/* ---------- Botones (el coral vive solo aquí) ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.6rem;
  font: inherit;
  font-weight: 600;
  color: var(--texto-sobre-coral);
  background: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.boton:hover {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.boton-chico {
  min-height: 2.5rem;
  padding: 0.4rem 1.2rem;
  font-size: 0.95rem;
}

.enlace-flecha {
  font-weight: 500;
  text-underline-offset: 0.25em;
}

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--linea);
}

.cabecera-interior {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
}

.marca {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.marca-icono {
  width: 2.6rem;
  height: auto;
}

.marca-texto {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.marca-nombre {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--coral);
}

.marca-detalle {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--azul);
}

/* Menú móvil sin JavaScript (casilla + etiqueta) */
.menu-casilla {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.menu-boton {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  border: 2px solid var(--linea);
  border-radius: var(--radio);
}

.menu-casilla:focus-visible + .menu-boton {
  outline: 3px solid var(--azul);
  outline-offset: 3px;
}

.menu-boton-linea,
.menu-boton-linea::before,
.menu-boton-linea::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--azul);
  border-radius: 2px;
  content: "";
}

.menu-boton-linea {
  position: relative;
}

.menu-boton-linea::before {
  position: absolute;
  top: -6px;
}

.menu-boton-linea::after {
  position: absolute;
  top: 6px;
}

.menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0 1.5rem;
  background: var(--fondo);
  border-bottom: 1px solid var(--linea);
}

.menu-casilla:checked ~ .menu {
  display: flex;
}

.menu-enlace {
  padding: 0.7rem 0.25rem;
  color: var(--azul-profundo);
  font-weight: 500;
  text-decoration: none;
}

.menu-enlace:hover {
  color: var(--azul);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.menu .boton {
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* ---------- Portada ---------- */
.portada {
  padding-block: clamp(2.5rem, 7vw, 5.5rem) var(--seccion);
}

.portada-interior {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.portada-texto {
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}

.portada-bajada {
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--texto-suave);
}

.portada-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.portada-ilustracion {
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
}

/* Único momento animado: las líneas de código se escriben una vez */
.codigo-linea {
  transform-box: fill-box;
  transform-origin: left center;
  animation: escribir 0.7s ease-out both;
}

.codigo-linea:nth-of-type(2) { animation-delay: 0.25s; }
.codigo-linea:nth-of-type(3) { animation-delay: 0.45s; }
.codigo-linea:nth-of-type(4) { animation-delay: 0.65s; }
.codigo-linea:nth-of-type(5) { animation-delay: 0.85s; }
.codigo-linea:nth-of-type(6) { animation-delay: 1.05s; }

@keyframes escribir {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Secciones ---------- */
.seccion {
  padding-block: var(--seccion);
}

.seccion-suave {
  background: var(--fondo-suave);
}

.seccion-titulo {
  display: grid;
  gap: 0.9rem;
  max-width: 38rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.seccion-titulo p {
  color: var(--texto-suave);
}

/* ---------- Servicios ---------- */
.servicios {
  display: grid;
  gap: 2.25rem 3rem;
  list-style: none;
  padding: 0;
}

.servicio {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.2rem 1.1rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--azul);
}

.servicio-icono {
  grid-row: span 2;
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: var(--azul);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.servicio p {
  color: var(--texto-suave);
}

/* ---------- Por qué w3ndi ---------- */
.razones {
  display: grid;
  gap: 2rem;
  list-style: none;
  padding: 0;
}

.razon {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.1rem;
  border-left: 4px solid var(--lavanda);
}

.razon p {
  color: var(--texto-suave);
}

/* ---------- Cómo trabajamos (secuencia real: sí lleva números) ---------- */
.pasos {
  display: grid;
  gap: 2rem;
  list-style: none;
  padding: 0;
  counter-reset: paso;
}

.paso {
  position: relative;
  display: grid;
  gap: 0.4rem;
  padding-left: 4rem;
  counter-increment: paso;
}

.paso::before {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--azul);
  font-weight: 600;
  border: 2px solid var(--azul);
  border-radius: 50%;
  content: counter(paso);
}

.paso p {
  color: var(--texto-suave);
}

/* ---------- Contacto ---------- */
.contacto-interior {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  max-width: 38rem;
}

.contacto-interior p {
  color: var(--texto-suave);
}

.contacto-datos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

/* ---------- Pie ---------- */
.pie {
  padding-block: 2rem;
  border-top: 1px solid var(--linea);
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.pie-interior {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pie-logo {
  width: 4.5rem;
  height: auto;
}

/* ---------- Tablet y escritorio ---------- */
@media (min-width: 52rem) {
  .menu-boton {
    display: none;
  }

  .menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    padding: 0;
    background: none;
    border: 0;
  }

  .menu .boton {
    margin-top: 0;
  }

  .portada-interior {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
  }

  .servicios {
    grid-template-columns: repeat(2, 1fr);
  }

  .razones {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .pasos {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .paso {
    padding-left: 0;
    padding-top: 4rem;
  }
}

/* ---------- Preferencias de la persona ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .codigo-linea {
    animation: none;
  }

  .boton {
    transition: none;
  }
}
