/* Instrumentos animados de los laboratorios (ilustración). Solo se mueven al pasar el cursor sobre la tarjeta, en el encabezado del laboratorio siempre. */
.inst { display: block; width: 100%; height: auto; }

/* Icono de la tarjeta: al pasar el cursor se agranda y se convierte en el instrumento (animado solo mientras está encima) */
.lab-badge { width: 40px; height: 40px; overflow: hidden; transition: width 220ms ease-out, height 220ms ease-out, background-color 220ms ease-out; --run: paused; }
.lab-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity 120ms ease-out; }
.lab-inst { position: absolute; inset: 4px; display: flex; align-items: center; opacity: 0; transition: opacity 200ms ease-out 90ms; }
.group:hover .lab-badge, .group:focus-visible .lab-badge { width: 150px; height: 114px; background-color: #0f172a; --run: running; }
.group:hover .lab-ico, .group:focus-visible .lab-ico { opacity: 0; }
.group:hover .lab-inst, .group:focus-visible .lab-inst { opacity: 1; }
.lab-badge [class^="i-"], .lab-badge [class*=" i-"] { animation-play-state: var(--run) !important; }

/* Encabezado de la página del laboratorio (solo en pantallas anchas) */
.inst-hero { display: none; }
@media (min-width: 1200px) {
  .inst-hero { display: block; position: absolute; right: max(24px, calc((100% - 1280px) / 2 + 24px)); top: 50%; transform: translateY(-50%); width: 320px; padding: 14px 14px 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(3px); }
}
.inst-rotulo { margin-top: 4px; text-align: center; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* Animaciones (cada una vive en el elemento con su clase i-*) */
.i-aguja { transform-origin: 80px 60px; animation: i-barrido 5s ease-in-out infinite alternate; }
@keyframes i-barrido { 0% { transform: rotate(-100deg); } 55% { transform: rotate(52deg); } 70% { transform: rotate(34deg); } 100% { transform: rotate(40deg); } }

.i-merc { transform-box: fill-box; transform-origin: left; animation: i-sube 6s ease-in-out infinite alternate; }
@keyframes i-sube { 0% { transform: scaleX(.2); } 60% { transform: scaleX(.95); } 100% { transform: scaleX(.75); } }

.i-flota { animation: i-flota 4s ease-in-out infinite alternate; }
@keyframes i-flota { 0% { transform: translateY(5px); } 100% { transform: translateY(-4px); } }

.i-nivel { transform-box: fill-box; transform-origin: bottom; animation: i-onda 5s ease-in-out infinite alternate; }
@keyframes i-onda { 0% { transform: scaleY(.88); } 100% { transform: scaleY(1.04); } }
.i-electrodo { animation: i-mece 5s ease-in-out infinite alternate; }
@keyframes i-mece { 0% { transform: translateX(-2px); } 100% { transform: translateX(2px); } }

.i-embolo { animation: i-pulsa 3s ease-in-out infinite; }
@keyframes i-pulsa { 0%, 55%, 100% { transform: translateY(0); } 25% { transform: translateY(3px); } }
.i-gota { animation: i-cae 3s ease-in infinite; }
@keyframes i-cae { 0%, 55% { transform: translateY(-4px); opacity: 0; } 62% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
/* Volumen del visor: 4 valores, uno cada 3 s (ciclo de 12 s; cada texto con su retraso negativo) */
.i-vol { opacity: 0; animation: i-v4 12s linear infinite; }
@keyframes i-v4 { 0%, 24% { opacity: 1; } 25%, 100% { opacity: 0; } }

/* Balanza: 4 pesas, una cada 8 s (ciclo de 32 s). La pesa se apoya, se levanta (lectura en cero) y se retira. */
.i-pesa { opacity: 0; animation: i-pesa 32s ease-in-out infinite; }
@keyframes i-pesa {
  0% { transform: translateY(-22px); opacity: 0; }
  3%, 12% { transform: translateY(0); opacity: 1; }
  15%, 22% { transform: translateY(-22px); opacity: 1; }
  25%, 100% { transform: translateY(-22px); opacity: 0; }
}
.i-lect { opacity: 0; animation: i-lect 32s linear infinite; }
@keyframes i-lect { 0%, 3% { opacity: 0; } 4%, 13% { opacity: 1; } 14%, 100% { opacity: 0; } }
.i-cero { animation: i-cero 8s linear infinite; }
@keyframes i-cero { 0%, 13% { opacity: 1; } 14%, 56% { opacity: 0; } 57%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .inst [class^="i-"], .inst [class*=" i-"] { animation: none !important; }
  .i-aguja { transform: rotate(40deg); }
  .i-merc { transform: scaleX(.75); }
  .i-primero { opacity: 1 !important; transform: none; }
  .i-cero { opacity: 0; }
}
