:root {
  --nb-bg: #000000;
  --nb-text: #ffffff;
  --nb-muted: #888888;
  --nb-accent: #c40000;
  --nb-border: #1a1a1a;
  --nb-height: 80px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Manrope", sans-serif;
  background-color: var(--nb-bg);
  padding-top: var(--nb-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nb-height);
  background: var(--nb-bg);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    height 0.3s ease;
}

#navbar.scrolled {
  height: 70px;
  border-bottom: 1px solid var(--nb-border);
}

#navbar.active {
  background: var(--nb-bg) !important;
  border-color: transparent;
}

.nav-container {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 800;
  color: var(--nb-text);
  text-decoration: none;
  letter-spacing: -0.04em;
  z-index: 1002;
  display: flex;
  align-items: center;
}

.brand span {
  color: var(--nb-accent);
}

.desktop-menu {
  display: flex;
  gap: 40px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  color: var(--nb-muted);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 600;
  transition: color 0.3s ease;
  position: relative;
}

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

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--nb-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
  will-change: transform;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  z-index: 1002;
}

.action-btn {
  padding: 10px 24px;
  background: var(--nb-text);
  color: #000;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1px solid var(--nb-text);
  transition:
    transform 0.2s var(--ease),
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.action-btn:hover {
  background: var(--nb-accent);
  border-color: var(--nb-accent);
  color: #fff;
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: flex-end;
  z-index: 1002;
  padding: 0;
  position: relative;
}

.hamburger-box {
  width: 26px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--nb-text);
  border-radius: 4px;
  position: absolute;
  left: 0;
  transition:
    transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6),
    opacity 0.2s,
    background-color 0.3s;
}

.line:nth-child(1) {
  top: 0;
}

.line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.line:nth-child(3) {
  bottom: 0;
}

#navbar.active .line {
  background-color: var(--nb-accent);
}

#navbar.active .line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

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

#navbar.active .line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--nb-bg);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  z-index: 1001;
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

#navbar.active .mobile-menu {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.3s ease,
    visibility 0s;
}

.mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4vh;
  width: 100%;
  text-align: center;
}

.mobile-links a {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--nb-muted);
  text-decoration: none;
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    color 0.3s,
    opacity 0.4s var(--ease),
    transform 0.4s var(--ease);
}

.mobile-links a:hover {
  color: var(--nb-text);
}

.mobile-links a.mobile-action {
  color: var(--nb-accent);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-top: 20px;
  border: 1px solid var(--nb-accent);
  padding: 12px 36px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mobile-links a.mobile-action:hover {
  background: var(--nb-accent);
  color: #fff;
}

#navbar.active .mobile-links a {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#navbar.active .mobile-links a:nth-child(1) {
  transition-delay: 0.1s;
}

#navbar.active .mobile-links a:nth-child(2) {
  transition-delay: 0.15s;
}

#navbar.active .mobile-links a:nth-child(3) {
  transition-delay: 0.2s;
}

#navbar.active .mobile-links a:nth-child(4) {
  transition-delay: 0.25s;
}

#navbar.active .mobile-links a:nth-child(5) {
  transition-delay: 0.3s;
}

@media (max-width: 950px) {
  .desktop-menu,
  .action-btn {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-height: 600px) {
  .mobile-menu {
    display: block;
    overflow-y: auto;
    padding-top: 100px;
  }

  .mobile-links {
    padding-bottom: 40px;
  }
}