/* =========================================================
   Héroe · animación del proceso de investigación
   Sustituye la foto del archivador. Todo es ilustración genérica:
   ningún nombre, imagen ni dato de un caso real.
   Medidas en cqw (ancho de la mesa) para que escale igual en móvil.
   ========================================================= */
.inv { position: relative; z-index: 1; width: 100%; }
.inv.pausa *, .inv.pausa *::before, .inv.pausa *::after { animation-play-state: paused !important; }

/* ---------- Encabezado: paso actual y avance ---------- */
.inv-cab { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 18px; margin-bottom: 18px; }
.inv-paso { font: 700 12px/1 var(--f-mono); letter-spacing: .24em; color: var(--crema-suave); white-space: nowrap; }
.inv-num { color: var(--rojo-claro); font-weight: 700; }
.inv-barras { display: flex; gap: 4px; justify-self: end; width: min(230px, 100%); }
.inv-barras i { flex: 1; height: 3px; border-radius: 2px; background: rgba(239, 230, 208, .16); overflow: hidden; }
.inv-barras b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rojo), var(--rojo-vivo)); }
.inv-barras .hecho b { width: 100%; }
.inv-barras .activo b { animation: inv-avance var(--d, 5s) linear both; }
@keyframes inv-avance { to { width: 100%; } }
.inv-tit { grid-column: 1 / -1; padding-left: 14px; border-left: 2px solid var(--rojo-vivo); }
.inv-txt { display: block; font: 400 clamp(22px, 2.4vw, 29px)/1.1 var(--f-maquina); color: #fbf4e2; }
.inv-sub { display: block; margin-top: 6px; min-height: 2.9em; font: 400 15px/1.45 var(--f-texto); color: var(--crema-suave); }
.inv-tit.cambia .inv-txt { animation: inv-cab .5s cubic-bezier(.2, .7, .3, 1) both; }
.inv-tit.cambia .inv-sub { animation: inv-cab .5s .08s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-cab { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Mesa ---------- */
.inv-mesa { position: relative; container-type: inline-size; aspect-ratio: 1 / .9; border-radius: 12px; overflow: hidden; background: #1c140d;
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 235, 200, .08), inset 0 1px 0 rgba(255, 235, 200, .06); }
.mesa-fondo { position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 62% 52% at 44% 36%, rgba(255, 214, 150, .24), rgba(255, 190, 110, .07) 55%, transparent 78%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='630'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0035 0.16' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.06  0 0 0 0 0.035  0 0 0 0 0.015  1.4 0 0 0 -0.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E") center / cover,
    linear-gradient(175deg, #4a3420, #2c1e12 60%, #1e140b); }
.mf-hoja { position: absolute; background: #e9dec3; filter: blur(.25cqw) brightness(.55); box-shadow: 0 1cqw 2cqw rgba(0, 0, 0, .5); }
.mf-h1 { left: -9cqw; top: -6cqw; width: 30cqw; height: 38cqw; transform: rotate(14deg); }
.mf-h2 { right: -12cqw; bottom: -14cqw; width: 34cqw; height: 40cqw; transform: rotate(-18deg); filter: blur(.3cqw) brightness(.45); }
.mf-cafe { position: absolute; right: -5cqw; top: -6cqw; width: 30cqw; height: auto; opacity: .55; }
.mf-pluma { position: absolute; left: -6cqw; bottom: 3cqw; width: 48cqw; height: 3.5cqw; transform: rotate(-24deg); filter: drop-shadow(0 1.2cqw .8cqw rgba(0, 0, 0, .55)); }
.mf-clip { position: absolute; left: 88cqw; top: 70cqw; width: 3cqw; height: 7cqw; transform: rotate(38deg); opacity: .8; }
.mesa-vineta { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 46% 42%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
.mesa-polvo { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.mesa-polvo i { position: absolute; width: .5cqw; height: .5cqw; border-radius: 50%; background: rgba(255, 232, 190, .55); filter: blur(.08cqw); animation: inv-polvo 11s linear infinite; }
.mesa-polvo i:nth-child(1) { left: 22%; top: 30%; }
.mesa-polvo i:nth-child(2) { left: 48%; top: 18%; animation-delay: -3s; width: .35cqw; height: .35cqw; }
.mesa-polvo i:nth-child(3) { left: 62%; top: 40%; animation-delay: -6s; }
.mesa-polvo i:nth-child(4) { left: 35%; top: 55%; animation-delay: -8s; width: .3cqw; height: .3cqw; }
.mesa-polvo i:nth-child(5) { left: 70%; top: 22%; animation-delay: -1.5s; width: .3cqw; height: .3cqw; }
.mesa-polvo i:nth-child(6) { left: 28%; top: 12%; animation-delay: -4.5s; }
.mesa-polvo i:nth-child(7) { left: 55%; top: 60%; animation-delay: -9.5s; width: .35cqw; height: .35cqw; }
.mesa-polvo i:nth-child(8) { left: 44%; top: 38%; animation-delay: -7s; }
@keyframes inv-polvo { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: .9; } 85% { opacity: .7; } 100% { opacity: 0; transform: translate(6cqw, -9cqw); } }

.esc { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .6s ease; }
.esc.vis { opacity: 1; }
.esc.on { animation: inv-camara var(--d, 5s) linear both; }
@keyframes inv-camara { from { transform: scale(1); } to { transform: scale(1.035); } }

/* ---------- Piezas comunes ---------- */
.ppl { position: absolute; color: #2a251d; border-radius: .25cqw; padding: 3cqw 3.2cqw;
  background: url("img/anim/grano.webp") 0 0 / 34cqw, linear-gradient(105deg, rgba(255, 255, 255, .4), transparent 35%, transparent 68%, rgba(120, 90, 40, .12)), #f1e7cf;
  box-shadow: inset 0 0 2.6cqw rgba(150, 110, 50, .22), 0 .25cqw .4cqw rgba(0, 0, 0, .3), 0 2.2cqw 3.4cqw -.6cqw rgba(0, 0, 0, .6); }
.ppl s, .tapa-etq s, .carp-pest s, .nt-preg s { text-decoration: none; background: #16130f; color: transparent; border-radius: .15cqw; }
.mq { margin: 0 0 1.1cqw; font: 400 1.55cqw/1.55 var(--f-mono); color: #2a251d; }
.tt { display: block; font: 400 2cqw/1 var(--f-maquina); letter-spacing: .16em; color: #2a251d; }
.folio { position: absolute; top: 1.4cqw; right: 2cqw; font: 700 1.2cqw/1 var(--f-mono); letter-spacing: .14em; color: #8a7a5e; }
.memb { display: flex; align-items: center; gap: 1.2cqw; padding-bottom: 1.2cqw; margin-bottom: 1.6cqw; border-bottom: .22cqw solid #2a251d; }
.memb b { display: block; font: 700 1.35cqw/1.1 var(--f-mono); letter-spacing: .08em; }
.memb span { display: block; margin-top: .4cqw; font: 400 1.5cqw/1 var(--f-maquina); color: #4d4537; }
.escudo { flex: none; width: 4.4cqw; height: 4.4cqw; border-radius: 50%; border: .3cqw double #2a251d; position: relative; }
.escudo::after { content: ""; position: absolute; inset: 22%; background: #2a251d; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.rn { display: flex; flex-direction: column; gap: 1cqw; }
.rn i { display: block; height: .75cqw; border-radius: .2cqw; background: rgba(43, 38, 30, .38); width: 100%; }
.rn i:nth-child(3n+2) { width: 88%; }
.rn i:nth-child(4n) { width: 66%; }
.rn i:nth-child(5n) { width: 78%; }
.polaroid { position: absolute; background: linear-gradient(#f7f4ec, #ebe6d9); padding: 1.2cqw 1.2cqw 0; border-radius: .2cqw; box-shadow: 0 .25cqw .4cqw rgba(0, 0, 0, .3), 0 2cqw 3cqw -.6cqw rgba(0, 0, 0, .6); display: flex; flex-direction: column; }
.polaroid .foto { display: block; width: 100%; flex: 1; min-height: 0; filter: sepia(.35) contrast(1.05); box-shadow: inset 0 0 1cqw rgba(0, 0, 0, .4); }
.polaroid em { display: block; height: 4.4cqw; font: 700 2.4cqw/4.4cqw var(--f-mano); font-style: normal; color: #1f3a8a; text-align: center; }
.sello-tx { color: var(--rojo); border: .4cqw solid currentColor; font-family: var(--f-mono); font-weight: 700; letter-spacing: .14em; text-align: center;
  -webkit-mask: url("img/anim/motas.webp") center / 22cqw; mask: url("img/anim/motas.webp") center / 22cqw; }
.cinta { position: absolute; width: 10cqw; height: 3cqw; background: url("img/anim/cinta.webp") center / 100% 100%; opacity: .92; filter: drop-shadow(0 .2cqw .2cqw rgba(0, 0, 0, .2)); }
svg.qr { display: block; background: #fff; fill: #15130f; fill-rule: evenodd; }
@keyframes inv-entra { from { opacity: 0; transform: translateY(6cqw) rotate(var(--r, 0deg)); } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }
@keyframes inv-traza { to { stroke-dashoffset: 0; } }

/* ---------- Teléfono ---------- */
.inv .tel { position: absolute; padding: 1cqw; border-radius: 5.6cqw;
  background: linear-gradient(135deg, #6a665f, #2b2925 30%, #45423c 55%, #1b1a18 80%, #55524b);
  box-shadow: inset 0 0 0 .2cqw rgba(255, 255, 255, .12), 0 .4cqw .6cqw rgba(0, 0, 0, .4), 0 3.4cqw 5cqw -1cqw rgba(0, 0, 0, .7); }
.inv .tel::before { content: ""; position: absolute; right: -.45cqw; top: 22%; width: .5cqw; height: 9cqw; border-radius: .3cqw; background: #3a3833; }
.tel-pant { position: relative; height: 100%; border-radius: 4.7cqw; background: #13110e; overflow: hidden; box-shadow: inset 0 0 0 .45cqw #050505; }
.tel-pant::after { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; border-radius: inherit; background: linear-gradient(125deg, rgba(255, 255, 255, .1), transparent 38%); }
.tel-isla { position: absolute; z-index: 9; top: 1.5cqw; left: 50%; width: 9.6cqw; height: 2.6cqw; margin-left: -4.8cqw; border-radius: 2cqw; background: #000; }
.tel-barra { display: flex; justify-content: space-between; align-items: center; height: 5.6cqw; padding: 0 3.6cqw 0 4.4cqw; font: 600 1.5cqw/1 var(--f-texto); color: #f1ece0; }
.tb-ic { display: flex; align-items: flex-end; gap: .3cqw; }
.tb-ic i { width: .45cqw; background: #f1ece0; border-radius: .1cqw; }
.tb-ic i:nth-child(1) { height: .7cqw; } .tb-ic i:nth-child(2) { height: 1cqw; } .tb-ic i:nth-child(3) { height: 1.3cqw; }
.tb-ic b { width: 2.6cqw; height: 1.2cqw; margin-left: .6cqw; border-radius: .3cqw; border: .15cqw solid #f1ece0; background: linear-gradient(90deg, #f1ece0 70%, transparent 70%) content-box; padding: .15cqw; }

/* ---------- 1 · Abre el sobre ---------- */
.sobre { position: absolute; left: 15cqw; top: 43cqw; width: 70cqw; height: 42cqw; }
.on .sobre { animation: inv-entra .7s cubic-bezier(.2, .7, .3, 1) both; }
.sb-fondo { position: absolute; inset: 0; border-radius: .6cqw; background: #a9853f; box-shadow: 0 3cqw 4cqw -1cqw rgba(0, 0, 0, .7); }
.sb-hoja { position: absolute; z-index: 2; }
.sh1 { left: 6%; width: 88%; top: 5%; height: 92%; padding: 2.6cqw 3cqw; }
.sh1 .mq { font-size: 1.45cqw; }
.sh2 { left: 36%; width: 30%; top: 8%; height: 66%; }
.sh3 { left: 22%; width: 54%; top: 4%; height: 88%; padding: 2.2cqw 2.4cqw; background: url("img/anim/grano.webp") 0 0 / 30cqw, #e3dfd2; }
.r-cab { display: block; text-align: center; font: 700 3.2cqw/1 Georgia, 'Times New Roman', serif; letter-spacing: .04em; border-bottom: .15cqw solid #2a251d; padding-bottom: .8cqw; }
.r-tit { display: block; margin: 1.2cqw 0 1.4cqw; text-align: center; font: 900 2.4cqw/1.05 Georgia, 'Times New Roman', serif; }
.r-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw; }
.r-foto { grid-column: 1 / -1; height: 9cqw; }
.r-foto .foto { width: 100%; height: 100%; display: block; filter: grayscale(1) contrast(1.2); }
.recorte .rn i { height: .55cqw; background: rgba(43, 38, 30, .45); }
.recorte .rn { gap: .75cqw; }
.on .sh1 { animation: inv-sale1 1.2s 1.25s cubic-bezier(.2, .7, .3, 1) both; }
.on .sh2 { animation: inv-sale2 1.2s 1.5s cubic-bezier(.2, .7, .3, 1) both; }
.on .sh3 { animation: inv-sale3 1.2s 1.75s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-sale1 { to { transform: translate(-12cqw, -33cqw) rotate(-8deg); } }
@keyframes inv-sale2 { to { transform: translate(20cqw, -29cqw) rotate(9deg); } }
@keyframes inv-sale3 { to { transform: translate(1cqw, -37cqw) rotate(-2deg); } }
.sb-frente { position: absolute; inset: 0; z-index: 3; border-radius: .6cqw;
  background: url("img/anim/grano.webp") 0 0 / 34cqw, linear-gradient(170deg, #dfc07c, #c9a45e 70%, #b8934e);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.sb-etq { position: absolute; left: 5cqw; bottom: 4cqw; width: 27cqw; padding: 1.4cqw 1.8cqw; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .5cqw 1.4cqw;
  background: url("img/anim/grano.webp") 0 0 / 30cqw, #f3ead4; box-shadow: 0 .2cqw .4cqw rgba(0, 0, 0, .25); transform: rotate(-1.5deg); }
.sb-etq span { font: 700 1.2cqw/1 var(--f-mono); letter-spacing: .16em; color: #5b544a; border-bottom: .12cqw solid #b9ad92; padding-bottom: .4cqw; }
.sb-etq em { font: 700 2.4cqw/1 var(--f-mano); font-style: normal; color: #1f3a8a; border-bottom: .12cqw solid #b9ad92; padding-bottom: .2cqw; }
.sb-etq .sb-letra { font-size: 4cqw; line-height: .8; }
.sb-sello { position: absolute; right: 5cqw; bottom: 6cqw; padding: .9cqw 1.8cqw; font-size: 2.3cqw; transform: rotate(-7deg); opacity: .88; }
.sb-solapa { position: absolute; left: 0; top: 0; width: 100%; height: 56%; z-index: 5; transform-origin: 50% 0;
  background: url("img/anim/grano.webp") 0 0 / 34cqw, linear-gradient(#cfac64, #bd974f); clip-path: polygon(0 0, 100% 0, 52% 100%, 48% 100%);
  filter: drop-shadow(0 .4cqw .4cqw rgba(0, 0, 0, .3)); }
.on .sb-solapa { animation: inv-solapa .75s .5s cubic-bezier(.5, 0, .3, 1) both; }
@keyframes inv-solapa { 0% { transform: scaleY(1); z-index: 5; } 49% { z-index: 5; } 50% { z-index: 1; } 100% { transform: scaleY(-1); z-index: 1; filter: brightness(.78); } }

/* ---------- 2 · Examina cada prueba (lupa con aumento real) ---------- */
.doc2 { left: 12cqw; top: 5cqw; width: 62cqw; height: 80cqw; }
.on .doc2 { animation: inv-entra .6s both; }
.d2-flujo { position: absolute; left: 3.2cqw; right: 3.2cqw; top: 11cqw; height: 25cqw; overflow: hidden; }
.d2-flujo::before { content: ""; float: right; width: 17cqw; height: 9cqw; }
.d2-clave { position: absolute; left: 3.2cqw; top: 37.5cqw; white-space: nowrap; }
.d2-clave u { text-decoration: none; }
.d2-cola { position: absolute; left: 3.2cqw; top: 41.4cqw; }
.d2-firma { position: absolute; left: 3.2cqw; top: 60cqw; width: 22cqw; border-top: .15cqw solid #2a251d; padding-top: .6cqw; font: 400 1.3cqw/1 var(--f-mono); color: #5b544a; }
.d2-firma::before { content: ""; position: absolute; left: 2cqw; bottom: 2.4cqw; width: 16cqw; height: 5cqw;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath d='M4 22c8-14 12-18 14-10s-4 12 2 8 10-16 14-12-2 14 4 10 8-10 12-8 0 8 6 6 14-6 20-8 12 0 20-2' fill='none' stroke='%231f3a8a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.d2-foto { right: 3cqw; top: -1.6cqw; width: 18cqw; height: 20cqw; transform: rotate(5deg); padding-bottom: 2.4cqw; }
.d2-clip { position: absolute; right: 13cqw; top: -3.4cqw; width: 2.4cqw; height: 6.4cqw; transform: rotate(6deg); }
.circulo { position: absolute; left: 44.5cqw; top: 36.2cqw; width: 14cqw; height: 5.4cqw; overflow: visible; }
.circulo path, .flecha-roja path { fill: none; stroke: #c4221f; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.circulo path { stroke-width: 2.4; }
.on .circulo path { animation: inv-traza .6s 3.4s ease-out both; }
.flecha-roja { position: absolute; left: 45cqw; top: 42cqw; width: 6cqw; height: 4.6cqw; overflow: visible; }
.on .flecha-roja path { animation: inv-traza .35s 3.95s ease-out both; }
.nota-roja { position: absolute; left: 36cqw; top: 46cqw; font: 700 4.4cqw/1 var(--f-mano); color: #c4221f; transform: rotate(-6deg); opacity: 0; }
.on .nota-roja { animation: inv-pop .4s 4.2s both; }
@keyframes inv-pop { from { opacity: 0; transform: rotate(-6deg) scale(.6); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
.lupa { position: absolute; left: 0; top: 0; z-index: 4; width: 24cqw; height: 24cqw; filter: drop-shadow(0 2.4cqw 2cqw rgba(0, 0, 0, .55)); }
.vidrio { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #f1e7cf; }
.vidrio::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .35), transparent 38%), radial-gradient(circle, transparent 60%, rgba(70, 50, 20, .28)); }
.vidrio .doc2 { left: 0; top: 0; transform-origin: 0 0; box-shadow: none; }
.lupa-aro { position: absolute; inset: 0; width: 100%; height: 100%; }
.lupa-mango { position: absolute; left: 85%; top: 85%; width: 15cqw; height: 3.4cqw; margin-top: -1.7cqw; transform-origin: 0 50%; transform: rotate(45deg); border-radius: 0 1.7cqw 1.7cqw 0;
  background: linear-gradient(90deg, #c9a24a 0 2.2cqw, #6d5420 2.2cqw 2.6cqw, transparent 2.6cqw), linear-gradient(#4a2e1a, #23160c 60%, #3a2414); }
.on .lupa { animation: inv-lupa 3s .3s cubic-bezier(.45, 0, .25, 1) both; }
.on .vidrio .doc2 { animation: inv-lupa-in 3s .3s cubic-bezier(.45, 0, .25, 1) both; }
@keyframes inv-lupa { 0% { transform: translate(76cqw, 72cqw); opacity: 0; } 12% { opacity: 1; } 35% { transform: translate(28cqw, 10cqw); } 65% { transform: translate(18cqw, 34cqw); } 100% { transform: translate(51cqw, 31.7cqw); opacity: 1; } }
@keyframes inv-lupa-in { 0% { transform: translate(-117.2cqw, -122.3cqw) scale(1.7); } 35% { transform: translate(-35.6cqw, -16.9cqw) scale(1.7); } 65% { transform: translate(-18.6cqw, -57.7cqw) scale(1.7); } 100% { transform: translate(-74.7cqw, -53.79cqw) scale(1.7); } }

/* ---------- 3 · Escanea el código ---------- */
.doc3 { left: 5cqw; top: 8cqw; width: 52cqw; height: 76cqw; --r: -2deg; transform: rotate(-2deg); }
.on .doc3 { animation: inv-entra .6s both; }
.qr-caja { position: absolute; left: 50%; bottom: 6cqw; width: 26cqw; margin-left: -13cqw; text-align: center; }
.qr-caja svg { width: 100%; height: auto; padding: 1.2cqw; border: .25cqw solid #2a251d; }
.qr-caja span { display: block; margin-top: 1.2cqw; font: 700 1.3cqw/1 var(--f-mono); letter-spacing: .18em; color: #2a251d; }
.t3 { left: 59cqw; top: 6cqw; width: 34cqw; height: 74cqw; transform: rotate(-3deg); }
.on .t3 { animation: inv-tel .9s .25s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-tel { from { transform: translateX(45cqw) rotate(10deg); } to { transform: rotate(-3deg); } }
.cam { position: absolute; inset: 0; z-index: 4; overflow: hidden; }
.cam-fondo { position: absolute; inset: -10%; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, #e8dcc0, #b9a986 70%, #6f6450); }
.cam-fondo svg.qr { width: 52%; height: auto; padding: 1.4cqw; transform: rotate(-5deg) skewX(3deg); filter: blur(.35cqw); }
.on .cam-fondo svg.qr { animation: inv-enfoca .5s 1.3s both; }
@keyframes inv-enfoca { to { filter: blur(0); } }
.esq { position: absolute; left: 10%; top: 24%; width: 80%; height: 52%; }
.esq path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.on .esq { animation: inv-esq .45s 1.6s cubic-bezier(.3, 1.4, .5, 1) both; }
.on .esq path { animation: inv-esq-c .2s 2s both; }
@keyframes inv-esq { to { left: 22%; top: 34%; width: 56%; height: 32%; } }
@keyframes inv-esq-c { to { stroke: #6fd086; } }
.cam-tx { position: absolute; left: 50%; bottom: 9cqw; transform: translateX(-50%); padding: .9cqw 2cqw; border-radius: 3cqw; background: rgba(0, 0, 0, .55); font: 500 1.5cqw/1 var(--f-texto); color: #fff; white-space: nowrap; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.on .flash { animation: inv-flash .5s 2.4s both; }
@keyframes inv-flash { 30% { opacity: .85; } 100% { opacity: 0; } }
.on .cam { animation: inv-fuera .3s 2.55s both; }
@keyframes inv-fuera { to { opacity: 0; visibility: hidden; } }
.app { position: absolute; inset: 0; padding: 0 2.6cqw; display: flex; flex-direction: column; gap: 1.6cqw; background: linear-gradient(#1d1915, #13110e); }
.app-logo { width: 70%; height: auto; margin: 1cqw auto 1cqw; }
.app-ok { display: flex; align-items: center; gap: 1.4cqw; padding: 2cqw; border-radius: 1.6cqw; background: rgba(79, 179, 101, .12); border: .2cqw solid rgba(111, 208, 134, .35); }
.app-ok svg { width: 5.6cqw; height: 5.6cqw; flex: none; color: #6fd086; }
.app-ok b { display: block; font: 600 1.9cqw/1.15 var(--f-texto); color: #f1ece0; }
.app-ok span { display: block; font: 400 1.4cqw/1.3 var(--f-texto); color: var(--crema-suave); }
.app-it { display: flex; align-items: center; gap: 1.4cqw; padding: 1.8cqw 2cqw; border-radius: 1.4cqw; background: rgba(239, 230, 208, .06); font: 500 1.8cqw/1 var(--f-texto); color: #f1ece0; }
.app-it svg { width: 3cqw; height: 3cqw; color: var(--manila); }
.app-it em { margin-left: auto; font: 700 1.4cqw/1 var(--f-mono); font-style: normal; color: #fff; background: var(--rojo); border-radius: 2cqw; padding: .5cqw 1cqw; }
.on .app-ok, .on .app-it { animation: inv-sube .45s cubic-bezier(.2, .7, .3, 1) both; }
.on .app-ok { animation-delay: 2.75s; }
.on .app-it:nth-of-type(1) { animation-delay: 2.95s; }
.on .app-it:nth-of-type(2) { animation-delay: 3.1s; }
.on .app-it:nth-of-type(3) { animation-delay: 3.25s; }
@keyframes inv-sube { from { opacity: 0; transform: translateY(3cqw); } to { opacity: 1; transform: none; } }

/* ---------- 4 · Escucha las grabaciones ---------- */
.t4 { left: 7cqw; top: 4cqw; width: 37cqw; height: 81cqw; transform: rotate(-1.5deg); }
.on .t4 { animation: inv-entra-t4 .7s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-entra-t4 { from { opacity: 0; transform: translateY(8cqw) rotate(-1.5deg); } to { opacity: 1; transform: rotate(-1.5deg); } }
.rep { display: flex; flex-direction: column; padding: 0 3cqw 3cqw; background: linear-gradient(#211c17, #13110e 70%); }
.rep-cab { display: flex; justify-content: space-between; align-items: baseline; margin: 1cqw 0 2.2cqw; font: 700 1.4cqw/1 var(--f-mono); letter-spacing: .2em; color: var(--rojo-claro); }
.rep-cab em { font-style: normal; letter-spacing: .1em; color: var(--crema-suave); }
.rep-arte { border-radius: 1.6cqw; overflow: hidden; background: radial-gradient(circle at 30% 20%, #4a3a26, #1d1813); padding: 3cqw 2.6cqw; box-shadow: 0 1.4cqw 2.4cqw rgba(0, 0, 0, .5); }
.rep-arte svg { display: block; width: 100%; height: auto; }
.rep-tit { margin-top: 2.6cqw; font: 400 2.6cqw/1.1 var(--f-maquina); color: #f6efdd; }
.rep-sub { margin-top: .6cqw; font: 400 1.5cqw/1.2 var(--f-texto); color: var(--crema-suave); }
.inv .onda { position: relative; height: 8cqw; margin-top: 2.4cqw; }
.onda-base, .onda-hecha { position: absolute; inset: 0; display: flex; align-items: center; gap: .35cqw; }
.inv .onda i { flex: 1; height: var(--h); border-radius: .3cqw; background: rgba(239, 230, 208, .22); }
.inv .onda-hecha i { background: var(--rojo-vivo); }
.onda-hecha { clip-path: inset(0 79% 0 0); }
.on .onda-hecha { animation: inv-reproduce 5.2s linear both; }
@keyframes inv-reproduce { to { clip-path: inset(0 30% 0 0); } }
.rep-tiempos { display: flex; justify-content: space-between; margin-top: 1cqw; font: 400 1.4cqw/1 var(--f-mono); color: var(--crema-suave); }
.rep-ctrl { display: flex; justify-content: center; align-items: center; gap: 4.4cqw; margin-top: auto; color: #f1ece0; }
.rep-ctrl > svg { width: 3.6cqw; height: 3.6cqw; }
.rep-play { width: 8.4cqw; height: 8.4cqw; border-radius: 50%; display: grid; place-items: center; background: #f1ece0; color: #13110e; box-shadow: 0 0 0 1.2cqw rgba(241, 236, 224, .08); }
.rep-play svg { width: 3.6cqw; height: 3.6cqw; }
.ondas-son { position: absolute; left: 44.5cqw; top: 28cqw; width: 8cqw; height: 12cqw; }
.ondas-son i { position: absolute; left: 0; top: 50%; width: 5cqw; height: 5cqw; margin-top: -2.5cqw; border: .4cqw solid transparent; border-right-color: rgba(217, 184, 113, .8); border-radius: 50%; opacity: 0; }
.on .ondas-son i { animation: inv-son 1.6s ease-out infinite both; }
.on .ondas-son i:nth-child(2) { animation-delay: .53s; }
.on .ondas-son i:nth-child(3) { animation-delay: 1.06s; }
@keyframes inv-son { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: translateX(2.4cqw) scale(2.1); } }
.casete { position: absolute; left: 53cqw; top: 6cqw; width: 41cqw; height: 26cqw; padding: 1.8cqw 2.2cqw; border-radius: 1.4cqw; transform: rotate(5deg);
  background: linear-gradient(160deg, #3a3631, #1f1d1a 70%); box-shadow: inset 0 0 0 .2cqw rgba(255, 255, 255, .06), 0 .3cqw .5cqw rgba(0, 0, 0, .4), 0 2.4cqw 3.4cqw -.6cqw rgba(0, 0, 0, .7); }
.on .casete { animation: inv-casete .8s .15s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-casete { from { opacity: 0; transform: translate(14cqw, -4cqw) rotate(16deg); } to { opacity: 1; transform: rotate(5deg); } }
.cas-etq { position: relative; height: 100%; border-radius: .8cqw; padding: 1.2cqw 2cqw; background: url("img/anim/grano.webp") 0 0 / 30cqw, linear-gradient(#f3ead4 0 62%, #c4221f 62% 66%, #f3ead4 66%); }
.cas-lado { position: absolute; left: 1.6cqw; top: 1cqw; font: 700 2.2cqw/1 var(--f-mono); color: #2a251d; }
.cas-etq em { display: block; padding-left: 3.4cqw; font: 700 3cqw/1 var(--f-mano); font-style: normal; color: #1f3a8a; }
.cas-lin { display: block; margin: .8cqw 0 0 3.4cqw; width: 60%; border-top: .12cqw solid #b9ad92; }
.cas-vent { position: absolute; left: 6cqw; right: 6cqw; top: 9.6cqw; height: 9cqw; border-radius: 4.5cqw; background: #14120f; box-shadow: inset 0 .3cqw .6cqw rgba(0, 0, 0, .8); display: flex; justify-content: space-between; align-items: center; padding: 0 2.4cqw; }
.carrete { width: 6.4cqw; height: 6.4cqw; display: grid; place-items: center; }
.carrete svg { width: 100%; height: 100%; }
.on .carrete svg { animation: inv-gira 2.4s linear infinite; }
@keyframes inv-gira { to { transform: rotate(360deg); } }
.tornillo { position: absolute; width: 1.1cqw; height: 1.1cqw; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9c4b8, #6b675f); }
.t-a { left: .7cqw; top: .7cqw; } .t-b { right: .7cqw; top: .7cqw; } .t-c { left: .7cqw; bottom: .7cqw; } .t-d { right: .7cqw; bottom: .7cqw; }
.transc { left: 51cqw; top: 40cqw; width: 44cqw; height: 42cqw; transform: rotate(-1.5deg); padding: 3cqw; }
.on .transc { animation: inv-entra-tr .7s .35s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-entra-tr { from { opacity: 0; transform: translateY(6cqw) rotate(-1.5deg); } to { opacity: 1; transform: rotate(-1.5deg); } }
.transc .tt { margin-bottom: 2.4cqw; padding-bottom: 1.2cqw; border-bottom: .2cqw solid #2a251d; }
.tr { margin: 0 0 1.6cqw; font: 400 1.6cqw/1.4 var(--f-mono); }
.tr span { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: top; width: 0; }
.on .tr span { animation: inv-teclea calc(var(--n) * .035s) var(--dl) steps(var(--n), end) both; }
@keyframes inv-teclea { to { width: calc(var(--n) * 1ch); } }

/* ---------- 5 · Conecta las pistas ---------- */
.corcho { position: absolute; inset: 4cqw; border-radius: .6cqw; border: 1.6cqw solid #4a3220;
  background:
    url("img/anim/grano.webp") 0 0 / 26cqw,
    radial-gradient(rgba(60, 35, 15, .4) 14%, transparent 17%) 0 0 / 1.3cqw 1.3cqw,
    radial-gradient(rgba(255, 220, 170, .2) 12%, transparent 15%) .65cqw .65cqw / 1.3cqw 1.3cqw,
    linear-gradient(160deg, #b5875a, #9a6f45);
  box-shadow: inset 0 0 5cqw rgba(0, 0, 0, .4), inset 0 0 0 .3cqw rgba(0, 0, 0, .3), 0 2cqw 4cqw rgba(0, 0, 0, .6); }
.on .corcho { animation: inv-entra .5s both; }
.tj { position: absolute; transform: rotate(var(--r)); }
.on .tj { animation: inv-clava .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.on .tj1 { animation-delay: .25s; } .on .tj2 { animation-delay: .4s; } .on .tj3 { animation-delay: .55s; }
.on .tj4 { animation-delay: .7s; } .on .tj5 { animation-delay: .85s; } .on .tj6 { animation-delay: 1s; }
@keyframes inv-clava { from { opacity: 0; transform: translateY(-3cqw) scale(1.1) rotate(var(--r)); } to { opacity: 1; transform: rotate(var(--r)); } }
.tj1 { left: 3cqw; top: 1.5cqw; width: 20cqw; height: 24cqw; --r: -6deg; }
.tj1 .cinta { left: -3cqw; top: -.6cqw; transform: rotate(-38deg); }
.tj2 { left: 55cqw; top: 2cqw; width: 22cqw; height: 27cqw; --r: 4deg; padding: 2.4cqw; }
.tj2 .tt { font-size: 1.5cqw; margin-bottom: 1.6cqw; }
.tj3 { left: 30cqw; top: 27cqw; width: 21cqw; height: 17cqw; --r: -3deg; padding: 3cqw 2cqw 2cqw; font: 700 3.7cqw/1 var(--f-mano); color: #23201a; background: linear-gradient(#f9e78a, #f2d968); box-shadow: 0 1.4cqw 2cqw -.4cqw rgba(0, 0, 0, .5); }
.tj4 { left: 4cqw; top: 45cqw; width: 28cqw; height: 21cqw; --r: 3deg; box-shadow: 0 1.4cqw 2cqw -.4cqw rgba(0, 0, 0, .5); }
.tj4 svg { display: block; width: 100%; height: 100%; }
.tj4 .cinta { left: -3cqw; bottom: -.8cqw; transform: rotate(40deg); }
.tj5 { left: 59cqw; top: 41cqw; width: 19cqw; height: 23cqw; --r: 7deg; }
.tj6 { left: 36cqw; top: 59cqw; width: 22cqw; height: 14cqw; --r: -2deg; padding: 2.4cqw 1.8cqw 1cqw; display: flex; flex-direction: column; gap: .6cqw;
  background: repeating-linear-gradient(#fbfaf5 0 2.6cqw, #9fc1dc 2.6cqw 2.75cqw), #fbfaf5; box-shadow: inset 0 .9cqw 0 #fbfaf5, inset 0 1.05cqw 0 #e08a8a, 0 1.4cqw 2cqw -.4cqw rgba(0, 0, 0, .5); }
.tj6 span { font: 700 2.8cqw/1 var(--f-mano); color: #1f3a8a; }
.tj6 span + span { color: #c4221f; text-decoration: underline; text-decoration-thickness: .2cqw; }
.hilos { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.hilos path { fill: none; stroke: #b81d1a; stroke-width: .42; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(.25px .6px .3px rgba(0, 0, 0, .55)); }
.on .hilos path { animation: inv-traza .55s ease-in-out both; }
.on .hilos path:nth-child(1) { animation-delay: 1.6s; } .on .hilos path:nth-child(2) { animation-delay: 2s; }
.on .hilos path:nth-child(3) { animation-delay: 2.4s; } .on .hilos path:nth-child(4) { animation-delay: 2.8s; }
.on .hilos path:nth-child(5) { animation-delay: 3.2s; } .on .hilos path:nth-child(6) { animation-delay: 3.6s; }
.chin { position: absolute; z-index: 3; width: 2.4cqw; height: 2.4cqw; margin: -1.2cqw 0 0 -1.2cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a8e, #c4221f 55%, #6d0d10); box-shadow: .3cqw .8cqw .8cqw rgba(0, 0, 0, .5); }
.on .chin { animation: inv-chin .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.on .chin:nth-of-type(1) { animation-delay: .45s; } .on .chin:nth-of-type(2) { animation-delay: .6s; } .on .chin:nth-of-type(3) { animation-delay: .75s; }
.on .chin:nth-of-type(4) { animation-delay: .9s; } .on .chin:nth-of-type(5) { animation-delay: 1.05s; } .on .chin:nth-of-type(6) { animation-delay: 1.2s; }
@keyframes inv-chin { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: none; } }

/* ---------- 6 · Valida tus conclusiones (7 s) ---------- */
.nav { position: absolute; left: 5cqw; top: 4cqw; width: 90cqw; height: 64cqw; border-radius: 1.4cqw; overflow: hidden; background: #191612;
  box-shadow: 0 0 0 .2cqw rgba(255, 235, 200, .1), 0 3cqw 5cqw -1cqw rgba(0, 0, 0, .75); }
.on .nav { animation: inv-entra .55s both; }
.nav-barra { display: flex; align-items: center; gap: .9cqw; height: 5cqw; padding: 0 2cqw; background: linear-gradient(#2e2820, #241f19); border-bottom: .15cqw solid #0f0d0a; }
.nav-barra > i { width: 1.4cqw; height: 1.4cqw; border-radius: 50%; background: #e0605a; }
.nav-barra > i:nth-child(2) { background: #e3b04b; } .nav-barra > i:nth-child(3) { background: #5fb466; }
.nav-url { display: flex; align-items: center; gap: .8cqw; margin: 0 auto; padding: .8cqw 3cqw; border-radius: 3cqw; background: #15120f; font: 400 1.4cqw/1 var(--f-texto); color: var(--crema-suave); }
.nav-url svg { width: 1.5cqw; height: 1.5cqw; }
.nav-app { display: grid; grid-template-columns: 23cqw 1fr; height: calc(100% - 5cqw); }
.nav-lado { display: flex; flex-direction: column; gap: .9cqw; padding: 2.4cqw 1.8cqw; background: #13110e; border-right: .15cqw solid #2a241c; }
.nav-lado img { width: 100%; height: auto; margin-bottom: 1.6cqw; }
.nl-tit { font: 700 1.2cqw/1 var(--f-mono); letter-spacing: .22em; color: var(--crema-suave); margin-bottom: .4cqw; }
.nl-it { display: flex; align-items: center; justify-content: space-between; padding: 1.2cqw 1.4cqw; border-radius: .8cqw; font: 500 1.55cqw/1 var(--f-texto); color: var(--crema-suave); }
.nl-it svg { width: 1.9cqw; height: 1.9cqw; }
.nl-it.ok svg { color: #6fd086; }
.nl-it.act { background: rgba(193, 39, 45, .16); color: #fbf4e2; box-shadow: inset .35cqw 0 0 var(--rojo-vivo); }
.nl-it.bloq { opacity: .5; }
.on .nl-it.bloq { animation: inv-libera 7s both; }
@keyframes inv-libera { 0%, 80% { opacity: .5; } 86%, 100% { opacity: 1; color: #fbf4e2; } }
.nav-tarea { position: relative; padding: 3cqw 3.4cqw; display: flex; flex-direction: column; gap: 2cqw; }
.nt-num { font: 700 1.4cqw/1 var(--f-mono); letter-spacing: .2em; color: var(--rojo-claro); }
.nt-preg { margin: 0; font: 400 2.2cqw/1.35 var(--f-maquina); color: #f6efdd; }
.nt-preg s { background: rgba(239, 230, 208, .22); }
.sis-fila { display: flex; gap: 1.6cqw; }
.sis-campo { flex: 1; display: flex; align-items: center; height: 7cqw; padding: 0 2cqw; border-radius: .9cqw; border: .25cqw solid #4a4135; background: #0f0d0a; font: 700 3.2cqw/1 var(--f-mono); color: var(--crema); }
.on .sis-campo { animation: inv-campo 7s linear both; }
@keyframes inv-campo {
  0%, 27% { border-color: #4a4135; transform: none; }
  28% { border-color: var(--rojo-vivo); transform: translateX(-1.2cqw); }
  30% { transform: translateX(1.2cqw); } 32% { transform: translateX(-.7cqw); } 34%, 54% { transform: none; border-color: var(--rojo-vivo); }
  55%, 73% { border-color: #4a4135; }
  74%, 100% { border-color: #4fb365; box-shadow: 0 0 0 .6cqw rgba(79, 179, 101, .15); }
}
.tec { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; }
.on .tec1 { animation: inv-tec1 7s both; }
.on .tec2 { animation: inv-tec2 7s both; }
@keyframes inv-tec1 { 0%, 9% { width: 0; animation-timing-function: steps(6, end); } 20%, 54% { width: 6ch; } 55%, 100% { width: 0; } }
@keyframes inv-tec2 { 0%, 57% { width: 0; animation-timing-function: steps(8, end); } 68%, 100% { width: 8ch; } }
.cursor { display: inline-block; width: .25cqw; height: 3.8cqw; margin-left: .3cqw; background: var(--crema); }
.on .cursor { animation: inv-parpadeo .9s steps(2, start) infinite; }
@keyframes inv-parpadeo { to { visibility: hidden; } }
.sis-btn { display: grid; place-items: center; padding: 0 2.6cqw; border-radius: .9cqw; background: linear-gradient(#c1272d, #a3161d); color: #fff; font: 700 1.6cqw/1 var(--f-mono); letter-spacing: .16em; box-shadow: 0 .6cqw 1.2cqw rgba(163, 22, 29, .35); }
.on .sis-btn { animation: inv-btn 7s both; }
@keyframes inv-btn { 0%, 23% { transform: none; } 24.5% { transform: scale(.92); filter: brightness(1.25); } 26%, 69% { transform: none; filter: none; } 70.5% { transform: scale(.92); filter: brightness(1.25); } 72%, 100% { transform: none; filter: none; } }
.sis-msg { position: relative; height: 3.4cqw; }
.sis-res { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 1.2cqw; font: 500 1.9cqw/1 var(--f-texto); opacity: 0; }
.sis-res svg { width: 2.8cqw; height: 2.8cqw; }
.mal { color: var(--rojo-claro); }
.bien { color: #6fd086; font-weight: 600; }
.on .mal { animation: inv-mal 7s both; }
.on .bien { animation: inv-bien 7s both; }
@keyframes inv-mal { 0%, 27% { opacity: 0; } 29%, 53% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes inv-bien { 0%, 73% { opacity: 0; transform: translateY(1cqw); } 76%, 100% { opacity: 1; transform: none; } }
.nt-pista { display: flex; gap: 1.6cqw; align-items: center; padding: 2cqw 2.2cqw; border-radius: 1cqw; background: rgba(247, 226, 122, .08); border: .2cqw dashed rgba(247, 226, 122, .45); opacity: 0; }
.on .nt-pista { animation: inv-pista 7s both; }
@keyframes inv-pista { 0%, 34% { opacity: 0; transform: translateY(3cqw); } 39%, 100% { opacity: 1; transform: none; } }
.nt-pista svg { width: 4.4cqw; height: 4.4cqw; flex: none; color: var(--postit); }
.nt-pista b { display: block; font: 700 1.3cqw/1 var(--f-mono); letter-spacing: .2em; color: var(--postit); margin-bottom: .6cqw; }
.nt-pista span { font: 700 3cqw/1 var(--f-mano); color: #f6efdd; }
.aviso-b { position: absolute; left: 50%; top: 71cqw; width: 60cqw; margin-left: -30cqw; display: flex; align-items: center; gap: 2.2cqw; padding: 2cqw 2.6cqw; border-radius: 1.6cqw;
  background: #1f1b16; border: .2cqw solid rgba(111, 208, 134, .4); box-shadow: 0 2.4cqw 4cqw -1cqw rgba(0, 0, 0, .8); opacity: 0; }
.on .aviso-b { animation: inv-aviso 7s both; }
@keyframes inv-aviso { 0%, 78% { opacity: 0; transform: translateY(5cqw) scale(.94); } 84%, 100% { opacity: 1; transform: none; } }
.ab-sobre { position: relative; width: 11cqw; height: 7.4cqw; flex: none; border-radius: .4cqw; background: linear-gradient(170deg, #dfc07c, #c29d58); display: grid; place-items: end center; padding-bottom: .8cqw; font: 400 2.4cqw/1 var(--f-maquina); color: #3a2a10; }
.ab-sobre::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 55%; background: #b8914b; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.ab-sobre span { position: relative; }
.ab-tx b { display: block; font: 600 2.2cqw/1.1 var(--f-texto); color: #f6efdd; }
.ab-tx span { display: block; margin-top: .5cqw; font: 400 1.6cqw/1 var(--f-texto); color: var(--crema-suave); }
.ab-cand { width: 5cqw; height: 5cqw; margin-left: auto; color: #6fd086; }
.ab-cand .arco { transform-origin: 16px 10px; }
.on .ab-cand .arco { animation: inv-arco 7s both; }
@keyframes inv-arco { 0%, 86% { transform: none; } 92%, 100% { transform: translate(5px, -2px) rotate(30deg); } }

/* ---------- 7 · Resuelve el caso ---------- */
.carp { position: absolute; left: 17cqw; top: 13cqw; width: 62cqw; height: 62cqw; transform: rotate(-2deg); perspective: 220cqw; }
.on .carp { animation: inv-golpe .3s 2.25s both; }
@keyframes inv-golpe { 40% { transform: rotate(-2deg) translateY(.7cqw) scale(.985); } 100% { transform: rotate(-2deg); } }
.carp-atras { position: absolute; inset: 0; border-radius: .3cqw 1cqw 1cqw 1cqw; background: linear-gradient(160deg, #c8a35c, #b08b47); box-shadow: 0 3cqw 5cqw -1cqw rgba(0, 0, 0, .75); }
.carp-pest { position: absolute; left: 3cqw; top: -4.4cqw; height: 5cqw; padding: 1.4cqw 3cqw 0; border-radius: 1cqw 1cqw 0 0; background: linear-gradient(#cfab64, #c8a35c); font: 700 1.5cqw/1 var(--f-mono); letter-spacing: .16em; color: #3a2a10; }
.carp-hojas { position: absolute; inset: 0; }
.ch1 { left: 3cqw; top: 2cqw; width: 54cqw; height: 56cqw; transform: rotate(1.5deg); }
.ch2 { left: 5cqw; top: 3.5cqw; width: 52cqw; height: 55cqw; transform: rotate(-2deg); }
.ch3 { left: 30cqw; top: 6cqw; width: 22cqw; height: 26cqw; transform: rotate(7deg); padding-bottom: 3cqw; }
.on .ch1 { animation: inv-cae .5s .1s cubic-bezier(.3, .7, .4, 1) both; }
.on .ch2 { animation: inv-cae .5s .25s cubic-bezier(.3, .7, .4, 1) both; }
.on .ch3 { animation: inv-cae .5s .4s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes inv-cae { from { opacity: 0; translate: 0 -30cqw; } to { opacity: 1; translate: 0 0; } }
.carp-tapa { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; transform: rotateY(-172deg); }
.on .carp-tapa { animation: inv-tapa .85s .85s cubic-bezier(.5, 0, .25, 1) both; }
@keyframes inv-tapa { from { transform: rotateY(-172deg); } to { transform: rotateY(0); } }
.tapa-frente, .tapa-dentro { position: absolute; inset: 0; border-radius: .3cqw 1cqw 1cqw 1cqw; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tapa-frente { background: url("img/anim/grano.webp") 0 0 / 34cqw, linear-gradient(160deg, #e0c07c, #caa65f 70%, #bb9650); box-shadow: inset 0 0 3cqw rgba(120, 80, 20, .25), 0 1cqw 2cqw rgba(0, 0, 0, .35); }
.tapa-dentro { transform: rotateY(180deg); background: linear-gradient(200deg, #e7cf98, #d3b475); }
.tapa-etq { position: absolute; left: 5cqw; top: 6cqw; width: 30cqw; padding: 1.8cqw 2.2cqw; display: grid; grid-template-columns: auto 1fr; gap: 1cqw 1.6cqw; align-items: baseline;
  background: url("img/anim/grano.webp") 0 0 / 30cqw, #f3ead4; border: .2cqw solid #2a251d; box-shadow: 0 .2cqw .4cqw rgba(0, 0, 0, .2); }
.tapa-etq b { grid-column: 1 / -1; font: 400 2.4cqw/1 var(--f-maquina); letter-spacing: .2em; color: #2a251d; border-bottom: .2cqw solid #2a251d; padding-bottom: 1cqw; }
.tapa-etq span { font: 700 1.2cqw/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #5b544a; }
.tapa-etq em { position: relative; font: 700 2.8cqw/1 var(--f-mano); font-style: normal; color: #1f3a8a; }
.tacha { position: absolute; left: -.6cqw; top: 1cqw; width: 10cqw; height: 1.6cqw; overflow: visible; }
.tacha path { fill: none; stroke: #c4221f; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.on .tacha path { animation: inv-traza .35s 3s ease-out both; }
.cerrado { position: absolute; left: 10cqw; top: -1.4cqw; font-style: normal; color: #c4221f; transform: rotate(-6deg); opacity: 0; }
.on .cerrado { animation: inv-pop2 .35s 3.3s both; }
@keyframes inv-pop2 { from { opacity: 0; transform: rotate(-6deg) scale(.6); } to { opacity: 1; transform: rotate(-6deg); } }
.sello-final { position: absolute; left: 50%; top: 42cqw; width: 46cqw; margin-left: -21cqw; padding: 2.2cqw 0; border-width: .8cqw; border-style: double; border-radius: 1cqw; font: 400 6cqw/1.05 var(--f-maquina); letter-spacing: .12em; transform: rotate(-11deg); opacity: 0; }
.on .sello-final { animation: inv-sello .4s 2s cubic-bezier(.5, 0, .7, 1.4) both; }
@keyframes inv-sello { from { opacity: 0; transform: rotate(-4deg) scale(2.6); } 70% { opacity: 1; transform: rotate(-11deg) scale(.96); } to { opacity: .9; transform: rotate(-11deg) scale(1); } }
.postit-final { position: absolute; right: 4cqw; bottom: 5cqw; width: 29cqw; padding: 2.6cqw 2.2cqw 3cqw; font: 700 4.4cqw/1.05 var(--f-mano); color: #3b3110;
  background: linear-gradient(#f9e78a, #f2d968); transform: rotate(6deg); box-shadow: 0 1.8cqw 3cqw -.4cqw rgba(0, 0, 0, .6); opacity: 0; }
.on .postit-final { animation: inv-postit .55s 3.8s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes inv-postit { from { opacity: 0; transform: translate(8cqw, 6cqw) rotate(16deg); } to { opacity: 1; transform: rotate(6deg); } }

@media (max-width: 520px) {
  .inv-cab { gap: 8px 12px; margin-bottom: 14px; }
  .inv-sub { font-size: 14px; }
  .inv-barras { width: 150px; }
}

/* Sin movimiento: cada escena aparece ya terminada y solo cambian con un fundido lento */
@media (prefers-reduced-motion: reduce) {
  .inv *, .inv *::before, .inv *::after { animation-delay: -60s !important; animation-iteration-count: 1 !important; }
  .esc.on { animation: none; }
}

/* ---------- Pizarrón de corcho (.inv-c, desde el 2-nov-2026): la animación, clavada en un pizarrón de corcho con marco de madera.
   Corcho, notas, post-it, chinche y ficha son fotos (img/anim/*.webp, generadas en ChatGPT el 2-nov-2026).
   Arriba, 7 notas clavadas con chinches y unidas con hilo rojo marcan los pasos; abajo, una ficha clavada dice el paso actual.
   Solo cambia el CSS: heroe-anim.js sigue usando .inv-num, .inv-txt, .inv-sub e .inv-barras i. */
.inv-c { --chinche: url("img/anim/chinche.webp");
  display: grid; grid-template-columns: 30px 1fr 30px; grid-template-rows: auto auto auto; isolation: isolate; }
.inv-c .inv-cab { display: contents; }

/* Pizarrón: foto del corcho; el marco de madera sale de las orillas de la misma foto (border-image) */
.inv-c::before { content: ""; grid-column: 1 / -1; grid-row: 1 / -1; z-index: -1;
  border: 16px solid #4b2f17; border-image: url("img/anim/corcho.webp") 28 fill / 16px stretch;
  box-shadow: 0 34px 60px -14px rgba(0,0,0,.8); }

/* Notas de los pasos, clavadas y unidas con hilo rojo */
.inv-c .inv-barras { position: relative; grid-column: 2; grid-row: 1; width: auto; justify-self: stretch; display: flex; gap: 7px; padding: 30px 0 0; align-items: flex-start; }
.inv-c .inv-barras::before { content: ""; position: absolute; left: 6%; right: 6%; top: 33px; height: 2px; z-index: 1; background: #b3121b;
  box-shadow: 0 1px 1px rgba(0,0,0,.35); transform: rotate(-.4deg); }
.inv-c .inv-barras i { position: relative; flex: 1; height: 50px; border-radius: 0; overflow: visible;
  background: url("img/anim/nota.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 3px 3px rgba(40,20,0,.4));
  transform: rotate(var(--g, -2deg)); transition: transform .35s cubic-bezier(.2,.7,.3,1), background-color .35s; }
.inv-c .inv-barras i:nth-child(2n) { --g: 2.2deg; }
.inv-c .inv-barras i:nth-child(3n) { --g: -1deg; }
.inv-c .inv-barras i::after { content: ""; position: absolute; left: 50%; top: -9px; width: 17px; height: 20px; margin-left: -8px; z-index: 2;
  background: var(--chinche) center / contain no-repeat; }
.inv-c .inv-barras i::before { content: attr(data-n) "\A" attr(data-e); white-space: pre; position: absolute; inset: 0; display: grid; place-items: center;
  padding-top: 8px; text-align: center; font: 400 10.5px/1.15 var(--f-maquina); letter-spacing: .02em; text-transform: uppercase; color: #4a4337; }
.inv-c .inv-barras .hecho::before { color: #8e0f15; }
.inv-c .inv-barras .activo { z-index: 2; background-image: url("img/anim/postit.webp");
  transform: rotate(0deg) scale(1.14) translateY(3px); filter: drop-shadow(0 7px 8px rgba(40,20,0,.5)); }
.inv-c .inv-barras .activo::before { color: #2b2410; font-size: 11px; }
/* Avance del paso: subrayado rojo de plumón */
.inv-c .inv-barras b { position: absolute; left: 18%; bottom: 5px; height: 2px; border-radius: 2px; background: var(--rojo-vivo); }
.inv-c .inv-barras .activo b { animation-name: inv-c-avance; }
@keyframes inv-c-avance { from { width: 0; } to { width: 64%; } }
.inv-c .inv-barras .hecho b { width: 0; }

/* La escena animada, como una foto clavada en el corcho */
.inv-c .inv-mesa { grid-column: 2; grid-row: 2; margin-top: 26px; border-radius: 1px; transform: rotate(-.6deg);
  box-shadow: 0 0 0 7px #f6efdd, 0 0 0 8px rgba(60,40,10,.25), 0 16px 26px rgba(30,15,0,.6); }
.inv-c::after { content: ""; grid-column: 2; grid-row: 2; align-self: start; height: 24px; margin: 12px -8px 0; z-index: 3; pointer-events: none;
  background: var(--chinche) left 0 top 0 / 20px 24px no-repeat, var(--chinche) right 0 top 0 / 20px 24px no-repeat; }

/* Ficha clavada con el paso actual, encimada en la orilla de la foto */
.inv-c .inv-tit { grid-column: 2; grid-row: 3; position: relative; z-index: 2; margin: -34px 22px 30px 34px; padding: 20px 20px 16px calc(8% + 12px); border: 0;
  background: url("img/anim/ficha.webp") center / 100% 100% no-repeat; color: var(--tinta); transform: rotate(1deg); filter: drop-shadow(0 10px 12px rgba(20,10,0,.5)); }
.inv-c .inv-tit::before { content: ""; position: absolute; left: 50%; top: -12px; width: 20px; height: 24px; margin-left: -10px;
  background: var(--chinche) center / contain no-repeat; }
.inv-c .inv-txt { font: 400 clamp(23px, 2.3vw, 29px)/1.1 var(--f-maquina); color: #1b1914; letter-spacing: .01em; }
.inv-c .inv-sub { margin-top: 7px; min-height: 2.8em; font: 400 15.5px/1.5 var(--f-mono); color: #4a4337; }
.inv-c .inv-paso { grid-column: 2; grid-row: 3; z-index: 3; justify-self: end; align-self: start; margin: -52px 8px 0 0; padding: 6px 11px 5px;
  border: 3px double var(--rojo); border-radius: 3px; color: var(--rojo); font: 400 14px/1 var(--f-maquina); letter-spacing: .16em;
  background: rgba(251,246,232,.92); transform: rotate(7deg); }
.inv-c .inv-paso .inv-num { color: var(--rojo); font-weight: 400; }

@media (max-width: 520px) {
  .inv-c { grid-template-columns: 20px 1fr 20px; }
  .inv-c::before { border-width: 12px; border-image-width: 12px; }
  .inv-c .inv-barras { gap: 5px; padding-top: 24px; }
  .inv-c .inv-barras::before { top: 27px; }
  .inv-c .inv-barras i { height: 38px; }
  .inv-c .inv-barras i::after { width: 14px; height: 17px; margin-left: -7px; top: -8px; }
  .inv-c .inv-barras i::before, .inv-c .inv-barras .activo::before { content: attr(data-n); font-size: 12px; padding-top: 6px; }
  .inv-c .inv-barras b { bottom: 4px; }
  .inv-c .inv-mesa { margin-top: 22px; }
  .inv-c .inv-tit { margin: -26px 8px 22px 14px; padding: 16px 14px 13px calc(8% + 10px); }
  .inv-c .inv-txt { font-size: 22px; }
  .inv-c .inv-sub { font-size: 14px; }
  .inv-c .inv-paso { margin-top: -42px; font-size: 12px; }
}
