/* ============================================================
   portada-ajustes.css · LA PORTADA CONECTADA CON CASTRO (01-12-2026)
   Se carga al final. Decisiones y su porqué: _equipo/06-portada-decisiones.md

   1. Botones un poco más cuadrados (radio 12, como "Ver horario").
   2. Cerrado: el estado dice cuándo abrimos, en su propia fila.
   3. El aviso del píxel no tapa "Pedido grande".
   4. El escenario: tejuelas arriba, Castro con sus palafitos, el
      mar, y el pudú que reparte en bote y recoge una hamburguesa.
   5. El titular: "Prensadas en CASTRO", grande y con rebote.

   OJO CON EL CACHÉ: /assets/** se guarda UN AÑO en el teléfono (firebase.json).
   Si se regenera un dibujo, hay que subirle el número a su ?v= acá abajo; si no,
   quien ya entró sigue viendo el viejo (le pasó a Lukas el 01-12 con la iglesia).

   REGLA DE FLUIDEZ (Lukas, 01-12: "lo primordial es la fluidez"):
   lo único que se mueve usa transform u opacity, nunca hay una
   animación dentro de un dibujo (el SVG de fondo es estático), no
   se usan mezclas ni máscaras sobre algo que se mueve, y todo se
   pausa cuando la portada sale de la pantalla (js/portada-escena.js).
   ============================================================ */

/* 1 · Botones más cuadrados, solo en la portada */
#hero .btn-primary,
#hero .manifiesto__sello,
#hero .manifiesto__wsp,
#hero .manifiesto__estado,
.sin-atencion #hero .btn-grande { border-radius: 12px !important; }

@media (max-width: 768px) {
  /* 2 · Cerrado: la línea de estado va sola, arriba de los dos accesos, y se lee */
  .sin-atencion #hero .manifiesto__fila { flex-wrap: wrap; justify-content: center; }
  .sin-atencion #hero .manifiesto__estado {
    order: -1;
    flex: 1 0 100%;
    justify-content: center;
    border-color: rgba(245, 197, 24, .55);
    color: #fff;
    font-size: 13.5px;
    letter-spacing: 1.6px;
  }
  /* 3 · La portada mide lo que mide su contenido: nada se estira ni salta con la barra del navegador. */
  #hero, body.con-aviso-pixel #hero { min-height: 0 !important; }
}

/* ============================================================
   4 · EL ESCENARIO
   ============================================================ */
.portada-escenario, .portada-palafitos, .portada-mar, .portada-bote, .portada-premio { display: none; }
.portada-escenario i { display: none; }

#hero { position: relative; isolation: isolate; }

/* Las tejuelas: un muro quieto arriba, detrás del logo. */
.portada-escenario {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: url(../assets/brand/tejuelas.svg?v=5) 0 0 / 28px 44px;
  opacity: .16;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 18%, transparent 40%);
  mask-image: linear-gradient(to bottom, #000 0, #000 18%, transparent 40%);
}

/* El carrusel de hamburguesas ya no va al medio: la escena es Castro. */
.hero-img-wrap--pudu .portada-escena,
.hero-img-wrap--pudu .portada-glow,
.hero-img-wrap--pudu .portada-sombra,
.hero-img-wrap--pudu .portada-puntos,
.hero-img-wrap--pudu > #hero-img-slider,
.hero-img-wrap--pudu > .img-placeholder { display: none !important; }
.hero-img-wrap--pudu { cursor: default !important; }

.hero-img-wrap--pudu > .portada-palafitos,
.hero-img-wrap--pudu > .portada-mar,
.hero-img-wrap--pudu > .portada-bote { display: block !important; position: absolute; pointer-events: none; }

/* El mar: una franja oscura con brillo al centro y dos hileras de olas. */
.hero-img-wrap--pudu > .portada-mar {
  overflow: hidden;
  background:
    radial-gradient(ellipse 46% 90% at 50% 0, rgba(245, 197, 24, .30) 0, transparent 70%),
    linear-gradient(to bottom, rgba(8, 8, 8, 0) 0, rgba(8, 8, 8, .8) 32%, rgba(8, 8, 8, .8) 62%, rgba(8, 8, 8, 0) 100%);
}
.portada-mar i {
  position: absolute; left: -80px; right: 0; height: 14px;
  background: url(../assets/brand/ola.svg?v=5) 0 0 / 80px 14px repeat-x;
  animation: ola-corre 7s linear infinite;
  will-change: transform;
}
.portada-mar i:nth-child(1) { top: 22%; opacity: .6; }
.portada-mar i:nth-child(2) { top: 58%; opacity: .8; animation-duration: 5s; animation-direction: reverse; }
.portada-mar i:nth-child(3) { display: none; }
@keyframes ola-corre { to { transform: translateX(80px); } }

