:root {
  --lumbre: #0d0a08;
  --crema: #f5ede2;
  --oro: #e0b46e;
  --oro-claro: #f6dba8;
  --marca: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --campo: #161310;
  --tinta: #f3eadf;
  --papel: #1c1814;
  --cobre: #d06a3a;
  --sobre-cobre: #1a120c;
  --display: "Gloock", "Palatino Linotype", serif;
  --barra: calc(4.2rem + env(safe-area-inset-top));
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--lumbre);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
[hidden] { display: none !important; }

::selection { background: var(--cobre); color: var(--sobre-cobre); }
:focus-visible { outline: 2px solid var(--cobre); outline-offset: 3px; border-radius: 6px; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-user-select: none;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}

/* ---------- Fondo de escritorio ---------- */

.pieza-pagina::before,
.pieza-pagina::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.pieza-pagina::before {
  inset: -8%;
  background: var(--foto, none) center / cover no-repeat;
  filter: blur(46px) saturate(1.25) brightness(0.42);
  opacity: 0.9;
}

.pieza-pagina::after {
  inset: 0;
  background:
    radial-gradient(70% 60% at 50% 40%, color-mix(in srgb, var(--cobre) 18%, transparent), transparent 70%),
    radial-gradient(120% 90% at 50% 120%, rgba(13, 10, 8, 0.9), transparent 70%),
    linear-gradient(rgba(13, 10, 8, 0.35), rgba(13, 10, 8, 0.6));
}

/* ---------- Barra ---------- */

.barra {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) 0.75rem max(0.85rem, env(safe-area-inset-left));
  pointer-events: none;
}

.barra > * { pointer-events: auto; }

.volver,
.pedir {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s;
}

.volver {
  padding-left: 0.6rem;
  background: rgba(13, 10, 8, 0.55);
  color: var(--crema);
  box-shadow: inset 0 0 0 1px rgba(245, 237, 226, 0.14);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.volver svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pedir {
  background: linear-gradient(135deg, var(--oro-claro), var(--oro) 50%, #c78a42);
  color: #1d1309;
  box-shadow: 0 10px 26px -10px rgba(224, 180, 110, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.volver:active, .pedir:active { transform: scale(0.96); }

.marca {
  display: none;
  align-items: center;
  gap: 0.45rem;
  color: var(--crema);
  font-family: var(--marca);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
}

.marca svg { width: 22px; height: 22px; fill: var(--oro); filter: drop-shadow(0 0 8px rgba(224, 180, 110, 0.6)); }

@media (hover: hover) and (pointer: fine) {
  .volver:hover { background: rgba(13, 10, 8, 0.75); }
  .pedir:hover { transform: translateY(-1px); }
}

/* ---------- Pieza ---------- */

.pieza {
  --pad: 1.4rem;
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--papel);
  color: var(--tinta);
  isolation: isolate;
}

.pieza::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.pieza-oscura .pieza::after { mix-blend-mode: overlay; opacity: 0.12; }

.ficha, .otras { display: none; }

/* ---------- Apertura ---------- */

.apertura {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: calc(var(--barra) + 1.2rem) var(--pad) calc(1.6rem + env(safe-area-inset-bottom));
  text-align: center;
  isolation: isolate;
}

.apertura::-webkit-scrollbar { display: none; }

.apertura > :first-child { margin-top: auto; }
.apertura > :last-child { margin-bottom: auto; }

.apertura > .foto {
  position: absolute;
  inset: 0 0 auto;
  z-index: -2;
  width: 100%;
  height: 56%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

.apertura::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--papel) 10%, transparent) 0%,
    color-mix(in srgb, var(--papel) 45%, transparent) 22%,
    color-mix(in srgb, var(--papel) 88%, transparent) 42%,
    var(--papel) 56%);
}

.apertura-saludo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--papel) 70%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 14%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.apertura-saludo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cobre);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cobre) 22%, transparent);
}

.pista {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
  color: color-mix(in srgb, var(--tinta) 78%, transparent);
  font-size: 0.95rem;
  font-weight: 500;
}

