/* Innovent — mega menu · Stripe-style floating card with shared slide motion */

.nav__links { display: flex; align-items: stretch; gap: 0; }
.nav__item { display: flex; align-items: stretch; position: static; }
.nav__item > .nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 72px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-80);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 220ms cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: -0.005em;
}
.nav__item > .nav__link:hover { color: var(--ink-100); }
.nav__item > .nav__link .chev {
  width: 9px; height: 9px;
  opacity: 0.4;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, color 220ms ease;
  margin-top: 1px;
}
.nav__item.is-open > .nav__link { color: var(--ink-100); }
.nav__item.is-open > .nav__link .chev { transform: rotate(180deg); opacity: 1; color: var(--accent); }

/* Mega panel — full-width sheet, Stripe-style slide motion */
.mega {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  width: auto;
  transform: translateY(-8px);
  background: rgba(8, 13, 24, 0.96);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 24px 64px -16px rgba(0,0,0,0.7);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
  transition:
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 280ms;
}
.mega.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}
.mega.is-leaving {
  opacity: 0;
  transition: opacity 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Accent glow on the top edge */
.mega::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(59,130,246,0.5) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 480ms ease;
}
.mega.is-open::before { opacity: 1; }

.mega__inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 32px 44px;
  gap: 56px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1) 60ms,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}
.mega.is-open .mega__inner { opacity: 1; transform: translateY(0); }

/* Sidebar */
.mega__sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mega__sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-70);
  font-weight: 500;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mega__cats {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.mega__cat {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-70);
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  transition: color 220ms ease, background 240ms ease;
  letter-spacing: -0.005em;
}
.mega__cat::before {
  content: "";
  position: absolute;
  left: 5px; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px; height: 13px;
  background: var(--accent);
  border-radius: 1px;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mega__cat:hover { color: var(--ink-100); }
.mega__cat.is-active {
  color: var(--ink-100);
  background: rgba(255,255,255,0.03);
}
.mega__cat.is-active::before { transform: translateY(-50%) scaleY(1); }

.mega__explore {
  margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.22);
  color: var(--ink-100);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  letter-spacing: -0.005em;
  transition: background 220ms ease, border-color 220ms ease;
}
.mega__explore:hover { background: rgba(59,130,246,0.14); border-color: rgba(59,130,246,0.36); }
.mega__explore svg { transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1); opacity: 0.7; width: 11px; height: 11px; }
.mega__explore:hover svg { transform: translateX(3px); opacity: 1; }

/* Body */
.mega__body { display: flex; flex-direction: column; min-width: 0; }
.mega__panel { display: none; }
.mega__panel.is-active {
  display: flex; flex-direction: column; gap: 16px;
  animation: panel-fade 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes panel-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mega__heading {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink-100);
  text-decoration: none;
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 220ms ease;
  width: fit-content;
}
.mega__heading svg { opacity: 0.45; transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease; width: 12px; height: 12px; }
.mega__heading:hover { color: var(--accent); }
.mega__heading:hover svg { opacity: 1; transform: translateX(3px); }

.mega__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 40px;
}
.mega__item {
  text-decoration: none; color: inherit;
  display: block;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  transition: background 200ms ease, padding-left 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mega__item:hover { background: rgba(255,255,255,0.025); padding-left: 16px; padding-right: 8px; }
.mega__item h5 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-100);
  margin: 0 0 3px;
  letter-spacing: -0.005em;
  transition: color 220ms ease;
}
.mega__item:hover h5 { color: var(--accent); }
.mega__item p {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-70);
  margin: 0;
}

/* No backdrop on Stripe — keep it transparent but catch clicks */
.mega-backdrop {
  position: fixed;
  top: 72px; left: 0; right: 0; bottom: 0;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: visibility 0s linear 200ms;
  z-index: 89;
  pointer-events: none;
}
.mega-backdrop.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: visibility 0s linear 0s;
}

