/* ==========================================================
   Diseño "Bananas" · Infantil (laboratorio de cumpleaños)
   palanca "¡No jalar!" → máquina en marcha → cápsula con el montaje → lluvia de plátanos
   Solo paleta y motivos genéricos: plátanos, engranes, tuercas, burbujas, franjas de advertencia.
   ========================================================== */

:root {
  --amarillo: #fce029;
  --mezclilla: #2f6db5;
  --mezclilla-osc: #22528a;
  --metal: #8b95a1;
  --metal-claro: #c3cad2;
  --metal-osc: #5d6670;
  --negro: #1a1a1a;
  --pared: #e9eef3;
  --franjas: repeating-linear-gradient(-45deg, var(--amarillo) 0 12px, var(--negro) 12px 24px);
  --mono: "Space Mono", ui-monospace, monospace;

  --s-fondo: #f3f6f9;
  --s-tinta: var(--negro);
  --s-suave: #4a525b;
  --s-acento: var(--mezclilla);
  --s-acento-tinta: var(--negro);
  --s-tarjeta: #ffffff;
  --s-borde: var(--metal-claro);
  --s-radio: 18px;
  --s-sombra: 0 16px 26px -18px rgba(26, 26, 26, .55);
  --s-fuente: "Fredoka", system-ui, sans-serif;
  --s-titulo: "Fredoka", system-ui, sans-serif;
  --s-titulo-tam: clamp(1.9rem, 8.4vw, 2.5rem);
  --s-etiqueta: var(--mono);
  --s-num: "Fredoka", system-ui, sans-serif;
  --s-num-color: var(--mezclilla);
  --s-btn-linea-color: var(--mezclilla);
}

body {
  background:
    linear-gradient(rgba(47, 109, 181, .07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(47, 109, 181, .07) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--s-fondo);
  color: var(--negro);
  font-family: var(--s-fuente);
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Piezas comunes */
.engrane { position: absolute; z-index: 0; height: auto; animation: girar 16s linear infinite; pointer-events: none; }
@keyframes girar { to { transform: rotate(360deg); } }
.platano { position: absolute; z-index: 1; height: auto; animation: platano-flota 5s ease-in-out infinite; pointer-events: none; }
@keyframes platano-flota { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* ==========================================================
   INTRO · laboratorio
   ========================================================== */
.lab {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 40px) 14px calc(env(safe-area-inset-bottom) + 40px);
  text-align: center;
  background:
    linear-gradient(180deg, transparent 78%, rgba(93, 102, 112, .25) 78%, rgba(93, 102, 112, .12)),
    linear-gradient(#d5dce4 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, #d5dce4 1px, transparent 1px) 0 0 / 44px 44px,
    var(--pared);
  transform-origin: 42% 48%;
  transition: opacity .9s ease, transform 1s ease;
  -webkit-user-select: none;
  user-select: none;
}
.lab.fuera { opacity: 0; transform: scale(1.3); pointer-events: none; }
.lab__franja { position: absolute; left: 0; right: 0; height: 22px; background: var(--franjas); z-index: 1; }
.lab__franja--arriba { top: env(safe-area-inset-top); box-shadow: 0 -40px 0 40px var(--negro); }
.lab__franja--abajo { bottom: 0; height: calc(22px + env(safe-area-inset-bottom)); }
.engrane--1 { top: 9%; left: -48px; width: 150px; }
.engrane--2 { top: 5%; right: -34px; width: 112px; animation-direction: reverse; animation-duration: 11s; }
.engrane--3 { bottom: 7%; left: 6%; width: 84px; animation-duration: 9s; }
.lab.activo .engrane { animation-duration: 1.4s; }

.tubo-ensayo {
  position: absolute;
  bottom: 9%;
  right: 7%;
  z-index: 0;
  width: 26px;
  height: 92px;
  border: 3px solid rgba(47, 109, 181, .55);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent 38%, rgba(252, 224, 41, .8) 38%);
}
.tubo-ensayo--2 { right: calc(7% + 36px); height: 72px; background: linear-gradient(transparent 30%, rgba(47, 109, 181, .55) 30%); }
.tubo-ensayo i {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  animation: burbuja-tubo 2.2s ease-in infinite;
}
.tubo-ensayo i:nth-child(2) { animation-delay: .7s; margin-left: -7px; width: 5px; height: 5px; }
.tubo-ensayo i:nth-child(3) { animation-delay: 1.4s; margin-left: 1px; }
.lab.activo .tubo-ensayo i { animation-duration: .6s; }
@keyframes burbuja-tubo { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-58px); opacity: 0; } }

