.nav, .menu {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}
.nav {
    margin-top: 2%;
    position: relative;
    background-color: #fff;
    padding: 20px;
    transition: 0.5s;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 15px rgba(0,0,0,.2);
}

.menu {
    width: 0;
    overflow: hidden;
    transition: 0.5s;
}

@media all and (min-width: 1024px) {
    .nav input:checked ~ .menu {
        width: 600px;
    }
}
@media all and (max-width: 1024px) {
    .nav input:checked ~ .menu {
        width: 600px;
    }
    .menu{
        display: flex;
        flex-direction: column;
    }
}

.menu li {
    list-style: none;
    margin: 2%;
}

.menu li a {
    text-decoration: none;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    transition: 0.5s;
}

.menu li a:hover {
    color: #161919;
}

.nav input {
    width: 40px;
    height: 40px;
    cursor: pointer;
    opacity: 0;
}

.nav span {
    position: absolute;
    left: 30px;
    width: 30px;
    height: 4px;
    border-radius: 50px;
    background-color: #666;
    pointer-events: none;
    transition: 0.5s;
}

.nav input:checked ~ span {
    background-color: #f974a1;
}

.nav span:nth-child(2) {
    transform: translateY(-8px);
}

.nav input:checked ~ span:nth-child(2) {
    transform: translateY(0) rotate(-45deg);
}
.nav span:nth-child(3) {
    transform: translateY(8px);
}

.nav input:checked ~ span:nth-child(3) {
    transform: translateY(0) rotate(45deg);
}