/* ==========================================================================
   Portada «Ahora primero». Se carga después de styles.css y usa sus tokens
   (--fondo, --tinta, --calle, --crema, paleta, --font-titular, --font-mono…).
   Las clases que chocan con styles.css (.btn, .in, .res, .dato) van acotadas
   a .portada (clase de <body>). El marco del sitio (.maq, cabecera y pie
   negros) vive en styles.css; aquí las medidas van en cqw de ese marco y
   las cartas (.ct) y los colores de canal (.k1–.k9) viven en cartas.css.
   ========================================================================== */

.portada {
  overflow-x: hidden;
}

/* El hero arranca cerca de la franja de grano de la cabecera. */
.portada #contenido { padding-top: 0; }

/* ---------- piezas comunes ---------- */
.portada .in { background: var(--amarillo); color: var(--calle); }
.portada .btn { min-height: 46px; padding: 12px 20px; font: 600 16px/1 var(--font-titular); border: 3px solid var(--calle); background: var(--calle); color: var(--crema); border-radius: 1.2rem 0.5rem 1.2rem 0.5rem; justify-self: start; }
.portada .btn:hover { background: transparent; color: var(--calle); border-color: var(--calle); }
.portada .btn-claro { background: var(--tinta); color: var(--fondo); border-color: var(--tinta); }
.portada .btn-claro:hover { background: transparent; color: var(--tinta); border-color: var(--tinta); }
.portada .dato { font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0; }
.portada .res { margin-block: 0.1em; }
.ex { font-size: clamp(17px, 1.7cqw, 21px); line-height: 1.5; }
.ex strong { font-weight: 600; }
.vivo { display: inline-block; background: var(--rojo); color: var(--calle); font: 600 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; margin-bottom: 6px; }

/* ---------- hero: cartel quieto con el nombre y los tres aparatos del juego ----------
   Célula naranja, el nombre en una línea y debajo el televisor, la cámara y la
   antena de /el-juego/ (aparatos.css), enteros y en fila, cada uno con su verbo.
   Sin animación ni interacción. */
.hC {
  container-type: inline-size;
  margin: clamp(20px, 2.6cqw, 32px) clamp(16px, 4cqw, 48px) 0;
  padding: clamp(18px, 3cqw, 40px);
  border-radius: var(--celula-1);
  background: var(--naranja);
  color: var(--calle);
}
.hC h1 { font-weight: 900; font-size: 10.8cqw; line-height: .9; letter-spacing: -.03em; white-space: nowrap; padding-bottom: .06em; }
.hC h1 .in { background: var(--calle); color: var(--crema); font-size: 1em; padding: .02em .09em .07em; margin-inline: .06em .05em; border-radius: .06em .03em .08em .04em; }
.hC-fila { display: grid; grid-template-columns: 1.12fr 1.1fr .9fr; gap: clamp(16px, 3cqw, 40px); align-items: end; margin: clamp(20px, 3.4cqw, 44px) 0 0; padding: 0; list-style: none; }
.hC-fila > li { display: grid; gap: clamp(10px, 1.4cqw, 16px); justify-items: start; min-width: 0; }
.hC .tv { margin: 0; max-width: none; width: 100%; }
.hC *, .hC *::before, .hC *::after { animation: none !important; }
.hC-tv .tv { transform: rotate(-3deg); }
.hC-cam .tv { transform: rotate(2deg); }
.hC-ant .tv { transform: rotate(-2deg); }
/* Etiqueta de cada aparato: número en el color del canal y verbo en crema sobre negro. */
.hC-et { display: inline-flex; align-items: center; gap: .55em; padding: 7px 10px 7px 7px; background: var(--calle); color: var(--crema); font: 600 clamp(11px, 1.15cqw, 15px)/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; white-space: nowrap; }
.hC-et b { background: var(--k); color: var(--calle); padding: 4px 5px; border-radius: 3px; font-weight: 600; }
/* Pastilla del canal dentro del tubo (cqw de .pantalla). */
.hC .pill { position: absolute; z-index: 6; left: 5cqw; bottom: 5cqw; display: flex; align-items: flex-end; gap: 1.2cqw; }
.hC .pill .n { display: grid; place-items: center; min-width: 1.4em; padding: .04em .2em .08em; font-weight: 900; font-size: max(12px, 11cqw); line-height: 1; color: var(--calle); background: var(--k, var(--amarillo)); border-radius: .22em .1em .26em .12em; }
.hC .pill .nm { font: 600 max(8px, 4.6cqw)/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--calle); color: var(--crema); padding: 2.2cqw 2.6cqw; border-radius: 4px; }

/* ---------- secciones compartidas ---------- */
.mz { padding: clamp(20px, 3.4cqw, 44px); color: var(--calle); display: grid; gap: 14px; align-content: start; min-width: 0; }
.mz h2 { font-weight: 800; font-size: clamp(30px, 4.4cqw, 58px); line-height: 1; letter-spacing: -.01em; text-wrap: balance; }
.mz h3, .e4-vivo .mz h2 { font-weight: 800; font-size: clamp(22px, 2.4cqw, 30px); line-height: 1.08; text-wrap: balance; }
.mz h3 a, .mz h2 a { text-decoration: none; }
.mz p { max-width: 38rem; }
.mz :focus-visible { outline-color: var(--calle); }
.v-nar { background: var(--naranja); } .v-tur { background: var(--turquesa); } .v-lim { background: var(--lima); } .v-azu { background: var(--azul); }
.r1 { border-radius: var(--celula-1); } .r2 { border-radius: var(--celula-2); } .r3 { border-radius: var(--celula-3); } .r4 { border-radius: var(--celula-4); }
.portada .calle { background: var(--calle); padding: var(--calle-ancho); display: grid; gap: var(--calle-ancho); }

