/* ANIMATIONS */
@keyframes tt-animation-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes tt-animation-shake {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-3px); }
    50%  { transform: translateX(3px); }
    75%  { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* Drops into place */
@keyframes tt-animation-slide-in {
    from { opacity: 0; transform: translateY(-0.25em); }
}

/* Fades and folds its height away; the element needs a max-height and overflow: hidden to fold from */
@keyframes tt-animation-fold-out {
    to { opacity: 0; max-height: 0; margin-top: 0; margin-bottom: 0; }
}

/* COPY */
.tt-copy-pop {
    animation: tt-animation-pop 250ms ease-out;
}

/* Confetti burst behind the success tooltip */
@keyframes tt-animation-burst {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

/* ENTRY MESSAGE - goes with the toast that came with it; a failure stays a little longer, to be read */
.tt-entry-message {
    --tt-entry-message-stay: var(--tt-toast-duration);
    max-height: 4lh;
    overflow: hidden;
    animation:
        tt-animation-slide-in 0.25s ease-out,
        tt-animation-fold-out 0.4s ease-in var(--tt-entry-message-stay) forwards;
}
.tt-entry-message--error {
    --tt-entry-message-stay: calc(var(--tt-toast-duration) * 1.5);
}
@media (prefers-reduced-motion: reduce) {
    .tt-entry-message {
        animation: tt-animation-fold-out 0.01s linear var(--tt-entry-message-stay) forwards;
    }
}
