/* LabExhibits: entrance effects. Every rule is scoped to .lab-ex-play, which
 * exhibits.js adds on entry and always removes again. Uses only the site's
 * existing tokens. Individual `translate` (not `transform`) so hover transforms
 * on cards are never fought. */

.lab-ex-counting {
    font-variant-numeric: tabular-nums;
}

@keyframes lab-ex-rise {
    from { opacity: 0; translate: 0 8px; }
    to   { opacity: 1; translate: 0 0; }
}

@keyframes lab-ex-pop {
    0%   { opacity: 0; scale: 0.82; }
    70%  { opacity: 1; scale: 1.05; }
    100% { opacity: 1; scale: 1; }
}

@keyframes lab-ex-beat {
    from { opacity: 0; translate: -6px 0; }
    to   { opacity: 1; translate: 0 0; }
}

/* ECG blip: the title underline draws left to right, then a small QRS complex
   sweeps over it and fades. The underline itself is unchanged at rest. */
@keyframes lab-ex-draw {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes lab-ex-trace {
    0%   { clip-path: inset(0 100% 0 0); opacity: 1; }
    70%  { clip-path: inset(0 0 0 0); opacity: 1; }
    100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

.lab-ex-play :is(.timeline-item, .publication-item, .grant-item, .talk-item,
                 .project-item, .phd-item, .faq-item) {
    animation: lab-ex-rise 0.34s ease-out both;
    animation-delay: var(--lab-ex-d, 0ms);
}

.lab-ex-play :is(.skill-tag, .credential) {
    animation: lab-ex-pop 0.28s ease-out both;
    animation-delay: var(--lab-ex-d, 0ms);
}

/* Problem / Measured / Outcome appear in order inside each project */
.lab-ex-play .project-beats > :is(dt, dd) {
    animation: lab-ex-beat 0.3s ease-out both;
    animation-delay: calc(var(--lab-ex-d, 0ms) + 120ms + var(--lab-ex-b, 0) * 110ms);
}


.lab-ex-play .section-title::after {
    animation: lab-ex-draw 0.5s ease-out both;
}

.lab-ex-play .section-title::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 60px;
    height: 22px;
    margin-left: -30px;
    transform: translateY(8px);
    pointer-events: none;
    background: no-repeat center / 100% 100%
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 22' fill='none' stroke='%230071e3' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M0 11H18L21 6L25 11H27L29 20L33 1L36 11H39L42 8L45 11H60'/%3E%3C/svg%3E");
    animation: lab-ex-trace 0.9s ease-out 0.05s both;
}

@media (prefers-reduced-motion: reduce) {
    .lab-ex-play *,
    .lab-ex-play *::before,
    .lab-ex-play *::after {
        animation: none !important;
    }
}
