/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5
 * Escaparate de temporada de la portada (de noviembre a Reyes): tres postales de ejemplo que se turnan.
 * Va en su propio archivo (no en site.css) para que quien tiene la app instalada lo reciba al momento.
 * Los colores de los dibujos vienen de /css/carta.css. Se animan «transform» y «opacity» (y el subrayado del
 * saludo, con «background-size»); con las animaciones del sistema desactivadas no se mueve nada y lo primero
 * que se ve es ya la postal terminada. */

/* El formulario «¿Para quién es la lista?» (.lp-start) está en /css/empezar.css: lo comparten las guías. */

/* Cuenta atrás (solo en temporada) */
.lp-kicker {
  justify-self: start;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-3-tint);
  color: var(--color-accent-3-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
}
.lp-kicker b {
  font-weight: 800;
}

/* ---------- Principio de la portada en tres bloques: titular y formulario · demo · instalar y código ---------- */

.lp-hero__more {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  min-width: 0;
}
.lp-hero__more .install-strip {
  max-width: 34rem;
}
/* Ordenador: a la izquierda el titular y, debajo, instalar y código; a la derecha, la demo centrada. */
@media (min-width: 60rem) {
  .lp-hero {
    grid-template-areas:
      'copy sample'
      'more sample';
    grid-template-rows: auto 1fr;
    align-items: start;
    row-gap: var(--space-lg);
  }
  .lp-hero > .lp-hero__copy {
    grid-area: copy;
  }
  .lp-hero > .sample {
    grid-area: sample;
    align-self: center;
  }
  .lp-hero > .lp-hero__more {
    grid-area: more;
  }
}

/* ---------- «¿Buscas ideas de regalo?»: las guías por edad, a un toque desde arriba ---------- */

/* La tira va pegada al bloque principal: el hueco grande queda después de ella, antes de «Cómo funciona».
   (Sin :has, en navegadores viejos, la tira sale igual con más aire encima.) */
.lp-hero:has(+ .lp-find) {
  padding-bottom: var(--space-xl);
}
.lp-find {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0 var(--page-gutter) var(--section-gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-sm);
}
.lp-find__title {
  font-size: var(--text-md);
}
.lp-find__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.lp-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--color-accent-tint);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.lp-chip--cyan {
  background: var(--color-accent-2-tint);
}
.lp-chip--coral {
  background: var(--color-accent-3-tint);
}
.lp-chip--lav {
  background: var(--color-lavender-tint);
}
.lp-chip--mint {
  background: var(--color-mint-tint);
}
/* «Navidad y Reyes»: no es una edad; va con borde en vez de color. */
.lp-chip--line {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--color-line-strong);
}
.lp-chip:hover {
  box-shadow: inset 0 0 0 1.5px var(--color-ink-3);
}
.lp-chip:active {
  transform: translateY(1px);
}

/* ---------- La lista de ejemplo se puede tocar ---------- */

/* La acción va debajo del texto: así cabe en cualquier móvil. (site.css esconde las etiquetas en pantallas estrechas.) */
.sample[data-demo] .sample__row {
  flex-wrap: wrap;
}
.sample[data-demo] .sample__row .badge {
  display: inline-flex;
}
.sample__act {
  flex-basis: 100%;
  display: grid;
  justify-items: start;
  align-items: center;
  min-height: 36px;
  padding-left: calc(44px + var(--space-sm));
}
/* Los tres estados ocupan la misma casilla: al cambiar de uno a otro no se mueve nada. */
.sample__act > * {
  grid-area: 1 / 1;
}
.sample__take,
.sample__mine {
  visibility: hidden;
}
/* El cambio de estado es instantáneo siempre. (Con el movimiento reducido, ui.css da 120 ms a todas las transiciones:
   durante ese rato el botón nuevo seguiría oculto y no podría recibir el foco.) */
