/* Hoja única del sitio de RUMI: la portada y las cuatro páginas legales.
   Sin JavaScript y sin nada en línea: la CSP del Caddyfile solo admite esta
   hoja, las imágenes y las fuentes propias. La paleta es la de la app
   (app/src/theme/tokens.ts) más la tierra y la sabana de las ilustraciones. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fuentes/nunito-400.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fuentes/nunito-700.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fuentes/nunito-800.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/fuentes/nunito-900.woff2") format("woff2");
}

:root {
  --navy: #002561;
  --noche: #001538;
  --amber: #fdbc1a;
  --amber-suave: #fdf1d4;
  --cielo-1: #5fc8f5;
  --cielo-2: #2e9fe0;
  --cielo-suave: #e7f2fd;
  --ink: #16233d;
  /* ink-2 de la app (#6B7A99) no llega a AA sobre blanco; este sí. */
  --tenue: #5b6474;
  --linea: #e4e9f0;
  --fondo: #ffffff;
  --tierra: #a76531;
  --sabana: #a3c11d;
  --pasto: #2d7324;

  --contenedor: 1200px;
  --margen: clamp(20px, 5vw, 40px);
  --cabecera: 68px;
  --sombra: 0 24px 48px -24px rgb(22 35 61 / 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cabecera) + 12px);
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--ink);
  font: 400 17px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.1;
  overflow-wrap: break-word;
  text-wrap: balance;
}

p,
li {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

a {
  color: var(--navy);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

strong {
  font-weight: 800;
}

.contenedor {
  width: min(100% - 2 * var(--margen), var(--contenedor));
  margin-inline: auto;
}

.salto {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
}

.salto:focus {
  top: 12px;
}

/* ---------- Cabecera ---------- */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgb(0 37 97 / 0.08);
}

.cabecera .contenedor {
  height: var(--cabecera);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cabecera .marca {
  display: block;
  padding: 6px 0;
}

.cabecera .marca img {
  width: 82px;
}

.cabecera nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cabecera nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
}

.cabecera nav a:hover {
  background: var(--cielo-suave);
}

.cabecera nav a.boton-ayuda {
  background: var(--navy);
  color: #fff;
  padding: 0 20px;
}

.cabecera nav a.boton-ayuda:hover {
  background: #0a3478;
}

.cabecera nav a[aria-current="page"] {
  text-decoration: underline 3px var(--amber);
  text-underline-offset: 6px;
}

.cabecera nav a.solo-ancho {
  display: none;
}

@media (min-width: 760px) {
  .cabecera nav a.solo-ancho {
    display: inline-flex;
  }
}

/* ---------- Insignia "Muy pronto" ---------- */

.acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.insignia {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 8px 22px 8px 10px;
  text-align: left;
  border-radius: 999px;
  background: var(--amber);
  color: var(--navy);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.2;
  box-shadow: 0 10px 24px -10px rgb(0 37 97 / 0.45), inset 0 -3px 0 rgb(0 37 97 / 0.12);
}

.insignia-punto {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
}

.insignia-punto::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgb(253 188 26 / 0.7);
  animation: latido 2.4s ease-out 3s infinite;
}

.insignia small {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.8;
}

.enlace-secundario {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgb(0 37 97 / 0.28);
}

.enlace-secundario:hover {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--navy);
}

/* ---------- Teléfono ----------
   El marco es CSS para que se vea nítido a cualquier escala. Adentro va la
   pantalla de bienvenida de la app, armada con sus mismas ilustraciones. */

.telefono {
  position: relative;
  width: var(--ancho-telefono, 290px);
  padding: 9px;
  border-radius: 48px;
  background: #0e1a33;
  box-shadow:
    inset 0 0 0 2px #2b3856,
    0 40px 70px -30px rgb(22 35 61 / 0.6),
    0 18px 30px -18px rgb(22 35 61 / 0.4);
}

