/* unicarcl.com: estilos compartidos (DECISIONES.md #68 y #78).
   Mundo: la noche como mapa. Fondo violeta noche en toda la página, la
   ruta brilla en lila, las pantallas reales de la app flotan encima y una
   sola franja lavanda muestra los viajes de ejemplo. */

:root {
  --noche-0: #100f2a;
  --noche: #17163a;
  --noche-2: #1e1c48;
  --noche-3: #29265f;
  --linea: rgb(185 168 255 / 0.16);
  --linea-fuerte: rgb(185 168 255 / 0.32);
  --texto: #f5f2ff;
  --texto-2: #c8bff0;
  --lila: #b9a8ff;
  --lila-claro: #d9cfff;
  --violeta: #5c40cc;
  --violeta-hover: #6a4fe0;
  --violeta-700: #3e2896;
  --menta: #34d399;
  --menta-fondo: rgb(52 211 153 / 0.14);
  --lavanda: #cac6f8;
  --tinta: #16132b;
  --tinta-2: #403b66;
  --papel: #ffffff;
  --linea-clara: #e6e3f2;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --wrap: 76rem;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sombra: 0 30px 60px -28px rgb(4 2 16 / 0.75);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--violeta) var(--noche-0);
  background: var(--noche);
}

body {
  margin: 0;
  background: var(--noche);
  color: var(--texto);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--lila);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

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

::selection {
  background: var(--violeta);
  color: #fff;
}

section[id] {
  scroll-margin-top: 5rem;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: 2rem;
  }
}

/* Mantiene juntas las palabras de un título al cortar la línea */
.junto {
  white-space: nowrap;
}

.saltar {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 30;
  padding: 0.65rem 1rem;
  border-radius: var(--r-sm);
  background: var(--papel);
  color: var(--tinta);
  font-weight: 700;
}

.saltar:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- botones ---------- */

.btn,
.btn-borde {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font: 700 1rem/1.1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.3s var(--ease-out);
}

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

.btn:hover {
  background: var(--violeta-hover);
  transform: translateY(-2px);
}

.btn-borde {
  border: 1.5px solid var(--linea-fuerte);
  color: var(--texto);
}

.btn-borde:hover {
  border-color: var(--lila);
  transform: translateY(-2px);
}

.btn:active,
.btn-borde:active {
  transform: translateY(0) scale(0.98);
}

.btn svg,
.btn-borde svg {
  flex: none;
}

.btn-lg {
  min-height: 3.6rem;
  padding: 0.9rem 1.8rem;
  font-size: 1.05rem;
}

.btn-sm {
  min-height: 2.6rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.95rem;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.tiendas-nota {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.1rem;
  color: var(--texto-2);
  font-size: 0.88rem;
}

.tiendas-nota svg {
  color: var(--lila);
}

.enlace-flecha {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}

.enlace-flecha svg {
  transition: transform 0.3s var(--ease-out);
}

.enlace-flecha:hover svg {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-borde,
  .enlace-flecha svg {
    transition: none;
  }

  .btn:hover,
  .btn-borde:hover,
  .enlace-flecha:hover svg {
    transform: none;
  }
}

/* ---------- navegación ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: rgb(23 22 58 / 0.94);
  color: var(--texto);
  transition: border-color 0.3s ease;
}

.nav.con-sombra {
  border-bottom-color: var(--linea);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
}

.links {
  display: none;
}

@media (min-width: 52rem) {
  .links {
    display: flex;
    gap: 2.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
}

.links a {
  padding: 0.45rem 0;
  border-bottom: 2px solid transparent;
  color: var(--texto-2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.links a:hover {
  border-bottom-color: var(--lila);
  color: #fff;
}

/* ---------- portada ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(3.5rem, 2rem + 4vw, 6rem);
  border-bottom: 1px solid var(--linea);
  background:
    radial-gradient(60% 55% at 78% 40%, rgb(92 64 204 / 0.28), transparent 70%),
    var(--noche);
}

.hero-in {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 64rem) {
  .hero-in {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 2.5rem;
  }
}

.hero h1 {
  margin-bottom: 1.25rem;
  font-weight: 800;
  font-size: clamp(2.6rem, 1.3rem + 3.4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero h1 em,
.beneficios h2 em {
  font-style: normal;
  color: var(--lila);
}

.hero .lead {
  max-width: 30rem;
  margin-bottom: 2rem;
  color: var(--texto-2);
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.22rem);
}

/* Escena: mapa inclinado, tarjetas flotantes y teléfono con la app */
.escena {
  position: relative;
  aspect-ratio: 1.1;
  max-width: 44rem;
  width: 100%;
  margin-inline: auto;
  perspective: 1600px;
}

.plano {
  position: absolute;
  top: 9%;
  left: 0;
  width: 78%;
  overflow: hidden;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-lg);
  box-shadow: 0 50px 90px -40px rgb(0 0 0 / 0.8);
  transform: rotateX(26deg) rotateZ(-10deg);
  transform-origin: 50% 60%;
}

