/* ==========================================================================
   Navigation: sticky header, the services mega panel, and the mobile drawer.
   Squared corners and hairline steel rules throughout, same as every other
   surface in the design.
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--c-navy);
  border-bottom: 1px solid var(--c-steel);
}

.header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.header__brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.header__links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__item {
  display: flex;
  align-items: center;
}

.header__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-white);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  white-space: nowrap;
}

.header__cta {
  white-space: nowrap;
  flex: none;
}

.header__link:hover {
  color: var(--c-amber);
}

.header__trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.header__caret {
  transition: transform 140ms ease;
}

.header__trigger[aria-expanded='true'] {
  color: var(--c-amber);
  border-bottom-color: var(--c-amber);
}

.header__trigger[aria-expanded='true'] .header__caret {
  transform: rotate(180deg);
}

.header__phone {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-white);
  white-space: nowrap;
}

.header__phone:hover {
  color: var(--c-amber);
}

/* --- Mega panel ------------------------------------------------------------ */

/* Anchored to the header rather than the trigger: the panel is full-bleed, so
   its inner grid can line up with the page's 1180px column. */
.mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--c-ink);
  border-bottom: 1px solid var(--c-steel);
  box-shadow: 0 24px 48px color-mix(in srgb, var(--c-ink) 34%, transparent);
}

.mega[hidden] {
  display: none;
}

.mega__rule {
  height: var(--rule-thick);
  background: var(--c-amber);
}

.mega__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px var(--gutter) 0;
}

.mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: color-mix(in srgb, var(--c-steel) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-steel) 55%, transparent);
}

.mega__col {
  background: var(--c-ink);
  padding: 22px 22px 24px;
}

.mega__problem {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: var(--ls-card);
  color: var(--c-white);
}

.mega__problem:hover,
.mega__problem:focus-visible {
  color: var(--c-amber);
}

.mega__col-blurb {
  font-size: var(--fs-micro);
  line-height: 1.5;
  color: var(--c-slate);
  margin-top: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-steel);
}

.mega__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega__item {
  display: block;
  padding: 7px 10px;
  margin: 0 -10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-white);
  border-left: 2px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.mega__item:hover,
.mega__item:focus-visible {
  background: var(--c-navy);
  border-left-color: var(--c-amber);
  color: var(--c-amber);
}

.mega__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
}

.mega__foot-text {
  font-size: var(--fs-small);
  color: var(--c-slate);
}

.mega__foot-link {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-amber);
  border-bottom: 1px solid color-mix(in srgb, var(--c-amber) 45%, transparent);
}

.mega__foot-link:hover {
  color: var(--c-amber-hover);
  border-bottom-color: var(--c-amber-hover);
}

.mega__foot-all {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--c-white);
  border-left: 1px solid var(--c-steel);
  padding-left: 14px;
}

.mega__foot-all:hover {
  color: var(--c-amber);
}

.mega__foot-phone {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-white);
  margin-left: auto;
}

/* Dims the page behind an open panel. */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--c-ink) 42%, transparent);
}

.nav-scrim[hidden] {
  display: none;
}

/* --- Burger ---------------------------------------------------------------- */

.header__burger {
  display: none;
  background: none;
  border: 1px solid var(--c-steel);
  padding: 9px 10px;
  cursor: pointer;
  color: var(--c-white);
}

.header__burger-bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.header__burger-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 140ms ease, opacity 140ms ease;
}

.header__burger[aria-expanded='true'] {
  border-color: var(--c-amber);
  color: var(--c-amber);
}

.header__burger[aria-expanded='true'] .header__burger-bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.header__burger[aria-expanded='true'] .header__burger-bars span:nth-child(2) {
  opacity: 0;
}

.header__burger[aria-expanded='true'] .header__burger-bars span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* --- Mobile drawer --------------------------------------------------------- */

.mobile-nav {
  display: none;
}

.mobile-nav__label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-slate);
  padding: 20px var(--gutter) 6px;
}

.mobile-nav__problems {
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter) 14px;
  border-bottom: 1px solid var(--c-steel);
}

.mnav-problem {
  display: block;
  padding: 11px 0 11px 12px;
  border-left: 2px solid var(--c-steel);
}

.mnav-problem__label {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: var(--ls-card);
  color: var(--c-white);
}

.mnav-problem__note {
  display: block;
  font-size: var(--fs-micro);
  line-height: 1.45;
  color: var(--c-slate);
  margin-top: 2px;
}

.mnav-problem:active,
.mnav-problem:focus-visible {
  border-left-color: var(--c-amber);
}

.mobile-nav__links {
  list-style: none;
  margin: 0;
  padding: 14px var(--gutter) 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav__link {
  display: block;
  padding: 9px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-white);
}

.mobile-nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px var(--gutter) 26px;
}

.mobile-nav__phone {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--c-white);
}

/* --- Breakpoints ----------------------------------------------------------- */

/* Between the page max-width and the drawer handoff the header row is tight,
   so the gaps close up before anything is allowed to wrap. */
@media (max-width: 1180px) {
  .header__inner {
    gap: 20px;
  }

  .header__nav,
  .header__links {
    gap: 16px;
  }
}

/* Only where the full link row is still on screen does the tagline have to go;
   below the handoff the burger frees the space back up. */
@media (min-width: 981px) and (max-width: 1180px) {
  .header__brand .wordmark__tagline {
    display: none;
  }
}

/* Just above the drawer handoff the four links, phone, and CTA don't fit in
   one row. The phone goes first: the CTA is the primary action, and the
   number is one tap away on the /pricing and service page heads. */
@media (min-width: 981px) and (max-width: 1100px) {
  .header__phone {
    display: none;
  }
}

/* Below 980px the four mega columns no longer hold their line length, so the
   whole desktop nav hands off to the burger + drawer. */
@media (max-width: 980px) {
  .header__links,
  .header__phone,
  .header__cta {
    display: none;
  }

  .header__burger {
    display: block;
  }

  .mega {
    display: none;
  }

  .mobile-nav {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--c-ink);
    border-top: var(--rule-thick) solid var(--c-amber);
    border-bottom: 1px solid var(--c-steel);
  }

  .mobile-nav[hidden] {
    display: none;
  }
}

/* On a tablet the drawer has room for two problems per row. */
@media (min-width: 620px) and (max-width: 980px) {
  .mobile-nav__problems {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }
}

/* Clears the fixed call bar, which sits over the bottom of the drawer. */
@media (max-width: 760px) {
  .mobile-nav__actions {
    padding-bottom: calc(26px + var(--callbar-h));
  }
}

/* While the drawer is open the page behind it shouldn't scroll. */
body.nav-open {
  overflow: hidden;
}

/* No-JS fallback: the panel and drawer never open, so drop the caret and the
   burger and let the top-level links wrap instead. "Services" is a plain link
   to the services index, which lists everything the panel would have. */
.no-js .header__caret,
.no-js .header__burger {
  display: none;
}

@media (max-width: 980px) {
  .no-js .header__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  .no-js .header__inner {
    flex-wrap: wrap;
    gap: 14px;
  }
}