.telefono::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 22%;
  width: 4px;
  height: 64px;
  border-radius: 0 3px 3px 0;
  background: #1d2a47;
}

.pantalla {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  border-radius: 40px;
  background: #49c6f8;
  container-type: inline-size;
}

.pantalla::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  width: 30%;
  height: 24px;
  border-radius: 999px;
  background: #0e1a33;
  transform: translateX(-50%);
}

.pantalla-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

.pantalla-letras {
  position: relative;
  z-index: 2;
  padding: 19cqi 7cqi 0;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgb(0 37 97 / 0.3);
}

.pantalla-titulo {
  margin: 0 0 3cqi;
  font-size: 9.6cqi;
  font-weight: 800;
  line-height: 1.12;
}

.pantalla-texto {
  margin: 0;
  font-size: 5.6cqi;
  font-weight: 700;
  line-height: 1.35;
}

.pantalla-escena {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 15%;
  width: 62%;
  transform: translateX(-50%);
}

.pantalla-puntos {
  position: absolute;
  z-index: 2;
  bottom: 6%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.8cqi;
}

.pantalla-puntos i {
  width: 2.4cqi;
  height: 2.4cqi;
  border-radius: 99px;
  background: var(--linea);
}

.pantalla-puntos i.activo {
  width: 6.4cqi;
  background: var(--navy);
}

/* ---------- Portada ---------- */

.portada {
  position: relative;
  overflow: hidden;
  background:
    url("/img/fondo-rubiales.svg") center bottom / cover no-repeat,
    linear-gradient(180deg, var(--cielo-2) 0%, var(--cielo-1) 62%);
  margin-top: calc(-1 * var(--cabecera));
  padding-top: calc(var(--cabecera) + clamp(32px, 6vw, 72px));
  /* el campo de abajo mide lo que mide la imagen de las colinas */
  --campo: max(100vw, 760px) * 0.2235;
  padding-bottom: calc(var(--campo) * 0.5);
}

/* El sol va pegado al teléfono para no pisar nunca el titular. */
.portada-telefono::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -9%;
  right: -26%;
  width: 46%;
  aspect-ratio: 97 / 105;
  background: url("/img/sol.svg") no-repeat center / contain;
  animation: girar 120s linear infinite;
}

/* El paisaje nuevo ya trae sus nubes. Estas, sueltas, cruzaban el titular
   y disolvía el botón blanco. */
.nube {
  display: none;
}

.nube-a {
  top: 22%;
  left: 4%;
  width: clamp(110px, 13vw, 190px);
  animation-duration: 38s;
}

.nube-b {
  top: 12%;
  left: 52%;
  width: clamp(80px, 9vw, 130px);
  animation-duration: 52s;
  animation-direction: alternate-reverse;
}

.nube-c {
  top: 48%;
  right: -2%;
  width: clamp(90px, 10vw, 150px);
  animation-duration: 46s;
}

@media (max-width: 759px) {
  .nube-a,
  .nube-c {
    display: none;
  }
}

