/*
 * LinaresDigital: sistema visual
 *
 * Sigue la habilidad landing-page-design (github.com/elayadesign/ai-design-skills):
 * una sola tipografía (Manrope), estilos de texto con nombre sobre la escala de
 * Tailwind, espaciados de la tabla B2, radios de Tailwind, fondos planos y la
 * curva de movimiento cubic-bezier(0.22, 1, 0.36, 1).
 */

@font-face {
  font-family: "Manrope";
  src: url("fuentes/manrope.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Espaciado (B2) */
  --s-25: 2px;
  --s-50: 4px;
  --s-75: 8px;
  --s-100: 12px;
  --s-200: 16px;
  --s-300: 24px;
  --s-400: 32px;
  --s-500: 40px;
  --s-600: 48px;
  --s-700: 64px;
  --s-800: 80px;
  --s-900: 96px;

  /* Radios (escala de Tailwind) */
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --r-full: 9999px;

  /* Movimiento (B7) */
  --curva: cubic-bezier(0.22, 1, 0.36, 1);

  /* Color: tema claro */
  --fondo: #f6f3ec;
  --superficie: #ffffff;
  --superficie-2: #efeae0;
  --tinta: #141414;
  --tinta-suave: #5e5b55;
  --linea: #e4ded3;
  --acento: #b84e1f;
  --acento-tinta: #ffffff;
  --titular-desde: #000000;
  --titular-hasta: #666666;
  --cristal: rgb(255 255 255 / 0.72);

  --ancho: 1120px;
  --ancho-texto: 680px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #131209;
    --superficie: #1f1f1f;
    --superficie-2: #272727;
    --tinta: #f2f0ea;
    --tinta-suave: #a8a49b;
    --linea: #313131;
    --acento: #e2733f;
    --acento-tinta: #131209;
    --titular-desde: #ffffff;
    --titular-hasta: #9b9b9b;
    --cristal: rgb(24 24 24 / 0.72);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

/* ---------- Estilos de texto (B1) ---------- */

.heading-1 { font-size: 3.75rem; line-height: 3.75rem; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 3rem; line-height: 3rem; font-weight: 600; letter-spacing: -0.02em; }
.heading-3 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 600; letter-spacing: -0.01em; }
.heading-4 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; }
.heading-5 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
.heading-6 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }
.title-1 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; }
.title-2 { font-size: 1.125rem; line-height: 1.75rem; font-weight: 500; }
.title-3 { font-size: 1rem; line-height: 1.5rem; font-weight: 500; }
.title-4 { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.body-1 { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.body-2 { font-size: 1rem; line-height: 1.5rem; font-weight: 500; }
.body-3 { font-size: 1rem; line-height: 1.5rem; font-weight: 400; }
.body-5 { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.body-6 { font-size: 0.875rem; line-height: 1.25rem; font-weight: 400; }
.button-md { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.button-sm { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; }
.caption-3 { font-size: 0.75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.caption-5 { font-size: 0.75rem; line-height: 1rem; font-weight: 400; }

.suave {
  color: var(--tinta-suave);
}

/* ---------- Utilidades de página ---------- */

.contenedor {
  width: min(var(--ancho), 100% - 2 * var(--s-200));
  margin-inline: auto;
}

.saltar {
  position: absolute;
  left: var(--s-200);
  top: -100px;
  z-index: 100;
  padding: var(--s-75) var(--s-100);
  background: var(--tinta);
  color: var(--fondo);
  border-radius: var(--r-lg);
  text-decoration: none;
}

.saltar:focus {
  top: var(--s-200);
}

.icono {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: currentColor;
}

/* ---------- Botones ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  gap: var(--s-75);
  padding: var(--s-75) var(--s-100);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 300ms var(--curva), color 300ms var(--curva), transform 300ms var(--curva), border-color 300ms var(--curva);
}

.boton:active {
  transform: scale(0.98);
}

.boton--primario {
  background: var(--acento);
  color: var(--acento-tinta);
}

.boton--primario:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--acento) 88%, var(--tinta));
}

.boton--secundario {
  border-color: var(--linea);
  background: var(--superficie);
}

.boton--secundario:hover {
  border-color: var(--tinta-suave);
}

.boton .icono {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform 300ms var(--curva);
}

.boton:hover .icono--flecha {
  transform: translateX(var(--s-50));
}

/* ---------- Navegación flotante (B7) ---------- */

.nav {
  position: fixed;
  top: var(--s-200);
  left: 0;
  right: 0;
  z-index: 50;
  width: max-content;
  max-width: calc(100% - 2 * var(--s-200));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--s-200);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200);
  border: 1px solid var(--linea);
  border-radius: var(--r-full);
  background: var(--cristal);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  white-space: nowrap;
}

.nav__marca {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-75);
  text-decoration: none;
}

.nav__marca img {
  width: 1.5rem;
  height: 1.5rem;
}

.nav__enlaces {
  display: flex;
  gap: var(--s-50);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__enlaces a {
  display: block;
  white-space: nowrap;
  padding: var(--s-50) var(--s-100);
  border-radius: var(--r-full);
  text-decoration: none;
  color: var(--tinta-suave);
  transition: color 300ms var(--curva), background-color 300ms var(--curva);
}

.nav__enlaces a:hover {
  color: var(--tinta);
  background: var(--superficie-2);
}

.nav__enlaces a[aria-current="page"] {
  color: var(--tinta);
  background: var(--superficie-2);
}

.nav__menu {
  position: relative;
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: var(--superficie-2);
  color: var(--tinta);
  cursor: pointer;
}

.nav__menu span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.125rem;
  height: 2px;
  margin: -1px 0 0 -0.5625rem;
  background: currentColor;
  border-radius: 2px;
  transition: transform 500ms var(--curva);
}

.nav__menu span:first-child {
  transform: translateY(-3px);
}

.nav__menu span:last-child {
  transform: translateY(3px);
}

.nav__menu[aria-expanded="true"] span:first-child {
  transform: rotate(45deg);
}

.nav__menu[aria-expanded="true"] span:last-child {
  transform: rotate(-45deg);
}

.panel-movil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-75);
  padding: var(--s-900) var(--s-300) var(--s-600);
  background: color-mix(in srgb, var(--fondo) 92%, transparent);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--curva), visibility 0s linear 300ms;
}