.mapa {
  display: block;
  width: 100%;
  height: auto;
}

.flota {
  position: absolute;
  z-index: 3;
  display: flex;
  border-radius: 18px;
  box-shadow: var(--sombra);
  font-size: 0.85rem;
  line-height: 1.3;
}

.flota strong {
  font-weight: 800;
}

.flota-conductor {
  top: 1%;
  left: 26%;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  background: var(--papel);
  color: var(--tinta);
}

.flota-cuerpo,
.flota-viaje {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.flota-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flota-gris {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--tinta-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.flota-gris svg {
  color: #f59e0b;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #e4dfff;
  color: #5842ed;
  font-weight: 800;
  font-size: 0.95rem;
}

.sello {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e7f8f0;
  color: #04603f;
  font-size: 0.7rem;
  font-weight: 700;
}

.flota-viaje {
  bottom: 3%;
  left: 3%;
  min-width: 15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--linea-fuerte);
  background: rgb(27 20 64 / 0.96);
  color: var(--texto);
}

.flota-viaje .hora {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.flota-ruta {
  color: var(--texto-2);
  font-weight: 600;
}

.flota-pie {
  margin-top: 0.35rem;
}

.flota-pie strong {
  font-size: 1.15rem;
}

.cupos {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--menta-fondo);
  color: var(--menta);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.en-vivo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--texto-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.en-vivo i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--menta);
}

.en-vivo b {
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}

/* Teléfono: marco dibujado alrededor de la captura real */
.telefono {
  position: absolute;
  z-index: 2;
  aspect-ratio: 9 / 18.6;
  padding: 2.6%;
  border: 1px solid var(--linea-fuerte);
  border-radius: 2.4rem;
  background: #0b0819;
  box-shadow:
    0 50px 80px -30px rgb(0 0 0 / 0.85);
}

.telefono img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 1.9rem;
  background: #faf7fe;
}

.telefono-hero {
  top: 0;
  right: 0;
  width: 31%;
  transform: rotateY(-20deg) rotateZ(5deg);
}

/* Celular: el mapa a todo el ancho, sin teléfono (las pantallas reales van
   en los pasos); las dos tarjetas arriba y abajo, fuera de los campus. */
@media (max-width: 39.99rem) {
  .escena {
    aspect-ratio: 0.82;
  }

  .plano {
    top: 15%;
    width: 100%;
    transform: rotateX(22deg) rotateZ(-6deg);
  }

  .telefono-hero {
    display: none;
  }

  .flota-conductor {
    top: 0;
    left: 0;
  }

  .flota-viaje {
    min-width: 0;
    right: 0;
    bottom: 0;
    left: auto;
  }
}

/* Entrada de la portada (solo con movimiento permitido) */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero .lead,
  .hero .acciones,
  .hero .tiendas-nota {
    animation: subir 0.8s var(--ease-out) both;
  }

  .hero .lead {
    animation-delay: 0.1s;
  }

  .hero .acciones {
    animation-delay: 0.2s;
  }

  .hero .tiendas-nota {
    animation-delay: 0.3s;
  }

  .plano {
    animation: plano 1.4s var(--ease-out) 0.1s both;
  }

  .mapa .ruta-trazo {
    stroke-dasharray: 1;
    animation: trazar 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.4s both;
  }

  .mapa .pin-campus {
    animation: aparecer 0.5s ease 1.8s both;
  }

  .telefono-hero {
    animation: telefono 1.2s var(--ease-out) 0.6s both;
  }

  .flota-conductor {
    animation: flotar 0.8s var(--ease-out) 1.2s both;
  }

  .flota-viaje {
    animation: flotar 0.8s var(--ease-out) 1.4s both;
  }
}

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes aparecer {
  from {
    opacity: 0;
  }
}