/* En curso */
.e4-vivo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: clamp(28px, 5cqw, 64px); }
.portada .calle.e4-vivo { padding: clamp(8px, 1.1cqw, 14px); gap: clamp(8px, 1.1cqw, 14px); border-radius: 8px; }
.tomas-lab { position: relative; min-width: 0; }
.toma-lab { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); border-radius: var(--celula-2); background: var(--papel); }
.toma-lab.capa { position: absolute; inset: 0; transition: opacity 1.6s ease-in-out; }
.toma-lab.capa.oculta { opacity: 0; }
.e4-vivo > .mz { position: relative; z-index: 1; margin-left: calc(-1 * min(5cqw, 60px)); box-shadow: -10px 0 28px rgb(0 0 0 / .45); }
.aliados { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 8px; padding-top: 16px; border-top: 1px solid rgb(11 11 12 / .25); }
.aliados img { height: clamp(40px, 4.4cqw, 54px); width: auto; }

/* Co-crear */
.e2-cc { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(20px, 4cqw, 56px); align-items: center; padding-block: clamp(36px, 6cqw, 80px); }
.e2-cc h2 { font-weight: 900; font-size: clamp(36px, 5.6cqw, 80px); line-height: .98; letter-spacing: -.015em; text-wrap: balance; }

/* Tarjetas */
.sueltas { display: grid; gap: clamp(10px, 1.4cqw, 16px); }
.e4-dos { grid-template-columns: 1.2fr 1fr; }
.tele { display: block; width: clamp(110px, 11cqw, 150px); height: auto; margin-bottom: 4px; }
.doc { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 3.4cqw, 48px); align-items: start; }
.doc-a { display: grid; gap: 14px; align-content: start; }
.doc-lista { list-style: none; margin: 0; padding: 0; display: grid; }
.doc-lista li + li { border-top: 2px solid var(--calle); }
.doc-lista a { display: grid; gap: 4px; padding: 14px 0; text-decoration: none; }
.doc-lista b { font-weight: 800; font-size: clamp(20px, 2.1cqw, 26px); line-height: 1.1; }
.doc-lista b::after { content: " →"; }
.doc-lista span { font-size: 15px; line-height: 1.45; }

/* Quiénes juegan */
.reparto { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: clamp(24px, 5cqw, 72px); align-items: center; margin-top: clamp(48px, 8cqw, 112px); padding-top: clamp(24px, 3cqw, 40px); border-top: 6px solid var(--tinta); }
.rep-a { display: grid; gap: 18px; align-content: start; }
.rep-a h2 { font-weight: 900; font-size: clamp(40px, 6cqw, 88px); line-height: .98; letter-spacing: -.015em; }
.rep-b { display: grid; place-items: center; padding-top: clamp(24px, 6cqw, 80px); }
.portada .mesa { position: relative; display: block; width: 100%; max-width: 600px; aspect-ratio: 1 / 0.82; margin-inline: auto; padding: 0; gap: 0; background: none; color: inherit; font-family: inherit; }
.portada .mesa > div { position: absolute; transform: rotate(var(--r)); }
/* Las cartas caen una sola vez, cuando la mesa entra en pantalla, y quedan armadas.
   Sin JS o con movimiento reducido ya están en su lugar. */
@media (prefers-reduced-motion: no-preference) {
  html.js .portada .cae:not(.cae-on) > div { opacity: 0; }
  .cae.cae-on > div { animation: cae .9s cubic-bezier(.2, .7, .3, 1) both; }
  .cae.cae-on > div:nth-child(2) { animation-delay: .35s; } .cae.cae-on > div:nth-child(3) { animation-delay: .7s; } .cae.cae-on > div:nth-child(4) { animation-delay: 1.05s; } .cae.cae-on > div:nth-child(5) { animation-delay: 1.4s; } .cae.cae-on > div:nth-child(6) { animation-delay: 1.75s; }
}
@keyframes cae { 0% { opacity: 0; transform: translateY(-26%) rotate(calc(var(--r) * 3)) scale(1.12); } 100% { opacity: 1; transform: rotate(var(--r)); } }

/* ---------- móvil ---------- */
@container maq (max-width: 700px) {
  .hC { margin-top: 18px; }
  .hC h1 { font-size: 10cqw; }
  .hC-fila { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .hC-ant { grid-column: 1 / -1; justify-self: center; width: 54%; }
  .hC-et { font-size: 10px; }
  .e2-cc { grid-template-columns: 1fr; }
  .e2-cc h2 { font-size: 10.6cqw; }
  .e4-vivo { grid-template-columns: 1fr; }
  .e4-vivo > .mz { margin-left: 0; margin-top: -10cqw; box-shadow: 0 -10px 28px rgb(0 0 0 / .45); }
  .toma-lab { aspect-ratio: 4 / 3; height: auto; }
  .toma-lab.capa { height: 100%; }
  .e4-dos { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; }
  .reparto { grid-template-columns: 1fr; }
  .rep-a h2 { font-size: 12cqw; }
}

/* Sin movimiento: cartas quietas y armadas (sin animación quedan con opacidad 1 en su lugar). */
@media (prefers-reduced-motion: reduce) {
  .portada *, .portada *::before, .portada *::after { animation: none !important; transition: none !important; }
}