.panel-movil.abierto {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--curva);
}

.panel-movil a {
  padding: var(--s-75) 0;
  text-decoration: none;
  opacity: 0;
  transform: translateY(var(--s-300));
}

.panel-movil.abierto a {
  opacity: 1;
  transform: none;
  transition: opacity 500ms var(--curva), transform 500ms var(--curva);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* ---------- Portada: héroe (B5) ---------- */

.heroe {
  padding: calc(var(--s-900) + var(--s-700)) 0 var(--s-700);
}

.heroe__antetitulo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-75);
  margin-bottom: var(--s-300);
  padding: var(--s-50) var(--s-100);
  border: 1px solid var(--linea);
  border-radius: var(--r-full);
  background: var(--superficie);
}

.heroe__antetitulo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--acento);
}

.degradado {
  max-width: var(--ancho-texto);
  background: linear-gradient(90deg, var(--titular-desde), var(--titular-hasta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.heroe__entradilla {
  max-width: var(--ancho-texto);
  margin-top: var(--s-300);
}

.heroe__acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-200);
  margin-top: var(--s-500);
}

.heroe__prueba {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-75) var(--s-300);
  margin-top: var(--s-600);
  padding: 0;
  list-style: none;
}

.heroe__prueba li {
  display: flex;
  align-items: center;
  gap: var(--s-75);
}

/* ---------- Mundo de escenas (scroll-world) ---------- */

.mundo {
  position: relative;
  /* La altura total la fija mundo.js según el número de islas */
  height: calc(var(--islas, 9) * 100vh);
}

.mundo__escenario {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--superficie-2);
}

.mundo__lienzo {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.mundo__lienzo img {
  width: 100%;
  height: 100%;
  max-width: none;
}

.mundo__textos {
  position: absolute;
  left: var(--s-400);
  bottom: var(--s-400);
  width: min(420px, 100% - 2 * var(--s-400));
}

.mundo__tarjeta {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: var(--s-300);
  border: 1px solid var(--linea);
  border-radius: var(--r-2xl);
  background: var(--cristal);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(var(--s-400));
  pointer-events: none;
  transition: opacity 600ms var(--curva), transform 600ms var(--curva);
}

.mundo__tarjeta.activa {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mundo__tarjeta .caption-3 {
  color: var(--acento);
}

.mundo__tarjeta h3 {
  margin-top: var(--s-75);
}

.mundo__tarjeta p {
  margin-top: var(--s-100);
}

.etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-75);
  margin: var(--s-200) 0 0;
  padding: 0;
  list-style: none;
}

