/* Full-width mega menu panel */

.site-header .nav-mega-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  pointer-events: auto;
}

.site-header .nav-shell {
  position: relative;
  z-index: 3;
}

.nav-links {
  justify-content: center;
  flex: 1 1 auto;
  gap: clamp(12px, 2vw, 24px);
}

.nav-links a[data-mega-panel] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 8px 12px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link-chevron {
  font-size: 14px;
  opacity: 0.72;
  transition: transform 0.18s ease;
}

.nav-links a[data-mega-panel].is-mega-active .nav-link-chevron {
  transform: rotate(180deg);
}

.nav-links a[data-mega-panel]:focus-visible {
  outline: none;
}

.nav-mega-wrap.is-open .nav-links a[data-mega-panel].is-mega-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.nav-mega-wrap:not(.is-open) .nav-links a[data-mega-panel]:hover,
.nav-mega-wrap:not(.is-open) .nav-links a[data-mega-panel]:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.command-palette-trigger {
  flex-shrink: 0;
}

/* Hover-intent bridge between nav trigger and menu panel */
.nav-mega-wrap.is-open::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
  z-index: 2;
  pointer-events: auto;
}

.nav-mega-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  margin: 0;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  cursor: default;
}

.nav-mega-wrap.is-open .nav-mega-backdrop:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-mega-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--landing-chrome-offset, 0px) + var(--landing-header-height, 68px));
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-mega-wrap.is-open .nav-mega-menu:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.mega-menu-frame {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  width: 100%;
  align-items: stretch;
}

.mega-menu-dismiss {
  width: 30px;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.mega-menu-dismiss .hgi-stroke {
  font-size: 16px;
}

.mega-menu-dismiss:hover,
.mega-menu-dismiss:focus-visible {
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  color: var(--ink);
}

.command-palette {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
  max-height: calc(100dvh - var(--landing-chrome-offset, 0px) - var(--landing-header-height, 68px) - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.command-palette__main,
.command-palette-trust {
  max-width: var(--container);
  margin: 0 auto;
}

.mega-menu-frame.command-palette--leaving {
  opacity: 0;
  transition: opacity 0.14s ease;
}

.mega-menu-frame.command-palette--entering {
  opacity: 0;
}

.command-palette--leaving {
  opacity: 0;
  transition: opacity 0.14s ease;
}

.command-palette--entering {
  opacity: 0;
}

.command-palette__main {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding: 24px;
  align-items: stretch;
  flex: 1 1 auto;
}

.command-palette__grid {
  grid-column: 1 / 10;
  display: grid;
  gap: 24px;
  min-width: 0;
  align-content: start;
  align-self: stretch;
}

.command-palette__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 28px;
}

.command-palette__row + .command-palette__row {
  padding-top: 4px;
}

.command-palette__row--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(33.333% - 8px);
}

.command-palette__row--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.command-palette-category__label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.command-palette-category__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.command-palette-link {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.16s ease;
}

.command-palette-link__icon {
  font-size: 18px;
  color: var(--accent-text);
}

.command-palette-link__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.command-palette-link__copy strong {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.command-palette-link__copy span {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.command-palette-link__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  line-height: 1.3;
}

.command-palette-link__chevron,
.command-palette-link__hover-icon {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.command-palette-link__hover-icon {
  color: var(--accent-text);
}

.command-palette-link:hover,
.command-palette-link:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-alt));
  outline: none;
}

.command-palette-link:hover .command-palette-link__chevron,
.command-palette-link:focus-visible .command-palette-link__chevron {
  opacity: 0.72;
}

.command-palette-link:hover .command-palette-link__hover-icon,
.command-palette-link:focus-visible .command-palette-link__hover-icon {
  opacity: 1;
}

.command-palette-category__all {
  display: inline-flex;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 750;
  color: var(--accent-text);
  text-decoration: none;
}

.command-palette-category__all:hover {
  text-decoration: underline;
}

.command-palette__promos {
  grid-column: 10 / -1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  align-self: stretch;
  min-width: 220px;
  min-height: 100%;
}

.command-palette-promo {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 18px;
  border-radius: calc(var(--radius-panel) + 2px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.command-palette-promo:hover {
  transform: translateY(-1px);
}

.command-palette-promo__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.command-palette-promo__eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.82;
}

.command-palette-promo strong {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.08;
}

.command-palette-promo p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.9;
}

.command-palette-promo__art {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: min(46%, 132px);
  pointer-events: none;
}

.command-palette-promo__art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.command-palette-promo--primary {
  flex: 1 1 auto;
  min-height: 168px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 88%, black),
    color-mix(in srgb, var(--accent) 72%, black)
  );
  color: white;
}

.command-palette-promo--primary .command-palette-promo__btn {
  justify-self: start;
  margin-top: 4px;
  background: white;
  color: var(--accent-text);
  border-color: transparent;
}

.command-palette-promo--secondary {
  min-height: 148px;
  background: color-mix(in srgb, #8fa57d 14%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, #8fa57d 28%, var(--line));
}

.command-palette-promo--secondary .command-palette-promo__btn {
  justify-self: start;
  margin-top: 4px;
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent-text);
}

