/* Ads N Sales 4 Me - Typewriter & Stat Effects */

.ans-typewriter {
    display: inline;
    border-right: 3px solid #ffd451;
    padding-right: 5px;
    animation: ansCursorBlink .7s step-end infinite;
}

.ans-typewriter.finished {
    border-right-color: transparent;
    animation: none;
}

@keyframes ansCursorBlink {
    0%, 49% {
        border-right-color: #ffd451;
    }
    50%, 100% {
        border-right-color: transparent;
    }
}

/* Highlight each statistic individually */

.stats .stat {
    position: relative;
    transition:
        background-color .3s ease,
        border-color .3s ease,
        box-shadow .3s ease,
        transform .3s ease;
}

.stats .stat.ans-stat-active {
    background-color: #e4fff0;
    border-color: #1dc66c;
    box-shadow:
        0 0 0 3px rgba(21,201,103,.20),
        0 8px 25px rgba(0,155,80,.18);
    animation: ansStatFlash .7s ease;
}

.stats .stat.ans-stat-active strong {
    color: #078c49;
}

@keyframes ansStatFlash {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.065);
    }
    100% {
        transform: scale(1);
    }
}

/* Smaller movements on phones */

@media (max-width: 720px) {
    .stats .stat.ans-stat-active {
        box-shadow:
            0 0 0 2px rgba(21,201,103,.20);
    }

    @keyframes ansStatFlash {
        0%,100% {
            transform: scale(1);
        }
        40% {
            transform: scale(1.025);
        }
    }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    .ans-typewriter,
    .stats .stat.ans-stat-active {
        animation: none !important;
        transition: none !important;
    }

    .stats .stat.ans-stat-active {
        transform: none !important;
    }
}