.etiquetas li {
  padding: var(--s-25) var(--s-100);
  border: 1px solid var(--linea);
  border-radius: var(--r-full);
  background: var(--superficie);
}

.mundo__tarjeta .boton {
  margin-top: var(--s-300);
}

.mundo__ruta {
  position: absolute;
  right: var(--s-400);
  top: 50%;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  gap: var(--s-100);
  margin: 0;
  padding: var(--s-100);
  list-style: none;
  border: 1px solid var(--linea);
  border-radius: var(--r-full);
  background: var(--cristal);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.mundo__ruta a {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--linea);
  transition: transform 300ms var(--curva), background-color 300ms var(--curva);
}

.mundo__ruta a:hover {
  transform: scale(1.3);
}

.mundo__ruta a[aria-current="step"] {
  background: var(--acento);
  transform: scale(1.3);
}

.mundo__pista {
  position: absolute;
  left: 50%;
  top: calc(var(--s-900) + var(--s-200));
  translate: -50% 0;
  padding: var(--s-50) var(--s-100);
  border-radius: var(--r-full);
  background: var(--cristal);
  transition: opacity 500ms var(--curva);
}

/* Sin JavaScript o con movimiento reducido: el mundo se muestra como imagen fija */
.sin-mundo .mundo {
  height: auto;
}

.sin-mundo .mundo__escenario {
  position: relative;
  height: auto;
  padding: var(--s-400) 0;
}

.sin-mundo .mundo__lienzo {
  position: relative;
  transform: none !important;
  width: 100% !important;
}

.sin-mundo .mundo__lienzo img {
  width: 100%;
  height: auto;
}

.sin-mundo .mundo__textos,
.sin-mundo .mundo__ruta,
.sin-mundo .mundo__pista {
  display: none;
}

/* ---------- Lema con revelado palabra a palabra (B11) ---------- */

.lema {
  padding: var(--s-900) 0;
}

.lema p {
  max-width: 760px;
}

.lema .palabra {
  opacity: 0.3;
  transition: opacity 500ms var(--curva);
}

.lema .palabra.vista {
  opacity: 1;
}

/* ---------- Apartados ---------- */

.seccion {
  padding: var(--s-800) 0;
}

.seccion__cabecera {
  max-width: var(--ancho-texto);
  margin-bottom: var(--s-500);
}

.seccion__cabecera p {
  margin-top: var(--s-200);
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-300);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--s-75);
  border: 1px solid var(--linea);
  border-radius: var(--r-2xl);
  background: var(--superficie);
  text-decoration: none;
  transition: transform 500ms var(--curva), border-color 300ms var(--curva);
}

.tarjeta:hover {
  transform: translateY(calc(-1 * var(--s-50)));
  border-color: var(--tinta-suave);
}

.tarjeta:active {
  transform: translateY(1px);
}

.tarjeta__imagen {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: var(--s-200);
  border-radius: var(--r-lg);
  background: var(--superficie-2);
}

.tarjeta__imagen img {
  width: 82%;
  height: 100%;
  object-fit: contain;
  transition: transform 500ms var(--curva);
}

.tarjeta:hover .tarjeta__imagen img {
  transform: scale(1.04);
}

.tarjeta__cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--s-75);
  padding: var(--s-200) var(--s-100) var(--s-100);
}

.tarjeta__cuerpo .caption-3 {
  color: var(--acento);
}

.tarjeta__mas {
  display: inline-flex;
  align-items: center;
  gap: var(--s-50);
  margin-top: auto;
  padding-top: var(--s-100);
}

.tarjeta:hover .icono--flecha {
  transform: translateX(var(--s-50));
}

.tarjeta .icono--flecha {
  width: 1rem;
  height: 1rem;
  transition: transform 300ms var(--curva);
}

/* ---------- Llamada final ---------- */

.final {
  padding: var(--s-900) 0;
  text-align: center;
}

.final .degradado {
  margin-inline: auto;
}

.final p {
  max-width: var(--ancho-texto);
  margin: var(--s-200) auto 0;
}

.final .heroe__acciones {
  justify-content: center;
}

/* ---------- Páginas de apartado ---------- */

.pagina-cabecera {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: var(--s-600);
  padding: calc(var(--s-900) + var(--s-600)) 0 var(--s-600);
}

