.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-link.active {
  background: var(--red-muted);
  color: var(--red-text);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.topbar-search:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border2);
}

.topbar-search:focus-within {
  border-color: rgba(59, 180, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 15px rgba(59, 180, 255, 0.1);
}

.topbar-search svg {
  color: var(--text3);
  flex-shrink: 0;
  transition: color 0.2s;
}

.topbar-search:focus-within svg {
  color: var(--accent);
}

.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  width: 100%;
  padding: 0;
}

.topbar-search input::placeholder {
  color: var(--text3);
  opacity: 0.7;
}

.shortcut {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.masthead {
  padding: 26px 28px 18px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 55%), var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.masthead-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.masthead-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  transform-origin: center;
  outline: none;
}

.masthead-logo-link:hover,
.masthead-logo-link:focus-visible {
  transform: scale(1.04);
}

.masthead-logo-link:active {
  transform: scale(0.985);
}

.masthead-logo-link:focus-visible {
  filter: drop-shadow(0 0 12px rgba(59, 180, 255, 0.25));
}

.masthead-logo-link img {
  display: block;
}

.masthead-logo img {
  height: clamp(52px, 5.5vw, 72px);
  width: auto;
  max-width: min(340px, 68vw);
  display: block;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.45));
}

.masthead-bar {
  width: min(1200px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.masthead-bar .nav-links {
  justify-content: center;
  gap: 6px;
}

.masthead-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.main {
  flex: 1;
  padding: 28px 32px;
  overflow-x: hidden;
}

.main--full {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  .masthead {
    padding: 16px 20px 14px;
    gap: 10px;
  }

  .masthead-logo img {
    height: clamp(40px, 10vw, 54px);
    max-width: min(260px, 64vw);
  }

  .masthead-bar {
    width: 100%;
    position: relative;
    padding: 0;
  }

  .masthead-actions {
    display: none;
  }

  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1002;
    padding: 0 10px;
    margin-left: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: min(300px, 86vw);
    height: 100vh;
    background: linear-gradient(180deg, #0d1117 0%, #050505 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 76px 20px 36px;
    gap: 8px;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.8);
    visibility: hidden;
  }

  .nav-links.open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
  }

  .nav-link.active {
    background: rgba(var(--red-rgb), 0.1);
    border-color: rgba(var(--red-rgb), 0.3);
    color: var(--red-text);
  }

  .main {
    padding: 16px 12px;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
  }

  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 600px) {
  .shortcut {
    display: none;
  }
}
