/* Active link state for the shared nav. Most layout comes from
   pages/MarketingHome.css; we lock down a few things here so the link
   text sits on exactly the same baseline whether or not a link is
   active (the homepage has no active link, every other page does). */

/* Center the link row vertically and pin a fixed line-height so the
   row's height never depends on which descenders are in the visible
   labels. */
.mm-marketing .mm-nav-links {
  align-items: center;
  line-height: 22px;
}

/* Each link is its own positioning context, an inline-flex box with
   text vertically centered, and shares the row's locked line-height. */
.mm-marketing .mm-nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 22px;
  line-height: 22px;
}

/* Active state: the gold underline is absolutely positioned so it
   doesn't add to the link's box height (which would push every page's
   nav text up relative to the homepage). */
.mm-marketing .mm-nav-links a.is-active {
  color: var(--mm-gold);
}
.mm-marketing .mm-nav-links a.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mm-gold) 50%, transparent);
  opacity: 0.85;
  pointer-events: none;
}

/* ============================================================
   MOBILE NAV — hamburger + slide-down panel
   Desktop: panel + hamburger trigger hidden, links row visible.
   Mobile: links row hidden, hamburger visible, panel slides down
   from the 56px top bar to fill the rest of the viewport.
   ============================================================ */

/* Hamburger trigger — hidden on desktop. */
.mm-marketing .mm-nav-trigger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  margin-left: 4px;
  border-radius: 10px;
  transition: background 0.2s var(--mm-ease-smooth);
}
.mm-marketing .mm-nav-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}
.mm-marketing .mm-nav-trigger-bar {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--mm-fg1);
  border-radius: 1px;
  transform-origin: 50% 50%;
  transition: transform 0.28s var(--mm-ease-smooth),
              opacity 0.18s var(--mm-ease-smooth),
              top 0.28s var(--mm-ease-smooth);
}
.mm-marketing .mm-nav-trigger-bar:nth-child(1) { top: 14px; }
.mm-marketing .mm-nav-trigger-bar:nth-child(2) { top: 21px; }
.mm-marketing .mm-nav-trigger-bar:nth-child(3) { top: 28px; }

/* Animated to an X when open. */
.mm-marketing .mm-nav.is-mobile-open .mm-nav-trigger-bar:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}
.mm-marketing .mm-nav.is-mobile-open .mm-nav-trigger-bar:nth-child(2) {
  opacity: 0;
}
.mm-marketing .mm-nav.is-mobile-open .mm-nav-trigger-bar:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* The slide-down panel — hidden on desktop, hidden when collapsed,
   shown as a full-viewport overlay below the 56px top bar when open. */
.mm-marketing .mm-nav-panel {
  display: none;
}

/* @bp <md + tablet — mobile + tablet nav share the hamburger + slide-down
   panel. MarketingHome.css already hides .mm-nav-links at <=900px, so
   without this the 768–1023 range had no menu UI at all. iPads (820,
   834, 1024 portrait) all land here and now get the hamburger nav. */
@media (max-width: 1023.98px) {
  /* Compress the top bar to 56px and keep the gold logo. */
  .mm-marketing .mm-nav {
    height: 56px;
    padding: 8px clamp(16px, 5vw, 24px);
  }

  /* Desktop nav links row hides; the panel takes over. */
  .mm-marketing .mm-nav-links { display: none; }

  /* "Book a demo" hides from the top bar — it appears inside the panel
     so it's reachable but doesn't crowd the 56px bar. */
  .mm-marketing .mm-nav-cta { display: none; }

  /* Show the trigger. */
  .mm-marketing .mm-nav-trigger { display: inline-block; }

  /* Panel: full viewport below the 56px bar, glass background. */
  .mm-marketing .mm-nav-panel {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 14, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 89;                                    /* one below .mm-nav (90) */
    padding: clamp(20px, 5vw, 32px);
    padding-bottom: max(clamp(24px, 6vw, 40px), env(safe-area-inset-bottom));
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--mm-ease-smooth),
                transform 0.28s var(--mm-ease-smooth),
                visibility 0s linear 0.28s;
  }
  .mm-marketing .mm-nav.is-mobile-open .mm-nav-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s var(--mm-ease-smooth),
                transform 0.28s var(--mm-ease-smooth),
                visibility 0s;
  }

  /* Panel link list — 56px-tall rows, full width, gold left-bar on active. */
  .mm-marketing .mm-nav-panel-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mm-marketing .mm-nav-panel-list a {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--mm-fg1);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 6px;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
  }
  .mm-marketing .mm-nav-panel-list a:active {
    background: rgba(255, 255, 255, 0.04);
  }
  .mm-marketing .mm-nav-panel-list a.is-active {
    color: var(--mm-gold);
    border-left-color: var(--mm-gold);
    padding-left: 14px;
  }

  /* CTA pinned below the link list. */
  .mm-marketing .mm-nav-panel-cta {
    margin-top: clamp(20px, 5vw, 32px);
    padding-top: clamp(16px, 4vw, 24px);
    border-top: var(--mm-border-hair);
  }
  .mm-marketing .mm-nav-panel-cta .mm-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }
}

/* @bp tablet — anchor the slide-down menu to the right half of the
   viewport so the underlying page stays partially visible. Mobile
   keeps the full-screen overlay defined above. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .mm-marketing .mm-nav-panel {
    left: 50%;
  }
}