.pista::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: none;
  background: var(--cobre);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11V5.5a1.5 1.5 0 0 1 3 0V10m0-1.5a1.5 1.5 0 0 1 3 0V11m0-1a1.5 1.5 0 0 1 3 0v4.5A6.5 6.5 0 0 1 11.5 21h-.7a6 6 0 0 1-4.6-2.2L3.6 15.5a1.6 1.6 0 0 1 2.3-2.2L9 15'/%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' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11V5.5a1.5 1.5 0 0 1 3 0V10m0-1.5a1.5 1.5 0 0 1 3 0V11m0-1a1.5 1.5 0 0 1 3 0v4.5A6.5 6.5 0 0 1 11.5 21h-.7a6 6 0 0 1-4.6-2.2L3.6 15.5a1.6 1.6 0 0 1 2.3-2.2L9 15'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: toque 1.8s var(--ease) infinite;
}

.is-revelada .pista::before { animation: none; -webkit-mask: none; mask: none; width: 8px; height: 8px; border-radius: 50%; }

@keyframes toque {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(3px) scale(0.9); }
}

.saltar {
  min-height: 40px;
  padding: 0.4rem 0.8rem;
  color: color-mix(in srgb, var(--tinta) 58%, transparent);
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tinta) 25%, transparent);
  text-underline-offset: 4px;
}

.entrar {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 54px;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--papel);
  font-weight: 700;
  box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--tinta) 70%, transparent);
  animation: aparece 0.7s var(--ease) both, pulso 2.4s 0.8s ease-in-out infinite;
}

.entrar::after {
  content: "→";
  font-size: 1.1rem;
  transition: transform 0.25s var(--ease);
}

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

@keyframes pulso {
  0%, 100% { box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--tinta) 70%, transparent), 0 0 0 0 color-mix(in srgb, var(--cobre) 45%, transparent); }
  50% { box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--tinta) 70%, transparent), 0 0 0 10px color-mix(in srgb, var(--cobre) 0%, transparent); }
}

/* ---------- Libro ---------- */

.libro {
  height: 100%;
  overflow: hidden;
  animation: entra 0.8s var(--ease) both;
}

@keyframes entra {
  from { opacity: 0; transform: scale(1.03); }
}

.riel {
  display: flex;
  height: 100%;
  touch-action: pan-y;
  will-change: transform;
}

.escena {
  counter-increment: escena;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 0 var(--pad) calc(6.5rem + env(safe-area-inset-bottom));
}

.escena::-webkit-scrollbar { display: none; }

.riel { counter-reset: escena; }

.escena > .foto {
  width: calc(100% + 2 * var(--pad));
  max-width: none;
  height: 46%;
  min-height: 15rem;
  max-height: 24rem;
  margin: 0 calc(-1 * var(--pad)) 0.4rem;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.escena > .foto-baja { height: 32%; min-height: 12rem; }

.escena:first-child > .foto { height: 60%; max-height: 30rem; margin-bottom: -2.5rem; }

.escena h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 11vw, 3.3rem);
}

.escena h2:first-of-type::before {
  content: counter(escena, decimal-leading-zero);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  color: var(--cobre);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1;
}

.escena h2:first-of-type::after {
  content: "";
  display: block;
  width: 2.6rem;
  height: 1px;
  margin-top: 1rem;
  background: color-mix(in srgb, var(--tinta) 30%, transparent);
}

.escena:first-child h2::before { display: none; }

.escena:first-child h2 {
  font-size: clamp(3rem, 13.5vw, 4.1rem);
  line-height: 0.95;
}

.escena h2 + h2,
.escena * + h2:not(:first-of-type) { margin-top: 2.2rem; font-size: 2rem; }

.escena p {
  margin: 0 0 0.75rem;
  color: color-mix(in srgb, var(--tinta) 82%, transparent);
  font-size: 1.04rem;
}

.saludo {
  position: relative;
  margin-bottom: 0.6rem !important;
  color: var(--cobre) !important;
  font-family: var(--display);
  font-size: 1.3rem !important;
  font-style: italic;
}

.escena .muestra {
  margin-top: 1.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tinta) 6%, transparent);
  color: color-mix(in srgb, var(--tinta) 60%, transparent);
  font-size: 0.82rem;
}

