
/* Anagram-style Hamburger Menu */
.menu-toggle {
  position: fixed;
  top: 25px;
  right: 0.5%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.menu-toggle span {
  display: block;
  width: 30px;
  height: 5px;
  background: linear-gradient(25deg,
      rgb(149, 158, 255),
      rgb(198, 137, 255),
      rgb(255, 145, 213),
      rgb(250, 255, 163),
      rgb(183, 255, 220),
      rgb(157, 240, 255),
      rgb(156, 202, 255),
      rgb(149, 158, 255));
  background-size: 600% 600%;
  animation: iridescent 4s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease,
    width 0.3s ease;
  border-radius: 3px;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 2px;
}

.menu-toggle span:nth-child(1) {
  width: 24px;
  align-self: flex-end;
}

.menu-toggle span:nth-child(3) {
  width: 20px;
  align-self: flex-end;
}

.menu-toggle:hover span {
  width: 30px;
  background: linear-gradient(45deg,
      rgb(179, 195, 255),
      rgb(193, 179, 255),
      rgb(220, 179, 255),
      rgb(255, 179, 206),
      rgb(255, 255, 221),
      rgb(186, 255, 201),
      rgb(186, 225, 255),
      rgb(179, 195, 255));
  background-size: 600% 600%;
  width 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  width: 30px;
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  width: 30px;
}



/* Fullscreen Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(89, 86, 104, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    visibility 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: default;
}

.menu-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.menu-nav a {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: bold;
  text-decoration: none;
  background: linear-gradient(45deg,
      rgb(179, 195, 255),
      rgb(193, 179, 255),
      rgb(220, 179, 255),
      rgb(255, 179, 206),
      rgb(255, 255, 221),
      rgb(186, 255, 201),
      rgb(186, 225, 255),
      rgb(179, 195, 255));
  background-size: 500% 500%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: iridescent 4s ease-in-out infinite;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    letter-spacing 0.3s ease;
  letter-spacing: 0;
  line-height: 1.25;
}

.menu-nav a:hover {
  letter-spacing: 0.03em;
}

.menu-overlay.active .menu-nav a {
  opacity: 1;
  transform: translateY(0);
}

.menu-overlay.active .menu-nav a:nth-child(1) {
  transition-delay: 0.1s;
}

.menu-overlay.active .menu-nav a:nth-child(2) {
  transition-delay: 0.15s;
}

.menu-overlay.active .menu-nav a:nth-child(3) {
  transition-delay: 0.2s;
}

.menu-overlay.active .menu-nav a:nth-child(4) {
  transition-delay: 0.25s;
}

.menu-overlay.active .menu-nav a:nth-child(5) {
  transition-delay: 0.3s;
}

.menu-footer {
  position: absolute;
  bottom: 40px;
  display: flex;
  gap: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s;

}

.menu-overlay.active .menu-footer {
  opacity: 1;
  transform: translateY(0);
}

.menu-footer a {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
  transition: color 0.3s ease;
}

.menu-footer a:hover {
  color: rgba(255, 255, 255, 1);
}
