.nav-toggle:focus-visible,
.nav a.nav-link:focus-visible,
.nav .lang-switch__current:focus-visible,
.nav .lang-switch__option:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

@media (max-width: 72rem) {
  .header-inner {
    min-height: 3.5rem;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding-block: 0.35rem;
  }

  .header-inner .nav {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 0.2rem;
    overflow: visible;
  }

  .header-inner.nav-ready {
    flex-wrap: nowrap;
  }

  .nav-ready .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding-inline: 0.8rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid rgba(139, 149, 165, .18);
    border-radius: 0.65rem;
  }

  .nav-ready .nav-toggle[aria-expanded="true"] {
    background: var(--surface-2);
    border-color: rgba(61, 255, 168, .3);
  }

  .nav-ready .nav {
    display: none;
  }

  .nav-ready .nav.open {
    display: flex;
    position: absolute;
    z-index: 1;
    inset: 100% 0 auto;
    width: auto;
    max-height: calc(100vh - 4.5rem);
    max-height: calc(100dvh - 4.5rem - env(safe-area-inset-top));
    flex-flow: column nowrap;
    align-items: stretch;
    gap: 0.125rem;
    margin: 0;
    padding: 0.45rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    background: var(--surface);
    border: 1px solid rgba(139, 149, 165, .18);
    border-radius: 0 0 0.85rem 0.85rem;
    box-shadow: 0 10px 24px #0005;
  }

  .nav-ready .nav.open::-webkit-scrollbar {
    display: block;
    width: 0.35rem;
  }

  .nav-ready .nav a.nav-link,
  .nav-ready .nav .lang-switch__current {
    justify-content: flex-start;
    min-height: 44px;
    padding: 0.5rem 0.8rem;
    font-size: 1rem;
    line-height: 1.35;
    white-space: normal;
  }

  .nav-ready .nav .lang-switch {
    position: relative;
    margin: 0.25rem 0 0;
    border-top: 1px solid rgba(139, 149, 165, .18);
    padding-top: 0.35rem;
  }

  .nav-ready .nav .lang-switch__current {
    width: 100%;
    justify-content: space-between;
    border-color: transparent;
  }

  .nav-ready .nav .lang-switch__menu {
    position: static;
    min-width: 0;
    margin: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav a.nav-link,
  .nav .lang-switch__current,
  .nav .lang-switch__chevron,
  .nav .lang-switch__option {
    transition: none;
  }

  .nav .lang-switch__menu {
    animation: none;
  }
}