/* Cuenta */

.cuenta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1.3rem 0 !important;
}

.cuenta span {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.8rem 0.2rem 0.65rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--tinta) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 10%, transparent);
}

.cuenta b {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
  color: var(--tinta);
  font-variant-numeric: tabular-nums lining-nums;
}

.cuenta small {
  color: color-mix(in srgb, var(--tinta) 58%, transparent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Itinerario */

.lista {
  position: relative;
  margin: 0.4rem 0 1.4rem;
  padding: 0;
  list-style: none;
}

.lista::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 1px;
  background: color-mix(in srgb, var(--tinta) 22%, transparent);
}

.lista li {
  position: relative;
  display: grid;
  gap: 0.1rem;
  padding: 0.65rem 0 0.65rem 1.8rem;
  font-size: 1.05rem;
}

.lista li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--papel);
  box-shadow: inset 0 0 0 2px var(--cobre);
}

.lista b {
  color: var(--cobre);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Botones */

.fila {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.escena .boton,
.escena button:not(.flecha):not(.marcas button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.2s var(--ease), background-color 0.25s, box-shadow 0.25s, color 0.25s;
}

.escena .boton {
  background: var(--tinta);
  color: var(--papel);
}

.escena button:not(.flecha) {
  background: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 28%, transparent);
  color: var(--tinta);
}

.escena .boton:active,
.escena button:active { transform: scale(0.97); }

.escena [data-copiar] {
  margin-top: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.escena [data-copiar]::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15V6a2 2 0 0 1 2-2h9'/%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' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15V6a2 2 0 0 1 2-2h9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.escena .musica { margin-top: 1rem; }
.musica-nota { margin-top: 0.6rem !important; font-size: 0.85rem !important; text-align: center; }

.escena .compartir {
  margin-top: 0.8rem;
  min-height: 44px !important;
  box-shadow: none !important;
  color: color-mix(in srgb, var(--tinta) 70%, transparent) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.escena .boton[data-estudio] {
  margin-top: 1rem;
  min-height: 56px;
  background: linear-gradient(135deg, var(--oro-claro), var(--oro) 50%, #c78a42);
  color: #1d1309;
  box-shadow: 0 14px 30px -12px rgba(199, 138, 66, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Confirmación */

.confirma {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 1.2rem 0 0.4rem;
}

.confirma > button { min-height: 56px !important; padding-inline: 0.4rem !important; }

.confirma button[aria-pressed="true"] {
  background: var(--cobre) !important;
  box-shadow: none !important;
  color: var(--sobre-cobre) !important;
}

.confirma .con {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
  padding: 0.9rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--tinta) 6%, transparent);
  animation: aparece 0.5s var(--ease) both;
}

.confirma .con::before {
  content: "¿Cuántos asistirán?";
  margin-bottom: 0.2rem;
  color: color-mix(in srgb, var(--tinta) 65%, transparent);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.confirma .con button { background: var(--papel) !important; }

/* Galería */

.galeria {
  display: flex;
  gap: 0.7rem;
  margin: 0.4rem calc(-1 * var(--pad)) 0;
  padding: 0 var(--pad) 0.4rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  scrollbar-width: none;
}

.galeria::-webkit-scrollbar { display: none; }

.galeria figure {
  flex: 0 0 82%;
  margin: 0;
  scroll-snap-align: start;
}

.galeria img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
}

.galeria figcaption {
  margin-top: 0.5rem;
  color: color-mix(in srgb, var(--tinta) 60%, transparent);
  font-size: 0.84rem;
}

/* ---------- Navegación entre páginas ---------- */

.puntos {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--papel) 92%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 12%, transparent), 0 14px 30px -12px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transform: translateX(-50%);
}

.flecha {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--tinta);
  transition: background-color 0.2s, opacity 0.2s, transform 0.2s var(--ease);
}

[data-pagina="0"] .flecha:last-child {
  background: var(--tinta);
  color: var(--papel);
  animation: empuja 1.8s var(--ease) infinite;
}

@keyframes empuja {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(4px); }
}

.flecha svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flecha:disabled { opacity: 0.25; cursor: default; }
.flecha:not(:disabled):active { transform: scale(0.9); }

