header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(14, 12, 28, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.header-content {
  width: 100%;
  max-width: var(--page-max);
  min-height: var(--header-height);
  margin: 0 auto;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-link img {
  width: auto;
  height: 58px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(66, 232, 255, 0.28));
}

.brand-name {
  min-width: 0;
  color: var(--ink);
  font-family: "Press Start 2P", cursive;
  font-size: clamp(12px, 1.35vw, 17px);
  line-height: 1.25;
  text-shadow: 2px 2px 0 var(--pink), 4px 4px 0 var(--shadow);
  white-space: nowrap;
}

.brand-name::first-letter {
  color: var(--yellow);
}

.header-content > nav {
  display: flex;
  align-items: center;
}

.header-content > nav > ul {
  display: flex;
  align-items: center;
  list-style: none;
}

.header-content > nav > ul > li {
  position: relative;
  margin: 0 6px;
}

nav ul li a,
.dropdown-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease-in-out, background 0.3s ease-in-out;
  cursor: pointer;
}

nav ul li a:hover,
nav ul li a[aria-current="page"],
.dropdown-toggle:hover,
.nav-dropdown.open .dropdown-toggle {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-toggle::after {
  transform: translateY(1px) rotate(225deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 2200;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 15, 31, 0.96);
  box-shadow: 8px 8px 0 var(--shadow), 0 24px 60px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  display: none;
  list-style: none;
  text-align: left;
  transform: translateX(-50%);
}

.dropdown-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
}

.nav-dropdown.open .dropdown-menu,
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan), var(--green));
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu li + li {
  margin-top: 4px;
}

.dropdown-menu a,
.dropdown-menu span {
  width: 100%;
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.dropdown-menu span {
  color: var(--muted);
  opacity: 0.72;
  cursor: default;
}

.burger-menu {
  z-index: 2300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(66, 232, 255, 0.42);
  border-radius: 8px;
  background: rgba(8, 7, 20, 0.34);
  box-shadow: 0 0 18px rgba(66, 232, 255, 0.14);
  cursor: pointer;
}

.burger-menu div {
  width: 30px;
  height: 4px;
  margin: 4px 0;
  background: var(--ink);
  box-shadow: 0 0 10px rgba(66, 232, 255, 0.35);
  transition: 0.4s;
}

.burger-menu.open div:nth-child(1) {
  transform: translateY(12px) rotate(45deg);
}

.burger-menu.open div:nth-child(2) {
  opacity: 0;
}

.burger-menu.open div:nth-child(3) {
  transform: translateY(-12px) rotate(-45deg);
}

@media (max-width: 1200px) {
  .header-content {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  .brand-link img {
    height: 44px;
  }

  .brand-name {
    font-size: 12px;
    max-width: 132px;
    white-space: normal;
  }

  .burger-menu {
    display: flex;
    position: fixed;
    top: calc((var(--header-height) - 46px) / 2);
    right: var(--page-gutter);
  }

  .header-content > nav > ul {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 2200;
    width: 100%;
    max-height: calc(100svh - var(--header-height));
    padding: 14px var(--page-gutter) 22px;
    display: none;
    flex-direction: column;
    background: rgba(18, 15, 31, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
    overflow-y: auto;
    text-align: center;
    transition: 0.4s ease-in-out;
    backdrop-filter: blur(16px);
  }

  .header-content > nav > ul.active {
    display: flex;
  }

  .header-content > nav > ul > li {
    padding: 4px 0;
    margin: 0;
    width: 100%;
  }

  nav ul li a,
  .dropdown-toggle {
    width: min(100%, 340px);
    min-height: 48px;
    padding: 12px 14px;
    font-size: 17px;
  }

  .dropdown-menu {
    position: static;
    width: min(100%, 340px);
    margin: 12px auto 0;
    transform: none;
    text-align: center;
    box-shadow: 6px 6px 0 var(--shadow), 0 18px 48px rgba(0, 0, 0, 0.24);
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 68px;
  }

  .header-content {
    padding-left: 20px;
    padding-right: 20px;
    gap: 12px;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-link img {
    height: 40px;
  }

  .brand-name {
    max-width: 116px;
    font-size: 10px;
  }

  .burger-menu {
    right: 20px;
  }
}
