.nav {
  --nav-fade: 0; /* 0 = top of page (solid), 1 = fully scrolled (frosted) -- see js/behaviors/nav-scroll-fade.js */
  position: sticky;
  top: 0;
  z-index: 100;
  /* Fades the white tint down to a low floor (not 0) -- the blur itself
     stays constant, so the nav settles into a frosted-glass bar rather
     than a bare see-through gap that lets page content read sharply
     (and overlap) through it. */
  background: rgba(255, 255, 255, calc(0.92 - 0.57 * var(--nav-fade)));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, calc(0.05 * (1 - var(--nav-fade))));
  /* Short, linear -- this tracks scroll position every frame, so a longer
     eased transition would visibly lag behind the actual scroll. */
  transition: background-color .05s linear, border-color .05s linear;
}

/* The mobile drawer needs a readable backdrop regardless of scroll
   position -- always force the nav bar solid while it's open. */
.nav.menu-open {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}
.wordmark img {
  display: block;
  height: 25px;
  width: auto;
}

/* Floating Center Pill (Desktop) */
.nav-pill-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 30px;
}

.nav-pill a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-pill a:hover {
  color: var(--accent-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.nav-signin {
  color: #17171A;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.nav-signin:hover {
  opacity: 0.7;
}

.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.32);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.nav-cta-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.4);
}

/* Mobile Hamburger Button */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  padding: 10px 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-hamburger:hover {
  background: rgba(0, 0, 0, 0.06);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #111113;
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.nav-hamburger.active .line-1 {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.active .line-2 {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.active .line-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Drawer Dropdown */
.nav-mobile-menu {
  display: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.nav-mobile-menu.open {
  max-height: 480px;
  opacity: 1;
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 8px;
  gap: 4px;
}

.mobile-nav-link {
  font-size: 16px;
  font-weight: 600;
  color: #17171A;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(246, 116, 32, 0.08);
  color: var(--accent);
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 24px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-signin {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #17171A;
  text-decoration: none;
  padding: 11px;
}

.mobile-cta-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(246, 116, 32, 0.32);
}

@media (max-width: 860px) {
  .nav-pill-wrap { display: none; }
  .nav-inner { padding: 12px 20px; }
  .nav-hamburger { display: flex; }
  .nav-mobile-menu { display: block; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 10px 16px; gap: 12px; }
  .nav-signin { display: none; }
  .nav-cta-btn { font-size: 12.5px; padding: 8px 14px; border-radius: 10px; }
  .wordmark img { height: 22px; }
}