.command-palette-promo__btn {
  pointer-events: none;
  height: 38px;
  padding-inline: 14px;
  font-size: 13px;
}

.command-palette-trust {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-alt) 72%, var(--surface));
  flex-shrink: 0;
}

.command-palette-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.command-palette-trust__item .hgi-stroke {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 18px;
  color: var(--accent-text);
}

.command-palette-trust__item strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.command-palette-trust__item span {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

/* Tablet layout */
@media (max-width: 1280px) {
  .command-palette__main {
    grid-template-columns: minmax(0, 1fr) minmax(196px, 220px);
    gap: 18px;
  }

  .command-palette__grid {
    grid-column: 1 / 2;
  }

  .command-palette__promos {
    grid-column: 2 / 3;
  }

  .command-palette__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-palette__row--single {
    max-width: none;
  }

  .command-palette__row--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-palette-trust {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .command-palette__main {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .command-palette__grid,
  .command-palette__promos {
    grid-column: 1 / -1;
  }

  .command-palette__promos {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }
}

@media (max-width: 920px) {
  .command-palette__row,
  .command-palette__row--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile full-screen overlay */
.command-palette-mobile {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--bg);
  overflow: hidden;
}

.command-palette-mobile:not([hidden]) {
  display: block;
}

.command-palette-mobile__dialog {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.command-palette-mobile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.command-palette-mobile__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.command-palette-mobile__theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.command-palette-mobile__theme-icon {
  font-size: 16px;
}

.command-palette-mobile__theme-icon--dark,
html[data-theme="dark"] .command-palette-mobile__theme-icon--light {
  display: none;
}

html[data-theme="dark"] .command-palette-mobile__theme-icon--dark {
  display: inline;
}

.command-palette-mobile__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 24px;
}

.command-palette-mobile__sections {
  display: grid;
}

.command-palette-mobile__menu {
  border-bottom: 1px solid var(--line);
}

.command-palette-mobile__menu summary {
  display: grid;
  grid-template-columns: 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-palette-mobile__menu summary::-webkit-details-marker {
  display: none;
}

.command-palette-mobile__menu-chevron {
  font-size: 16px;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.command-palette-mobile__menu[open] summary {
  background: color-mix(in srgb, var(--bg-alt) 72%, var(--surface));
}

.command-palette-mobile__menu[open] .command-palette-mobile__menu-chevron {
  transform: rotate(180deg);
}

.command-palette-mobile__menu-body {
  padding: 0 0 12px;
}

.command-palette-mobile__group-label {
  margin: 0;
  padding: 12px 16px 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.command-palette-mobile__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.command-palette-mobile__link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.command-palette-mobile__link-icon {
  margin-top: 2px;
  font-size: 18px;
  color: var(--accent-text);
}

.command-palette-mobile__link-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.command-palette-mobile__link-copy strong {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.command-palette-mobile__link-copy span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.command-palette-mobile__link-chevron {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.command-palette-mobile__view-all {
  display: inline-flex;
  margin: 4px 16px 0;
  font-size: 13px;
  font-weight: 750;
  color: var(--accent-text);
  text-decoration: none;
}

.command-palette-mobile__promo-row {
  display: grid;
  gap: 4px;
  margin: 8px 16px 0;
  padding: 14px 16px;
  border-radius: calc(var(--radius-panel) + 2px);
  text-decoration: none;
  color: white;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 88%, black),
    color-mix(in srgb, var(--accent) 72%, black)
  );
}

.command-palette-mobile__promo-row-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.82;
}

.command-palette-mobile__promo-row strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.08;
}

.command-palette-mobile__promo-row span:last-child {
  font-size: 13px;
  font-weight: 750;
}

.command-palette-mobile__trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 20px 16px 8px;
}

.command-palette-mobile__trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.command-palette-mobile__trust-item .hgi-stroke {
  flex: 0 0 auto;
  margin-top: 2px;
  font-size: 18px;
  color: var(--accent-text);
}

.command-palette-mobile__trust-item strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.command-palette-mobile__trust-item span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.command-palette-mobile__trust-item:last-child {
  grid-column: 1 / -1;
}

.command-palette-mobile__cta {
  display: grid;
  gap: 10px;
  padding: 16px 16px 0;
}

.command-palette-mobile__cta .button {
  width: 100%;
  min-height: 52px;
}

.command-palette-mobile__signin {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  color: var(--muted);
  padding: 4px 0 8px;
}

html.command-palette-open {
  overflow: hidden;
}

html.command-palette-open .site-header {
  z-index: 121;
}

@media (max-width: 880px) {
  .nav-mega-menu {
    display: none !important;
  }

  .nav-mega-backdrop {
    display: none !important;
  }

  .command-palette-trigger {
    display: grid;
  }
}

@media (min-width: 881px) {
  .command-palette-mobile {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .command-palette-trust {
    grid-template-columns: 1fr 1fr;
  }

  .command-palette__promos {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mega-menu,
  .nav-mega-backdrop,
  .command-palette-promo,
  .command-palette-mobile__menu-chevron,
  .command-palette--leaving,
  .command-palette--entering {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .command-palette,
  .command-palette-mobile__header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface);
  }
}