.sample__hearts,
.sample__mine,
.sample__mine > * {
  transition-property: none;
}
.sample__mine {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.sample.is-live .sample__hearts,
.sample.is-live .is-taken .sample__take {
  visibility: hidden;
}
.sample.is-live .sample__take,
.sample.is-live .is-taken .sample__mine {
  visibility: visible;
}
.sample__status {
  margin: 0;
  min-height: calc(2 * 1.4em); /* dos renglones reservados: el aviso cambia sin mover la tarjeta */
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-ink-2);
}
.sample__go {
  margin: 0;
}

/* ---------- Barra fija «Crear su lista» (móvil y tableta), cuando el formulario ya no se ve ---------- */

.lp-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  padding: 10px var(--page-gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in oklch, var(--color-paper) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  border-top: var(--rule);
  /* Escondida no se ve ni se puede enfocar */
  visibility: hidden;
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}
.lp-bar.is-on {
  visibility: visible;
  transform: none;
  transition: transform var(--dur-base) var(--ease-out);
}
@media (min-width: 60rem) {
  .lp-bar {
    display: none;
  }
}

/* ---------- Colocación en la portada (temporada) ---------- */

.lp-hero--season {
  gap: var(--space-md);
  padding-top: clamp(12px, 3vw, 40px);
}
.lp-hero--season .lp-hero__copy .display {
  max-width: 15ch;
}
/* Móvil y tableta: el escaparate, el titular y «Crear su lista» caben en la primera pantalla; la explicación va después. */
@media (max-width: 59.99rem) {
  .lp-hero--season .lp-hero__copy {
    gap: var(--space-md);
  }
  .lp-hero--season .lp-hero__copy > .lp-kicker {
    order: -4;
  }
  .lp-hero--season .lp-hero__copy > .display {
    order: -3;
  }
  .lp-hero--season .lp-hero__copy > .lp-start {
    order: -2;
  }
  .lp-hero--season .lp-hero__copy > .lead {
    order: -1;
  }
}
/* Móviles bajos: el escaparate y los huecos ceden sitio para que quepa el botón */
@media (max-width: 59.99rem) and (max-height: 700px) {
  .lp-hero--season {
    gap: var(--space-sm);
  }
  .lp-hero--season .nv-stage {
    width: min(100%, 41vh, 34rem);
  }
  .lp-hero--season .lp-hero__copy {
    gap: var(--space-sm);
  }
  .lp-hero--season .lp-kicker {
    padding-block: 3px;
  }
  .lp-hero--season .lp-start {
    gap: 6px;
  }
}
/* Ordenador: el titular a la izquierda; a la derecha, el escaparate y debajo la lista de ejemplo. */
@media (min-width: 60rem) {
  .lp-hero--season {
    align-items: start;
    grid-template-areas:
      'copy nv'
      'copy sample'
      'more sample';
    grid-template-rows: auto auto 1fr;
    gap: var(--space-xl) var(--space-3xl);
    padding-top: clamp(32px, 5vw, 72px);
  }
  .lp-hero--season .lp-hero__copy {
    gap: var(--space-lg);
  }
  .lp-hero--season > .nv {
    grid-area: nv;
  }
  .lp-hero--season > .lp-hero__copy {
    grid-area: copy;
  }
  .lp-hero--season > .sample {
    grid-area: sample;
    align-self: start;
  }
}

/* ---------- El escaparate ---------- */

.nv {
  --nv-bear: oklch(68% 0.09 62);
  --nv-bear-2: oklch(58% 0.09 58);
  --nv-bear-3: oklch(88% 0.05 75);
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xs);
  min-width: 0;
}
/* El alto queda reservado desde el primer momento (nada salta al cargar) y nunca pasa de media pantalla. */
.nv-stage {
  container-type: inline-size;
  position: relative;
  width: min(100%, 76vh, 34rem);
  margin-inline: auto;
  aspect-ratio: 1.64;
}

