.mobile-nav {
  display: none;
}

.mobile-nav > summary {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  list-style: none;
}

.mobile-nav > summary::-webkit-details-marker {
  display: none;
}

.mobile-nav > summary::marker {
  content: "";
}

.mobile-nav > summary:focus-visible,
.mobile-nav-close:focus-visible,
.mobile-nav-overlay:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 3px;
}

.menu-icon {
  width: 20px;
  display: grid;
  gap: 4px;
}

.menu-icon span {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.mobile-nav[open] .menu-icon span:first-child {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav[open] .menu-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-nav[open] .menu-icon span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-panel {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 45px rgba(20, 33, 61, 0.18);
}

.mobile-nav-links {
  display: grid;
  gap: 2px;
}

.mobile-nav-panel a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a:focus-visible {
  color: var(--brand);
  background: var(--soft);
}

.mobile-nav-panel .mobile-nav-cta {
  justify-content: center;
  margin-top: 8px;
  color: white;
  background: var(--brand);
}

.mobile-nav-panel .mobile-nav-cta:hover,
.mobile-nav-panel .mobile-nav-cta:focus-visible {
  color: white;
  background: var(--brand-dark);
}

.mobile-nav-close,
.mobile-nav-overlay {
  display: none;
}

@media (max-width: 960px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .nav {
    gap: 8px;
  }

  .nav-links {
    display: none !important;
  }

  .actions {
    margin-left: auto;
  }

  .mobile-nav {
    display: block;
  }

  .mobile-nav > summary {
    position: fixed;
    top: 50%;
    left: 14px;
    z-index: 1002;
    width: 46px;
    height: 46px;
    color: white;
    background: rgba(15, 118, 110, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(16, 42, 67, 0.28);
    transform: translateY(-50%);
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  }

  .mobile-nav > summary:hover {
    background: var(--brand-dark);
    box-shadow: 0 10px 30px rgba(16, 42, 67, 0.34);
    transform: translateY(-50%) scale(1.06);
  }

  .mobile-nav[open]:not(.is-enhanced) > summary {
    top: 18px;
    left: min(calc(78vw - 58px), 264px);
    z-index: 1005;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .mobile-nav.is-enhanced[open] > summary {
    z-index: 1001;
  }

  .mobile-nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1004;
    width: min(78vw, 320px);
    height: 100vh;
    height: 100dvh;
    padding: 76px 18px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: white;
    background: #102a43;
    border: 0;
    border-radius: 0;
    box-shadow: 8px 0 34px rgba(10, 28, 45, 0.28);
    animation: mobile-drawer-in 280ms ease both;
  }

  .mobile-nav.is-closing .mobile-nav-panel {
    animation: mobile-drawer-out 240ms ease both;
  }

  .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1003;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(10, 28, 45, 0.52);
    cursor: default;
    animation: mobile-overlay-in 280ms ease both;
  }

  .mobile-nav.is-closing .mobile-nav-overlay {
    animation: mobile-overlay-out 240ms ease both;
  }

  .mobile-nav-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
  }

  .mobile-nav-close::before,
  .mobile-nav-close::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .mobile-nav-close::before {
    transform: rotate(45deg);
  }

  .mobile-nav-close::after {
    transform: rotate(-45deg);
  }

  .mobile-nav-links {
    gap: 6px;
  }

  .mobile-nav-panel a {
    min-height: 48px;
    padding: 12px 14px;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
  }

  .mobile-nav-panel a:hover,
  .mobile-nav-panel a:focus-visible {
    color: white;
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-panel .mobile-nav-cta {
    margin-top: 18px;
    color: white;
    background: var(--brand);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  .mobile-nav-panel .mobile-nav-cta:hover,
  .mobile-nav-panel .mobile-nav-cta:focus-visible {
    color: white;
    background: #0d9488;
  }
}

@media (max-width: 380px) {
  .logo > span:last-child {
    display: none;
  }

  .mobile-nav-panel {
    width: 76vw;
  }
}

@keyframes mobile-drawer-in {
  from { transform: translateX(-104%); }
  to { transform: translateX(0); }
}

@keyframes mobile-drawer-out {
  from { transform: translateX(0); }
  to { transform: translateX(-104%); }
}

@keyframes mobile-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mobile-overlay-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-icon span,
  .mobile-nav > summary {
    transition: none;
  }

  .mobile-nav-panel,
  .mobile-nav-overlay,
  .mobile-nav.is-closing .mobile-nav-panel,
  .mobile-nav.is-closing .mobile-nav-overlay {
    animation: none;
  }
}
