/* Portada */

/* ---------- Héroe: texto y logo desplegado sobre la rejilla ---------- */
.hero {
  overflow: clip;
  border-bottom: 1px solid var(--rejilla);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: center;
  gap: 48px;
  padding-block: clamp(56px, 8vw, 104px);
}

/* La rejilla del logo continúa hasta el borde de la ventana. */
.hero-art {
  margin-right: calc((100vw - min(100vw - 2 * var(--gutter), var(--container))) / -2);
}
.hero-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.art-grid {
  fill: none;
  stroke: var(--rejilla);
  stroke-width: 0.3;
}
.art-pixel {
  fill: var(--cobalto);
}
.route {
  fill: none;
  stroke-linejoin: round;
  stroke-dasharray: 100;
}
.route-s-edge,
.route-p-edge {
  stroke-width: 7.2;
}
.route-s-edge {
  stroke: var(--trazo);
}
.route-p-edge {
  stroke: var(--cobalto);
}
.route-fill {
  stroke: var(--placa);
  stroke-width: 4.8;
}

/* Única animación automática: el recorrido del logo se traza al cargar. */
@media (prefers-reduced-motion: no-preference) {
  .route {
    animation: trazar 1.1s cubic-bezier(0.6, 0, 0.3, 1) both;
  }
  .route-p-edge ~ .route-fill,
  .route-p-edge {
    animation-delay: 0.15s;
  }
  .route-s-edge,
  .route-s-edge + .route-fill {
    animation-delay: 0.65s;
  }
  .art-pixel {
    animation: encender 0.3s steps(2, end) 1.6s both;
  }
}
@keyframes trazar {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes encender {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .hero-art {
    order: -1;
    max-width: 640px;
  }
  .hero-art svg {
    min-width: 0;
    width: 150%;
  }
}

/* ---------- ¿Qué necesitas? ---------- */
.needs {
  margin-top: 48px;
  padding: 0;
  border-top: 1px solid var(--rejilla);
  list-style: none;
}
.need {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 5fr) minmax(0, 6fr) 14rem;
  align-items: center;
  gap: 32px;
  padding-block: 28px;
  border-bottom: 1px solid var(--rejilla);
}
.need-icon {
  width: 48px;
  height: 48px;
  fill: var(--cobalto);
}
.need h3 {
  font-size: clamp(var(--step-1), 2.2vw, var(--step-2));
}
.need h3 a {
  text-decoration: none;
}
/* El enlace del título cubre toda la fila. */
.need h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.need p {
  max-width: 34em;
  color: var(--trazo-2);
}
.need-more {
  color: var(--cobalto);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  white-space: nowrap;
  justify-self: end;
}
.need:hover h3 a,
.need:focus-within h3 a {
  color: var(--cobalto);
}
.need:hover .need-more {
  text-decoration-thickness: 2px;
}
.need:has(a:focus-visible) {
  outline: 2px solid var(--cobalto);
  outline-offset: 8px;
}
.need h3 a:focus-visible {
  outline: none;
}
@media (max-width: 860px) {
  .need {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px 20px;
    align-items: start;
  }
  .need-icon {
    width: 40px;
    height: 40px;
    grid-row: span 3;
  }
}
