:root {
  --menu-overlay-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(12, 12, 14, 0.82));
  --menu-overlay-border: rgba(255, 255, 255, 0.22);
  --menu-overlay-shadow: 0 45px 85px rgba(0, 0, 0, 0.7), inset 0 1px 18px rgba(255, 255, 255, 0.2);
}

.main-nav {
  position: fixed;
  top: clamp(18px, 4vw, 32px);
  left: clamp(18px, 4vw, 32px);
  z-index: 30;
  backdrop-filter: blur(16px);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.18), rgba(20, 20, 22, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.55), inset 0 2px 6px rgba(255, 255, 255, 0.18);
  padding: 10px;
}

.menu-toggle {
  width: clamp(48px, 8vw, 58px);
  height: clamp(48px, 8vw, 58px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(8, 8, 10, 0.85));
  box-shadow: inset 0 3px 9px rgba(255, 255, 255, 0.25), inset 0 -6px 12px rgba(0, 0, 0, 0.45), 0 18px 35px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: clamp(24px, 6vw, 30px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(160, 160, 170, 0.6));
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
  transition: transform 0.3s ease, opacity 0.2s ease, width 0.3s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
  transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 3px 9px rgba(255, 255, 255, 0.35), inset 0 -6px 14px rgba(0, 0, 0, 0.55), 0 28px 55px rgba(0, 0, 0, 0.65);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(42deg);
}

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

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-42deg);
}

.close-toggle {
  gap: 0;
}

.close-toggle span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  width: clamp(26px, 6vw, 34px);
}

.close-toggle span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(42deg);
}

.close-toggle span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-42deg);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 80px);
  background: radial-gradient(circle at 15% 15%, rgba(120, 130, 255, 0.12), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(255, 120, 180, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(8, 8, 10, 0.9), rgba(0, 0, 0, 0.95));
  backdrop-filter: blur(28px);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 25;
  min-height: 100dvh;
  overflow-y: auto;
}

.menu-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.menu-overlay.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.overlay-inner {
  position: relative;
  width: min(860px, 92%);
  max-height: min(90dvh, 860px);
  border-radius: 32px;
  padding: clamp(32px, 6vw, 64px);
  background: var(--menu-overlay-bg);
  border: 1px solid var(--menu-overlay-border);
  box-shadow: var(--menu-overlay-shadow);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 48px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.overlay-inner::before {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
  box-shadow: inset 0 25px 45px rgba(255, 255, 255, 0.1);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.overlay-brand {
  font-size: clamp(24px, 4vw, 36px);
  color: #f6f7fa;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 600;
  text-shadow: 0 18px 35px rgba(0, 0, 0, 0.8), 0 0 28px rgba(255, 255, 255, 0.45);
}

.overlay-links {
  display: grid;
  gap: clamp(16px, 3vw, 26px);
  position: relative;
  z-index: 1;
}

.overlay-link,
.overlay-button {
  font-size: clamp(20px, 4vw, 32px);
  color: #e6e7eb;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: clamp(14px, 4vw, 20px) clamp(12px, 6vw, 32px);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(15, 15, 17, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 4px 12px rgba(255, 255, 255, 0.2), inset 0 -8px 18px rgba(0, 0, 0, 0.45), 0 30px 60px rgba(0, 0, 0, 0.65);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overlay-button {
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(15, 15, 17, 0.85));
}

.overlay-link:hover,
.overlay-link:focus,
.overlay-button:hover,
.overlay-button:focus {
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(15, 15, 17, 0.9));
  color: #ffffff;
  box-shadow: inset 0 6px 16px rgba(255, 255, 255, 0.25), inset 0 -10px 22px rgba(0, 0, 0, 0.55), 0 38px 70px rgba(0, 0, 0, 0.75);
}

.overlay-link--active {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

.overlay-footer {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.overlay-secondary {
  padding: 12px 28px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(20, 20, 24, 0.8));
  color: #e9ebf1;
  box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.22), inset 0 -6px 16px rgba(0, 0, 0, 0.45), 0 22px 40px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overlay-secondary:hover,
.overlay-secondary:focus {
  transform: translateY(-3px);
  box-shadow: inset 0 5px 14px rgba(255, 255, 255, 0.3), inset 0 -8px 20px rgba(0, 0, 0, 0.55), 0 32px 58px rgba(0, 0, 0, 0.65);
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .overlay-inner {
    padding: clamp(24px, 8vw, 40px);
  }

  .overlay-link,
  .overlay-button {
    font-size: clamp(18px, 5vw, 26px);
  }
}
