/* Logo keeps its shape at every width */
.wm-marketing header > a:first-child {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}

.header-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: none;
}

/* Hamburger and backdrop only exist on phones */
.nav-toggle,
.nav-backdrop {
  display: none;
}

@media (max-width: 720px) {
  .wm-marketing header {
    height: 64px;
    padding: 0 20px;
  }

  .header-logo {
    height: 36px;
  }

  .nav-ready .nav-toggle {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid #1f2d52;
    border-radius: 6px;
    cursor: pointer;
  }

  .nav-toggle:focus-visible {
    outline: 2px solid #1e90ff;
    outline-offset: 2px;
  }

  .nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* The flyout panel */
  .nav-ready .nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2;
    width: min(300px, 82vw);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 88px 24px 32px;
    background: #050b1a;
    border-left: 1px solid #1f2d52;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-open .nav {
    transform: none;
    visibility: visible;
    transition: transform 0.3s ease;
  }

  .nav-ready .nav a {
    margin: 0;
    padding: 14px 0;
    font-size: 18px;
    opacity: 1;
    border-bottom: 1px solid #1f2d52;
  }

  .nav-ready .nav a:last-child {
    margin-top: 24px;
    padding: 14px 20px;
    text-align: center;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e90ff, #007bff);
  }

  /* Dims the page behind the open menu */
  .nav-ready .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    background: rgba(5, 11, 26, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
  }

  body.nav-locked {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-backdrop,
  .nav-toggle-bar {
    transition: none !important;
  }
}