/* Cada postal. La que está delante lleva data-pos="0"; las otras asoman por detrás. */
.nv-stage .nv-sheet {
  position: absolute;
  left: 9%;
  bottom: 2.5%;
  width: 82%;
  max-width: none;
  margin: 0;
  padding: 0;
  aspect-ratio: 1.52;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 34% minmax(0, 1fr);
  overflow: hidden;
  background: var(--carta-paper);
  border: 4px double var(--carta-frame);
  box-shadow: var(--shadow-lift);
  transform-origin: 50% 60%;
}
.nv-stage .carta--noel {
  border: 4px solid var(--carta-frame);
  border-image: repeating-linear-gradient(-45deg, var(--carta-frame) 0 6px, var(--carta-white) 6px 12px) 4;
}
.nv-stage .nv-sheet--sorteo {
  --carta-paper: oklch(99% 0.008 95);
  --carta-white: oklch(99.4% 0.004 95);
  --carta-main: var(--color-accent-2-ink);
  --carta-frame: var(--color-accent-2-deep);
  --carta-tint: var(--color-accent-tint);
}
.nv-sheet[data-pos='0'] {
  z-index: 3;
  transform: rotate(-1.5deg);
}
.nv-sheet[data-pos='1'] {
  z-index: 2;
  transform: translate(6.5%, -6%) rotate(4.5deg) scale(0.95);
}
.nv-sheet[data-pos='2'] {
  z-index: 1;
  transform: translate(-6%, -7.5%) rotate(-6deg) scale(0.92);
}

.nv-sheet__head {
  position: relative;
  overflow: hidden;
  line-height: 0;
}
.nv-stage .nv-sheet .carta__art {
  width: 100%;
  height: 100%;
}
.nv-stage .nv-sheet .carta__stamp {
  top: 5px;
  right: 4px;
  width: 54px;
  top: 1.5cqw;
  right: 1.2cqw;
  width: 16.5cqw;
}
.nv-sheet__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 5px;
  padding: 6px 12px 7px;
  gap: 1.5cqw;
  padding: 1.8cqw 3.6cqw 2.2cqw;
  min-height: 0;
}
.nv-to {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-size: 5.3cqw;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: var(--tracking-display);
  color: var(--carta-main);
  white-space: nowrap;
}
.nv-to span {
  background-image: linear-gradient(var(--carta-tint) 0 0);
  background-repeat: no-repeat;
  background-size: 100% 0.42em;
  background-position: 0 92%;
}
/* «Me llamo…»: lleva el nombre que se escribe en «¿Para quién es la lista?» */
.nv-me {
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  font-size: 3.4cqw;
  line-height: 1.2;
  color: var(--color-ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.nv-me b {
  color: var(--color-ink);
}

/* Lo que pide: cuatro cromos numerados */
.nv-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  gap: 2.4cqw;
  width: 90%;
}
.nv-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--carta-white);
  border: 1.5px solid var(--color-line-strong);
  border-radius: 8px;
  border-radius: 2.4cqw;
}
.nv-tile svg {
  width: 72%;
  height: 72%;
}
.nv-num {
  position: absolute;
  top: -5px;
  left: -4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  width: 5.2cqw;
  height: 5.2cqw;
  border-radius: 50%;
  border: 1.5px solid var(--carta-main);
  background: var(--carta-white);
  color: var(--carta-main);
  font-size: 10px;
  font-size: 3cqw;
  font-weight: 800;
  line-height: 1;
}
.nt-coral {
  fill: var(--color-accent-3);
}
.nt-cyan {
  fill: var(--color-accent-2);
}
.nt-cyan-2 {
  fill: var(--color-accent-2-deep);
}
.nt-pear {
  fill: var(--color-accent);
}
.nt-paper {
  fill: var(--color-surface);
}
.nt-ink {
  fill: var(--color-ink);
}
.nt-bear {
  fill: var(--nv-bear);
}
.nt-bear-2 {
  fill: var(--nv-bear-2);
}
.nt-bear-3 {
  fill: var(--nv-bear-3);
}
.nt-line {
  fill: none;
  stroke: var(--color-ink-3);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Reyes: una estrella fugaz de vez en cuando. Papá Noel: nieve que cae. Sin animaciones no se ven. */
.nv-shoot,
.nv-snowfall {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}
.nv-shoot {
  top: 12%;
  right: 4%;
  width: 20%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--carta-white), transparent);
}
.nv-snowfall {
  inset: -90px 0 0;
  background-image: radial-gradient(circle, var(--carta-snow) 0 1.3px, transparent 1.8px),
    radial-gradient(circle, var(--carta-snow) 0 1px, transparent 1.5px),
    radial-gradient(circle, var(--carta-snow) 0 1.6px, transparent 2.1px);
  background-size: 90px 90px;
  background-position: 12px 8px, 51px 37px, 73px 66px;
}
.nv-snowfall--2 {
  inset: -130px 0 0;
  background-size: 130px 130px;
  background-position: 30px 20px, 84px 58px, 110px 104px;
}

