@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Oswald', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #434750;
}

ul {
    transform: skewY(-15deg); /* text direction iт oblique (skew) direction */
}

ul li {
    list-style: none;
    position: relative;
    width: 200px;
    background: #3e3f46;
    padding: 15px;
    z-index: var(--i); /* show hovered item at top */
    transition: 0.5s;
}

ul li:hover {
    background: #33a3ee;
    transform: translateX(-50px); /* makes item move left. If we remove "-", then items move right */
}

ul li::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 100%;
    background: #2e3233;
    top: 0;
    left: -40px;
    transform-origin: right; /* what will be the center of transformation (e.g. rotation) */
    transform: skewY(45deg);
    transition: 0.5s;
}

ul li:hover::before {
    background: #1f5378;
}

ul li::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 40px;
    background: #35383e;
    top: -40px;
    left: 0;
    transform-origin: bottom;
    transform: skewX(45deg);
    transition: 0.5s;
}

ul li:hover::after {
    background: #2982b9;
}

ul li a {
    text-decoration: none;
    color: #999;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: 0.5s;
}

ul li:hover a {
    color: white;
}

ul li:last-child::after {
    box-shadow: -120px 120px 20px rgba(0, 0, 0, 0.25);
}