.portada-contenido {
  position: relative;
  z-index: 3;
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

/* Un velo esmerilado: el paisaje se ve a través, desenfocado, y se disuelve
   hacia la derecha. z-index crea el plano del texto sin aislar el blur
   del paisaje que hay detrás. */
.portada-texto {
  position: relative;
  z-index: 1;
}

.portada-texto::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28% -4% -30% -22vw;
  border-radius: 48%;
  background: linear-gradient(
    108deg,
    rgb(255 255 255 / 0.68) 0%,
    rgb(176 220 244 / 0.42) 42%,
    rgb(105 197 240 / 0.18) 72%,
    transparent 100%
  );
  backdrop-filter: blur(42px) saturate(1.3);
  -webkit-backdrop-filter: blur(42px) saturate(1.3);
  mask-image: linear-gradient(108deg, #000 0%, #000 52%, transparent 96%);
  pointer-events: none;
}

.portada h1 {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 1rem + 5.6vw, 5.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.portada h1 .resalte {
  text-decoration: underline 0.14em var(--amber);
  text-decoration-skip-ink: none;
  text-underline-offset: 0.06em;
}

.portada-bajada {
  max-width: 38ch;
  margin: 0 0 32px;
  color: var(--navy);
  font-size: clamp(1.12rem, 1rem + 0.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.45;
}

.portada-texto > * {
  animation: subir 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.portada-texto > :nth-child(2) {
  animation-delay: 0.12s;
}

.portada-texto > :nth-child(3) {
  animation-delay: 0.24s;
}

.portada-telefono {
  position: relative;
  justify-self: center;
  margin-bottom: calc(var(--campo) * -0.3);
  --ancho-telefono: clamp(240px, 64vw, 300px);
  animation: subir 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}

.portada-telefono .telefono {
  animation: flotar 6s ease-in-out 1.3s infinite alternate;
}

/* El arbusto 3, delante del teléfono, lo planta en el campo. */
.portada-telefono::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: -18%;
  bottom: -8%;
  width: 44%;
  aspect-ratio: 70 / 56;
  background: url("/img/arbusto-3.svg") no-repeat center / contain;
}

.portada-campo {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -1px;
  width: max(100vw, 760px);
  max-width: none;
  transform: translateX(-50%);
}

.portada-arbusto {
  position: absolute;
  z-index: 4;
  bottom: -6px;
}

.portada-arbusto.izquierda {
  left: -30px;
  width: clamp(120px, 16vw, 240px);
}

.portada-arbusto.derecha {
  right: -20px;
  width: clamp(110px, 13vw, 200px);
}

/* El único momento coreografiado de la página: el armadillo entra
   caminando por el campo y se queda parado mirando la app. */
.portada-mascota {
  position: absolute;
  z-index: 5;
  left: clamp(8px, 9vw, 140px);
  bottom: calc(var(--campo) * 0.12);
  width: clamp(104px, 13vw, 190px);
  animation: llegar 2.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.5s both;
}

.portada-mascota img {
  transform-origin: 50% 100%;
  animation:
    paso 0.35s ease-in-out 0.5s 8 alternate,
    respirar 3.5s ease-in-out 3.5s infinite alternate;
}

@media (min-width: 960px) {
  .portada {
    min-height: min(100svh, 980px);
    /* Corre el paisaje a la derecha: la palma deja libre el titular. */
    background-position: 90% 100%, center;
  }

  .portada-contenido {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .portada-telefono {
    align-self: end;
  }
}

/* ---------- Encabezados de sección ---------- */

.seccion {
  position: relative;
  padding-block: clamp(72px, 10vw, 136px);
}

.seccion h2 {
  margin: 0 0 20px;
  font-size: clamp(2.05rem, 1.2rem + 3.1vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.seccion-bajada {
  max-width: 46ch;
  margin: 0;
  color: var(--tenue);
  font-size: 1.15rem;
}

/* ---------- Tipos de alojamiento: un pueblo sobre la sabana ---------- */

.tipos {
  padding-bottom: 0;
}

.tipos .encabezado {
  text-align: center;
}

.tipos .seccion-bajada {
  margin-inline: auto;
}

.pueblo-ventana {
  margin-top: 56px;
}

.pueblo {
  --suelo: 34px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(132px, 40vw, 168px);
  gap: 8px;
  margin: 0;
  padding: 0 0 calc(var(--suelo) + 64px);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--margen);
  scrollbar-width: none;
}

.pueblo::-webkit-scrollbar {
  display: none;
}

.pueblo li {
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.pueblo li::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -6px;
  right: -6px;
  bottom: calc(-1 * var(--suelo) + 6px);
  height: var(--suelo);
  /* cada casa pone su tramo; las franjas a lo alto hacen que empalmen sin costura */
  background: linear-gradient(180deg, #bed021 0 6px, var(--sabana) 6px calc(100% - 6px), #83ae1a 0);
}

.pueblo li:first-child::after {
  border-radius: 999px 0 0 999px;
}

.pueblo li:last-child::after {
  border-radius: 0 999px 999px 0;
}

.pueblo img {
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pueblo li:hover img {
  transform: translateY(-8px);
}

.pueblo span {
  position: absolute;
  bottom: calc(-1 * var(--suelo) - 44px);
  color: var(--navy);
  font-weight: 800;
  font-size: 1.05rem;
}

@media (min-width: 1100px) {
  .pueblo .repetido {
    display: none;
  }

  .pueblo {
    grid-auto-flow: row;
    grid-template-columns: repeat(7, 1fr);
    width: min(100% - 2 * var(--margen), 1320px);
    margin-inline: auto;
    padding-inline: 0;
    overflow: visible;
  }
}

/* En pantallas donde las siete casas no caben, la fila desfila sola.
   La copia (aria-hidden) permite que el salto de -50% sea invisible. */
@media (max-width: 1099px) {
  .pueblo-ventana {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }

  .pueblo {
    display: flex;
    width: max-content;
    gap: 0;
    padding-inline: 0;
    overflow: visible;
    scroll-snap-type: none;
    animation: desfilar 42s linear infinite;
  }

  .pueblo:hover,
  .pueblo:focus-within {
    animation-play-state: paused;
  }

  /* El margen va en cada casa, no en el hueco del flex: así -50% cae
     justo al inicio de la copia y el bucle no da un salto. */
  .pueblo li {
    flex: 0 0 clamp(148px, 42vw, 176px);
    margin-right: 8px;
    scroll-snap-align: none;
  }

  .pueblo li:first-child::after,
  .pueblo li:last-child::after {
    border-radius: 0;
  }
}

@keyframes desfilar {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ---------- Los pasos, como un camino con pines ---------- */

.dos-columnas {
  display: grid;
  gap: clamp(56px, 7vw, 96px);
  align-items: center;
}

@media (min-width: 960px) {
  .dos-columnas {
    grid-template-columns: 1fr 1fr;
  }

  .dos-columnas.visual-derecha > .visual {
    order: 2;
  }
}

.ruta {
  --pin: var(--navy);
  --pin-texto: #fff;
  --camino: var(--tierra);
  position: relative;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.ruta::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 30px;
  bottom: 40px;
  border-left: 4px dashed var(--camino);
  opacity: 0.55;
}

.ruta li {
  position: relative;
  counter-increment: paso;
  margin: 0;
  padding: 0 0 36px 76px;
}

.ruta li:last-child {
  padding-bottom: 0;
}

.ruta li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin);
  transform: rotate(-45deg);
  box-shadow: -3px 3px 0 rgb(0 0 0 / 0.08);
}

.ruta li::after {
  content: counter(paso);
  position: absolute;
  left: 2px;
  top: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--pin-texto);
  font-weight: 900;
  font-size: 1.2rem;
}

.ruta h3 {
  margin: 4px 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.ruta p {
  margin: 0;
  max-width: 40ch;
  color: var(--tenue);
  font-size: 1.08rem;
}

/* ---------- Para viajeros: de día ---------- */

.viajeros {
  background: var(--cielo-suave);
  overflow: hidden;
}

.visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
}

.visual .telefono {
  --ancho-telefono: clamp(230px, 62vw, 280px);
  z-index: 2;
}

.viajeros-mapa {
  position: absolute;
  width: min(118%, 560px);
  max-width: none;
  transform: rotate(-8deg);
  opacity: 0.95;
}

.viajeros-mascota {
  position: absolute;
  z-index: 3;
  right: max(-4%, calc(50% - 300px));
  bottom: -24px;
  width: clamp(110px, 30vw, 170px);
}

/* ---------- Para dueños: de noche ---------- */

.duenos {
  overflow: hidden;
  color: #dfe7f5;
  background:
    radial-gradient(circle at 82% 8%, rgb(253 188 26 / 0.16), transparent 34%),
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 28% 8%, #fff 60%, transparent 70%),
    radial-gradient(1.8px 1.8px at 44% 22%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 63% 12%, #fff 60%, transparent 70%),
    radial-gradient(1.6px 1.6px at 74% 30%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 91% 40%, #fff 60%, transparent 70%),
    radial-gradient(1.4px 1.4px at 6% 46%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 36% 52%, #fff 60%, transparent 70%),
    radial-gradient(1.6px 1.6px at 55% 40%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 84% 62%, #fff 60%, transparent 70%),
    radial-gradient(1.2px 1.2px at 20% 70%, #fff 60%, transparent 70%),
    linear-gradient(180deg, var(--noche), var(--navy));
  padding-bottom: calc(clamp(72px, 10vw, 136px) + max(100vw, 760px) * 0.12);
}

.duenos h2 {
  color: #fff;
}

.duenos h2 em {
  font-style: normal;
  color: var(--amber);
}

.duenos .seccion-bajada {
  color: #c6d2e6;
}

.duenos .ruta {
  --pin: var(--amber);
  --pin-texto: var(--navy);
  --camino: var(--amber);
}

.duenos .ruta h3 {
  color: #fff;
}

.duenos .ruta p {
  color: #c6d2e6;
}

.duenos .contenedor {
  position: relative;
  z-index: 2;
}

.duenos-casco {
  position: absolute;
  z-index: 3;
  left: max(-2%, calc(50% - 290px));
  bottom: 10px;
  width: clamp(120px, 32vw, 180px);
  transform: rotate(-10deg);
}

.duenos-radio {
  position: absolute;
  z-index: 3;
  right: max(4%, calc(50% - 250px));
  bottom: 40px;
  width: clamp(36px, 9vw, 52px);
  transform: rotate(12deg);
}

.duenos-campo {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -1px;
  width: max(100vw, 760px);
  max-width: none;
  transform: translateX(-50%) scaleY(0.55);
  transform-origin: 50% 100%;
  filter: brightness(0.32) saturate(0.7) hue-rotate(10deg);
}

/* ---------- Cómo funciona: tipografía, sin tarjetas ---------- */

.funciona .contenedor {
  display: grid;
  gap: 32px 64px;
  align-items: start;
}


.principios {
  margin: 0;
  padding: 0;
  list-style: none;
}

.principios li {
  margin: 0;
  padding: 28px 0 30px;
  border-top: 2px solid var(--linea);
}

.principios li:first-child {
  border-top: 3px solid var(--navy);
}

.principios strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: clamp(1.85rem, 1.1rem + 2.4vw, 3.1rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.principios span {
  color: var(--tenue);
  font-size: clamp(1.1rem, 1rem + 0.3vw, 1.3rem);
}

@media (min-width: 960px) {
  .funciona .contenedor {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .funciona h2 {
    max-width: 10ch;
    position: sticky;
    top: calc(var(--cabecera) + 32px);
  }
}

/* ---------- Cierre: el camino que sigue ---------- */

.cierre {
  padding-top: 0;
}

.cierre-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 40px;
  align-items: center;
  border-radius: clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, var(--cielo-2), var(--cielo-1));
  padding: clamp(48px, 7vw, 88px) clamp(24px, 6vw, 88px) 0;
  text-align: center;
}

.cierre-nube {
  display: none;
  position: absolute;
  top: 9%;
  right: 4%;
  width: clamp(90px, 10vw, 140px);
}

.cierre-texto {
  position: relative;
}

.cierre h2 {
  margin: 0 auto 32px;
  max-width: 13ch;
  font-size: clamp(2.3rem, 1.2rem + 3.8vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.025em;
}

.cierre .acciones {
  justify-content: center;
}

/* Una ventana en arco al camino de la app: la ilustración es vertical,
   así que entra entera sin recortar el cielo ni el camino. */
.cierre-ventana {
  position: relative;
  justify-self: center;
  width: min(100%, 360px);
  aspect-ratio: 456 / 660;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 0 10px rgb(255 255 255 / 0.35);
}

.cierre-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}

.cierre-mascota {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 40%;
  transform: translateX(-38%);
}

@media (min-width: 960px) {
  .cierre-panel {
    grid-template-columns: 1.1fr 0.9fr;
    padding-top: 72px;
    text-align: left;
  }

  .cierre-texto {
    padding-bottom: 72px;
  }

  .cierre-nube {
    display: block;
  }

  .cierre h2 {
    margin-left: 0;
  }

  .cierre .acciones {
    justify-content: flex-start;
  }

  .cierre-ventana {
    width: min(100%, 420px);
  }
}

/* ---------- Pie ---------- */

.pie {
  background: var(--navy);
  color: #c6d2e6;
  padding-block: 56px 40px;
  font-size: 0.98rem;
}

.pie .contenedor {
  display: grid;
  gap: 28px;
}

.pie-marca img {
  width: 128px;
}

.pie nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pie nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  margin-left: -12px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
}

.pie nav a:hover {
  text-decoration: underline 2px var(--amber);
  text-underline-offset: 5px;
}

.pie p {
  margin: 0;
}

@media (min-width: 760px) {
  .pie .contenedor {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .pie nav ul {
    justify-content: flex-end;
  }

  .pie p {
    grid-column: 1 / -1;
    padding-top: 24px;
    border-top: 1px solid rgb(255 255 255 / 0.12);
  }
}

/* ---------- Páginas legales ---------- */

.documento {
  width: min(100% - 2 * var(--margen), 760px);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) 0 88px;
}

.documento h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.documento h2 {
  margin: 48px 0 12px;
  font-size: 1.45rem;
  font-weight: 800;
}

.documento h3 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.vigencia {
  color: var(--tenue);
  font-size: 0.95rem;
  margin: 0 0 28px;
}

.datos {
  background: var(--cielo-suave);
  border-radius: 20px;
  padding: 18px 22px;
  margin: 0 0 24px;
}

.datos dl {
  margin: 0;
}

.datos dt {
  color: var(--tenue);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 12px;
}

.datos dt:first-child {
  margin-top: 0;
}

.datos dd {
  margin: 0;
}

.aviso {
  border-left: 4px solid var(--amber);
  background: var(--amber-suave);
  padding: 14px 18px;
  border-radius: 0 16px 16px 0;
  margin: 18px 0;
}

.tabla {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--linea);
}

th {
  color: var(--navy);
  font-weight: 800;
  background: var(--cielo-suave);
}

td:first-child {
  min-width: 160px;
}

.documento ol,
.documento ul {
  padding-left: 24px;
}

.documento li {
  margin: 6px 0;
}

/* En textos largos `pretty` deja cortes raros a mitad de renglón. */
.documento p,
.documento li {
  text-wrap: wrap;
}

/* ---------- Movimiento al desplazarse ----------
   Animaciones atadas al scroll, sin JavaScript. Donde el navegador no las
   soporta, @supports las salta y todo se ve quieto y completo. Animan
   translate, rotate, scale y opacity sueltos para sumarse al transform que
   cada pieza ya trae. Con reduce, la regla del final las apaga. */

@supports (animation-timeline: view()) {
  /* La cabecera se asienta al bajar, y una línea amber marca cuánto falta. */
  .cabecera {
    animation: asentar linear both;
    animation-timeline: scroll(root);
    animation-range: 0 160px;
  }

  .cabecera::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 3px;
    background: var(--amber);
    transform-origin: 0 50%;
    animation: progreso linear both;
    animation-timeline: scroll(root);
  }

  /* Portada: al bajar, cada capa se va a su ritmo. */
  .portada-texto {
    animation: capa-texto linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }

  .portada-telefono {
    animation:
      subir 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both,
      capa-telefono linear both;
    animation-timeline: auto, scroll(root);
    animation-range: normal, 0 100vh;
  }

  .portada-campo {
    animation: capa-campo linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }

  /* Títulos y bajadas suben al entrar. */
  .seccion h2,
  .seccion-bajada,
  .principios li,
  .cierre .acciones {
    animation: asomar linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 30%;
  }

  /* El camino de los pasos se dibuja al bajar y cada pin cae en su sitio. */
  .ruta {
    view-timeline: --ruta block;
  }

  .ruta::before {
    animation: trazar linear both;
    animation-timeline: --ruta;
    animation-range: entry 40% cover 60%;
  }

  .ruta li {
    view-timeline: --paso block;
    animation: asomar-lado linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 35%;
  }

  /* En el celular el recorte lateral no termina de abrirse mientras el paso
     está a la vista, y la frase se queda cortada a mitad de palabra. */
  @media (max-width: 959px) {
    .ruta li {
      animation: none;
    }
  }

  .ruta li::before,
  .ruta li::after {
    animation: clavar linear both;
    animation-timeline: --paso;
    animation-range: entry 30% cover 40%;
  }

  /* Teléfonos y utilería entran con un leve giro, cada uno hacia su lado. */
  .visual .telefono {
    animation: entrar-telefono linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  .duenos .visual .telefono {
    animation-name: entrar-telefono-espejo;
  }

  .viajeros-mapa {
    animation: desplegar-mapa linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
  }

  .viajeros-mascota {
    animation: llegar-lado linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  .duenos-casco {
    animation: caer-casco linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }

  .duenos-radio {
    animation: llegar-lado linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  /* Cierre: el armadillo se aleja camino arriba mientras pasa la ventana. */
  .cierre-mascota {
    animation: alejarse linear both;
    animation-timeline: view();
    animation-range: entry 60% exit 30%;
  }

  /* El pueblo: en ancho las casas brotan una tras otra. En el celular
     la fila ya se mueve sola y esta animación no debe pisarla. */
  @media (min-width: 1100px) {
    .pueblo img {
      transform-origin: 50% 100%;
      animation: brotar linear both;
      animation-timeline: view();
    }

    .pueblo li:nth-child(1) img { animation-range: entry 20% cover 30%; }
    .pueblo li:nth-child(2) img { animation-range: entry 30% cover 33%; }
    .pueblo li:nth-child(3) img { animation-range: entry 40% cover 36%; }
    .pueblo li:nth-child(4) img { animation-range: entry 50% cover 39%; }
    .pueblo li:nth-child(5) img { animation-range: entry 60% cover 42%; }
    .pueblo li:nth-child(6) img { animation-range: entry 70% cover 45%; }
    .pueblo li:nth-child(7) img { animation-range: entry 80% cover 48%; }
  }
}

/* Detalles que no dependen del scroll. */
.portada-mascota img,
.enlace-secundario,
.insignia {
  transition: translate 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.portada-mascota:hover img {
  translate: 0 -10px;
}

.enlace-secundario:hover {
  translate: 0 -2px;
}

.ruta li:hover::before {
  translate: 0 -4px;
  transition: translate 0.25s;
}

.ruta li:hover::after {
  translate: 0 -4px;
  transition: translate 0.25s;
}

/* La noche: un puñado de estrellas que titilan y, de vez en cuando, una fugaz. */
.duenos::before {
  content: "";
  position: absolute;
  inset: 0 0 30% 0;
  background:
    radial-gradient(1.6px 1.6px at 18% 30%, #fff 60%, transparent 70%),
    radial-gradient(1.4px 1.4px at 48% 12%, #fff 60%, transparent 70%),
    radial-gradient(1.8px 1.8px at 68% 24%, #fff 60%, transparent 70%),
    radial-gradient(1.4px 1.4px at 88% 16%, #fff 60%, transparent 70%),
    radial-gradient(1.6px 1.6px at 32% 44%, #fff 60%, transparent 70%);
  animation: titilar 3.2s ease-in-out infinite alternate;
  pointer-events: none;
}

.duenos::after {
  content: "";
  position: absolute;
  top: 9%;
  left: 62%;
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  opacity: 0;
  rotate: 18deg;
  animation: fugaz 11s ease-in 4s infinite;
  pointer-events: none;
}

/* ---------- Movimiento ---------- */

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes llegar {
  from {
    transform: translateX(-46vw);
  }
}

@keyframes paso {
  to {
    transform: translateY(-5%) rotate(-3deg);
  }
}

@keyframes respirar {
  to {
    transform: translateY(-3%);
  }
}

@keyframes flotar {
  to {
    transform: translateY(-12px);
  }
}

@keyframes deriva {
  to {
    transform: translateX(14vw);
  }
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

@keyframes latido {
  70% {
    box-shadow: 0 0 0 10px rgb(253 188 26 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(253 188 26 / 0);
  }
}

@keyframes asentar {
  to {
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 10px 30px -18px rgb(22 35 61 / 0.35);
  }
}

@keyframes progreso {
  from {
    scale: 0 1;
  }
}

@keyframes capa-texto {
  to {
    translate: 0 -70px;
    opacity: 0.35;
  }
}

@keyframes capa-telefono {
  to {
    translate: 0 -120px;
  }
}

@keyframes capa-campo {
  to {
    translate: 0 60px;
  }
}

/* El texto entra descubriéndose, no con opacidad: así su color, y su
   contraste, es siempre el final. */
@keyframes asomar {
  from {
    translate: 0 36px;
    clip-path: inset(-10% -10% 100% -10%);
  }
  to {
    clip-path: inset(-10%);
  }
}

@keyframes asomar-lado {
  from {
    translate: 28px 0;
    clip-path: inset(-10% 100% -10% -10%);
  }
  to {
    clip-path: inset(-10%);
  }
}

@keyframes trazar {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes clavar {
  from {
    opacity: 0;
    translate: 0 -24px;
  }
}

@keyframes entrar-telefono {
  from {
    opacity: 0.2;
    translate: 0 90px;
    rotate: -7deg;
  }
}

@keyframes entrar-telefono-espejo {
  from {
    opacity: 0.2;
    translate: 0 90px;
    rotate: 7deg;
  }
}

@keyframes desplegar-mapa {
  from {
    opacity: 0;
    scale: 0.8;
    rotate: -10deg;
  }
}

@keyframes llegar-lado {
  from {
    opacity: 0;
    translate: 70px 20px;
  }
}

@keyframes caer-casco {
  from {
    opacity: 0;
    translate: 0 -90px;
    rotate: -30deg;
  }
}

@keyframes alejarse {
  from {
    translate: 0 12%;
    scale: 1.15;
  }
  to {
    translate: 8% -105%;
    scale: 0.5;
  }
}

@keyframes brotar {
  from {
    opacity: 0;
    translate: 0 24px;
    scale: 0.6;
  }
}

@keyframes titilar {
  to {
    opacity: 0.25;
  }
}

@keyframes fugaz {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  3% {
    opacity: 1;
  }
  8%,
  100% {
    opacity: 0;
    translate: 260px 85px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  /* Sin animación, la línea de progreso quedaría llena todo el tiempo. */
  .cabecera::after {
    display: none;
  }

  /* La cinta quieta: una sola fila, y se recorre con el dedo. */
  .pueblo-ventana {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: none;
  }

  .pueblo .repetido {
    display: none;
  }
}
