@font-face {
    font-family: "Fredoka";
    src: url("assets/fredoka.ttf");
}

* {
    --dark: #151a40;
    --light: #fff;
    --primary: #43bfe5;
    --red: #f40058;
    --yellow: #eea500;
    --green: #41b854;

    margin: 0;
    padding: 0;

    color: var(--light);
    font-family: "Fredoka";
}

body {
    background-color: var(--dark);
    overflow: hidden;   
}

.wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.container h1 {
    align-self: center;
    border: 5px solid var(--light);
    padding: 25px;
    font-size: 3em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 10px;
}

.container h2 {
    align-self: center;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 1.6em;
    max-width: 40vw;
}

.container span {
    color: var(--primary);
}

@keyframes fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0;
    }
    1% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.5;
    }
}

@keyframes fall-reversed {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0;
    }
    1% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) rotate(-360deg);
        opacity: 0.5;
    }
}

.triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    animation: fall 10s linear infinite;
    transform-origin: center;
    z-index: -1;
    opacity: 0;
}

/* Triangles rotating clockwise (fall) */
.triangle:nth-child(1) {
    border-width: 50px 25px 20px 15px;
    border-color: var(--red) transparent transparent transparent;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.triangle:nth-child(2) {
    border-width: 30px 10px 40px 20px;
    border-color: var(--green) transparent transparent transparent;
    left: 25%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.triangle:nth-child(3) {
    border-width: 40px 15px 10px 25px;
    border-color: var(--yellow) transparent transparent transparent;
    left: 40%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.triangle:nth-child(4) {
    border-width: 60px 15px 45px 30px;
    border-color: var(--green) transparent transparent transparent;
    left: 55%;
    animation-delay: 3s;
    animation-duration: 11s;
}

.triangle:nth-child(5) {
    border-width: 60px 40px 10px 20px;
    border-color: var(--red) transparent transparent transparent;
    left: 70%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.triangle:nth-child(6) {
    border-width: 35px 15px 25px 18px;
    border-color: var(--yellow) transparent transparent transparent;
    left: 85%;
    animation-delay: 5s;
    animation-duration: 8s;
}

.triangle:nth-child(7) {
    border-width: 25px 20px 20px 5px;
    border-color: var(--red) transparent transparent transparent;
    left: 15%;
    animation-delay: 6s;
    animation-duration: 9s;
}

/* Triangles rotating counterclockwise (fall-reversed) */
.triangle:nth-child(8) {
    border-width: 45px 10px 30px 15px;
    border-color: var(--green) transparent transparent transparent;
    left: 30%;
    animation: fall-reversed 10s linear infinite;
    animation-delay: 7s;
    animation-duration: 10s;
}

.triangle:nth-child(9) {
    border-width: 55px 25px 15px 35px;
    border-color: var(--yellow) transparent transparent transparent;
    left: 45%;
    animation: fall-reversed 10s linear infinite;
    animation-delay: 8s;
    animation-duration: 11s;
}

.triangle:nth-child(10) {
    border-width: 60px 15px 75px 30px;
    border-color: var(--primary) transparent transparent transparent;
    left: 60%;
    animation: fall-reversed 10s linear infinite;
    animation-delay: 9s;
    animation-duration: 12s;
}

.triangle:nth-child(11) {
    border-width: 30px 25px 10px 5px;
    border-color: var(--primary) transparent transparent transparent;
    left: 75%;
    animation: fall-reversed 10s linear infinite;
    animation-delay: 10s;
    animation-duration: 8s;
}

.triangle:nth-child(12) {
    border-width: 40px 10px 15px 20px;
    border-color: var(--primary) transparent transparent transparent;
    left: 90%;
    animation: fall-reversed 10s linear infinite;
    animation-delay: 11s;
    animation-duration: 9s;
}

@media screen and (max-width: 1000px) {
    .wrapper {
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .container {
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 80px;
    }
    
    .container h1 {
        align-self: center;
        border: 10px solid var(--light);
        padding: 50px;
        font-size: 5em;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 20px;
    }
    
    .container h2 {
        align-self: center;
        font-weight: 400;
        text-transform: uppercase;
        font-size: 3em;
        max-width: 80vw;
    }
    
    .container span {
        color: var(--primary);
    }

    @keyframes fall {
        0% {
            transform: translateY(-100vh) rotate(0deg);
            opacity: 0;
        }
        1% {
            opacity: 0.5;
        }
        100% {
            transform: translateY(100vh) rotate(360deg);
            opacity: 0.5;
        }
    }

    @keyframes fall-reversed {
        0% {
            transform: translateY(-100vh) rotate(0deg);
            opacity: 0;
        }
        1% {
            opacity: 0.5;
        }
        100% {
            transform: translateY(100vh) rotate(-360deg);
            opacity: 0.5;
        }
    }

    .triangle {
        position: absolute;
        width: 0;
        height: 0;
        border-style: solid;
        animation: fall 10s linear infinite;
        transform-origin: center;
        z-index: -1;
        opacity: 0;
    }

    /* Triangles rotating clockwise (fall) */
    .triangle:nth-child(1) {
        border-width: 100px 50px 40px 30px;
        border-color: var(--red) transparent transparent transparent;
        left: 10%;
        animation-delay: 0s;
        animation-duration: 8s;
    }

    .triangle:nth-child(2) {
        border-width: 60px 20px 80px 40px;
        border-color: var(--green) transparent transparent transparent;
        left: 25%;
        animation-delay: 1s;
        animation-duration: 9s;
    }

    .triangle:nth-child(3) {
        border-width: 80px 30px 20px 50px;
        border-color: var(--yellow) transparent transparent transparent;
        left: 40%;
        animation-delay: 2s;
        animation-duration: 10s;
    }

    .triangle:nth-child(4) {
        border-width: 120px 30px 90px 60px;
        border-color: var(--green) transparent transparent transparent;
        left: 55%;
        animation-delay: 3s;
        animation-duration: 11s;
    }

    .triangle:nth-child(5) {
        border-width: 120px 80px 20px 40px;
        border-color: var(--red) transparent transparent transparent;
        left: 70%;
        animation-delay: 4s;
        animation-duration: 12s;
    }

    .triangle:nth-child(6) {
        border-width: 70px 30px 50px 36px;
        border-color: var(--yellow) transparent transparent transparent;
        left: 85%;
        animation-delay: 5s;
        animation-duration: 8s;
    }

    .triangle:nth-child(7) {
        border-width: 50px 40px 40px 10px;
        border-color: var(--red) transparent transparent transparent;
        left: 15%;
        animation-delay: 6s;
        animation-duration: 9s;
    }

    /* Triangles rotating counterclockwise (fall-reversed) */
    .triangle:nth-child(8) {
        border-width: 90px 20px 60px 30px;
        border-color: var(--green) transparent transparent transparent;
        left: 30%;
        animation: fall-reversed 10s linear infinite;
        animation-delay: 7s;
        animation-duration: 10s;
    }

    .triangle:nth-child(9) {
        border-width: 110px 50px 30px 70px;
        border-color: var(--yellow) transparent transparent transparent;
        left: 45%;
        animation: fall-reversed 10s linear infinite;
        animation-delay: 8s;
        animation-duration: 11s;
    }

    .triangle:nth-child(10) {
        border-width: 120px 30px 150px 60px;
        border-color: var(--primary) transparent transparent transparent;
        left: 60%;
        animation: fall-reversed 10s linear infinite;
        animation-delay: 9s;
        animation-duration: 12s;
    }

    .triangle:nth-child(11) {
        border-width: 60px 50px 20px 10px;
        border-color: var(--primary) transparent transparent transparent;
        left: 75%;
        animation: fall-reversed 10s linear infinite;
        animation-delay: 10s;
        animation-duration: 8s;
    }

    .triangle:nth-child(12) {
        border-width: 80px 20px 30px 40px;
        border-color: var(--primary) transparent transparent transparent;
        left: 90%;
        animation: fall-reversed 10s linear infinite;
        animation-delay: 11s;
        animation-duration: 9s;
    }
}