.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
}

@media (max-width: 860px) {
  .nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    min-height: 82px;
  }

  .nav .brand {
    min-width: 0;
    gap: 10px;
    font-size: clamp(1rem, 5.8vw, 1.55rem);
    line-height: 1;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .nav .brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
  }

  .nav-toggle-label {
    display: grid !important;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    margin-left: auto;
    border: 1px solid rgba(236, 230, 216, 0.22);
    background: rgba(236, 230, 216, 0.055);
    cursor: pointer;
  }

  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block;
    width: 20px;
    height: 2px;
    content: "";
    background: #ece6d8;
  }

  .nav-toggle-label span {
    position: relative;
  }

  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    position: absolute;
    left: 0;
    transform: none !important;
  }

  .nav-toggle-label span::before {
    top: -7px;
  }

  .nav-toggle-label span::after {
    top: 7px;
  }

  .nav .links,
  .nav .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 32px));
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid rgba(236, 230, 216, 0.16);
    background: rgba(15, 14, 12, 0.94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
  }

  header.nav .links {
    right: max(16px, calc((100vw - var(--max, 1180px)) / 2));
  }

  .nav .links a,
  .nav .nav-links a {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(236, 230, 216, 0.08);
    color: #d8d0c1;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.04em;
    white-space: normal;
  }

  .nav .links a:last-child,
  .nav .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-toggle:checked ~ .links,
  .nav-toggle:checked ~ .nav-links {
    display: flex !important;
  }
}

@media (max-width: 460px) {
  .nav {
    min-height: 76px;
  }

  .nav .brand {
    font-size: clamp(0.95rem, 6vw, 1.25rem);
    letter-spacing: 0.1em;
  }

  .nav .brand-logo {
    width: 42px;
    height: 42px;
  }

  .nav-toggle-label {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}
