/* Shared enterprise mega-menu component (light theme).
   Single source of truth for the desktop dropdown menus, loaded by BOTH
   marketing stacks: the Pug pages (after marketing/styles.css) and the
   static site3 pages (after sandbox/site3/styles.css). Because site3 does
   not define the --color-* tokens, every var() here carries a literal
   fallback — keep them in sync with marketing/styles.css. */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Aspekta', 'Inter', -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: #3f3f46;
  background: none;
  border: none;
  padding: 0.35rem 0;
  cursor: pointer;
  transition: color 0.12s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: var(--color-text, #111827);
}

.nav-dropdown-trigger .nav-chevron,
.nav-dropdown-trigger [data-icon="ChevronDown"] svg,
.nav-dropdown-trigger svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown:focus-within .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  padding-top: 14px; /* hover bridge so the pointer can travel into the menu */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 300;
}

/* Keyboard support: :focus-within keeps the menu open while any link inside
   has focus (the old trigger:focus + menu selector collapsed the menu the
   moment focus moved into it, making links unreachable by keyboard). */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.nav-dropdown-panel {
  background: #ffffff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 4px 12px rgba(16, 17, 20, 0.06), 0 24px 48px -16px rgba(16, 17, 20, 0.18);
  display: flex;
  gap: 0.75rem;
}

.nav-dropdown-column {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 250px;
}

.nav-dropdown-heading {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-dim, #8b8b96);
  padding: 0.45rem 0.75rem 0.3rem;
}

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  text-decoration: none;
  transition: background 0.12s ease;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  background: var(--color-surface, #f6f6f8);
}

.nav-dropdown-item .ndi-icon {
  display: inline-flex;
  color: var(--color-accent, #6663fd);
  flex-shrink: 0;
  margin-top: 2px;
}

.nav-dropdown-item .ndi-icon svg,
.nav-dropdown-item [data-lucide] {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-dropdown-item-title {
  display: block;
  font-family: 'Aspekta', 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text, #111827);
  line-height: 1.3;
}

.nav-dropdown-item-desc {
  display: block;
  font-family: 'Aspekta', 'Inter', sans-serif;
  font-size: 0.74rem;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.4;
  margin-top: 1px;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--color-border, #e5e7eb);
  margin: 0.5rem 0;
}

/* Featured card (right rail of a mega menu) */
.nav-dropdown-feature {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 220px;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(102, 99, 253, 0.16), transparent 60%),
    var(--color-surface, #f6f6f8);
  border: 1px solid var(--color-border, #e5e7eb);
  transition: border-color 0.12s ease;
}

.nav-dropdown-feature:hover {
  border-color: var(--color-accent, #6663fd);
}

/* Pip (the star of /story) peeks out of the bottom of the card and slides up on hover */
.nav-dropdown-feature .ndf-pip {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 108px;
  height: auto;
  transform: translate(-50%, 46%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.1);
  pointer-events: none;
}
.nav-dropdown-feature:hover .ndf-pip {
  transform: translate(-50%, 14%);
}

.nav-dropdown-feature .ndf-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent, #6663fd);
}

.nav-dropdown-feature .ndf-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text, #111827);
  margin-top: 0.35rem;
}

.nav-dropdown-feature .ndf-desc {
  font-size: 0.74rem;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.45;
  margin-top: 0.25rem;
}

/* "The Story" — the pip tucked at the bottom of the Trust & fit column (bigger,
   fully visible, instead of a whole extra feature column). */
.nav-dropdown-story {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  background:
    radial-gradient(120% 100% at 15% 0%, rgba(102, 99, 253, 0.13), transparent 62%),
    var(--color-surface, #f6f6f8);
  border: 1px solid var(--color-border, #e5e7eb);
  transition: border-color 0.12s ease;
}
.nav-dropdown-story:hover {
  border-color: var(--color-accent, #6663fd);
}
.nav-dropdown-story .ndf-pip {
  width: 66px;
  height: auto;
  flex-shrink: 0;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
.nav-dropdown-story:hover .ndf-pip {
  transform: translateY(-3px) rotate(-4deg);
}
.nav-dropdown-story .nds-title {
  display: block;
  font-family: 'Aspekta', 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text, #111827);
  line-height: 1.25;
}
.nav-dropdown-story .nds-desc {
  display: block;
  font-family: 'Aspekta', 'Inter', sans-serif;
  font-size: 0.74rem;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.4;
  margin-top: 2px;
}

/* ============================================================
   Mobile menu for the static site3 headers (.hnav__burger +
   .hnav__mobile). Distinct classes from the Pug pages' own
   .nav-mobile-* menu, so the two never collide. Loaded on both
   stacks but the markup only exists on site3 pages.
   ============================================================ */
.hnav__burger { display: none; }
.hnav__mobile { display: none; }

@media (max-width: 900px) {
  .hnav .hnav__links { display: none !important; }
  .hnav .hnav__cta { display: none !important; }
  .hnav__burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px; margin-left: auto;
    border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
    position: relative; z-index: 260;
  }
  .hnav__burger span {
    display: block; height: 2px; width: 100%; background: #111827; border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
  }
  .hnav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hnav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .hnav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hnav__mobile {
    display: block; position: fixed; inset: 0; z-index: 1300;
    background: #ffffff; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 74px 22px 40px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  }
  body.hnav-open { overflow: hidden; }
  body.hnav-open .hnav__mobile { opacity: 1; visibility: visible; transform: none; }

  .hnav__mobile-close {
    position: absolute; top: 14px; right: 16px; z-index: 1;
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: none; cursor: pointer; color: #111827;
    -webkit-tap-highlight-color: transparent;
  }
  .hnav__mobile-close svg { width: 26px; height: 26px; }

  .hnav__macc { border-bottom: 1px solid #ececf0; }
  .hnav__macc-t {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
    background: none; border: 0; cursor: pointer; padding: 16px 2px;
    font-family: 'Aspekta', 'Inter', sans-serif; font-size: 1.12rem; font-weight: 500; color: #111827;
  }
  .hnav__macc-t svg { width: 18px; height: 18px; color: #8b8b96; transition: transform .2s ease; flex: none; }
  .hnav__macc-t[aria-expanded="true"] svg { transform: rotate(180deg); }
  .hnav__macc-c { display: flex; flex-direction: column; padding: 0 2px 14px; }
  .hnav__macc-c[hidden] { display: none; }
  .hnav__macc-c a { padding: 10px 0; color: #52525e; text-decoration: none; font-size: 1rem; }
  .hnav__macc-c a:hover, .hnav__macc-c a:active { color: #6663fd; }

  .hnav__mobile-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
  .hnav__mobile-cta a {
    width: 100%; text-align: center; padding: 14px; border-radius: 11px;
    font-weight: 600; font-size: 1rem; text-decoration: none;
    border: 1px solid #e5e7eb; color: #111827; background: #fff;
  }
  .hnav__mobile-cta a.is-primary { background: #6663fd; border-color: #6663fd; color: #fff; }
}

/* The Pug pages' own mobile toggle (.nav-mobile-toggle) must right-align; the
   .hnav row is justify-content:normal and the desktop CTA is hidden on mobile. */
.nav-mobile-toggle { margin-left: auto; }
