/* ============================================
   MOBILE OVERLAY MENU
   Full-screen overlay for mobile navigation.
   Loaded on all pages alongside the burger button.
   ============================================ */

/* Overlay container */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: linear-gradient(170deg, #45332A 0%, #3D2B1F 40%, #352318 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
  overflow: hidden;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Warm glow — mirrors the body::after radial warmth on the main site */
.mobile-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(180, 154, 106, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 85%, rgba(122, 92, 68, 0.04) 0%, transparent 50%);
}

/* Glyph rain canvas */
.mobile-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* Content container */
.mobile-overlay-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
  text-align: center;
}

/* Logo */
.mobile-overlay-logo {
  height: 56px;
  width: auto;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: 0.08s;
}
.mobile-overlay.open .mobile-overlay-logo {
  opacity: 1;
  transform: scale(1);
}

/* Wordmark */
.mobile-overlay-wordmark {
  font-family: 'Spectral', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #B49A6A;
  margin-top: 14px;
  margin-bottom: 44px;
  opacity: 0;
  transition: opacity 0.35s;
  transition-delay: 0.16s;
}
.mobile-overlay.open .mobile-overlay-wordmark {
  opacity: 1;
}

/* Nav links container */
.mobile-overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Individual nav links */
.mobile-overlay-link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #F0E8DA;
  text-decoration: none;
  padding: 14px 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.25s;
}

/* Staggered entrance — each link 55ms after the previous */
.mobile-overlay-link:nth-child(1) { transition-delay: 0.14s; }
.mobile-overlay-link:nth-child(2) { transition-delay: 0.195s; }
.mobile-overlay-link:nth-child(3) { transition-delay: 0.25s; }
.mobile-overlay-link:nth-child(4) { transition-delay: 0.305s; }
.mobile-overlay-link:nth-child(5) { transition-delay: 0.36s; }

.mobile-overlay.open .mobile-overlay-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-overlay-link:hover,
.mobile-overlay-link:active {
  color: #B49A6A;
}

/* Coming-soon variant */
.mobile-overlay-link.mobile-overlay-coming-soon {
  color: rgba(240, 232, 218, 0.3);
  cursor: default;
  position: relative;
  padding-bottom: 22px;
}
.mobile-overlay.open .mobile-overlay-link.mobile-overlay-coming-soon {
  opacity: 0.45;
}
.mobile-overlay-link.mobile-overlay-coming-soon:hover,
.mobile-overlay-link.mobile-overlay-coming-soon:active {
  color: rgba(240, 232, 218, 0.3);
}
.mobile-overlay-link.mobile-overlay-coming-soon::after {
  content: 'Coming Soon';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(180, 154, 106, 0.45);
  white-space: nowrap;
}

/* Auth section */
.mobile-overlay-auth {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-overlay-auth-link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #B49A6A;
  text-decoration: none;
  padding: 10px 28px;
  border: 1px solid rgba(180, 154, 106, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s, border-color 0.25s, color 0.25s, background 0.25s;
  transition-delay: 0.42s;
}
.mobile-overlay.open .mobile-overlay-auth-link {
  opacity: 1;
  transform: translateY(0);
}
.mobile-overlay-auth-link:hover {
  border-color: #B49A6A;
  background: rgba(180, 154, 106, 0.08);
  color: #F0E8DA;
}

/* Close button (top-right of overlay) */
.mobile-overlay-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(240, 232, 218, 0.6);
  transition: color 0.2s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-overlay-close:hover {
  color: #F0E8DA;
}

/* ============================================
   BURGER OVERRIDES WHEN OVERLAY IS OPEN
   The burger lifts to position: fixed above
   the overlay so it remains tappable as the
   close (X) control.
   ============================================ */
body.menu-open .burger {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10001;
  transform: none;
}
body.menu-open .burger span {
  background: #F0E8DA;
}

/* Lock body scroll */
body.menu-open {
  overflow: hidden;
}

/* ============================================
   CLOSING STATE
   Remove stagger delays for a snappy close.
   ============================================ */
.mobile-overlay:not(.open) .mobile-overlay-logo,
.mobile-overlay:not(.open) .mobile-overlay-wordmark,
.mobile-overlay:not(.open) .mobile-overlay-link,
.mobile-overlay:not(.open) .mobile-overlay-auth-link {
  transition-delay: 0s !important;
}

/* ============================================
   DESKTOP: hide overlay entirely
   ============================================ */
@media (min-width: 769px) {
  .mobile-overlay {
    display: none !important;
  }
}
