/* ==========================================
   TYPEWRITER PAGE LOADER
   ========================================== */

#typewriter-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}


/* Loader in fase di scomparsa */

#typewriter-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


/* Contenitore dei tasti */

.typewriter-keys {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


/* Singolo tasto */

.typewriter-keys span {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    background: #f7f7f7;
    color: #222222;

    border: 3px solid #555555;
    border-radius: 50%;

    font-family: "Courier New", Courier, monospace;
    font-size: 18px;
    font-weight: bold;

    box-shadow:
        0 0 0 2px #b8b8b8,
        0 4px 5px rgba(0, 0, 0, 0.25);

    animation: typewriter-key 1.2s infinite;
}


/* Ritardo progressivo */

.typewriter-keys span:nth-child(1) {
    animation-delay: 0s;
}

.typewriter-keys span:nth-child(2) {
    animation-delay: 0.2s;
}

.typewriter-keys span:nth-child(3) {
    animation-delay: 0.4s;
}

.typewriter-keys span:nth-child(4) {
    animation-delay: 0.6s;
}

.typewriter-keys span:nth-child(5) {
    animation-delay: 0.8s;
}

.typewriter-keys span:nth-child(6) {
    animation-delay: 1s;
}

.skip-typewriter-loader #typewriter-loader {
    display: none !important;
}

/* Animazione pressione tasto */

@keyframes typewriter-key {

    0%,
    70%,
    100% {
        background: #f7f7f7;
        color: #222222;
        transform: translateY(0);
        box-shadow:
            0 0 0 2px #b8b8b8,
            0 4px 5px rgba(0, 0, 0, 0.25);
    }

    15% {
        background: #333333;
        color: #ffffff;
        transform: translateY(4px);
        box-shadow:
            0 0 0 2px #999999,
            0 1px 2px rgba(0, 0, 0, 0.20);
    }
}


/* Adattamento per smartphone */

@media (max-width: 500px) {

    .typewriter-keys {
        gap: 7px;
    }

    .typewriter-keys span {
        width: 34px;
        height: 34px;
        font-size: 15px;
        border-width: 2px;
    }
}