.pagina-cabecera .caption-3 {
  color: var(--acento);
}

.pagina-cabecera h1 {
  margin-top: var(--s-100);
}

.pagina-cabecera .heroe__entradilla {
  margin-top: var(--s-200);
}

.migas {
  display: flex;
  gap: var(--s-75);
  margin-bottom: var(--s-300);
  padding: 0;
  list-style: none;
}

.migas li + li::before {
  content: "/";
  margin-right: var(--s-75);
  color: var(--tinta-suave);
}

.migas a {
  color: var(--tinta-suave);
  text-decoration: none;
}

.migas a:hover {
  color: var(--tinta);
}

.prosa {
  max-width: var(--ancho-texto);
  padding-bottom: var(--s-800);
}

.prosa h2 {
  margin: var(--s-600) 0 var(--s-200);
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
}

.prosa h3 {
  margin: var(--s-400) 0 var(--s-100);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
}

.prosa p,
.prosa ul,
.prosa ol,
.prosa blockquote {
  margin-bottom: var(--s-200);
  color: var(--tinta-suave);
}

.prosa strong {
  color: var(--tinta);
  font-weight: 600;
}

.prosa a {
  color: var(--tinta);
  text-decoration-color: var(--acento);
  text-underline-offset: 3px;
}

.prosa ul,
.prosa ol {
  padding-left: var(--s-300);
}

.prosa li + li {
  margin-top: var(--s-75);
}

.prosa blockquote {
  margin-left: 0;
  padding: var(--s-200) var(--s-300);
  border: 1px solid var(--linea);
  border-radius: var(--r-xl);
  background: var(--superficie);
}

.pendiente {
  padding: var(--s-25) var(--s-75);
  border: 1px dashed var(--acento);
  border-radius: var(--r-md);
  color: var(--acento);
  font-size: 0.875rem;
  line-height: 1.25rem;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.vecinos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-300);
  padding: var(--s-400) 0 var(--s-800);
  border-top: 1px solid var(--linea);
}

.vecinos a {
  display: flex;
  flex-direction: column;
  gap: var(--s-50);
  padding: var(--s-200);
  border: 1px solid var(--linea);
  border-radius: var(--r-xl);
  background: var(--superficie);
  text-decoration: none;
  transition: border-color 300ms var(--curva);
}

.vecinos a:hover {
  border-color: var(--tinta-suave);
}

.vecinos a:last-child {
  text-align: right;
}

/* ---------- Pie ---------- */

.pie {
  padding: var(--s-500) 0;
  border-top: 1px solid var(--linea);
}

.pie .contenedor {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-200);
}

.pie ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-300);
  padding: 0;
  list-style: none;
}

.pie a {
  text-decoration: none;
}

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

/* ---------- Revelado al hacer scroll (B7) ---------- */

.revelar {
  opacity: 0;
  transform: translateY(var(--s-400));
  transition: opacity 700ms var(--curva), transform 700ms var(--curva);
}

.revelar.visto {
  opacity: 1;
  transform: none;
}

.sin-js .revelar {
  opacity: 1;
  transform: none;
}

/* ---------- Pantallas estrechas ---------- */

@media (max-width: 860px) {
  .heading-1 { font-size: 3rem; line-height: 3rem; }
  .heading-2 { font-size: 2.25rem; line-height: 2.5rem; }

  .nav__enlaces {
    display: none;
  }

  .nav__menu {
    display: block;
  }

  .pagina-cabecera {
    grid-template-columns: 1fr;
    gap: var(--s-300);
  }

  .pagina-cabecera img {
    max-width: 320px;
  }

  .mundo__textos {
    left: var(--s-200);
    right: var(--s-200);
    bottom: calc(var(--s-200) + env(safe-area-inset-bottom));
    width: auto;
  }

  .mundo__ruta {
    right: var(--s-100);
    padding: var(--s-75);
    gap: var(--s-75);
  }

  .mundo__ruta a {
    width: 8px;
    height: 8px;
  }

  .vecinos {
    grid-template-columns: 1fr;
  }

  .vecinos a:last-child {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .heading-1 { font-size: 2.25rem; line-height: 2.5rem; }
  .heading-2 { font-size: 1.875rem; line-height: 2.25rem; }
  .heading-3 { font-size: 1.875rem; line-height: 2.25rem; }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .revelar {
    transform: none;
  }
}