.marcas { display: flex; align-items: center; gap: 0.1rem; }

.marcas button {
  position: relative;
  width: 16px;
  height: 32px;
}

.marcas button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tinta) 30%, transparent);
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), background-color 0.35s;
}

.marcas button[aria-current="true"]::before { width: 14px; background: var(--cobre); }

@media (hover: hover) and (pointer: fine) {
  .escena .boton:hover { filter: brightness(1.08); }
  .escena button:not(.flecha):not(.marcas button):hover { background: color-mix(in srgb, var(--tinta) 8%, transparent); }
  .flecha:not(:disabled):hover { background: color-mix(in srgb, var(--tinta) 10%, transparent); }
}

.fila > :only-child { grid-column: 1 / -1; }

/* ---------- Paquetes ---------- */

/* Selector: barra del estudio, fuera de la invitación. */
.con-paquetes { --paquetes: calc(3.85rem + env(safe-area-inset-bottom)); }
.con-paquetes .pieza { height: calc(100dvh - var(--paquetes)); }

.paquetes {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  padding: 0.4rem max(0.5rem, env(safe-area-inset-right)) calc(0.4rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  background: var(--lumbre);
  box-shadow: 0 -1px 0 rgba(245, 237, 226, 0.1);
  color: var(--crema);
}

.paquetes-tit {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.paquetes-lista {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
}

.paquetes a {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.1rem;
  min-height: 3.05rem;
  border-radius: 14px;
  color: rgba(245, 237, 226, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, transform 0.2s var(--ease);
}

.paquetes small {
  color: rgba(245, 237, 226, 0.5);
  font-size: 0.72rem;
  font-weight: 500;
}

.paquetes a[aria-current="page"] {
  background: linear-gradient(135deg, var(--oro-claro), var(--oro) 50%, #c78a42);
  color: #1d1309;
}

.paquetes a[aria-current="page"] small { color: rgba(29, 19, 9, 0.72); }
.paquetes a:active { transform: scale(0.96); }

@media (hover: hover) and (pointer: fine) {
  .paquetes a:not([aria-current]):hover { background: rgba(245, 237, 226, 0.08); color: var(--crema); }
}

/* Básico: la imagen tal como llega al chat. */
.basica {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding: calc(var(--barra) + 0.6rem) var(--pad) 1.4rem;
  background: color-mix(in srgb, var(--tinta) 8%, var(--papel));
}

.basica::-webkit-scrollbar { display: none; }

.chat {
  position: relative;
  width: min(84%, 19rem);
  padding: 0.3rem 0.3rem 1.45rem;
  border-radius: 16px 16px 16px 4px;
  background: var(--papel);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--tinta) 10%, transparent), 0 20px 40px -24px rgba(0, 0, 0, 0.55);
}

.imagen {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: var(--papel);
  color: var(--tinta);
  user-select: none;
  -webkit-user-select: none;
}

.imagen img {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 64%;
  object-fit: cover;
}

.imagen figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 3.4rem 1rem 1.3rem;
  background: linear-gradient(to bottom, transparent, var(--papel) 2.8rem);
  text-align: center;
}

.imagen-frase {
  color: var(--cobre);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.imagen-nombres {
  font-family: var(--display);
  font-size: 2.15rem;
  line-height: 1;
  text-wrap: balance;
}

.imagen-fecha { font-size: 0.82rem; font-weight: 600; }
.imagen-lugar { color: color-mix(in srgb, var(--tinta) 65%, transparent); font-size: 0.76rem; }

.chat-hora {
  position: absolute;
  right: 0.65rem;
  bottom: 0.3rem;
  color: color-mix(in srgb, var(--tinta) 50%, transparent);
  font-size: 0.66rem;
}

.basica-nota {
  max-width: 20rem;
  color: color-mix(in srgb, var(--tinta) 75%, transparent);
  font-size: 0.9rem;
  text-align: center;
}

/* Estándar: una sola página que se baja, sin pasar hojas. */
.paquete-estandar .libro { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.paquete-estandar .libro::-webkit-scrollbar { display: none; }
.paquete-estandar .riel { display: block; height: auto; transform: none; touch-action: auto; will-change: auto; }
.paquete-estandar .escena { height: auto; overflow: visible; padding-bottom: 0; }
.paquete-estandar .escena + .escena { margin-top: 2.6rem; }
.paquete-estandar .escena:last-child { padding-bottom: calc(2.4rem + env(safe-area-inset-bottom)); }
.paquete-estandar .escena:first-child > .foto { height: min(56vh, 26rem); }
.paquete-estandar .escena:not(:first-child) > .foto { display: none; }
.paquete-estandar .escena h2:first-of-type::before { display: none; }
.paquete-estandar .escena:not(:first-child) h2 { font-size: 2.2rem; }

/* ---------- Premium: música y efectos (efectos.js) ---------- */

.particulas {
  position: absolute;
  inset: 0;
  z-index: 19;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.musica-boton {
  position: absolute;
  z-index: 22;
  right: 0.9rem;
  bottom: calc(1.15rem + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--papel) 88%, transparent);
  color: var(--tinta);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 16%, transparent), 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease), background-color 0.3s;
  animation: llama-musica 2.4s ease-in-out infinite;
}

.musica-boton svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.musica-boton:active { transform: scale(0.92); }

.ecualizador { display: none; align-items: flex-end; gap: 3px; height: 16px; }
.ecualizador i { width: 3px; height: 100%; border-radius: 2px; background: var(--cobre); transform-origin: 50% 100%; animation: barra 0.9s ease-in-out infinite; }
.ecualizador i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.ecualizador i:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }

