* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    background: #74ebd5;
    background: -webkit-linear-gradient(to right,
            #acb6e5,
            #74ebd5);
    background: linear-gradient(to right,
            #acb6e5,
            #74ebd5);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
}

section {
    width: 40vw;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    grid-gap: 2rem;
    perspective: 800px;
    padding: 1rem;
}

.card {
    position: relative;
    transform-style: preserve-3d;
    transition: all 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: rgba(0, 0, 0, 0.7) 0px 5px 15px;
    border-radius: 0.5rem;
    cursor: pointer;
}

.face,
.back {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 0.5rem;
}

.face {
    transform: rotateY(-180deg);
}

.back {
    background: white;
    /* Safari */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.toggleCard {
    transform: rotateY(180deg);
}

h1, h2 {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: #4b1f05b1;
}

span {
    color: #b44a20;
}

@media screen and (max-width: 1200px) {
    section {
        width: 60%;
        grid-gap: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    section {
        width: 80%;
        grid-gap: 0.8rem;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }
}

@media screen and (max-width: 400px) {
    section {
        width: 90%;
        grid-gap: 0.6rem;
    }

    h1 {
        font-size: 1.3em;
    }

    h2 {
        font-size: 1em;
    }
}

@media screen and (max-width: 280px) {
    section {
        width: 95%;
        grid-gap: 0.3rem;
    }

    h1 {
        font-size: 1em;
    }

    h2 {
        font-size: 0.8em;
    }
}