/* Amigo invisible: quiénes juegan y a quién le toca regalar */
.nv-faces-wrap {
  display: grid;
  place-items: center;
  background: var(--color-accent-2-tint);
}
.nv-faces {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  gap: 1.8cqw;
}
.nv-faces li {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  width: 10.4cqw;
  height: 10.4cqw;
  border-radius: 50%;
  border: 2px solid var(--carta-white);
  font-size: 15px;
  font-size: 4.6cqw;
  font-weight: 800;
  line-height: 1;
}
.nv-draw-label {
  margin: 0;
  font-size: 11px;
  font-size: 3.5cqw;
  font-weight: 650;
  line-height: 1.2;
  color: var(--color-ink-2);
}
.nv-slot {
  margin: 0;
  height: 1.12em;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 28px;
  font-size: 8.8cqw;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: var(--tracking-display);
  color: var(--carta-main);
}
.nv-slot__reel {
  display: grid;
  transform: translateY(-80%); /* se queda en el último nombre */
}
.nv-draw-btn {
  margin: 0;
  line-height: 1;
}
.nv-draw-btn span {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 0.9em;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-ink);
  font-size: 11px;
  font-size: 3.4cqw;
  font-weight: 700;
}
.nv-draw-btn .ico {
  width: 1.2em;
  height: 1.2em;
}

/* ---------- Debajo: elegir el ejemplo, pausar y de qué va ---------- */

.nv__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xs);
}
/* Los botones solo sirven con JavaScript: su sitio queda reservado y aparecen cuando funcionan. */
.nv__picks {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  visibility: hidden;
}
.nv.is-live .nv__picks {
  visibility: visible;
}
.nv-pill,
.nv-pause {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  border: 1.5px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink-2);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.nv-pill {
  padding: 0 12px;
}
.nv-pill:hover,
.nv-pause:hover {
  border-color: var(--color-ink-3);
  color: var(--color-ink);
}
.nv-pill:active,
.nv-pause:active {
  transform: translateY(1px);
}
.nv-pill:focus-visible,
.nv-pause:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.nv-pill[aria-pressed='true'] {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: var(--color-on-dark);
}
.nv-pause {
  flex: none;
  width: 36px;
  margin-left: auto;
  padding: 0;
}
.nv-pause svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nv-pause__off,
.nv-pause[aria-pressed='true'] .nv-pause__on {
  display: none;
}
.nv-pause[aria-pressed='true'] .nv-pause__off {
  display: block;
  fill: currentColor;
}
.nv__cap {
  margin: 0;
  min-height: 1.4em; /* todos los pies caben en un renglón: al cambiar de ejemplo no se mueve lo de abajo */
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-ink-2);
}
.nv__cap b {
  color: var(--color-ink);
}
.nv__cap a {
  font-weight: 650;
  white-space: nowrap;
}
/* Móviles estrechos: los tres botones y la pausa caben en una fila, y el pie y la cuenta atrás en un renglón */
@media (max-width: 23rem) {
  .nv__cap,
  .lp-kicker {
    font-size: var(--text-xs);
  }
  .lp-kicker {
    padding-inline: 10px;
  }
  .nv__picks {
    gap: 4px;
  }
  .nv-pill {
    padding: 0 8px;
    font-size: var(--text-xs);
  }
  .nv-pause {
    width: 34px;
  }
}

