/* Mobile and Tablet: Burger Menu (< 1024px) */
#menuToggle {
  display: block;
  position: fixed;
  top: 24px;
  left: 20px;
  z-index: 888;
  -webkit-user-select: none;
  user-select: none;
}

#menuToggle a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

#menuToggle a:hover {
  color: #286742;
}

#menuToggle input {
  display: block;
  width: 40px;
  height: 32px;
  position: absolute;
  top: -7px;
  left: -5px;
  cursor: pointer;
  opacity: 0;
  z-index: 999;
  -webkit-touch-callout: none;
}

#menuToggle span {
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 6px;
  position: relative;
  background: black;
  border-radius: 2px;
  z-index: 888;
  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;
}

#menuToggle span:first-child {
  transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2) {
  transform-origin: 0% 100%;
}

#menuToggle input:checked ~ span {
  opacity: 1;
  transform: rotate(45deg) translate(-2px, -4px);
  background: white !important;
}

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

#menuToggle input:checked ~ span:nth-last-child(2) {
  transform: rotate(-45deg) translate(0, -1px);
}

#menu {
  position: absolute;
  width: 240px;
  height: 100vh;
  margin: -100px 0 0 -20px;
  padding: 50px;
  padding-top: 125px;
  background: black;
  list-style-type: none;
  -webkit-font-smoothing: antialiased;
  transform-origin: 0% 0%;
  transform: translate(-100%, 0);
  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
}

#menu li {
  padding: 10px 0;
  font-size: 24px;
}

.active {
  color: #286742;
  font-weight: normal;
}

#menuToggle input:checked ~ ul {
  transform: none;
}

/* Desktop: Horizontal Menu (>= 1024px) */
@media (min-width: 1024px) {
  #menuToggle {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
  }

  #menuToggle input,
  #menuToggle span {
    display: none;
  }

  #menu {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    transform: none;
    transition: none;
  }

  #menu li {
    padding: 0;
    font-size: 18px;
  }

  #menu a {
    color: white;
    font-weight: 500;
    position: relative;
  }

  #menu a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #286742;
    transition: width 0.3s ease;
  }

  #menu a:hover::after {
    width: 100%;
  }

  #menu a:hover {
    color: #286742;
  }
}