.lab__titulo {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 16em;
  font-weight: 700;
  font-size: clamp(1.25rem, 5.6vw, 1.7rem);
  line-height: 1.15;
  color: var(--mezclilla);
}
.lab__pista {
  position: relative;
  z-index: 2;
  margin: 10px 0 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--negro);
  color: var(--amarillo);
  font-family: var(--mono);
  font-size: .74rem;
  animation: pista-late 1.6s ease-in-out infinite;
}
.lab.activo .lab__pista { visibility: hidden; }
@keyframes pista-late { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---------- Máquina ---------- */
.maquina {
  --cap: min(50vw, 30svh, 230px);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  margin-top: 64px;
}
.lab.tenso .maquina { animation: temblar .22s linear infinite; }
.lab.activo .maquina { animation: temblar .08s linear infinite; }
.lab.abierto .maquina { animation: none; }
@keyframes temblar {
  0% { transform: translate(1px, 0) rotate(.25deg); }
  25% { transform: translate(-1px, 1px) rotate(-.25deg); }
  50% { transform: translate(-2px, -1px); }
  75% { transform: translate(2px, 1px) rotate(.2deg); }
  100% { transform: translate(1px, -1px); }
}
.maquina__tubos { position: absolute; left: 0; right: 74px; top: -52px; height: 52px; z-index: 0; }
.chimenea {
  position: absolute;
  bottom: 0;
  width: 26px;
  height: 40px;
  border: 3px solid var(--metal-osc);
  border-bottom: 0;
  background: linear-gradient(90deg, #7d8792, var(--metal-claro) 45%, #7d8792);
}
.chimenea::before { content: ""; position: absolute; left: -7px; right: -7px; top: -9px; height: 9px; border-radius: 3px; background: var(--metal-osc); }
.chimenea--1 { left: 16%; }
.chimenea--2 { right: 20%; height: 52px; }
.vapor {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffffff, rgba(255, 255, 255, .75) 55%, rgba(255, 255, 255, 0) 72%);
  opacity: 0;
}
.vapor:first-child { animation: bocanada 4s ease-out infinite; }
.chimenea--2 .vapor:first-child { animation-delay: 2s; }
.lab.activo .vapor { animation: bocanada .9s ease-out infinite; }
.lab.activo .vapor:nth-child(2) { animation-delay: .45s; }
.lab.abierto .vapor { animation-iteration-count: 2; }
@keyframes bocanada {
  0% { opacity: .95; transform: translate(0, 0) scale(.3); }
  100% { opacity: 0; transform: translate(10px, -96px) scale(2.6); }
}

.maquina__cuerpo {
  position: relative;
  z-index: 1;
  padding: 16px 14px 26px;
  border: 4px solid var(--metal-osc);
  border-radius: 26px 26px 16px 16px;
  /* tuercas/remaches en las 4 esquinas + lámina metálica */
  --remache: radial-gradient(circle, var(--metal-osc) 0 2.5px, #eef1f4 3px 4.5px, transparent 5px);
  background:
    var(--remache) 7px 7px / 12px 12px no-repeat,
    var(--remache) calc(100% - 7px) 7px / 12px 12px no-repeat,
    var(--remache) 7px calc(100% - 26px) / 12px 12px no-repeat,
    var(--remache) calc(100% - 7px) calc(100% - 26px) / 12px 12px no-repeat,
    linear-gradient(180deg, #d5dbe1, var(--metal) 85%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .55), 0 20px 30px -14px rgba(0, 0, 0, .5);
}
.maquina__cuerpo::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  height: 12px;
  border-radius: 3px;
  background: var(--franjas);
}

.capsula { position: relative; width: var(--cap); }
.capsula__ventana {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 6px solid var(--metal-osc);
  border-radius: 50% 50% 16px 16px / 30% 30% 16px 16px;
  background: #bfe0ff;
  box-shadow: 0 0 0 4px var(--metal-claro), inset 0 0 0 3px rgba(255, 255, 255, .4);
  transition: box-shadow .6s ease;
}
.lab.abierto .capsula__ventana { box-shadow: 0 0 0 4px var(--amarillo), 0 0 34px 10px rgba(252, 224, 41, .75); }
.capsula__foto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) saturate(.6);
  transform: scale(1.12);
  transition: filter 1.1s ease .2s, transform 1.4s ease .2s;
}
.lab.abierto .capsula__foto { filter: none; transform: none; }
.capsula__niebla {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .55), rgba(220, 232, 245, .92));
  transition: opacity 1.2s ease .3s;
}
.lab.abierto .capsula__niebla { opacity: 0; }
.compuerta {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  background:
    radial-gradient(circle, var(--metal-osc) 0 2.5px, transparent 3px) 6px 10px / 24px 26px,
    linear-gradient(90deg, #a5aeb8, #dde2e7 50%, #98a2ad);
  transition: transform 1s cubic-bezier(.7, 0, .3, 1);
}
.compuerta--izq { left: 0; border-right: 10px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--amarillo) 0 7px, var(--negro) 7px 14px) 10; }
.compuerta--der { right: 0; border-left: 10px solid transparent; border-image: repeating-linear-gradient(45deg, var(--amarillo) 0 7px, var(--negro) 7px 14px) 10; }
.lab.abierto .compuerta--izq { transform: translateX(-104%); }
.lab.abierto .compuerta--der { transform: translateX(104%); }
.capsula__brillo {
  position: absolute;
  top: 9%;
  left: 12%;
  width: 13%;
  height: 58%;
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
}
.capsula__placa {
  width: fit-content;
  margin: 10px auto 0;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--negro);
  color: var(--amarillo);
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tablero {
  margin-top: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-radius: 12px;
  background: var(--mezclilla);
  box-shadow: inset 0 0 0 3px var(--mezclilla), inset 0 0 0 5px rgba(252, 224, 41, .7);
  outline: 2px dashed rgba(252, 224, 41, .55);
  outline-offset: -8px;
}
.medidor { width: 30%; max-width: 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.medidor__svg { display: block; width: 100%; height: auto; }
.medidor span { font-family: var(--mono); font-size: .52rem; text-transform: uppercase; color: #fff; }
.aguja { transform-box: view-box; transform-origin: 30px 32px; transform: rotate(-110deg); transition: transform .12s ease; }
.lab.activo .aguja { animation: aguja-loca .32s ease-in-out infinite alternate; }
.lab.activo .medidor:last-child .aguja { animation-duration: .21s; animation-direction: alternate-reverse; }
.lab.abierto .aguja { animation: none; transform: rotate(108deg); }
@keyframes aguja-loca { from { transform: rotate(-100deg); } to { transform: rotate(116deg); } }

.luces { display: grid; grid-template-columns: repeat(5, 9px); gap: 5px; }
.luz {
  --c: var(--amarillo);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22406a;
  animation: luz-on 2.5s steps(1, end) infinite;
}
.luz:nth-child(2) { --c: #ffffff; animation-delay: .5s; }
.luz:nth-child(3) { --c: var(--amarillo); animation-delay: 1s; }
.luz:nth-child(4) { --c: #ffffff; animation-delay: 1.5s; }
.luz:nth-child(5) { --c: var(--amarillo); animation-delay: 2s; }
.lab.activo .luz { animation-duration: .24s; }
.lab.activo .luz:nth-child(2n) { animation-duration: .17s; }
@keyframes luz-on { 0%, 39% { background: var(--c); box-shadow: 0 0 8px var(--c); } 40%, 100% { background: #22406a; box-shadow: none; } }

/* ---------- Palanca ---------- */
.palanca-zona {
  position: relative;
  z-index: 2;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}
.letrero {
  position: relative;
  z-index: 2;
  margin: 0;
  width: 84px;
  padding: 5px 4px;
  border: 3px solid var(--negro);
  border-radius: 6px;
  background: var(--amarillo);
  color: var(--negro);
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-7deg);
  box-shadow: 0 6px 0 -2px rgba(0, 0, 0, .25);
  animation: letrero-tiembla 3s ease-in-out infinite;
}
@keyframes letrero-tiembla { 0%, 86%, 100% { transform: rotate(-7deg); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(-2deg); } }
.riel {
  position: relative;
  flex: 1;
  width: 22px;
  min-height: 150px;
  margin: 18px 0 30px;
  border: 4px solid var(--metal);
  border-radius: 14px;
  background: linear-gradient(90deg, #2c3137, #4a525b 50%, #2c3137);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .6);
}
.palanca {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  border-radius: 50%;
  outline: none;
}
.palanca.agarrado { cursor: grabbing; }
.palanca::before {
  content: "";
  position: absolute;
  right: 50%;
  top: 50%;
  width: 52px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e3e7ec, var(--metal) 60%, var(--metal-osc));
}
.palanca__bola {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--negro);
  background: radial-gradient(circle at 34% 30%, #fff8c4, var(--amarillo) 45%, #c9a90a);
  box-shadow: 0 6px 10px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.palanca:hover .palanca__bola, .palanca.agarrado .palanca__bola { transform: scale(1.08); }
.palanca:focus-visible .palanca__bola { box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--mezclilla); }
.flecha {
  position: absolute;
  right: -12px;
  top: 46%;
  width: 14px;
  height: 14px;
  border-right: 4px solid var(--mezclilla);
  border-bottom: 4px solid var(--mezclilla);
  transform: rotate(45deg);
  animation: flecha-baja 1.1s ease-in-out infinite;
}
.flecha::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 14px;
  height: 14px;
  border-right: 4px solid var(--mezclilla);
  border-bottom: 4px solid var(--mezclilla);
}
.lab.activo .flecha, .lab.tenso .flecha { opacity: 0; }
@keyframes flecha-baja { 0%, 100% { translate: 0 0; opacity: .5; } 50% { translate: 0 12px; opacity: 1; } }

/* ==========================================================
   HERO · cápsula grande
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 46px) 16px calc(env(safe-area-inset-bottom) + 96px);
  overflow: hidden;
  text-align: center;
  background:
    linear-gradient(#dfe5eb 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, #dfe5eb 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #f8fafb, var(--pared));
}
.hero__franja { position: absolute; left: 0; right: 0; top: 0; height: calc(18px + env(safe-area-inset-top)); background: var(--franjas); }
.engrane--h1 { top: 9%; left: -54px; width: 160px; animation-duration: 20s; }
.engrane--h2 { bottom: 10%; right: -44px; width: 132px; animation-direction: reverse; }
.platano--1 { top: 13%; right: 7%; width: 62px; rotate: 22deg; }
.platano--2 { bottom: 24%; left: 5%; width: 54px; rotate: -28deg; animation-delay: -2s; }
.platano--3 { top: 46%; right: 2%; width: 40px; rotate: 64deg; animation-delay: -3.5s; }
.hero__eyebrow, .hero__escenario, .hero__nombre, .hero__cumple, .hero__fecha { position: relative; z-index: 2; }
.hero .desliza-c { z-index: 3; color: var(--mezclilla); font-family: var(--mono); }

.hero__eyebrow {
  margin: 0;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--negro);
  color: var(--amarillo);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.capsula-hero { position: relative; width: min(70vw, 320px, 42svh); margin-top: 18px; }
.capsula-hero__tapa {
  position: relative;
  z-index: 2;
  display: block;
  height: 30px;
  margin: 0 -10px -8px;
  border: 4px solid var(--metal-osc);
  border-radius: 18px 18px 6px 6px;
  background:
    radial-gradient(circle, var(--metal-osc) 0 3px, transparent 3.5px) 10px 50% / 28px 12px repeat-x,
    linear-gradient(180deg, #e3e7ec, var(--metal));
}
.capsula-hero__tapa::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 22px;
  height: 14px;
  margin-left: -11px;
  border: 3px solid var(--metal-osc);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--amarillo);
  animation: foco 1.4s steps(1, end) infinite;
}
@keyframes foco { 50% { background: #fff8c4; box-shadow: 0 0 14px 4px rgba(252, 224, 41, .8); } }
.capsula-hero__vidrio {
  position: relative;
  z-index: 1;
  aspect-ratio: 9 / 11;
  overflow: hidden;
  border: 6px solid var(--metal-osc);
  border-radius: 24px;
  background: #cfe6ff;
  box-shadow: 0 0 0 4px var(--metal-claro), 0 26px 40px -18px rgba(0, 0, 0, .55);
}
.capsula-hero__vidrio img { display: block; width: 100%; height: 100%; object-fit: cover; }
.capsula-hero__vidrio::after {
  content: "";
  position: absolute;
  top: 6%;
  left: 7%;
  width: 11%;
  height: 66%;
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.capsula-hero__base {
  position: relative;
  z-index: 2;
  display: block;
  margin: -8px -14px 0;
  padding: 10px 0 9px;
  border: 4px solid var(--negro);
  border-radius: 6px 6px 16px 16px;
  background: var(--franjas);
}
.capsula-hero__base b {
  display: inline-block;
  padding: 2px 12px;
  border: 3px solid var(--negro);
  border-radius: 4px;
  background: #fff;
  font-family: var(--mono);
  font-size: .9rem;
}

/* Personaje opcional (PNG del cliente) */
.personaje {
  position: absolute;
  left: -18%;
  bottom: 2%;
  z-index: 3;
  width: 48%;
  max-width: 200px;
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .3));
  pointer-events: none;
}

.hero__nombre {
  margin: 20px 0 0;
  max-width: 100%;
  font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 4rem);
  line-height: 1;
  overflow-wrap: anywhere;
  color: var(--mezclilla);
  text-shadow: 3px 3px 0 var(--amarillo), 6px 6px 0 var(--negro);
}
.hero__cumple {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.2rem;
}
.hero__cumple b {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 4px solid var(--negro);
  border-radius: 50%;
  background: var(--amarillo);
  font-size: 2rem;
  box-shadow: 0 5px 0 var(--negro);
}
.hero__fecha { margin: 12px 0 0; font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #4a525b; }

.burbujas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.burbujas i {
  position: absolute;
  bottom: -40px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(47, 109, 181, .4);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9) 0 3px, rgba(255, 255, 255, .25) 4px);
  animation: burbuja-sube 9s linear infinite;
}
.burbujas i:nth-child(1) { left: 10%; animation-delay: -1s; }
.burbujas i:nth-child(2) { left: 26%; width: 14px; height: 14px; animation-delay: -4s; animation-duration: 7s; }
.burbujas i:nth-child(3) { left: 48%; width: 30px; height: 30px; animation-delay: -6s; animation-duration: 11s; }
.burbujas i:nth-child(4) { left: 68%; animation-delay: -2.5s; }
.burbujas i:nth-child(5) { left: 84%; width: 16px; height: 16px; animation-delay: -7s; animation-duration: 8s; }
.burbujas i:nth-child(6) { left: 92%; width: 26px; height: 26px; animation-delay: -3s; animation-duration: 12s; }
@keyframes burbuja-sube { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } to { transform: translate(18px, -110vh); opacity: .2; } }

