/*
 * Header navigation — a proper mega menu.
 *
 * The earlier version was a full-bleed panel with a plain link list, which read
 * as unmanaged: it hit the viewport edges, had no visual container, no active
 * state and no keyboard affordances. This rebuild gives it a bounded card,
 * a scrim, column headers, per-link hover states and visible focus rings.
 *
 * Load order matters: this comes after site.css, so the rules below win on
 * equal specificity.
 */

/* ---- nav list ------------------------------------------------------------ */

.mk-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-nav__item {
  /* The panel is positioned against the header, not this li — that is what
     lets one item open a panel spanning the whole nav. */
  position: static;
}

.mk-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.mk-nav__link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.mk-nav__link:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

.mk-nav__link[aria-current='page'] {
  color: var(--brand-700);
  font-weight: 600;
}

/* The underline marks the open item, not the current page — two different
   states and they should not look alike. */
.mk-nav__item.is-open > .mk-nav__link {
  color: var(--brand-700);
  font-weight: 600;
  background: var(--surface-2);
}

.mk-nav__item.is-open > .mk-nav__link::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-600);
}

.mk-nav__caret {
  opacity: .45;
  transition: transform .18s ease;
}

.mk-nav__item.is-open .mk-nav__caret {
  opacity: 1;
  transform: rotate(180deg);
}

/* ---- scrim --------------------------------------------------------------- */

/*
 * Dims the page behind an open panel so the menu reads as a layer above the
 * content rather than as part of the header.
 */
.mk-scrim {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 50;
  background: rgba(14, 23, 38, .28);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.mk-scrim.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---- panel shell --------------------------------------------------------- */

.mk-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 60;
  display: none;
  padding: 0;
  background: transparent;
}

.mk-panel.is-open {
  display: block;
  animation: mk-panel-in .18s ease both;
}

@keyframes mk-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The visible card. Full-bleed so it lines up with the header edges, but the
   content inside is held to the same max width as the page. */
.mk-panel__inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 24px 48px -24px rgba(14, 23, 38, .28), 0 2px 8px -4px rgba(14, 23, 38, .12);
}

.mk-panel__body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 24px;
}

.mk-panel__foot {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 14px 32px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}

.mk-panel__foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  text-decoration: none;
}

.mk-panel__foot a::after {
  content: '→';
  transition: transform .15s ease;
}

.mk-panel__foot a:hover::after {
  transform: translateX(3px);
}

/* ---- mega grid ----------------------------------------------------------- */

.mk-mega {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 28px;
}

.mk-mega__col {
  min-width: 0;
  padding-bottom: 6px;
}

.mk-mega__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-sm);
}

.mk-mega__head:hover {
  color: var(--brand-700);
}

.mk-mega__head span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-2);
}

.mk-mega__col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-mega__col li a {
  display: block;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}

.mk-mega__col li a:hover {
  background: var(--surface-2);
  color: var(--brand-700);
}

.mk-mega__col li a:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
}

.mk-mega__col li em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

/* ---- plain dropdown ------------------------------------------------------ */

.mk-drop {
  max-width: 620px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.mk-drop a {
  display: block;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}

.mk-drop a:hover {
  background: var(--surface-2);
  color: var(--brand-700);
}

.mk-drop a:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: -2px;
}

/* ---- page furniture ------------------------------------------------------ */

.mk-narrow {
  max-width: 760px;
}

.mk-quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.mk-grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.mk-panelcard {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.mk-panelcard h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.mk-panelcard p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---- role cards (hire-talent) -------------------------------------------- */

.mk-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.mk-role {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* Anchors in the nav link to #role-id; without this the target hides under
     the sticky header. */
  scroll-margin-top: 90px;
}

.mk-role__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mk-role__head h3 {
  font-size: 18px;
  margin: 0 0 4px;
}

.mk-role__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-2);
}

.mk-role__head .mk-price {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

.mk-role > p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.mk-role h4 {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 4px 0 0;
}

.mk-role__links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.mk-role__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}

.mk-role__links a:hover {
  color: var(--brand-700);
}

.mk-role__links em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  white-space: nowrap;
}

.mk-role__actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.mk-steps--wide {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  display: grid;
}

/* ---- get started menu ---------------------------------------------------- */

/*
 * "Get started" is the one header action that is a menu rather than a link:
 * creating an account and talking to an engineer are different next steps,
 * and picking one in the header saves a bounce through a page that offers both.
 */
.mk-getstarted {
  position: relative;
}

.mk-getstarted__btn { gap: 5px; }

.mk-getstarted__btn .mk-nav__caret { transition: transform .16s ease; }
.mk-getstarted.is-open .mk-getstarted__btn .mk-nav__caret { transform: rotate(180deg); }

.mk-getstarted__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  display: none;
  width: 320px;
  padding: 6px;
  background: var(--surface-1, #fff);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 12px);
  box-shadow: 0 18px 40px rgba(14, 23, 38, .16);
}

.mk-getstarted.is-open .mk-getstarted__menu { display: block; }

.mk-getstarted__opt {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.mk-getstarted__opt:hover,
.mk-getstarted__opt:focus-visible {
  background: var(--surface-2);
}

.mk-getstarted__opt strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink, #0e1726);
}

.mk-getstarted__opt span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---- narrow screens ------------------------------------------------------ */

@media (max-width: 1100px) {
  .mk-mega {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  /* Below this the header collapses into the drawer, which already lists
     every nav item — so the panels and scrim are removed rather than left
     half-usable. */
  .mk-panel,
  .mk-scrim,
  .mk-getstarted {
    display: none !important;
  }
}