/* ---------- Movimiento (solo si el sistema no pide reducirlo) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .nv-stage .nv-sheet {
    transition: transform 640ms var(--ease-spring);
  }

  /* Ambiente: estrellas que parpadean, coronas que flotan, el gorro que se mece, nieve y una estrella fugaz */
  .nv-stage .ca-star,
  .nv-stage .ca-flake {
    animation: nv-twinkle 2.6s ease-in-out infinite;
  }
  .nv-stage .ca-star:nth-of-type(2n),
  .nv-stage .ca-flake:nth-of-type(2n) {
    animation-duration: 3.2s;
    animation-delay: -0.9s;
  }
  .nv-stage .ca-star:nth-of-type(3n),
  .nv-stage .ca-flake:nth-of-type(3n) {
    animation-delay: -1.7s;
  }
  .nv-stage .ca-star-dim:nth-of-type(odd) {
    animation: nv-twinkle 3.8s ease-in-out -1.2s infinite;
  }
  .nv-stage .ca-halo-c {
    animation: nv-glow 3.2s ease-in-out infinite;
  }
  .nv-stage .carta__art .ca-bob {
    animation: nv-bob 2.8s ease-in-out infinite;
  }
  .nv-stage .carta__art > g:nth-of-type(4) > .ca-bob {
    animation-delay: -0.9s;
  }
  .nv-stage .carta__art > g:nth-of-type(5) > .ca-bob {
    animation-delay: -1.8s;
  }
  .nv-stage .ca-hat {
    transform-box: fill-box;
    transform-origin: 20% 100%;
    animation: nv-hat 3s ease-in-out infinite;
  }
  .nv-shoot {
    animation: nv-shoot 7s linear 1.4s infinite;
  }
  .nv-snowfall {
    opacity: 0.85;
    animation: nv-fall-a 7s linear infinite;
  }
  .nv-snowfall--2 {
    opacity: 0.6;
    animation: nv-fall-b 13s linear infinite;
  }

  /* Al ponerse delante: se subraya el saludo, saltan los cromos y cae el sello (todo parte de lo ya visible) */
  .nv-sheet[data-pos='0'] .nv-to span {
    animation: nv-mark 700ms var(--ease-out) 250ms both;
  }
  .nv-sheet[data-pos='0'] .nv-tile,
  .nv-sheet[data-pos='0'] .nv-faces li {
    animation: nv-hop 620ms var(--ease-out) calc(420ms + var(--n) * 110ms);
  }
  .nv-stage .nv-sheet[data-pos='0'] .carta__stamp {
    animation: nv-thunk 620ms var(--ease-out) 950ms;
  }
  .nv-sheet[data-pos='0'] .nv-slot__reel {
    animation: nv-reel 1.9s cubic-bezier(0.2, 0.7, 0.2, 1) 500ms both;
  }

  /* En pausa (con su botón, fuera de la pantalla o en otra pestaña) todo se queda quieto */
  .nv.is-paused .nv-stage *,
  .nv.is-away .nv-stage * {
    animation-play-state: paused !important;
  }
}
@keyframes nv-twinkle {
  50% {
    opacity: 0.2;
  }
}
@keyframes nv-glow {
  50% {
    opacity: 0.5;
  }
}
@keyframes nv-bob {
  50% {
    transform: translateY(-2.5px);
  }
}
@keyframes nv-hat {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(4deg);
  }
}
@keyframes nv-mark {
  from {
    background-size: 0 0.42em;
  }
}
@keyframes nv-hop {
  40% {
    transform: translateY(-18%) scale(1.07) rotate(-3deg);
  }
  70% {
    transform: translateY(2%) scale(0.98);
  }
}
@keyframes nv-thunk {
  35% {
    transform: rotate(-10deg) scale(1.6);
  }
  70% {
    transform: rotate(6deg) scale(0.92);
  }
}
@keyframes nv-reel {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-80%);
  }
}
@keyframes nv-shoot {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-14deg);
  }
  2% {
    opacity: 1;
  }
  12%,
  100% {
    opacity: 0;
    transform: translate(-190px, 46px) rotate(-14deg);
    transform: translate(-58cqw, 14cqw) rotate(-14deg);
  }
}
@keyframes nv-fall-a {
  to {
    transform: translateY(90px);
  }
}
@keyframes nv-fall-b {
  to {
    transform: translateY(130px);
  }
}