@keyframes trazar {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes plano {
  from {
    opacity: 0;
    transform: rotateX(42deg) rotateZ(-16deg) translateY(30px);
  }
}

@keyframes telefono {
  from {
    opacity: 0;
    transform: rotateY(-30deg) rotateZ(9deg) translateY(50px);
  }
}

@keyframes flotar {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

/* ---------- secciones ---------- */

.seccion {
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem);
}

/* Pega el punto final de los títulos (la tipografía le deja aire a la izquierda) */
.punto {
  margin-left: -0.07em;
}

.seccion h2 {
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

/* Revelado al entrar en pantalla (el contenido es visible sin JS) */
@media (prefers-reduced-motion: no-preference) {
  .js .revela {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.7s ease,
      transform 0.9s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 90ms);
  }

  .js .revela.visto {
    opacity: 1;
    transform: none;
  }
}

/* ---------- beneficios ---------- */

.beneficios {
  border-bottom: 1px solid var(--linea);
  background: var(--noche);
}

.pasos {
  background: var(--noche-2);
}

.beneficios-in {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 64rem) {
  .beneficios-in {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 2.6fr);
    gap: 3rem;
    align-items: start;
  }

  .beneficios h2 {
    font-size: 2.3rem;
  }
}

.beneficios-lista {
  display: grid;
  gap: 1.75rem 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .beneficios-lista {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .beneficios-lista {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 39.99rem) {
  .beneficios-lista li {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr);
    column-gap: 1rem;
  }

  .beneficios-lista .ico {
    grid-row: span 2;
    margin-bottom: 0;
  }
}

.ico {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  margin-bottom: 1.1rem;
  border-radius: 14px;
  background: var(--violeta);
  color: #fff;
}

.ico-verde {
  background: #0f8a5f;
}

.beneficios h3 {
  margin-bottom: 0.45rem;
  line-height: 1.25;
  font-weight: 800;
  font-size: 1.15rem;
}

.beneficios p {
  color: var(--texto-2);
  font-size: 0.95rem;
}

/* ---------- cómo funciona ---------- */

.pasos-in {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 64rem) {
  .pasos-cabeza {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
  }
}

.bajada-lila {
  max-width: 24rem;
  margin-top: 1rem;
  color: var(--lila);
  font-size: 1.05rem;
}

.pasos-lista {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 52rem) {
  .pasos-lista {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }

  /* La flecha que lleva de un paso al siguiente, en el espacio entre paneles */
  .paso:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(-1.25rem - 11px);
    width: 22px;
    height: 22px;
    background: var(--lila);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

.paso {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  position: relative;
  gap: 0.75rem;
  min-height: 20rem;
  padding: 1.4rem 0 0 1.3rem;
  border: 1px solid var(--linea);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--noche-3), var(--noche-2));
}

.paso-texto {
  padding-bottom: 1.4rem;
}

.paso-num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--violeta);
  font-weight: 800;
  font-size: 0.95rem;
}

.paso h3 {
  margin-bottom: 0.5rem;
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.2;
}

