/* Keep the header blur on its own layer so open menus can blur the page behind them. */
.header.header-v2 { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.header.header-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffffed;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  pointer-events: none;
}

.header-v2 .header-inner { max-width: 1280px; gap: 26px; }
.header-v2 .navigation { gap: 23px; }
.header-v2 .nav-trigger, .header-v2 .nav-pricing, .header-v2 .header-cta { white-space: nowrap; }
.header-v2 .mega-menu { left: 0; right: 0; padding: 28px 32px 0; max-height: calc(100dvh - 80px); overflow-y: auto; }
.menu-featured { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 12px 24px; }
.menu-featured strong { display: block; font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.menu-featured small { display: block; color: var(--muted); margin-top: 6px; font-size: 14px; line-height: 1.5; }
.menu-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.menu-section { min-width: 0; }
.menu-section h2 { font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; color: var(--muted); padding: 0 12px 10px; margin: 0; }
.header-v2 .menu-link { padding: 12px; gap: 12px; }
.header-v2 .menu-link strong { font-size: 15px; line-height: 1.35; margin: 0 0 4px; }
.header-v2 .menu-link small { font-size: 13px; line-height: 1.5; }
.header-v2 .menu-bottom { margin: 22px -32px 0; padding: 18px 44px; }
@media (min-width:1281px) and (max-width:1350px) {
 .header-v2 .header-inner { gap: 18px; }
 .header-v2 .navigation { gap: 18px; }
 .header-v2 .header-actions { gap: 14px; }
}
/* The direct Download link needs room in both language variants. */
@media (max-width:1280px) {
 .header-v2 .header-inner { justify-content: space-between; gap: 16px; }
 .header-v2 .header-actions { margin-left: auto; }
 .header-v2 .mobile-toggle { display: inline-flex; }
 .header-v2 .signin { display: none; }
 .header-v2 .navigation { display: none; }
 .header-v2 .navigation-open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; padding: 16px var(--gutter) 28px; max-height: calc(100dvh - 60px); overflow-y: auto; background: rgb(255 255 255 / 98%); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 32px 48px -20px #2212362e, 0 16px 20px -12px #2212361f; clip-path: inset(0 -80px -96px); }
 .header-v2 .nav-group { width: 100%; display: block; }
 .header-v2 .nav-trigger, .header-v2 .nav-pricing { width: 100%; justify-content: space-between; font-size: 17px; padding: 16px 0; }
 .header-v2 .mega-menu { position: static; width: 100%; padding: 12px 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
 .header-v2 .menu-bottom { margin: 20px 0 0; padding: 16px 12px; }
 .header-v2 .mobile-signin { display: flex; padding-block: 16px; gap: 10px; }
 .menu-featured { padding-inline: 0; }
 .menu-sections { gap: 20px; }
}
@media (max-width:650px) {
 .menu-sections { grid-template-columns: 1fr; gap: 24px; }
 .menu-section h2 { padding: 0 0 6px; font-size: 13px; }
 .header-v2 .menu-link { padding: 10px 0; }
 .header-v2 .menu-link strong { font-size: 16px; }
 .header-v2 .menu-link small { font-size: 14px; }
 .menu-featured strong { font-size: 20px; }
}
@media (min-width:1281px) { .header-v2 .signin { display: inline-flex; } }

/* A single surface stays visible as categories crossfade, without replaying
   the old panel entrance and staggered link animations on every selection. */
.header.header-v2 .navigation .mega-menu,
.header.header-v2 .navigation .mega-menu .menu-section { animation: none; }
.header.header-v2 .mega-menu {
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 150ms ease, transform 200ms ease, visibility 0s linear 200ms;
}
.header.header-v2 .mega-menu[data-active="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}
.mega-menu-content { padding: 28px 32px 0; }
.mega-menu-surface {
  position: absolute;
  z-index: 1;
  top: calc(100% - 4px);
  inset-inline: 0;
  height: var(--menu-height, 0px);
  max-height: calc(100dvh - 80px);
  border: 1px solid #0000000a;
  border-radius: 0 0 22px 22px;
  background: rgb(255 255 255 / 98%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 32px 48px -20px #2212362e, 0 16px 20px -12px #2212361f;
  clip-path: inset(0 -80px -96px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: height 240ms cubic-bezier(.22,.61,.36,1), opacity 150ms ease, transform 200ms ease, visibility 0s linear 200ms;
}
.mega-menu-surface[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.header.header-v2 .header-cta {
  background: var(--purple);
  border-color: transparent;
  border-radius: 999px;
  color: #fff;
  box-shadow: none;
  gap: 12px;
  transition: background-color 180ms ease;
}
.header.header-v2 .header-cta:hover {
  background: #5921a4;
  transform: none;
}
.header.header-v2 .header-cta:focus-visible { outline: 3px solid #6716d8; outline-offset: 4px; }
@media (max-width:1280px) {
  .mega-menu-surface { display: none; }
  .header.header-v2 .mega-menu {
    display: grid;
    grid-template-rows: 0fr;
    margin: 0;
    transform: none;
    transition: grid-template-rows 220ms cubic-bezier(.22,.61,.36,1), opacity 150ms ease, visibility 0s linear 220ms;
  }
  .header.header-v2 .mega-menu[data-active="true"] { grid-template-rows: 1fr; transition-delay: 0s; }
  .mega-menu-content { min-height: 0; overflow: hidden; padding: 0; }
  .mega-menu-content > :first-child { margin-top: 12px; }
  .header.header-v2 .mega-menu-content .menu-bottom { margin-bottom: 12px; }
}
@media (prefers-reduced-motion:reduce) {
  .header.header-v2 .mega-menu,
  .header.header-v2 .mega-menu-surface { transition: none; transform: none; }
  .header.header-v2 .header-cta { transition: none; }
}
