/**
 * Full-screen navigation overlay (homepage case-study style).
 */

.km-fullmenu {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: #fff;
}

.km-fullmenu.is-open {
  display: flex;
}

body.km-menu-open {
  overflow: hidden;
}

/*
 * Menu open: remove all header chrome (logo, MENU, hamburger) so nothing bleeds through
 * the overlay — fixed header + filter/drop-shadow can stack above the dimmer on some GPUs.
 * Close the menu via overlay “Close”, Escape, or a nav link.
 */
body.km-menu-open .header_section {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Belt-and-suspenders (e.g. if header markup changes) */
body.km-menu-open .header_section .km-hero-nav-brand,
body.km-menu-open .header_section a.navbar-brand.km-hero-nav-brand {
  display: none !important;
}

/* No logo in overlay top bar either — “Home” remains in the nav list */
body.km-menu-open .km-fullmenu__logo {
  display: none !important;
}

body.km-menu-open .km-fullmenu__topbar {
  justify-content: flex-end;
}

/* Logo + Close — one row at top of overlay */
.km-fullmenu__topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10052;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.75rem);
  pointer-events: none;
}

.km-fullmenu__topbar > * {
  pointer-events: auto;
}

.km-fullmenu__logo {
  display: flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}

.km-fullmenu__logo img {
  height: clamp(40px, 9vw, 52px);
  width: auto;
  max-width: min(220px, 50vw);
  object-fit: contain;
}

.km-fullmenu__close {
  flex-shrink: 0;
  margin: 0;
  padding: 0.65rem 1.35rem;
  font-family: var(--md-font-body), "Roboto", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--km-ceo-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.km-fullmenu__close:hover,
.km-fullmenu__close:focus {
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 6px 28px rgba(14, 29, 66, 0.35);
  outline: none;
}

.km-fullmenu__stage {
  width: 100%;
  max-width: min(900px, 96vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

.km-fullmenu__card {
  position: relative;
  width: 100%;
  max-width: min(820px, 94vw);
  padding: clamp(1.75rem, 4vw, 3.25rem);
  background: var(--km-ceo-bg);
  border-radius: 40px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  container-type: inline-size;
  container-name: kmenu;
}

.km-fullmenu__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  padding: 0.95rem 1.5rem;
  font-family: var(--md-font-body), "Roboto", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff !important;
  background: transparent;
  border: 2px solid #fff;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow:
    0 0 0 1px rgba(14, 29, 66, 0.45),
    0 0 36px rgba(14, 29, 66, 0.65),
    0 0 72px rgba(14, 29, 66, 0.3);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.km-fullmenu__cta:hover,
.km-fullmenu__cta:focus {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(14, 29, 66, 0.6),
    0 0 48px rgba(14, 29, 66, 0.85),
    0 0 96px rgba(14, 29, 66, 0.4);
  outline: none;
}

@keyframes kmFullmenuNavIn {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.km-fullmenu__nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.km-fullmenu__nav a {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: clamp(0.75rem, 1.8vw, 1.05rem) 0;
  font-family: var(--md-font-body), "Roboto", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  /* Fallback when container queries unsupported */
  font-size: clamp(0.62rem, 2.15vw + 0.42rem, 1.28rem);
  opacity: 0;
  transform: scale(0.82);
  transform-origin: 50% 50%;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.km-fullmenu.is-open .km-fullmenu__nav a {
  animation: kmFullmenuNavIn 3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@supports (font-size: 1cqi) {
  .km-fullmenu__nav a {
    /* Scales with black card width so longest link fits on one line */
    font-size: clamp(0.62rem, 5.4cqi + 0.2rem, 1.28rem);
  }
}

.km-fullmenu__nav a:first-of-type {
  padding-top: 0;
}

.km-fullmenu__nav a:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.km-fullmenu__nav a:hover,
.km-fullmenu__nav a:focus {
  color: var(--color-blue-400) !important;
  padding-left: 0.35rem;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .km-fullmenu__cta,
  .km-fullmenu__close {
    transition: none;
  }

  .km-fullmenu__nav a {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .km-fullmenu.is-open .km-fullmenu__nav a {
    animation: none;
  }
}