.paso p {
  color: var(--texto-2);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Pantalla real recortada, asomando desde el borde inferior del panel */
.pantalla-mini {
  align-self: end;
  overflow: hidden;
  height: 17rem;
  margin-top: 0.5rem;
  border: 6px solid #0b0819;
  border-bottom: 0;
  border-radius: 22px 0 23px 0;
  border-right: 0;
  background: #faf7fe;
}

.pantalla-mini img {
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .js .paso .pantalla-mini img {
    transform: translateY(18%);
    transition: transform 1.1s var(--ease-out) 0.15s;
  }

  .js .paso.visto .pantalla-mini img {
    transform: none;
  }
}

/* ---------- viajes de ejemplo (la franja lavanda) ---------- */

.viajes {
  background: var(--lavanda);
  color: var(--tinta);
}

.viajes-in {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 64rem) {
  .viajes-in {
    grid-template-columns: minmax(0, 0.55fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: center;
  }
}

.viajes-cabeza p {
  max-width: 24rem;
  margin: 0.9rem 0 1.25rem;
  color: var(--tinta-2);
}

.viajes .enlace-flecha {
  color: var(--violeta);
}

.viajes-lista {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(14rem, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0 0 0.5rem;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

@media (min-width: 64rem) {
  .viajes-lista {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }
}

.viaje {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.9rem;
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid #ddd6fb;
  border-radius: 20px;
  background: var(--papel);
  box-shadow: 0 18px 36px -26px rgb(0 0 0 / 0.3);
  scroll-snap-align: start;
}

.viaje-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.viaje .hora {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.viaje .cupos {
  background: #dcfaec;
  color: #046046;
}

.viaje-ruta {
  position: relative;
  display: grid;
  gap: 0.55rem;
  padding-left: 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.viaje-ruta::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: calc(0.35rem - 1px);
  width: 2px;
  background: #cfc6f6;
}

.viaje-ruta span {
  position: relative;
}

.viaje-ruta span::before {
  content: "";
  position: absolute;
  top: 0.42em;
  left: -1.4rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 2.5px solid var(--violeta);
  border-radius: 50%;
  background: var(--papel);
}

.viaje-ruta span:last-child::before {
  border-color: var(--violeta);
  background: var(--violeta);
}

.avatares {
  display: flex;
}

.avatares i {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-right: -0.45rem;
  border: 2px solid var(--papel);
  border-radius: 50%;
  background: #e4dfff;
  color: #5842ed;
  font-style: normal;
  font-weight: 800;
  font-size: 0.7rem;
}

.precio {
  font-size: 1.15rem;
  font-weight: 800;
}

/* ---------- comunidad y descarga ---------- */

.comunidad {
  overflow: hidden;
  background:
    radial-gradient(50% 60% at 20% 50%, rgb(92 64 204 / 0.25), transparent 70%),
    var(--noche);
}

.comunidad-in {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 64rem) {
  .comunidad-in {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.55fr);
    gap: 2.5rem;
  }
}

.collage {
  position: relative;
  height: clamp(22rem, 18rem + 12vw, 30rem);
  perspective: 1400px;
}

.foto {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--linea-fuerte);
  border-radius: 18px;
  box-shadow: var(--sombra);
}

.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto figcaption {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgb(14 10 34 / 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.foto-1 {
  top: 6%;
  left: 0;
  width: 42%;
  aspect-ratio: 4 / 3;
  transform: rotateY(18deg) rotateZ(-4deg);
}

.foto-2 {
  bottom: 4%;
  left: 6%;
  width: 38%;
  aspect-ratio: 4 / 3;
  transform: rotateY(14deg) rotateZ(3deg);
}

.foto-3 {
  top: 50%;
  right: 0;
  width: 26%;
  aspect-ratio: 3 / 4;
  transform: rotateY(-16deg) rotateZ(4deg);
}

.telefono-comunidad {
  top: 0;
  left: 36%;
  width: 34%;
  transform: rotateY(-14deg) rotateZ(-6deg);
}

/* Las tres etiquetas que salen del teléfono, como en la referencia */
.etiqueta {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem 0.45rem 0.45rem;
  border: 1px solid var(--linea-fuerte);
  border-radius: 999px;
  background: var(--noche-3);
  color: var(--texto);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--sombra);
}

.etiqueta svg {
  padding: 3px;
  border-radius: 50%;
  background: var(--violeta);
  color: #fff;
}

.etiqueta-1 {
  top: 8%;
  left: 62%;
}

.etiqueta-2 {
  top: 22%;
  left: 68%;
}

.etiqueta-3 {
  top: 36%;
  left: 64%;
}

.comunidad-texto h2 {
  max-width: 12ch;
}

.comunidad-texto p {
  max-width: 26rem;
  margin: 1rem 0 1.75rem;
  color: var(--texto-2);
}

.datos {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

@media (min-width: 40rem) and (max-width: 63.99rem) {
  .datos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.datos dt {
  color: var(--menta);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.datos dd {
  margin: 0.25rem 0 0;
  color: var(--texto-2);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: no-preference) {
  .js .collage .foto,
  .js .collage .telefono,
  .js .collage .etiqueta {
    opacity: 0;
    translate: 0 30px;
    transition:
      opacity 0.8s ease,
      translate 1s var(--ease-out);
  }

  .js .collage.visto .foto,
  .js .collage.visto .telefono,
  .js .collage.visto .etiqueta {
    opacity: 1;
    translate: 0 0;
  }

  .js .collage.visto .foto-2 {
    transition-delay: 0.1s;
  }

  .js .collage.visto .telefono {
    transition-delay: 0.2s;
  }

  .js .collage.visto .foto-3 {
    transition-delay: 0.3s;
  }

  .js .collage.visto .etiqueta-1 {
    transition-delay: 0.5s;
  }

  .js .collage.visto .etiqueta-2 {
    transition-delay: 0.65s;
  }

  .js .collage.visto .etiqueta-3 {
    transition-delay: 0.8s;
  }
}

/* ---------- pie ---------- */

.pie {
  border-top: 1px solid var(--linea);
  background: var(--noche-0);
  color: var(--texto-2);
}

.pie-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.8rem 1.2rem;
  font-size: 0.93rem;
}

.pie .brand {
  color: var(--texto);
  font-size: 1.1rem;
}

.pie .brand img {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
}

.pie nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.pie a {
  color: var(--texto-2);
}

.pie a:hover {
  color: #fff;
}

.pie-notas {
  display: grid;
  gap: 0.35rem;
  padding-bottom: 2.2rem;
  font-size: 0.8rem;
}

/* ---------- documentos legales y 404 ---------- */

.tabs {
  padding-bottom: 3.6rem;
  background: var(--noche);
}

.tabs nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

.tabs a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--linea-fuerte);
  border-radius: 999px;
  color: var(--texto-2);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.tabs a:hover {
  border-color: var(--lila);
  color: #fff;
}

.tabs a[aria-current] {
  border-color: #fff;
  background: #fff;
  color: var(--violeta-700);
}

.documento {
  max-width: var(--wrap);
  margin: -2.4rem auto 0;
  padding: 0 1.25rem 4.5rem;
}

.doc {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 0.5rem + 3vw, 3.25rem);
  border: 1px solid var(--linea-clara);
  border-radius: var(--r-lg);
  background: var(--papel);
  color: var(--tinta);
  line-height: 1.7;
  color-scheme: light;
}

.doc a:not(.btn) {
  color: var(--violeta);
}

.doc h1 {
  margin: 0 0 0.85rem;
  font-weight: 800;
  font-size: clamp(2rem, 1.5rem + 2.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 1rem;
}

.doc h1 + p {
  display: inline-block;
  margin-bottom: 1.8rem;
  padding: 0.25rem 0.9rem;
  border: 1px solid #eeeafd;
  border-radius: 999px;
  background: #f6f4fe;
  color: var(--violeta-700);
  font-size: 0.9rem;
}

.toc {
  margin: 0.5rem 0 2.5rem;
  padding: 0.2rem 1.2rem;
  border: 1px solid #eeeafd;
  border-radius: 16px;
  background: #f6f4fe;
}

.toc summary {
  padding: 0.8rem 0;
  color: var(--violeta-700);
  font-weight: 700;
  cursor: pointer;
}

.toc ol {
  padding-left: 1.3rem;
}

.toc li {
  margin: 0.3rem 0;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.route {
  position: relative;
  padding-left: 2.3rem;
}

.route::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  bottom: 0.4rem;
  left: calc(0.6rem - 2px);
  width: 4px;
  border-radius: 2px;
  background: #eeeafd;
}

.route h2 {
  position: relative;
  margin: 2.7rem 0 0.8rem;
  font-weight: 700;
  font-size: 1.38rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  scroll-margin-top: 5.5rem;
}

.route h2::before {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: -2.3rem;
  width: 1.2rem;
  height: 1.2rem;
  border: 4px solid var(--violeta);
  border-radius: 50%;
  background: var(--papel);
}

.route > h2:first-child {
  margin-top: 0;
}

.route p,
.route li {
  max-width: 68ch;
}

.route ul,
.route ol {
  padding-left: 1.2rem;
}

.route li {
  margin: 0.35rem 0;
}

.route li::marker {
  color: var(--violeta);
}

.route strong {
  font-weight: 700;
}

.tw {
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid var(--linea-clara);
  border-radius: 14px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--linea-clara);
  text-align: left;
  vertical-align: top;
}

.doc tr:last-child td {
  border-bottom: 0;
}

.doc th {
  background: #f6f4fe;
  color: var(--violeta-700);
  font-weight: 700;
}

.doc .end {
  margin: 3rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--linea-clara);
  color: var(--tinta-2);
  font-size: 0.95rem;
}

@media (max-width: 40rem) {
  .route {
    padding-left: 1.9rem;
  }

  .route h2::before {
    left: -1.9rem;
  }
}

/* 404 según el diseño del dueño (DECISIONES.md #86): el "404" con la
   carita y la parada con la mochila salen de su imagen; el resto es HTML. */
.pagina-404 {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #101336;
}

.pagina-404 .nav {
  background: rgb(16 19 54 / 0.94);
}

.pagina-404 .pie {
  background: #0c0e2b;
}

.perdido {
  display: grid;
  flex: 1;
  align-items: center;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

/* Como en el diseño del dueño, esta página usa casi todo el ancho */
.pagina-404 .wrap {
  max-width: 120rem;
}

@media (min-width: 60rem) {
  .pagina-404 .wrap {
    padding-inline: clamp(1.25rem, 6.4vw, 7.5rem);
  }
}

.perdido-in {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

/* Escritorio, con las medidas de la imagen del dueño (1823 px de ancho):
   el texto empieza ~4vw más adentro que el logo y la parada mide ~48vw,
   sobresaliendo un poco del borde derecho del contenido. */
@media (min-width: 60rem) {
  .perdido-in {
    grid-template-columns: minmax(0, 1fr) 42vw;
    gap: 2rem;
  }

  .perdido-texto {
    padding-inline-start: 4.1vw;
  }

  .perdido-in .perdido-parada {
    justify-self: start;
    width: calc(100% + 2vw);
    max-width: none;
  }

  .perdido h1 {
    white-space: nowrap;
  }
}

.perdido-numero {
  width: min(80%, 24rem);
  height: auto;
  margin: 0 0 0.75rem -0.5rem;
}

.perdido h1 {
  margin-bottom: 1rem;
  font-weight: 800;
  font-size: clamp(2.1rem, 0.3rem + 3.1vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.perdido h1 em {
  font-style: normal;
  color: var(--lila);
}

.perdido-texto p {
  max-width: 31rem;
  margin-bottom: 2rem;
  color: var(--texto);
  font-size: clamp(1.05rem, 0.9rem + 0.55vw, 1.375rem);
  line-height: 1.6;
  text-wrap: balance;
}

@media (min-width: 60rem) {
  .perdido .btn {
    min-height: 4rem;
    padding-inline: 2.1rem;
    font-size: 1.3rem;
  }
}

/* El corte de línea del diseño, solo donde el párrafo va en dos líneas */
.salto-escritorio {
  display: none;
}

@media (min-width: 100rem) {
  .perdido-in {
    grid-template-columns: minmax(0, 1fr) 46vw;
  }

  .salto-escritorio {
    display: inline;
  }

  .perdido-texto p {
    max-width: none;
  }
}

.perdido-explora {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  margin-top: 2rem;
  color: var(--lila);
  font-weight: 500;
  transition: color 0.2s ease;
}

.perdido-explora:hover {
  color: var(--texto);
}

.perdido-explora:hover span {
  text-decoration-thickness: 2.5px;
}

.perdido-explora svg {
  flex: none;
}

.perdido-explora span {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}

.perdido-parada {
  justify-self: center;
  width: min(100%, 56rem);
  height: auto;
}

.pie-correo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.pie-correo svg {
  color: var(--lila);
}

/* Entrada: el texto sube, el "404" aterriza con un pequeño rebote y la
   parada aparece después; nada se repite en bucle. */
@media (prefers-reduced-motion: no-preference) {
  .perdido-numero {
    animation: aterrizar 0.9s var(--ease-out) both;
  }

  .perdido h1,
  .perdido-texto p,
  .perdido .btn,
  .perdido-explora {
    animation: subir 0.8s var(--ease-out) both;
  }

  .perdido h1 {
    animation-delay: 0.12s;
  }

  .perdido-texto p {
    animation-delay: 0.2s;
  }

  .perdido .btn {
    animation-delay: 0.28s;
  }

  .perdido-explora {
    animation-delay: 0.34s;
  }

  .perdido-parada {
    animation: llegarParada 1.1s var(--ease-out) 0.25s both;
  }
}

@keyframes aterrizar {
  0% {
    opacity: 0;
    transform: translateY(-24px) rotate(-4deg);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) rotate(1deg);
  }
}

@keyframes llegarParada {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
}
