nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 14px 24px;
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 52px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  background: rgba(7,11,17,.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  transition: border-color .3s, box-shadow .3s;
}

nav.scrolled .nav-inner {
  border-color: rgba(59,130,246,.15);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}

.nav-logo,
.nav-inner > a:first-child {
  display: flex;
  align-items: center;
  justify-self: start;
  height: 100%;
}

.nav-logo img,
.nav-inner > a:first-child img {
  display: block;
  height: 26px;
  transform: none;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  position: relative;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px rgba(59, 130, 246, .45);
}

.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 0;
  margin-right: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 .72rem var(--sans);
  letter-spacing: .04em;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: rgba(59,130,246,.16);
  color: var(--blue-l);
}

.lang-switch button:hover {
  color: var(--text);
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}

.theme-toggle {
  position: relative;
  padding: 0;
  cursor: pointer;
}

.theme-toggle:hover,
.nav-social:hover {
  color: #fff;
  border-color: rgba(59,130,246,.4);
  background: rgba(59,130,246,.12);
  transform: translateY(-1px);
}

.theme-icon,
.nav-social svg {
  width: 16px;
  height: 16px;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: block;
}

@media (max-width: 900px) {
  .nav-inner {
    grid-template-columns: auto auto;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 560px) {
  nav {
    padding: 10px;
  }

  .nav-inner {
    height: 48px;
    border-radius: 14px;
  }

  .nav-logo img,
  .nav-inner > a:first-child img {
    height: 24px;
  }
}
