nav {
  position: fixed;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 5%;
  height: 76px;
  width: 100%;
  background: rgba(22, 22, 30, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

nav.hidden {
  opacity: 0;
  pointer-events: none;
}

body.mobile-menu-open {
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img, .logo svg { flex-shrink: 0; height: 36px; width: auto; }

.logo-name {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 400;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.nav-links a[aria-current="page"] {
  color: #ffffff;
  font-weight: 500;
}

.nav-cta {
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  background: var(--accent);
  padding: 0.5rem 1.15rem;
  border-radius: 6px;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars::before {
  transform: translateY(-6px);
}

.nav-toggle-bars::after {
  transform: translateY(4px);
}

nav.mobile-open .nav-toggle-bars {
  transform: rotate(45deg);
}

nav.mobile-open .nav-toggle-bars::before {
  transform: translateY(0);
  opacity: 0;
}

nav.mobile-open .nav-toggle-bars::after {
  transform: translateY(-2px) rotate(-90deg);
}

@media (max-width: 1024px) {
  nav {
    padding-left: 4%;
    padding-right: 4%;
  }

  .nav-links {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 860px) {
  nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-right: calc(4% + 46px);
    height: 72px;
    overflow: visible;
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: calc(72px + 1.4rem) 1.1rem 1.4rem;
    gap: 0.52rem;
    flex-direction: column;
    justify-content: flex-start;
    background: linear-gradient(165deg, rgba(10, 14, 23, 0.94) 0%, rgba(7, 10, 18, 0.9) 100%);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.28s ease;
    z-index: 120;
  }

  .nav-links::before {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(77, 147, 240, 0.9), rgba(34, 114, 224, 0.7));
    margin: 0.15rem auto 0.9rem;
  }

  .nav-links li {
    list-style: none;
    width: min(560px, 100%);
    margin: 0 auto;
  }

  nav.mobile-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.08rem;
    border-radius: 14px;
    font-size: 1.14rem;
    font-weight: 600;
    color: #f7fbff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
    background: #243047;
    border: 1px solid #3a4f75;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  }

  .nav-links a:hover {
    color: #ffffff;
    background: #31436a;
    border-color: #7fa2e6;
    transform: translateX(3px);
  }

  .nav-links a[aria-current="page"] {
    color: #ffffff;
    background: linear-gradient(135deg, #3f78d6, #2a5fb8);
    border-color: #87adf3;
    box-shadow: 0 10px 24px rgba(34, 114, 224, 0.24);
  }

  .nav-toggle {
    display: inline-flex;
    position: absolute;
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 130;
  }

  nav.mobile-open .nav-toggle {
    background: rgba(77, 147, 240, 0.16);
    border-color: rgba(77, 147, 240, 0.5);
  }

  .logo {
    min-width: 0;
    width: auto;
    max-width: 100%;
  }

  .logo-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .logo img,
  .logo svg {
    height: 30px;
  }

  .nav-cta {
    display: none;
  }
}

@media (max-width: 680px) {
  .logo-name {
    font-size: 0.98rem;
    letter-spacing: 0.01em;
  }
}

@media (max-width: 480px) {
  nav {
    height: 68px;
    padding-left: 3.5%;
    padding-right: 3.5%;
    padding-right: calc(3.5% + 44px);
  }

  .nav-links {
    padding-top: calc(68px + 1.25rem);
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .logo img,
  .logo svg {
    display: block;
    height: 26px;
  }

  .logo {
    gap: 5px;
    max-width: 100%;
  }

  .nav-toggle {
    right: 3.5%;
  }

  .logo-name {
    font-size: 0.92rem;
    letter-spacing: 0.005em;
  }

  .nav-cta {
    display: none;
  }
}
