.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);
  transition: background-color .24s ease, border-color .24s ease, box-shadow .24s ease, backdrop-filter .24s ease;
}

.header.is-scrolled {
  background-color: rgba(23, 23, 23, .84);
  border-bottom-color: rgba(245, 242, 236, .16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header .container {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px clamp(24px, 5vw, 72px);
}

.header .logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 220px;
  width: 220px;
  height: 56px;
  min-width: 220px;
  overflow: hidden;
  color: white;
  cursor: pointer;
  text-decoration: none;
}

.header .brand-logo {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: cover;
  object-position: center;
}

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

.header .menu {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 1.9vw, 28px);
}

.header .menu a {
  flex: 0 0 auto;
  color: white;
  font-size: clamp(.82rem, 1vw, .96rem);
  white-space: nowrap;
  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(55, 58, 60, .2);
  border-color: var(--accent);
}

.menu-toggle:focus-visible,
.header .logo:focus-visible,
.header .menu a: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: 1100px) {
  .header .container {
    padding: 22px clamp(24px, 5vw, 72px);
  }

  .header .logo {
    flex-basis: 220px;
  }

  .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(100svh - 100px);
    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,
  .mobile-menu a.active {
    color: var(--accent);
  }
}

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

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

  .header .logo {
    flex-basis: 170px;
    width: 170px;
    min-width: 0;
    height: 48px;
  }

  .header .brand-logo { height: 48px; }

  .mobile-menu:not([hidden]) {
    max-height: calc(100svh - 80px);
  }
}
