@charset "utf-8";

#header {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  color: var(--header-text);
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
  backdrop-filter: blur(12px);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#header.scrolled {
  background: var(--header-bg-scrolled);
}

.nav-container {
  width: min(1180px, calc(100% - 40px));
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 10px 13px;
  color: var(--header-text);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--header-text);
  background: var(--header-hover);
}

.nav-link:hover {
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(24, 52, 95, 0.28);
  border-radius: 10px;
  cursor: pointer;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--header-text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  z-index: 990;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  background: rgba(24, 52, 95, 0.34);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.menu-overlay.active {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 960px) {
  .nav-container {
    justify-content: flex-start;
  }

  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    z-index: 1001;
    top: 70px;
    right: 0;
    width: min(340px, 88vw);
    height: calc(100vh - 70px);
    display: block;
    padding: 18px;
    overflow-y: auto;
    background: var(--header-bg-scrolled);
    box-shadow: -14px 0 30px rgba(0, 0, 0, 0.18);
    transform: translateX(105%);
    transition: transform 0.24s ease;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-item + .nav-item {
    margin-top: 6px;
  }

  .nav-link {
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 0.96rem;
  }
}

@media (max-width: 640px) {
  .nav-container {
    width: calc(100% - 24px);
    height: 64px;
  }

  .nav-menu {
    top: 64px;
    height: calc(100vh - 64px);
  }
}
