/* Stable, opaque product navigation inspired by mature SaaS information architecture. */
body > nav {
  z-index: 10000 !important;
  isolation: isolate;
  overflow: visible !important;
}

body > nav .product-menu { position: static; }
body > nav .product-menu > summary {
  position: relative;
  z-index: 2;
  padding: 12px 3px;
  cursor: pointer;
}
body > nav .product-menu > summary::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: #c9a8f5;
  transform: scaleX(0);
  transition: transform 180ms ease;
}
body > nav .product-menu > summary span { transition: transform 180ms ease; }
body > nav .product-menu[open] > summary { color: #fff; }
body > nav .product-menu[open] > summary::after { transform: scaleX(1); }
body > nav .product-menu[open] > summary span { transform: rotate(180deg); }

body > nav .mega-menu {
  position: absolute;
  z-index: 10001;
  top: calc(100% - 1px) !important;
  left: 50% !important;
  right: auto !important;
  width: min(760px, calc(100vw - 48px));
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  isolation: isolate;
  overflow: visible;
  opacity: 1 !important;
  color: #f6f1fb;
  border: 1px solid #44394f;
  border-radius: 0 0 18px 18px;
  background: #121017 !important;
  box-shadow: 0 38px 100px rgba(0,0,0,.82), 0 0 0 1px rgba(255,255,255,.025) inset;
  backdrop-filter: none !important;
  pointer-events: auto;
  transform: translateX(-50%);
  animation: lead-menu-in 190ms cubic-bezier(.2,.8,.2,1) both !important;
}

/* Invisible bridge keeps the panel open while the pointer crosses from the label. */
body > nav .mega-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 22px;
}
body > nav + *, body > nav ~ main { position: relative; z-index: 0; }

body > nav .mega-menu-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin: -14px -14px 4px;
  padding: 19px 22px 17px;
  border-bottom: 1px solid #342d3d;
  background: #19151f;
}
body > nav .mega-menu-head span {
  color: #f8f3fc !important;
  font-size: 14px !important;
  font-weight: 650;
  letter-spacing: -.01em;
}
body > nav .mega-menu-head small {
  color: #8f8698;
  font-size: 11px;
  letter-spacing: .02em;
}

body > nav .mega-menu > a {
  min-height: 92px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #f6f1fb;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
body > nav .mega-menu > a:hover,
body > nav .mega-menu > a:focus-visible {
  position: relative;
  z-index: 1;
  transform: translateY(-2px);
  border-color: #564367;
  background: #211927;
}
body > nav .menu-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #44384f;
  border-radius: 11px;
  background: linear-gradient(145deg,#2a2033,#18131e);
  color: #d2b5fb !important;
}
body > nav .menu-icon .ui-icon { width: 19px; height: 19px; }
body > nav .menu-icon.network {
  font: 650 11px/1 ui-monospace,SFMono-Regular,monospace;
  letter-spacing: -.02em;
}
body > nav .menu-copy { min-width: 0; display: block; }
body > nav .mega-menu b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f8f3fc !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
}
body > nav .mega-menu b i {
  color: #8d72aa;
  font-style: normal;
  transition: transform 160ms ease, color 160ms ease;
}
body > nav .mega-menu a:hover b i { color: #d2b5fb; transform: translate(2px,-2px); }
body > nav .mega-menu .menu-copy small {
  display: block;
  margin-top: 7px;
  color: #9e95a7 !important;
  font-size: 11px;
  line-height: 1.45;
}

@keyframes lead-menu-in {
  from { opacity: 0; transform: translate(-50%,-8px); }
  to { opacity: 1; transform: translate(-50%,0); }
}

@media (hover:hover) and (pointer:fine) {
  body > nav .product-menu > summary { cursor: default; }
  body > nav .product-menu:hover > summary { color: #fff; }
}

@media (max-width:760px) {
  body > nav .product-menu { position: relative; }
  body > nav .mega-menu {
    position: fixed;
    top: 76px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    grid-template-columns: 1fr;
    border-radius: 16px;
    transform: none;
    animation: lead-menu-mobile-in 180ms ease both !important;
  }
  body > nav .mega-menu-head { position: sticky; top: -14px; z-index: 2; }
  body > nav .mega-menu > a { min-height: 78px; }
}

@keyframes lead-menu-mobile-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion:reduce) {
  body > nav .mega-menu,
  body > nav .mega-menu > a,
  body > nav .mega-menu b i,
  body > nav .product-menu > summary::after {
    animation: none !important;
    transition: none !important;
  }
}