.musica-boton.is-sonando { animation: none; }
.musica-boton.is-sonando svg { display: none; }
.musica-boton.is-sonando .ecualizador { display: flex; }

@keyframes barra {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

@keyframes llama-musica {
  0%, 100% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 16%, transparent), 0 0 0 0 color-mix(in srgb, var(--cobre) 40%, transparent); }
  50% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 16%, transparent), 0 0 0 9px color-mix(in srgb, var(--cobre) 0%, transparent); }
}

.aviso-flotante {
  position: absolute;
  z-index: 23;
  left: 50%;
  top: calc(var(--barra) + 0.4rem);
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: var(--tinta);
  color: var(--papel);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

@media (min-width: 720px) {
  .aviso-flotante { top: 1rem; }
}

.aviso-flotante.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Cada página entra con movimiento: primero la foto, luego el texto en cascada. */
.con-efectos .escena { overflow-x: hidden; }

.con-efectos .libro .escena > :not(.foto) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 85ms + 120ms);
}

.con-efectos .libro .escena.is-activa > :not(.foto) { opacity: 1; transform: none; }
.con-efectos .escena.is-activa > .foto { animation: acercar 14s var(--ease) both; }

@keyframes acercar {
  from { transform: scale(1.1); }
}

.paquete-premium .cuenta b.late { animation: cae 0.5s var(--ease); }

@keyframes cae {
  from { transform: translateY(-40%); opacity: 0.2; }
}

/* ---------- Tablet y escritorio ---------- */

@media (min-width: 720px) {
  body.pieza-pagina {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 5rem 1.5rem 1.5rem;
  }

  .marca { display: inline-flex; }

  .barra {
    padding-inline: clamp(1rem, 3vw, 2.4rem);
    background: linear-gradient(rgba(13, 10, 8, 0.6), transparent);
  }

  .pieza {
    --pad: 1.75rem;
    --barra: 0rem;
    width: 410px;
    height: min(880px, calc(100dvh - 6.5rem));
    border-radius: 36px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.08),
      0 0 0 10px rgba(13, 10, 8, 0.55),
      0 0 0 11px rgba(255, 255, 255, 0.07),
      0 50px 100px -30px rgba(0, 0, 0, 0.85),
      0 0 120px -20px color-mix(in srgb, var(--cobre) 40%, transparent);
  }

  .apertura { padding-top: 2rem; padding-bottom: 2rem; }
  .escena { padding-bottom: 6rem; }
  .puntos { bottom: 1.1rem; }

  body.pieza-pagina.con-paquetes { padding-bottom: 7rem; }
  .con-paquetes .pieza { height: min(860px, calc(100dvh - 12.5rem)); }
  .basica { padding-top: 2rem; }

  .paquetes {
    inset: auto auto 1rem 50%;
    width: min(27rem, calc(100% - 2rem));
    padding: 0.35rem 0.4rem 0.4rem;
    border-radius: 22px;
    background: rgba(13, 10, 8, 0.72);
    box-shadow: inset 0 0 0 1px rgba(245, 237, 226, 0.12), 0 24px 50px -24px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    transform: translateX(-50%);
  }

  .paquetes-tit {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    margin: 0.25rem 0 0.4rem;
    color: rgba(245, 237, 226, 0.5);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
  }
}