@media (max-width: 1100px) {
  .mega__inner { grid-template-columns: 200px 1fr; gap: 36px; padding: 28px 24px 36px; }
  .mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .mega, .mega-backdrop { display: none !important; }
  .nav__item > .nav__link .chev { display: none; }
}

/* ══ Mobile navigation ═════════════════════════════════════════════════════
   Everything below is inert at desktop widths: the burger and the drawer are
   display:none until 860px, which is also where the mega menu switches off.
   No existing desktop rule is touched.                                       */
.nav__burger,
.mnav { display: none; }

@media (max-width: 860px) {
  /* The six links in a row are what pushed every page 134px wider than the
     viewport on a phone. Hand navigation to the drawer instead. */
  .nav__links,
  .nav__right { display: none !important; }

  .nav__inner { gap: 12px; padding: 0 16px; }
  .nav__brand { margin-right: auto; }
  .nav__brand img { height: 38px !important; }

  .nav__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;              /* 44px — a comfortable tap target */
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--hair, rgba(125,211,252,0.18));
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav__burger span {
    display: block;
    height: 1.5px;
    background: var(--ink-90, #e2e8f0);
    border-radius: 2px;
    transition: transform 180ms ease, opacity 140ms ease;
  }
  .nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* overflow:hidden matters: the panel is parked at translateX(100%), and
     without clipping it counts toward the document's scroll width and
     re-introduces the sideways scroll this drawer exists to remove. */
  .mnav { display: block; position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
  .mnav__scrim {
    position: absolute; inset: 0;
    background: rgba(2, 6, 16, 0.72);
    opacity: 0;
    transition: opacity 220ms ease;
  }
  .mnav__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(86vw, 360px);
    display: flex;
    flex-direction: column;
    background: var(--bg-1, #0a1224);
    border-left: 1px solid var(--hair, rgba(125,211,252,0.14));
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    overscroll-behavior: contain;
  }
  .mnav.is-open { pointer-events: auto; }
  .mnav.is-open .mnav__scrim { opacity: 1; }
  .mnav.is-open .mnav__panel { transform: translateX(0); }
  body.mnav-lock { overflow: hidden; }

  .mnav__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hair, rgba(125,211,252,0.12));
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-70, #94a3b8);
    flex-shrink: 0;
  }
  .mnav__close {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    font-size: 26px; line-height: 1;
    background: transparent; border: 0; cursor: pointer;
    color: var(--ink-80, #cbd5e1);
  }

  .mnav__list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 20px; }

  .mnav__toggle,
  .mnav__link {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    background: transparent; border: 0;
    font-family: inherit; font-size: 15.5px; font-weight: 500;
    color: var(--ink-90, #e2e8f0);
    text-align: left; text-decoration: none;
    cursor: pointer;
  }
  .mnav__toggle svg { width: 12px; height: 12px; flex-shrink: 0; transition: transform 200ms ease; }
  .mnav__group.is-open .mnav__toggle { color: var(--accent, #7dd3fc); }
  .mnav__group.is-open .mnav__toggle svg { transform: rotate(180deg); }

  .mnav__sub { display: none; padding: 2px 0 12px; background: rgba(255,255,255,0.02); }
  .mnav__group.is-open .mnav__sub { display: block; }
  .mnav__cat {
    padding: 12px 20px 6px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-60, #64748b);
  }
  .mnav__sublink,
  .mnav__all {
    display: block;
    min-height: 44px;
    padding: 12px 20px 12px 32px;
    font-size: 14.5px; line-height: 1.35;
    color: var(--ink-80, #cbd5e1);
    text-decoration: none;
  }
  .mnav__all { color: var(--accent, #7dd3fc); font-weight: 600; padding-left: 20px; }

  .mnav__cta {
    display: grid; gap: 10px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--hair, rgba(125,211,252,0.12));
    flex-shrink: 0;
  }
  .mnav__cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    font-size: 14.5px;
  }
}
