/* =============================================================================
   SITE HEADER + MOBILE MENU (Editorial Split)
   =============================================================================
   Vanilla, framework-free replacement for the original Webflow header. Drives
   the desktop nav (with Services dropdown) and the mobile editorial-split menu.
   Pairs with /js/menu.js. Tokens come from /css/outboundpilot.css.
   ========================================================================== */

:root {
  --menu-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --menu-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --menu-ease-snap: cubic-bezier(0.65, 0, 0.35, 1);
  --menu-bp-mobile: 991px;
}

/* -----------------------------------------------------------------------------
   HEADER SHELL
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 50;
  background: #fff;
  font-family: Inter, system-ui, sans-serif;
}

.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 180px;
  transition: transform 320ms var(--menu-ease);
  position: relative;
  z-index: 2;
}
.site-header__logo:hover {
  transform: scale3d(0.98, 0.98, 1);
}
.site-header__logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* -----------------------------------------------------------------------------
   DESKTOP NAV
   -------------------------------------------------------------------------- */

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 36px;
}
.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--neutrals--neutral-800, #12151e);
  text-decoration: none;
  transition: color 220ms ease;
  position: relative;
}
.site-nav__link:hover {
  color: var(--primary, #244060);
}
.site-nav__link.is-active {
  color: var(--primary, #244060);
}
.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary, #244060);
}

/* Dropdown */
.site-nav__dropdown {
  position: relative;
}
.site-nav__chev {
  width: 14px;
  height: 14px;
  transition: transform 240ms var(--menu-ease);
  color: currentColor;
}
.site-nav__dropdown.is-open .site-nav__chev {
  transform: rotate(180deg);
}

.site-nav__menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  min-width: 240px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 12px 40px -12px rgba(18, 21, 30, 0.18),
    0 0 0 1px rgba(36, 64, 96, 0.06);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px) scale(0.98);
  transform-origin: top center;
  transition:
    opacity 220ms ease,
    transform 280ms var(--menu-ease);
}
.site-nav__dropdown.is-open .site-nav__menu {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
.site-nav__menu::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 12px;
}
.site-nav__menu a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutrals--neutral-800, #12151e);
  text-decoration: none;
  border-radius: 8px;
  transition:
    background 200ms ease,
    color 200ms ease,
    padding-left 200ms ease;
}
.site-nav__menu a:hover {
  background: rgba(36, 64, 96, 0.06);
  color: var(--primary, #244060);
  padding-left: 18px;
}
.site-nav__menu a.is-active {
  color: var(--primary, #244060);
  background: rgba(36, 64, 96, 0.06);
}

/* -----------------------------------------------------------------------------
   HEADER CTA (desktop)
   -------------------------------------------------------------------------- */

/* The header CTA also carries the .primary-button class in the HTML, so
   shape, padding, font, line-height, box-shadow and hover transform all come
   from outboundpilot.css. Here we only add the header-layout role so the
   button doesn't shrink in the flex row. */
.site-header__cta {
  flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   HEADER ENTRANCE ANIMATION
   --------------------------------------------------------------------------
   Plays once on page load. Animates logo + each nav item + CTA with a small
   stagger. Note: we deliberately animate the inner elements rather than the
   <header> itself, because <header> contains a position:fixed burger; a
   transform on the ancestor would break its viewport-relative positioning.
   -------------------------------------------------------------------------- */

@keyframes site-header-fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header__logo,
.site-nav__list > li,
.site-header__cta,
.site-header__burger {
  animation: site-header-fade-in 600ms var(--menu-ease) backwards;
}
/* All delays carry a 200ms warmup so the page settles before the header
   starts orchestrating in. Matches the equivalent warmup in /js/reveal.js. */
.site-header__logo {
  animation-delay: 260ms;
}
.site-nav__list > li:nth-child(1) {
  animation-delay: 340ms;
}
.site-nav__list > li:nth-child(2) {
  animation-delay: 400ms;
}
.site-nav__list > li:nth-child(3) {
  animation-delay: 460ms;
}
.site-header__cta {
  animation-delay: 520ms;
}
.site-header__burger {
  animation-delay: 340ms;
}

@media (prefers-reduced-motion: reduce) {
  .site-header__logo,
  .site-nav__list > li,
  .site-header__cta,
  .site-header__burger {
    animation: none;
  }
}

/* -----------------------------------------------------------------------------
   HAMBURGER (mobile only)
   -------------------------------------------------------------------------- */

.site-header__burger {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.site-header__burger span {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 1.5px;
  background: var(--neutrals--neutral-800, #12151e);
  border-radius: 2px;
  transform: translateX(-50%);
  transition:
    transform 420ms var(--menu-ease-snap),
    opacity 220ms ease,
    background 280ms ease,
    width 280ms var(--menu-ease);
}
.site-header__burger span:nth-child(1) {
  top: 14px;
}
.site-header__burger span:nth-child(2) {
  top: 21px;
  width: 16px;
}
.site-header__burger span:nth-child(3) {
  top: 28px;
}
.site-header__burger:hover span:nth-child(2) {
  width: 22px;
}

/* -----------------------------------------------------------------------------
   MOBILE MENU SHELL — Editorial Split
   -------------------------------------------------------------------------- */

.mobile-menu {
  display: none;
}

@media (max-width: 991px) {
  /* Hide desktop nav + CTA, show hamburger */
  .site-nav,
  .site-header__cta {
    display: none;
  }
  .site-header__burger {
    display: block;
    margin-left: auto;
    position: fixed;
    top: 22px;
    right: 18px;
    z-index: 200;
  }

  /* Body lock when menu is open */
  body.is-menu-open {
    overflow: hidden;
  }

  /* Hide the hamburger when the menu is open — the explicit close button
     in the menu hero takes over so the affordance is unmistakable. */
  body.is-menu-open .site-header__burger {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  /* Explicit, always-visible close button inside the menu hero */
  .mobile-menu__close {
    position: absolute;
    top: 18px;
    right: 14px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: scale(0.8) rotate(-45deg);
    transition:
      opacity 240ms ease,
      transform 320ms var(--menu-ease),
      background 200ms ease,
      border-color 200ms ease;
    z-index: 10;
  }
  .mobile-menu__close svg {
    width: 22px;
    height: 22px;
    display: block;
  }
  .mobile-menu__close:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.42);
  }
  .mobile-menu__close:active {
    transform: scale(0.95) rotate(0);
  }
  body.is-menu-open .mobile-menu__close {
    opacity: 1;
    transform: scale(1) rotate(0);
    transition-delay: 220ms;
  }

  /* Mobile menu container.
     Visibility is delayed on close so the inner exit animations have time
     to run; on open we override the delay to 0 so it shows immediately. */
  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 100;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 900ms;
  }
  body.is-menu-open .mobile-menu,
  body.is-menu-closing .mobile-menu {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  body.is-menu-closing .mobile-menu {
    pointer-events: none;
  }

  /* HERO — top section, primary blue */
  .mobile-menu__hero {
    flex-shrink: 0;
    background: var(--primary, #244060);
    background-image: radial-gradient(
      ellipse at 80% 20%,
      var(--neutrals--neutral-700, #2e5070) 0%,
      var(--primary, #244060) 70%
    );
    color: #fff;
    padding: 92px 28px 40px;
    position: relative;
    transform: translateY(-100%);
    opacity: 0;
    transition:
      transform 520ms var(--menu-ease),
      opacity 380ms ease;
  }
  body.is-menu-open .mobile-menu__hero {
    transform: translateY(0);
    opacity: 1;
  }
  /* Note on delays: base-rule transitions never carry delays, so close runs
     immediately. Open delays are scoped under body.is-menu-open instead. */
  .mobile-menu__brand {
    position: absolute;
    top: 28px;
    left: 28px;
    font-family: Archivo, system-ui, sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateX(-8px);
    transition:
      opacity 280ms ease,
      transform 360ms var(--menu-ease);
  }
  body.is-menu-open .mobile-menu__brand {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 220ms;
  }

  .mobile-menu__eyebrow {
    font-family: Archivo, system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 500;
    color: rgba(210, 223, 233, 0.85);
    margin: 0 0 14px;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 320ms ease,
      transform 420ms var(--menu-ease);
  }
  body.is-menu-open .mobile-menu__eyebrow {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 280ms;
  }

  .mobile-menu__quote {
    font-family: Archivo, system-ui, sans-serif;
    font-size: clamp(26px, 7vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.02em;
    font-weight: 600;
    color: #fff;
    margin: 0;
    max-width: 24ch;
    opacity: 0;
    transform: translateY(12px);
    transition:
      opacity 380ms ease,
      transform 480ms var(--menu-ease);
  }
  body.is-menu-open .mobile-menu__quote {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 340ms;
  }

  /* NAV — bottom section, cream */
  .mobile-menu__nav {
    flex: 1;
    background: var(--secondary, #f7f4ef);
    padding: 32px 28px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateY(100%);
    opacity: 0;
    transition:
      transform 520ms var(--menu-ease),
      opacity 380ms ease;
  }
  body.is-menu-open .mobile-menu__nav {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 80ms;
  }

  .mobile-menu__label {
    font-family: Archivo, system-ui, sans-serif;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--neutrals--neutral-500, #9aa0ad);
    font-weight: 600;
    margin: 8px 0 0;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity 320ms ease,
      transform 360ms var(--menu-ease);
  }
  body.is-menu-open .mobile-menu__label {
    opacity: 1;
    transform: translateY(0);
  }
  body.is-menu-open .mobile-menu__label:nth-of-type(1) {
    transition-delay: 220ms;
  }
  body.is-menu-open .mobile-menu__label:nth-of-type(2) {
    transition-delay: 380ms;
  }

  .mobile-menu__list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  .mobile-menu__list li {
    margin: 0;
    padding: 0;
    border-top: 1px dashed rgba(36, 64, 96, 0.22);
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 360ms ease,
      transform 460ms var(--menu-ease);
  }
  .mobile-menu__list li:first-child {
    border-top: 0;
  }
  body.is-menu-open .mobile-menu__list li {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger: Browse list (Home, Pricing) */
  body.is-menu-open .mobile-menu__list:not(.mobile-menu__list--sub) li:nth-child(1) {
    transition-delay: 280ms;
  }
  body.is-menu-open .mobile-menu__list:not(.mobile-menu__list--sub) li:nth-child(2) {
    transition-delay: 340ms;
  }
  /* Stagger: Services list (3 items) */
  body.is-menu-open .mobile-menu__list--sub li:nth-child(1) {
    transition-delay: 440ms;
  }
  body.is-menu-open .mobile-menu__list--sub li:nth-child(2) {
    transition-delay: 500ms;
  }
  body.is-menu-open .mobile-menu__list--sub li:nth-child(3) {
    transition-delay: 560ms;
  }

  .mobile-menu__list a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 0;
    margin: 0;
    font-family: Archivo, system-ui, sans-serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--primary, #244060);
    text-decoration: none;
    transition:
      padding-left 280ms var(--menu-ease),
      color 200ms ease;
  }
  .mobile-menu__list a::after {
    content: "→";
    font-size: 16px;
    opacity: 0;
    transform: translateX(-6px);
    color: var(--primary, #244060);
    transition:
      opacity 240ms ease,
      transform 280ms var(--menu-ease);
  }
  .mobile-menu__list a:hover,
  .mobile-menu__list a:focus-visible {
    padding-left: 8px;
    color: var(--neutrals--neutral-800, #12151e);
  }
  .mobile-menu__list a:hover::after,
  .mobile-menu__list a:focus-visible::after {
    opacity: 1;
    transform: translateX(0);
  }
  .mobile-menu__list a.is-active {
    color: var(--neutrals--neutral-800, #12151e);
  }
  .mobile-menu__list a.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary, #244060);
  }

  .mobile-menu__list--sub a {
    font-size: 16px;
    font-weight: 500;
    color: var(--neutrals--neutral-700, #2e5070);
  }
  .mobile-menu__list--sub a:hover,
  .mobile-menu__list--sub a:focus-visible {
    color: var(--primary, #244060);
  }

  /* The mobile menu CTA also carries the .primary-button class in the HTML
     (shape, padding, font, hover scale, box-shadow inherited from there).
     Here we only handle layout placement inside the menu and the open/close
     reveal animation. width:auto overrides .primary-button's mobile-only
     width:100% so the button stays intrinsic-width inside the menu. */
  .mobile-menu__cta {
    margin-top: auto;
    align-self: flex-start;
    width: auto;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition:
      opacity 320ms ease,
      transform 420ms var(--menu-ease-bounce);
  }
  body.is-menu-open .mobile-menu__cta {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 560ms;
  }

  /* ---------------------------------------------------------------------------
     CLOSE — reverse stagger
     ---------------------------------------------------------------------------
     The body class is-menu-closing is added by JS for ~900ms while the menu
     winds back down. The delays below mirror the open delays so the LAST
     elements to enter (CTA, sub-list items) are the FIRST to leave, and the
     hero/nav slide back out last. After the timeout the class is removed and
     all delays revert to 0.
     ----------------------------------------------------------------------- */
  body.is-menu-closing .mobile-menu__close,
  body.is-menu-closing .mobile-menu__cta,
  body.is-menu-closing .mobile-menu__list--sub li:nth-child(3) {
    transition-delay: 0ms;
  }
  body.is-menu-closing .mobile-menu__list--sub li:nth-child(2) {
    transition-delay: 60ms;
  }
  body.is-menu-closing .mobile-menu__list--sub li:nth-child(1),
  body.is-menu-closing .mobile-menu__list:not(.mobile-menu__list--sub) li:nth-child(2) {
    transition-delay: 120ms;
  }
  body.is-menu-closing .mobile-menu__list:not(.mobile-menu__list--sub) li:nth-child(1),
  body.is-menu-closing .mobile-menu__label:nth-of-type(2) {
    transition-delay: 180ms;
  }
  body.is-menu-closing .mobile-menu__quote {
    transition-delay: 220ms;
  }
  body.is-menu-closing .mobile-menu__label:nth-of-type(1),
  body.is-menu-closing .mobile-menu__eyebrow {
    transition-delay: 260ms;
  }
  body.is-menu-closing .mobile-menu__brand {
    transition-delay: 300ms;
  }
  body.is-menu-closing .mobile-menu__nav {
    transition-delay: 320ms;
  }
  body.is-menu-closing .mobile-menu__hero {
    transition-delay: 380ms;
  }
}

/* Phone-specific tightening */
@media (max-width: 480px) {
  .mobile-menu__hero {
    padding: 88px 24px 36px;
  }
  .mobile-menu__nav {
    padding: 28px 24px 32px;
  }
  .mobile-menu__list a {
    font-size: 18px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-header__burger span,
  .mobile-menu__hero,
  .mobile-menu__nav,
  .mobile-menu__brand,
  .mobile-menu__eyebrow,
  .mobile-menu__quote,
  .mobile-menu__label,
  .mobile-menu__list li,
  .mobile-menu__cta,
  .site-nav__menu {
    transform: none !important;
    transition-duration: 180ms !important;
    transition-delay: 0ms !important;
  }
}
