/* Burger Menu Styles */
.menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  position: relative;
  cursor: pointer;
  transition: 0.5s ease-in-out;
}

.menu-toggle span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text-color);
  border-radius: var(--radius-sm);
  opacity: 1;
  left: 0;
  transform-origin: center;
  transition: .25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
  top: 8px;
}

.menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
  bottom: 8px;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-color);
  display: none;
  z-index: 999;
}

.menu-overlay.menu-open {
  display: block;
}

.menu-items {
  padding: var(--space-lg) var(--margin-x);
}

.menu-items > a {
  display: block;
  font-size: var(--font-size);
  font-family: 'DM Mono', monospace;
  color: var(--text-color);
  margin-bottom: var(--space-lg);
  text-decoration: none;
  cursor: pointer;
}

/* Animation 1: Morphing - smooth morphing to X */
.menu-toggle.menu--animatable span {
  transition: .4s ease-in-out;
}

.menu-toggle.menu--animatable.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--animatable.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--animatable.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Animation 2: Elastic - bouncy spring effect */
.menu-toggle.menu--elastic span {
  transition: .4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.menu-toggle.menu--elastic.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--elastic.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--elastic.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Animation 3: Arrow - forms arrows before X */
.menu-toggle.menu--emphatic span {
  transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.menu-toggle.menu--emphatic span:nth-child(2) {
  transition: opacity 0.2s ease;
}

.menu-toggle.menu--emphatic.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--emphatic.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--emphatic.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Animation 4: Collapse - lines collapse together */
.menu-toggle.menu--collapse span {
  transition: transform .4s, opacity .4s;
}

.menu-toggle.menu--collapse.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--collapse.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) scaleX(0);
}

.menu-toggle.menu--collapse.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Animation 5: 3D Spin - rotates 360 + 45 degrees */
.menu-toggle.menu--spin span {
  transition: transform .5s cubic-bezier(0.9, 0, 0.33, 1);
}

.menu-toggle.menu--spin.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(405deg);
}

.menu-toggle.menu--spin.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) rotate(180deg);
}

.menu-toggle.menu--spin.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-405deg);
}

/* Animation 6: Squeeze */
.menu-toggle.menu--squeeze span {
  transition: .4s;
}

.menu-toggle.menu--squeeze.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--squeeze.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--squeeze.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Animation 7: Vortex - dramatic spin - 720 + 45 degrees */
.menu-toggle.menu--vortex span {
  transition: transform .7s cubic-bezier(0.19, 1, 0.22, 1);
}

.menu-toggle.menu--vortex.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(765deg);
}

.menu-toggle.menu--vortex.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--vortex.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-765deg);
}

/* Animation 8: Simple */
.menu-toggle.menu--boring span {
  transition: .3s ease;
}

.menu-toggle.menu--boring.is-active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.menu--boring.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.menu--boring.is-active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}