/* =========================================================
   San Juan 1944 · Menú principal
   ========================================================= */

body.app {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, #22325a 0%, rgba(34, 50, 90, 0) 60%),
    var(--noche);
  background-attachment: fixed;
  padding-bottom: calc(96px + var(--seguro-abajo));
}

.contenedor {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--noche-baja);
  transition: opacity 0.6s ease, visibility 0.6s;
}
.splash.fuera { opacity: 0; visibility: hidden; }
.splash__centro {
  width: min(560px, 88vw);
  text-align: center;
}
.splash .sismo { width: 100%; height: auto; overflow: visible; }
.splash .sismo path {
  stroke: url(#grad-splash);
  stroke-width: 2.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trazar 1.7s cubic-bezier(0.55, 0.1, 0.4, 1) 0.2s forwards;
}
.splash__hora {
  font-family: var(--f-titulo);
  font-size: var(--t-xxl);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--tinta);
  font-variant-numeric: tabular-nums;
  margin-top: 18px;
  opacity: 0;
  animation: aparecer 0.5s ease 1.25s forwards;
}
.splash__titulo {
  margin-top: 6px;
  font-family: var(--f-titulo);
  font-size: var(--t-l);
  font-weight: 400;
  color: var(--adobe);
  opacity: 0;
  animation: aparecer 0.5s ease 1.6s forwards;
}
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { to { opacity: 1; } }

/* ---------- Vistas ---------- */
.vista { display: none; }
.vista.activa { display: block; }

/* ---------- Portada ---------- */
.portada {
  position: relative;
  padding-top: calc(28px + var(--seguro-arriba));
  padding-bottom: 28px;
}
.portada__fecha {
  font-family: var(--f-titulo);
  font-size: var(--t-s);
  color: var(--polvo);
  letter-spacing: 0.02em;
}
.portada__fecha time { color: var(--tinta); font-variant-numeric: tabular-nums; }

.portada__titulo {
  position: relative;
  margin-top: 18px;
  isolation: isolate;
}
.portada__titulo h1 {
  font-size: clamp(3.4rem, 15vw, 7.5rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--papel);
}
.portada__titulo h1 span { display: block; }
.portada__titulo .sismo {
  position: absolute;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  top: 50%;
  width: calc(100% + var(--gutter) * 2);
  height: 46%;
  transform: translateY(-50%);
  z-index: -1;
  opacity: 0.9;
}
.portada__titulo .sismo path { stroke: url(#grad-portada); stroke-width: 1.6; }

.portada__bajada {
  margin-top: 22px;
  max-width: 36ch;
  font-size: var(--t-l);
  line-height: 1.45;
  color: rgba(241, 236, 226, 0.86);
}

/* ---------- Lista de edificios ---------- */
.lista {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--linea);
}
.lista li { border-bottom: 1px solid var(--linea); }

.lugar {
  display: grid;
  grid-template-columns: 128px 1fr 20px;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  text-decoration: none;
  color: inherit;
}
.lugar__imagen {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: end center;
}
/* Elipse de piso: alude a la superficie donde se apoya el modelo en RA */
.lugar__imagen::before {
  content: "";
  position: absolute;
  left: 4%; right: 4%; bottom: 6%;
  height: 30%;
  border-radius: 50%;
  border: 1px solid var(--linea-fuerte);
  background: radial-gradient(closest-side, rgba(216, 195, 160, 0.14), rgba(216, 195, 160, 0));
}
.lugar__imagen img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  padding-bottom: 12%;
  transition: transform 0.35s ease;
}
.lugar:hover .lugar__imagen img { transform: translateY(-3px); }

.lugar__texto { min-width: 0; }
.lugar__texto h2 {
  font-size: var(--t-l);
  font-weight: 600;
}
.lugar__sub {
  margin-top: 4px;
  font-style: italic;
  color: var(--polvo);
  font-size: var(--t-s);
  line-height: 1.4;
}
.lugar__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}
.lugar__anio {
  font-family: var(--f-titulo);
  font-size: var(--t-s);
  color: var(--adobe);
  font-variant-numeric: tabular-nums;
}
.lugar__flecha { width: 20px; height: 20px; color: var(--polvo); }

.leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 18px;
}

/* ---------- Encabezado de vistas secundarias ---------- */
.encabezado {
  padding-top: calc(36px + var(--seguro-arriba));
  padding-bottom: 8px;
}
.encabezado h1 {
  font-size: clamp(2.3rem, 9vw, 3.6rem);
  line-height: 1;
}
.encabezado p {
  margin-top: 14px;
  max-width: 40ch;
  font-size: var(--t-l);
  line-height: 1.45;
  color: rgba(241, 236, 226, 0.86);
}