@media (min-width: 1180px) {
  body.pieza-pagina {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 5.5rem);
    padding-inline: clamp(1.5rem, 4vw, 4rem);
  }

  .ficha,
  .otras { display: block; }

  .ficha {
    justify-self: end;
    width: min(100%, 22rem);
    color: var(--crema);
  }

  .ficha-tag {
    display: inline-block;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    color: var(--oro);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .ficha h1 {
    margin: 1.2rem 0 0.9rem;
    font-size: clamp(2.8rem, 3.6vw, 3.6rem);
    line-height: 0.98;
  }

  .ficha-gesto {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--oro-claro);
    font-weight: 600;
  }

  .ficha-gesto span {
    width: 26px;
    height: 1px;
    background: var(--oro);
  }

  .ficha-texto {
    margin-top: 1rem;
    color: rgba(245, 237, 226, 0.66);
  }

  .ficha-nombre { margin-top: 1.8rem; }

  .ficha-nombre label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(245, 237, 226, 0.55);
    font-size: 0.84rem;
  }

  .ficha-nombre span {
    display: flex;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: box-shadow 0.25s;
  }

  .ficha-nombre span:focus-within { box-shadow: inset 0 0 0 1px rgba(224, 180, 110, 0.6), 0 0 0 4px rgba(224, 180, 110, 0.1); }

  .ficha-nombre input {
    flex: 1;
    min-width: 0;
    padding: 0 0.9rem;
    border: 0;
    outline: 0;
    background: none;
    color: var(--crema);
    font: inherit;
    font-family: var(--marca);
    font-size: 1.3rem;
  }

  .ficha-nombre input::placeholder { color: rgba(245, 237, 226, 0.3); font-style: italic; }

  .ficha-nombre button {
    min-height: 42px;
    padding: 0 1.1rem;
    border-radius: 999px;
    background: var(--crema);
    color: #1a1209;
    font-size: 0.9rem;
    font-weight: 700;
  }

  .ficha-pedir {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--oro-claro), var(--oro) 50%, #c78a42);
    color: #1d1309;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 34px -12px rgba(224, 180, 110, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.25s var(--ease);
  }

  .ficha-pedir:hover { transform: translateY(-2px); }

  .ficha-precio {
    margin-top: 1rem;
    color: rgba(245, 237, 226, 0.55);
    font-size: 0.86rem;
  }

  .ficha-precio b { color: var(--crema); font-weight: 600; }

  .otras {
    justify-self: start;
    width: min(100%, 17rem);
  }

  .otras-tit {
    margin-bottom: 0.9rem;
    color: rgba(245, 237, 226, 0.5);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .otras a:not(.otras-todas) {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 16px;
    color: var(--crema);
    text-decoration: none;
    transition: background-color 0.25s;
  }

  .otras a:not(.otras-todas):hover { background: rgba(255, 255, 255, 0.06); }

  .otras img {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .otras b { display: block; font-size: 1.15rem; font-weight: 400; line-height: 1.1; }
  .otras small { display: block; margin-top: 0.2rem; color: rgba(245, 237, 226, 0.5); font-size: 0.78rem; }

  .otras-todas {
    display: inline-block;
    margin-top: 1rem;
    color: var(--oro);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
  }
}

@media (max-width: 380px) {
  .pieza { --pad: 1.1rem; }
  .volver span { display: none; }
  .volver { padding-right: 0.6rem; }
  .cuenta b { font-size: 1.55rem; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .escena > .foto { height: 70%; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
