@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

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

body {
    overflow-x: hidden;
    background-image: -webkit-gradient(linear,
        right bottom, left top,
        from(#ffadad),
        color-stop(#ffd6a5), 
        color-stop(#fdffb6),
        color-stop(#caffbf),
        color-stop(#9bf6ff),
        color-stop(#a0c4ff),
        to(#bdb2ff));
    background-image: linear-gradient(to top left,
        #ffadad,
        #ffd6a5, 
        #fdffb6,
        #caffbf,
        #9bf6ff,
        #a0c4ff,
        #bdb2ff);
    color: #5d5865;
}

#list-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 0.5rem; gap: 0.5rem;
    padding: 1rem;
}

.item {
    position: relative;
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
            flex-direction: column;
    -webkit-box-pack: center;
            justify-content: center;
    -webkit-box-align: center;
            align-items: center;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.3), transparent, rgba(255,255,255,0.3));
    border-radius: 2rem;
    padding: 3rem 0;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.item::before,
.item::after {
    content: "";
    position: absolute;
    z-index: 1;
    width: 3rem;
    height: 3rem;
}

.item::before {
    bottom: 1rem; left: 1rem;
    border-radius: 0 0 0 1rem;
    background-image: linear-gradient(225deg, transparent 50%, rgba(255, 255, 255, 0.5));
}

.item::after {
    top: 1rem; right: 1rem;
    border-radius: 0 1rem 0 0;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5));
}

.item:hover,
.item:focus,
.item:active {
    background-color: white;
    outline: none;
}

dt {
    text-align: right;
    font-family: 'Great Vibes', serif;
    font-size: 3rem;
}

dt.smaller {
    font-size: 1.8rem;
}

dt.medium {
    font-size: 2.1rem;
}

dt.smaller,
dt.medium {
    font-style: italic;   
}

.italic {
    font-style: italic;
}

dd {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
}

dd, dt {
    pointer-events: none;
}

#modal {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
            flex-direction: column;
    -webkit-box-pack: center;
            justify-content: center;
    -webkit-box-align: center;
            align-items: center;
    left: 2rem; top: 2rem; right: 2rem; bottom: 2rem;
    border-radius: 1rem;
    box-shadow: 0.5rem 0.5rem 5rem rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.25);
    background-color: white;
}

#modal.active {
    min-height: 15rem;
    display: -webkit-box;
    display: flex;
    position: fixed;
    z-index: 2;
    -webkit-animation: openModal 0.2s;
            animation: openModal 0.2s;
}

#modal .lang-name {
    position: relative;
    z-index: 4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    text-transform: capitalize;
}

#modal h1 {
    position: relative;
    z-index: 1;
    font-family: 'Great Vibes', serif;
    font-size: 10rem;
    line-height: 1.3;
}

#modal h1.smaller {
    font-size: 5rem;
}

#modal h1.medium {
    font-size: 7.5rem;
}

#modal h1::after,
#modal h1::before { /* modal heart shapes */
    content: "";
    position: absolute;
    bottom: 50%; left: 50%;
    -webkit-transform: translateX(-50%) translateY(52%);
            transform: translateX(-50%) translateY(52%);
    -webkit-clip-path: polygon(50% 10%, 66% 0, 100% 0, 100% 50%, 50% 100%, 0 50%, 0 0, 33% 0);
            clip-path: polygon(50% 10%, 66% 0, 100% 0, 100% 50%, 50% 100%, 0 50%, 0 0, 33% 0);
}

#modal h1::before {
    z-index: -2;
    background-color: lightcoral;
    opacity: 0.5;
    width: 10rem;
    height: 10rem;
    border-radius: 3rem 3rem 6rem 6rem;
}

#modal h1::after {
    z-index: -1;
    background-color: lightcoral;
    opacity: 0.3;
    width: 12rem;
    height: 12rem;
    border-radius: 3rem 3rem 6rem 6rem;
}

#modal-close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 2rem; height: 2rem;
    text-align: center;
    display: -webkit-box;
    display: flex;
    -webkit-box-pack: center;
            justify-content: center;
    -webkit-box-align: center;
            align-items: center;
    background-color: transparent;
    border: 1px solid rgba(93, 88, 101, 0.5);
    border-radius: 0.5rem;
    -webkit-transition: 0.2s ease;
    transition: 0.2s ease;
}

#modal-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(93, 88, 101, 0.8);
}

button {
    cursor: pointer;
}

/* tablet styles */
@media screen and (max-width: 959px) {
    #list-group {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #modal {
        left: 1rem; top: 1rem; right: 1rem; bottom: 1rem;
    }
}

@media screen and (max-width: 759px) {
    #list-group {
        grid-template-columns: repeat(3, 1fr);
    }

    #modal h1 {
        font-size: 7rem;
        line-height: 1.3;
    }
    
    #modal h1.smaller {
        font-size: 3rem;
    }
    
    #modal h1.medium {
        font-size: 4.4rem;
    }

    #modal {
        left: 0.75rem; top: 0.75rem; right: 0.75rem; bottom: 0.75rem;
    }
}

@media screen and (max-width: 639px) {
    #list-group {
        grid-template-columns: repeat(2, 1fr);
    }

    #modal h1 {
        font-size: 5rem;
        line-height: 1.3;
    }
    
    #modal h1.smaller {
        font-size: 2rem;
    }
    
    #modal h1.medium {
        font-size: 3.3rem;
    }

    #modal {
        left: 0.5rem; top: 0.5rem; right: 0.5rem; bottom: 0.5rem;
    }
}

@-webkit-keyframes openModal { /* subtle fade in for modal */
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
                transform: scale(0.8);
    } to {
        opacity: 1;
        -webkit-transform: scale(1);
                transform: scale(1);
    }
}

@keyframes openModal { /* subtle fade in for modal */
    from {
        opacity: 0;
        -webkit-transform: scale(0.8);
                transform: scale(0.8);
    } to {
        opacity: 1;
        -webkit-transform: scale(1);
                transform: scale(1);
    }
}