.header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  background: rgba(17, 17, 17, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  backdrop-filter: blur(12px);
}

.header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 10%;
}

.header .container[data-public-header="materials"] {
  padding-top: 24px;
  padding-bottom: 24px;
}

.header .logo {
  display: inline-flex;
  align-items: center;
  color: white;
  cursor: pointer;
  text-decoration: none;
}

.header .logo:hover {
  color: white;
}

.header .menu {
  display: flex;
  align-items: center;
  gap: 35px;
}

.header .container[data-public-header="materials"] .menu {
  gap: 30px;
}

.header .menu a {
  color: white;
  text-decoration: none;
  transition: color .3s ease, opacity .3s ease;
}

.header .menu a:hover,
.header .menu a.active {
  color: var(--accent);
}

.header .login-link {
  opacity: .75;
}

.header .login-link:hover {
  opacity: 1;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: white;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.menu-toggle:hover {
  background: rgba(140, 122, 79, .2);
  border-color: var(--accent);
}

.menu-toggle:focus-visible,
.header .logo:focus-visible,
.mobile-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.menu-toggle__icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .header .container {
    padding: 16px 5%;
  }

  .header .container[data-public-header="materials"] {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .header .menu {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100vw;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 5% 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: #111;
    box-shadow: 0 18px 35px rgba(0, 0, 0, .28);
  }

  .mobile-menu a {
    display: block;
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: var(--text-light, #f4f4f4);
    line-height: 1.35;
    text-decoration: none;
  }

  .mobile-menu a:last-child {
    border-bottom: 0;
  }

  .mobile-menu a:hover {
    color: var(--accent);
  }
}

@media (min-width: 769px) {
  .mobile-menu[hidden] {
    display: none;
  }
}