/* ---------- Línea de tiempo ---------- */
.tiempo {
  list-style: none;
  margin: 32px 0 0;
  padding: 0 0 0 26px;
  border-left: 1px solid var(--linea-fuerte);
  max-width: 64ch;
}
.tiempo li { position: relative; padding-bottom: 34px; }
.tiempo li::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--noche);
  border: 1px solid var(--adobe);
}
.tiempo li.tiempo__sismo::before { background: var(--tinta); border-color: var(--tinta); }
.tiempo h2 {
  font-size: var(--t-m);
  font-weight: 600;
  color: var(--adobe);
  font-variant-numeric: tabular-nums;
}
.tiempo .tiempo__sismo h2 { color: var(--tinta); }
.tiempo p { margin-top: 8px; color: rgba(241, 236, 226, 0.88); line-height: 1.65; }

.fuentes {
  margin-top: 8px;
  max-width: 64ch;
  font-size: var(--t-s);
  color: var(--polvo);
}
.fuentes a { color: var(--adobe); }

/* ---------- Cómo usar ---------- */
.pasos {
  list-style: none;
  counter-reset: paso;
  margin: 28px 0 0;
  padding: 0;
  max-width: 60ch;
}
.pasos li {
  counter-increment: paso;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--linea);
}
.pasos li::before {
  content: counter(paso);
  font-family: var(--f-titulo);
  font-size: var(--t-xl);
  font-weight: 300;
  color: var(--adobe);
  line-height: 1;
}
.pasos strong { font-family: var(--f-titulo); font-weight: 600; display: block; margin-bottom: 2px; }
.pasos span { color: rgba(241, 236, 226, 0.84); }

.bloque {
  margin-top: 36px;
  max-width: 60ch;
}
.bloque h2 { font-size: var(--t-l); margin-bottom: 10px; }
.bloque p { color: rgba(241, 236, 226, 0.84); }
.bloque p + p { margin-top: 10px; }

.qr {
  display: none;
  margin-top: 36px;
  gap: 20px;
  align-items: center;
}
.qr.visible { display: flex; }
.qr__codigo {
  width: 132px; height: 132px;
  padding: 10px;
  background: var(--papel);
  border-radius: 12px;
  flex: none;
}
.qr__codigo img, .qr__codigo svg { width: 100%; height: 100%; }
.qr p { max-width: 30ch; color: rgba(241, 236, 226, 0.84); }

#instalar { margin-top: 18px; display: none; }
#instalar.visible { display: inline-flex; }

/* ---------- Pie ---------- */
.credito {
  margin: 44px 0 0;
  padding: 22px 0 8px;
  border-top: 1px solid var(--linea);
  font-family: var(--f-titulo);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: var(--polvo);
}
.credito b { color: var(--papel); font-weight: 600; }

/* ---------- Barra de pestañas ---------- */
.pestanas {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--seguro-abajo));
  transform: translateX(-50%);
  z-index: 50;
  width: min(420px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px;
  border-radius: 22px;
  background: rgba(17, 26, 46, 0.78);
  border: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 12px 30px rgba(5, 8, 18, 0.45);
}
.pestanas a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border-radius: 16px;
  text-decoration: none;
  font-family: var(--f-titulo);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--polvo);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pestanas svg { width: 22px; height: 22px; }
.pestanas a[aria-current="page"] {
  color: var(--papel);
  background: rgba(241, 236, 226, 0.1);
}

/* ---------- Pantallas grandes ---------- */
@media (min-width: 760px) {
  :root { --gutter: 40px; }
  .portada { padding-top: 64px; padding-bottom: 48px; }
  .lista {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 0;
    column-gap: 40px;
  }
  .lista li { border-bottom: 0; border-top: 1px solid var(--linea); }
  .lugar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 0 30px;
  }
  .lugar__imagen { aspect-ratio: 4 / 3; }
  .lugar__imagen::before { left: 14%; right: 14%; }
  .lugar__flecha { display: none; }
  .lugar__texto h2 { font-size: var(--t-xl); }
  .encabezado { padding-top: 72px; }
}

@media (min-width: 1040px) {
  .lista { grid-template-columns: repeat(4, 1fr); column-gap: 28px; }
  .lugar__imagen { aspect-ratio: 3 / 4; }
}
