@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    background-color: #222831;
}

.container {
    height: 70vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    position: relative;
}

.cradle {
    height: 9rem;
    width: 19rem;
    border-top: 1.4rem solid #f7f7f7;
    position: relative;
    margin: auto;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.ball {
    height: 9rem;
    width: 0.3rem;
    background-color: #f7f7f7;
    position: relative;
    transform-origin: top;
}

.ball::after {
    position: absolute;
    content: "";
    height: 3.75rem;
    width: 3.75rem;
    background-color: #f0a500;
    border-radius: 50%;
    left: -1.87rem;
    bottom: -3.75rem;
    transform-origin: top;
}

.ball:first-child {
    animation: swing1 1.3s infinite linear;
}

@keyframes swing1 {
    25% {
        transform: rotate(50deg);
    }

    50% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.ball:last-child {
    animation: swing2 1.3s 0.7s infinite linear;
}

@keyframes swing2 {
    25% {
        transform: rotate(-50deg);
    }

    50% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.text {
    position: relative;
}

#txt {
    position: relative;
    font-size: 3vw;
    color: #252839;
    -webkit-text-stroke: 0.03vw #383d52;
    text-transform: uppercase;
}

#txt::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    color: #01fe87;
    -webkit-text-stroke: 0vw #383d52;
    border-right: 0.06rem solid #01fe87;
    overflow: hidden;
    animation: animate 3s linear infinite;
}

@keyframes animate {

    0%,
    10%,
    100% {
        width: 0;
    }

    70%,
    90% {
        width: 100%;
    }
}