/* El bote va y vuelve sin cortes: cruza, se da vuelta y regresa. */
.hero-img-wrap--pudu > .portada-bote {
  left: 0;
  animation: bote-va-y-vuelve 28s linear infinite;
  will-change: transform;
}
.portada-bote__mece {
  position: relative;
  transform-origin: 50% 90%;
  animation: bote-mece 3.2s ease-in-out infinite;
  will-change: transform;
}
.portada-bote__mece img { display: block; width: 78%; height: auto; margin: 0 auto -31%; position: relative; }
.portada-bote__mece svg { display: block; width: 100%; height: auto; position: relative; }
@keyframes bote-mece {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-4px); }
}

/* El premio: una hamburguesa flotando. El pudú la recoge al pasar (mismo reloj
   de 28 s que el bote) y en la vuelta siguiente vuelve a aparecer. */
.hero-img-wrap--pudu > .portada-premio { animation: premio 28s linear infinite; will-change: transform, opacity; }
.portada-premio img { display: block; width: 100%; height: auto; animation: bote-mece 2.6s ease-in-out infinite; }
@keyframes premio {
  0%, 6%    { transform: translateY(26px) scale(.3); opacity: 0; }
  10%, 29%  { transform: translateY(0) scale(1); opacity: 1; }
  32%       { transform: translateY(-34px) scale(.75); opacity: 1; }
  35%, 100% { transform: translateY(-20px) scale(.2); opacity: 0; }
}

/* El humo de las estufas: lo pone js/portada-escena.js sobre cada cañón. */
.portada-humo {
  position: absolute;
  width: 9px; height: 9px;
  margin: -5px 0 0 -4px;
  border-radius: 50%;
  background: #d8d2b8;
  opacity: 0;
  animation: humo-sube 5.2s linear infinite;
  will-change: transform, opacity;
}
@keyframes humo-sube {
  0%   { transform: translate(0, 0) scale(.5); opacity: 0; }
  18%  { opacity: .26; }
  100% { transform: translate(16px, -46px) scale(2.6); opacity: 0; }
}

/* ---------- En el teléfono: la escena vive en su caja, entre el logo y el titular ---------- */
@media (max-width: 768px) {
  #hero .hero-img-wrap--pudu {
    height: 46vw !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 7vw 0 0 !important;          /* aire para que las torres no toquen el logo */
    overflow: visible !important;
  }
  .hero-img-wrap--pudu > .portada-palafitos {
    left: 0; bottom: 0; z-index: 0;
    width: 100%; height: 56vw;          /* el dibujo entero: 235/420 del ancho */
    background: url(../assets/brand/palafitos.svg?v=5) center bottom / 100% 100% no-repeat;
  }
  .hero-img-wrap--pudu > .portada-mar { left: 0; bottom: 0; z-index: 1; width: 100%; height: 30%; }
  .hero-img-wrap--pudu > .portada-premio { left: 64vw; bottom: 3%; z-index: 2; width: 17vw; }
  .hero-img-wrap--pudu > .portada-bote { bottom: 5%; z-index: 3; width: 30vw; }
  /* El logo cede alto al escenario y queda por delante del cielo. */
  #hero .hero-logo { position: relative; z-index: 2; }
  #hero .hero-logo img { height: clamp(92px, 27vw, 122px) !important; }      /* en vw: no cambia con la barra */
}
@keyframes bote-va-y-vuelve {
  0%   { transform: translateX(-32vw) scaleX(1); }
  48%  { transform: translateX(102vw) scaleX(1); }
  50%  { transform: translateX(102vw) scaleX(-1); }
  98%  { transform: translateX(-32vw) scaleX(-1); }
  100% { transform: translateX(-32vw) scaleX(1); }
}

/* ---------- En el computador: la misma escena, a todo el ancho de la portada ---------- */
@media (min-width: 769px) {
  /* La caja de la foto deja de ser una caja: sus piezas se apoyan en la portada entera. */
  #hero .hero-img-wrap--pudu {
    position: static !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    height: auto !important;
    min-height: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  #hero .hero-img-wrap--pudu::before,
  #hero .hero-img-wrap--pudu::after { content: none !important; }

  .hero-img-wrap--pudu > .portada-palafitos {
    left: 0; bottom: 0; z-index: -2;
    width: 100%; height: min(72vh, 46vw);   /* la ciudad entera; el tope evita casas gigantes en pantallas altas */
    background: url(../assets/brand/palafitos-ancho.svg?v=5) center bottom / auto 100% no-repeat;
  }
  /* Bajo el texto de la izquierda la escena se oscurece, para que se lea. */
  .hero-img-wrap--pudu > .portada-palafitos::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8, 8, 8, .92) 0, rgba(8, 8, 8, .78) 22%, rgba(8, 8, 8, 0) 46%);
  }
  .hero-img-wrap--pudu > .portada-mar { left: 0; bottom: 0; z-index: -2; width: 100%; height: 17vh; }
  .hero-img-wrap--pudu > .portada-premio { left: 78vw; bottom: 3vh; z-index: 4; width: 6.4vw; animation-name: premio-pc; animation-duration: 22s; }
  /* El pudú navega por el lado derecho, delante de todo: nunca pasa bajo el texto ni los botones. */
  .hero-img-wrap--pudu > .portada-bote { bottom: 2vh; z-index: 5; width: 15vw; max-width: 250px; animation-name: bote-va-y-vuelve-pc; animation-duration: 22s; }
}
@keyframes premio-pc {
  0%, 8%    { transform: translateY(26px) scale(.3); opacity: 0; }
  13%, 36%  { transform: translateY(0) scale(1); opacity: 1; }
  40%       { transform: translateY(-40px) scale(.75); opacity: 1; }
  44%, 100% { transform: translateY(-24px) scale(.2); opacity: 0; }
}
@keyframes bote-va-y-vuelve-pc {
  0%   { transform: translateX(40vw) scaleX(1); }
  48%  { transform: translateX(86vw) scaleX(1); }
  50%  { transform: translateX(86vw) scaleX(-1); }
  98%  { transform: translateX(40vw) scaleX(-1); }
  100% { transform: translateX(40vw) scaleX(1); }
}

