.toggle-menu {
  position: relative;
  user-select: none;
  z-index: 1;
  display: none;
  top: 1rem;
  right: 1.9rem;
}

.toggle-menu input {
  position: relative;
  display: block;
  width: 35px;
  height: 32px;
  cursor: pointer;
  opacity: 0;
  z-index: 2;
}

.toggle-menu span {
  display: block;
  width: 33px;
  height: 4px;
  position: relative;
  top: -2rem;
  left: .35rem;
  margin-bottom: 5px;
  background: #222;
  border-radius: 3px;
  z-index: 1;
  transform-origin: 4px 0px;
  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
    background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.55s ease;
}

.toggle-menu input:checked~span {
  opacity: 1;
  transform: rotate(45deg) translate(1px, 0px);
  background: #333;
}

.toggle-menu input:checked~span:nth-last-child(3) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}

.toggle-menu input:checked~span:nth-last-child(2) {
  transform: rotate(-45deg) translate(-1px, -1px);
}

.header-list ul {
  transition: all 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
    background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.55s ease;
}

@media (max-width: 840px) {
  .toggle-menu {
    display: block;
  }

  .toggle-menu input:checked~.header-list ul {
    opacity: 1;
    top: 40px;
  }
}