/* Text intro animation. */
.stage {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: clamp(2rem, 15.142vh + -2.9211rem, 5rem);
    margin-bottom: clamp(5rem, calc(1.695rem + 13.559vh), 20rem);

    color: white;
    font-size: clamp(6rem, 4.5rem + 3.125vw, 12rem);
    font-family: "Mario";
    font-weight: bold;
    paint-order: stroke fill;
    -webkit-text-stroke: clamp(0.6rem, 0.45rem + 0.3125vw, 1.2rem) black;

    text-shadow: 0.4rem 0.4rem 0.75rem rgba(0, 0, 0, 0.5);

    /* Safari fix for shadows */
    @supports (background: -webkit-named-image(i)) {
        text-shadow: 0.1rem 0.1rem 0.25rem rgba(0, 0, 0, 0.5);
    }

    @media screen and (max-width: 768px) {
        -webkit-text-stroke: 0.3rem black;
        font-size: 3rem;
    }
}

@keyframes slideIn {
    from { transform: translateX(-120vw); opacity: 0; }
    to   { transform: translateX(0);      opacity: 1; }
}

.word {
    display: flex;
    animation: slideIn 0.5s cubic-bezier(0.25, 1, 0.25, 1) 0s both;
    z-index: 2;
}

@keyframes wave {
    0%  { transform: translateY(0rem); }
    50%  { transform: translateY(0.7rem); }
}

.letter {
    animation: wave 2.5s ease-in-out;
}

.word.arrived .letter {
    animation-play-state: running;
    animation-iteration-count: infinite;
}

/* Trigger wave after slide completes,
    done per character with 0.15s delay */
.letter:nth-child(1) { animation-delay: 0.65s; }
.letter:nth-child(2) { animation-delay: 0.80s; }
.letter:nth-child(3) { animation-delay: 0.95s; }
.letter:nth-child(4) { animation-delay: 1.10s; }
.letter:nth-child(5) { animation-delay: 1.25s; }
.letter:nth-child(6) { animation-delay: 1.40s; }
.letter:nth-child(7) { animation-delay: 1.55s; }
.letter:nth-child(8) { animation-delay: 1.70s; }
.letter:nth-child(9) { animation-delay: 1.95s; }

/* Navigation buttons */
@keyframes navScale {
    0%   { transform: scale(0%);   }
    100% { transform: scale(100%); }
}

nav ul {
    display: flex;
    gap: clamp(2rem, calc(0rem + 4.167vw), 10rem);

    @media screen and (max-width: 980px) {
        flex-direction: column;
    }

    transform: scale(0%);
    animation: navScale 0.25s cubic-bezier(0, 0.75, 0, 1) 0.75s forwards;
    
    li {
        font-family: "Mario";
        font-size: 4rem;

        @media screen and (max-width: 768px) {
            font-size: 3rem;
        }
        text-align: center;
        paint-order: stroke fill;
        -webkit-text-stroke: 0.4rem black;
        text-shadow: 0.25rem 0.25rem 0.5rem rgba(0, 0, 0, 0.5);

        /* Safari fix for shadows */
        @supports (background: -webkit-named-image(i)) {
            text-shadow: 0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
        }

        a { color: white; }
        a:hover { color: #A2A2C0; }
    }

    li:nth-child(1) { rotate: 3deg; }
    li:nth-child(2) { rotate: -3deg; }
    li:nth-child(3) { rotate: 4deg; }

    margin-bottom: 3rem;
}

/* Social Media buttons */
@keyframes scaling {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

aside ul {
    margin: 3rem 1rem 2rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    @media screen and (max-width: 768px) {
        gap: 0.5rem;
    }

    opacity: 0;
    animation: scaling 0.2s 1.25s forwards;

    align-self: center;
    justify-content: center;

    li a {
        img {
            max-height: 4rem;

            @media screen and (max-width: 768px) {
                max-height: 3rem;
            }

            filter: drop-shadow(-1px -1px 0 #000)
                    drop-shadow(0   -1px 0 #000)
                    drop-shadow(1px -1px 0 #000)
                    drop-shadow(1px  0   0 #000)
                    drop-shadow(1px  1px 0 #000)
                    drop-shadow(0    1px 0 #000)
                    drop-shadow(-1px  1px 0 #000)
                    drop-shadow(-1px  0   0 #000)
                    drop-shadow(0.2rem 0.2rem 0.25rem rgba(0, 0, 0, 0.5));
        }
        
        img:hover {
            filter: sepia(100%) saturate(300%) brightness(65%) hue-rotate(180deg)
                    drop-shadow(-1px -1px 0 #000)
                    drop-shadow(0   -1px 0 #000)
                    drop-shadow(1px -1px 0 #000)
                    drop-shadow(1px  0   0 #000)
                    drop-shadow(1px  1px 0 #000)
                    drop-shadow(0    1px 0 #000)
                    drop-shadow(-1px  1px 0 #000)
                    drop-shadow(-1px  0   0 #000)
                    drop-shadow(0.2rem 0.2rem 0.25rem rgba(0, 0, 0, 0.5));
        }
    }
}

/* Text on page */
main {
    opacity: 0;
    animation: scaling 0.2s 1.25s forwards;
    background-color: transparent;

    font-size: 2rem;
    text-align: center;
    margin: 0 1rem 0 1rem;
    color: white;

    justify-content: center;
    align-items: center;
}

/* Prevent scrolling */
html, body {
    overflow: hidden;
}