/* ============================================================
   5 · EL TITULAR: "Prensadas en" chico arriba y CASTRO enorme,
   ladeado, que cada tanto se aplasta y rebota: es una smash.
   ============================================================ */
#hero .manifiesto__titular span {
  display: block;
  width: max-content;
  line-height: .9;
  letter-spacing: 1px;
  color: #F5C518;
  transform: rotate(-3deg);
  animation: castro-prensa 7s cubic-bezier(.3, 0, .2, 1) infinite;
  will-change: transform;
}
#hero .manifiesto__titular span::after { display: none !important; }
@keyframes castro-prensa {
  0%, 78%, 100% { transform: rotate(-3deg) scale(1, 1); }
  82%           { transform: rotate(-3deg) scale(1.07, .78); }
  87%           { transform: rotate(-3deg) scale(.97, 1.06); }
  92%           { transform: rotate(-3deg) scale(1.01, .98); }
}
@media (max-width: 768px) {
  #hero .manifiesto__titular { font-size: clamp(18px, 5.2vw, 23px) !important; letter-spacing: 3px; line-height: 1 !important; }
  #hero .manifiesto__titular span {
    margin: 2px auto 0;
    font-size: clamp(74px, 25vw, 108px);
    text-shadow: 3px 3px 0 #080808, 6px 6px 0 rgba(245, 197, 24, .28);
    transform-origin: 50% 100%;
  }
  #hero .manifiesto__frase { font-size: clamp(14px, 4vw, 17px) !important; letter-spacing: 2px; margin-top: 4px; }

  /* CASTRO llena el ancho: a los lados no queda aire que rellenar con adornos. */
  #hero .manifiesto__titular { display: block; width: 100%; }
}
@media (min-width: 769px) {
  #hero .manifiesto__titular { font-size: clamp(26px, 2.4vw, 38px) !important; letter-spacing: 4px; line-height: 1 !important; }
  #hero .manifiesto__titular span {
    margin: 4px 0 6px;
    font-size: clamp(96px, 9.5vw, 168px);
    text-shadow: 4px 4px 0 #080808, 8px 8px 0 rgba(245, 197, 24, .28);
    transform-origin: 0 100%;
  }
}

/* El botón principal: un brillo que lo cruza cada tanto, para que el ojo vaya ahí. */
#hero .hero-ctas .btn-primary { position: relative; overflow: hidden; }
#hero .hero-ctas .btn-primary::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent 0, rgba(255, 255, 255, .55) 50%, transparent 100%);
  transform: skewX(-18deg);
  animation: boton-brillo 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes boton-brillo { 0%, 70% { transform: translateX(0) skewX(-18deg); } 100% { transform: translateX(520%) skewX(-18deg); } }

/* ============================================================
   6 · FLUIDEZ: fuera de pantalla, todo quieto; y quien pide menos
   movimiento en su teléfono, lo tiene.
   ============================================================ */
.portada-fuera #hero *,
.portada-fuera #hero *::after { animation-play-state: paused !important; }

/* "Reducir movimiento" del teléfono: experiencia.css apaga TODAS las animaciones en ese
   modo (les pone duración .01ms y una sola vuelta). El iPhone de Lukas lo tiene activado
   y el pudú quedaba quieto. Igual que con la cinta de arriba, se rescata lo que es lento
   y horizontal y no marea a nadie: el bote que cruza y las olas. Lo que salta o rebota
   (el mecerse, el rebote de CASTRO, el brillo del botón, el humo) sí se apaga. */
@media (prefers-reduced-motion: reduce) {
  .hero-img-wrap--pudu > .portada-bote {
    animation-duration: 28s !important;
    animation-iteration-count: infinite !important;
  }
  .portada-mar i {
    animation-duration: 7s !important;
    animation-iteration-count: infinite !important;
  }
  .portada-bote__mece, .portada-humo,
  #hero .manifiesto__titular span, #hero .hero-ctas .btn-primary::after { animation: none !important; }
  #hero .manifiesto__titular span { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) and (min-width: 769px) {
  .hero-img-wrap--pudu > .portada-bote { animation-duration: 22s !important; }
}