/* Entrada del hero */
.hero__eyebrow, .hero__escenario, .hero__nombre, .hero__cumple, .hero__fecha { opacity: 0; }
.hero.listo .hero__eyebrow { animation: sube .6s ease forwards; }
.hero.listo .hero__escenario { animation: capsula-entra 1s cubic-bezier(.3, 1.5, .5, 1) .1s forwards; }
.hero.listo .hero__nombre { animation: sube .7s cubic-bezier(.3, 1.6, .5, 1) .55s forwards; }
.hero.listo .hero__cumple { animation: sube .7s cubic-bezier(.3, 1.6, .5, 1) .75s forwards; }
.hero.listo .hero__fecha { animation: sube .7s ease .95s forwards; }
.hero.listo .personaje { animation: personaje-asoma 1s cubic-bezier(.3, 1.6, .5, 1) 1.1s forwards; }
@keyframes sube { from { opacity: 0; transform: translateY(22px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes capsula-entra { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes personaje-asoma { from { opacity: 0; transform: translateX(45%) scale(.4) rotate(-18deg); } to { opacity: 1; transform: none; } }

/* ==========================================================
   Secciones
   ========================================================== */
.formula-sec { padding-top: 84px; }
.ficha-lab {
  position: relative;
  width: min(100%, 360px);
  overflow: hidden;
  border: 3px solid var(--negro);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 0 var(--negro);
}
.ficha-lab__t {
  margin: 0;
  padding: 12px 10px;
  background: var(--negro);
  color: var(--amarillo);
  font-family: var(--mono);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  border-bottom: 10px solid transparent;
  border-image: var(--franjas) 10;
}
.ficha-lab__formula { margin: 0; padding: 22px 22px 40px; font-weight: 600; font-size: 1.22rem; line-height: 1.4; color: var(--mezclilla); }
.ficha-lab__tuerca {
  position: absolute;
  bottom: 10px;
  width: 22px;
  height: 22px;
  background: radial-gradient(circle, #fff 0 4px, var(--metal) 4.5px);
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  animation: girar 8s linear infinite;
}
.ficha-lab__tuerca--1 { left: 12px; }
.ficha-lab__tuerca--2 { right: 12px; animation-direction: reverse; }
.formula__mensaje { margin: 26px 0 0; max-width: 22em; font-size: 1.08rem; line-height: 1.6; }

.s-titulo { font-weight: 700; color: var(--mezclilla); }
.s-titulo::after { content: ""; display: block; width: 92px; height: 10px; margin: 12px auto 0; border-radius: 3px; background: var(--franjas); }
.s-cuenta__caja { border: 3px solid var(--metal); background: linear-gradient(180deg, #fff, #e9eef3); }
.s-cuenta__num { font-weight: 700; }
.s-cuenta__fin { font-weight: 700; color: var(--mezclilla); }
.s-evento { position: relative; overflow: hidden; padding-top: 40px; border: 3px solid var(--metal); }
.s-evento::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--franjas); }
.s-evento__icono { border: 3px solid var(--negro); background: var(--amarillo); color: var(--negro); }
.s-evento__hora { font-weight: 700; color: var(--mezclilla); }
.s-vestimenta__tipo { font-weight: 700; font-size: 1.5rem; color: var(--mezclilla); }
.s-paleta li { border: 2px solid var(--negro); }
.s-rsvp__saludo { font-weight: 600; font-size: 1.3rem; color: var(--mezclilla); }

.s-btn { font-weight: 700; letter-spacing: .06em; }
.s-btn--linea, .s-btn--mini { border-width: 3px; background: #fff; }
.s-btn--lleno { border: 3px solid var(--negro); background: var(--amarillo); color: var(--negro); box-shadow: 0 6px 0 var(--negro); }
.s-btn--lleno:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--negro); }
.s-btn:focus-visible { outline: 3px solid var(--mezclilla); outline-offset: 4px; }

.rsvp-foto {
  position: relative;
  width: min(58%, 220px);
  margin: 36px auto -36px;
  padding: 10px 10px 34px;
  background: #fff;
  box-shadow: 0 16px 26px -14px rgba(0, 0, 0, .45);
  transform: rotate(3deg);
}
.rsvp-foto.aparece.visible { transform: rotate(3deg); }
.rsvp-foto::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  width: 92px;
  height: 22px;
  margin-left: -46px;
  background: var(--franjas);
  opacity: .9;
  transform: rotate(-4deg);
}
.rsvp-foto img { display: block; width: 100%; aspect-ratio: 9 / 11; object-fit: cover; }

.s-pie { margin-top: 30px; background: var(--mezclilla); color: #fff; box-shadow: inset 0 6px 0 var(--mezclilla-osc); outline: 2px dashed rgba(252, 224, 41, .6); outline-offset: -12px; }
.s-pie__t { color: rgba(255, 255, 255, .85); }
.s-pie__n { font-weight: 700; color: var(--amarillo); }
.s-pie__credito { color: #e3ebf6; }
.s-pie__marca { text-decoration-color: var(--amarillo); }

.btn-musica { background: var(--amarillo); color: var(--negro); border: 3px solid var(--negro); }

/* Lluvia de plátanos (canvas propio) */
.lluvia-platanos { position: fixed; inset: 0; z-index: 65; width: 100%; height: 100%; pointer-events: none; }

@media (max-height: 620px) {
  .lab__titulo { font-size: 1.1rem; }
  .maquina { margin-top: 56px; }
  .riel { min-height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .engrane, .platano, .burbujas i, .tubo-ensayo i, .letrero, .flecha, .lab__pista, .luz, .ficha-lab__tuerca, .capsula-hero__tapa::before { animation: none !important; }
  .lab.tenso .maquina, .lab.activo .maquina { animation: none; }
  .lab.fuera { transform: none; }
}
