/**
 * Header v2 — logo + CTA outside; nav-only glass pill (separate from header.css)
 */

/* ── Nav glass pill (center box) ── */
.nav-v2-pill {
  display: block;
  border-radius: 999px;
  border: 1px solid var(--v2-glass-dark-border, rgba(255, 255, 255, 0.22));
  background: var(--v2-glass-dark-bg, rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(var(--v2-glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--v2-glass-blur, 20px));
  box-shadow: var(--v2-glass-dark-shadow, 0 4px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18));
}

@media (min-width: 1024px) {
  .nav-v2-pill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

.nav-v2-links .nav-v2-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  line-height: 1.25;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-v2-links .nav-v2-link:hover {
  color: #fff;
}

.nav-v2-links .nav-v2-link--active,
.nav-v2-links .nav-v2-link.nav-v2-link--active {
  background: #fff;
  color: #0d1117;
  font-weight: 600;
}

/* ── CTA glass (outside, right) ── */
.nav-v2-cta {
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-v2-cta-icon {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Burger (hidden on desktop) ── */
.nav-v2-burger {
  display: none;
}

.nav-v2-burger-line {
  transition: transform 0.25s ease, opacity 0.2s;
  transform-origin: center;
}

/* ── Scrolled / light page ── */
.nav-v2-wrap--scrolled,
.nav-v2-wrap.is-scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-v2-wrap--scrolled .nav-v2-logo-name,
.nav-v2-wrap.is-scrolled .nav-v2-logo-name {
  color: #0d1117;
}

.nav-v2-wrap--scrolled .nav-v2-logo-sub,
.nav-v2-wrap.is-scrolled .nav-v2-logo-sub {
  color: rgba(13, 17, 23, 0.55);
}

.nav-v2-wrap--scrolled .nav-v2-pill,
.nav-v2-wrap.is-scrolled .nav-v2-pill {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-v2-wrap--scrolled .nav-v2-links .nav-v2-link,
.nav-v2-wrap.is-scrolled .nav-v2-links .nav-v2-link {
  color: rgba(13, 17, 23, 0.75);
}

.nav-v2-wrap--scrolled .nav-v2-links .nav-v2-link:hover,
.nav-v2-wrap.is-scrolled .nav-v2-links .nav-v2-link:hover {
  color: #0d1117;
}

.nav-v2-wrap--scrolled .nav-v2-links .nav-v2-link--active,
.nav-v2-wrap--scrolled .nav-v2-links .nav-v2-link.nav-v2-link--active,
.nav-v2-wrap.is-scrolled .nav-v2-links .nav-v2-link--active,
.nav-v2-wrap.is-scrolled .nav-v2-links .nav-v2-link.nav-v2-link--active {
  background: #0d1117;
  color: #fff;
}

.nav-v2-wrap--scrolled .nav-v2-cta,
.nav-v2-wrap.is-scrolled .nav-v2-cta {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.75);
  color: #0d1117;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nav-v2-wrap--scrolled .nav-v2-burger-line,
.nav-v2-wrap.is-scrolled .nav-v2-burger-line {
  background: #0d1117;
}

/* ── Tight desktop (nav still fits) ── */
@media (min-width: 1024px) and (max-width: 1160px) {
  .nav-v2-links .nav-v2-link {
    padding-left: 14px;
    padding-right: 14px;
    font-size: 13px;
  }

  .nav-v2-logo-name {
    font-size: 16px;
  }
}

/* ── Mobile & tablet (hamburger menu) ── */
@media (max-width: 1023px) {
  .nav-v2-wrap {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-v2-inner {
    gap: 10px;
  }

  .nav-v2-pill {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    transform: none;
    z-index: 30;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    translate: 0 -6px;
    transition:
      opacity 0.22s ease,
      visibility 0.22s ease,
      translate 0.22s ease;
  }

  .nav-v2-pill.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  }

  .nav-v2-pill.is-open .nav-v2-links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    height: auto;
    padding: 8px;
  }

  .nav-v2-pill.is-open .nav-v2-link,
  .nav-v2-pill.is-open .nav-v2-mega-trigger {
    display: flex;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    color: rgba(13, 17, 23, 0.82);
    border-radius: 12px;
  }

  .nav-v2-pill.is-open .nav-v2-mega-trigger {
    justify-content: space-between;
  }

  .nav-v2-pill.is-open .nav-v2-link:hover {
    background: rgba(13, 17, 23, 0.05);
    color: #0d1117;
  }

  .nav-v2-pill.is-open .nav-v2-link--active,
  .nav-v2-pill.is-open .nav-v2-link.nav-v2-link--active {
    background: #0d1117;
    color: #fff;
    font-weight: 600;
  }

  .nav-v2-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
  }

  .nav-v2-wrap--scrolled .nav-v2-burger,
  .nav-v2-wrap.is-scrolled .nav-v2-burger {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.82);
  }

  .nav-v2-burger.is-open .nav-v2-burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-v2-burger.is-open .nav-v2-burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .nav-v2-burger.is-open .nav-v2-burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-v2-wrap.is-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.42);
    animation: nav-v2-backdrop-in 0.22s ease;
  }

  @keyframes nav-v2-backdrop-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .nav-v2-cta {
    height: 40px;
    padding-left: 16px;
    font-size: 13px;
  }

  .nav-v2-cta-icon {
    height: 28px;
    width: 28px;
  }

  .nav-v2-cta-icon svg {
    height: 12px;
    width: 12px;
  }
}

@media (max-width: 480px) {
  .nav-v2-logo-name {
    display: none;
  }

  .nav-v2-actions {
    gap: 6px;
  }
}

@media (max-width: 400px) {
  .nav-v2-cta {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    font-size: 0;
    gap: 0;
  }
}
