/* ============================================
   Nav V5 – Floating Pill Navigation
   Shared across all pages
   ============================================ */

/* CSS Variables (fallbacks if not defined elsewhere) */
:root {
    --brand-blue: #1192f2;
    --brand-blue-dark: #0a6bc4;
    --brand-blue-darker: #003b7a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --white: #ffffff;
    --teal-accent: #3FEAC2;
}

/* ── Scroll progress bar ── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--teal-accent));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* ── Main nav pill ── */
.nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(17, 146, 242, 0.1);
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 32px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    flex-wrap: nowrap;
    width: max-content;
    max-width: calc(100vw - 48px);
}

.nav::before {
    display: none;
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ── Logo ── */
.nav .nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.nav .nav-logo img {
    height: 22px;
    width: auto;
    display: block;
}

/* ── Desktop links ── */
.nav .nav-links {
    display: flex;
    gap: 24px;
    white-space: nowrap;
    flex-shrink: 1;
    align-items: center;
}

.nav .nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-blue);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.8, 0, 0.2, 1);
}

.nav .nav-link:hover {
    color: var(--brand-blue);
}

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

.nav .nav-link.active {
    color: var(--brand-blue);
}

.nav .nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ── CTA button ── */
.nav .nav-cta {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--brand-blue);
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(17, 146, 242, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.nav .nav-cta:hover {
    background: var(--brand-blue-darker, #003b7a);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(17, 146, 242, 0.45);
}

/* ── Mobile toggle (hamburger) ── */
.nav .nav-mobile-toggle {
    display: none;
    width: 24px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    flex-shrink: 0;
}

.nav .nav-mobile-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ── Mobile menu dropdown ── */
.nav .nav-mobile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(17, 146, 242, 0.1);
    border-radius: 16px;
    padding: 20px;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav .nav-mobile-menu.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.nav .nav-mobile-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav .nav-mobile-menu a:hover {
    background: rgba(17, 146, 242, 0.08);
    color: var(--brand-blue);
}

.nav .nav-mobile-menu .nav-cta {
    margin-top: 8px;
    text-align: center;
    color: var(--white, #ffffff);
}

/* ── Responsive: Tablet ── */
@media (max-width: 1100px) {
    .nav {
        gap: 20px;
        padding: 10px 24px;
    }

    .nav .nav-links {
        gap: 16px;
    }

    .nav .nav-link {
        font-size: 12px;
    }

    .nav .nav-cta {
        font-size: 12px;
        padding: 10px 20px;
    }
}

/* ── Responsive: Mobile ── */
@media (max-width: 900px) {
    .nav {
        left: 16px;
        right: 16px;
        transform: none;
        padding: 12px 20px;
        width: auto;
        max-width: none;
    }

    .nav .nav-links {
        display: none;
    }

    .nav .nav-mobile-toggle {
        display: flex;
    }

    .nav > .nav-cta {
        display: none;
    }
}
