/* ═══════════════════════════════════════════════════════════════
   SENTINEL AI — Elite Navigation v1.0
   ═══════════════════════════════════════════════════════════════
   Floating glass pill navbar with:
   - Animated conic gradient border
   - Magnetic hover on links
   - Sliding active pill indicator
   - Scroll morph (shrink + blur increase)
   - Shimmer CTA button
   - Cinematic full-screen mobile menu
   - Scroll progress line
   ═══════════════════════════════════════════════════════════════ */

/* ── @property for animatable gradient angle ── */
@property --nav-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ═══ WRAPPER — positions the floating pill ═══ */
.nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    padding: 16px 24px 0;
    pointer-events: none;
    transition: padding 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)),
                top 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.nav-wrapper.scrolled {
    padding: 8px 24px 0;
}

.nav-wrapper.hidden {
    top: -100px;
}

/* ═══ THE PILL — floating glass nav ═══ */
.nav-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    height: 60px;
    padding: 0 28px;
    border-radius: 100px;
    background: rgba(8, 8, 26, 0.6);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: all;
    transition: all 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
    --nav-border-angle: 0deg;
}

/* Animated gradient border glow */
.nav-pill::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--nav-border-angle),
        transparent 0%,
        rgba(236, 72, 153, 0.4) 10%,
        transparent 20%,
        rgba(139, 92, 246, 0.4) 45%,
        transparent 55%,
        rgba(59, 130, 246, 0.4) 75%,
        transparent 85%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: navBorderSpin 6s linear infinite;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.nav-pill:hover::before {
    opacity: 1;
}

@keyframes navBorderSpin {
    to { --nav-border-angle: 360deg; }
}

/* Ambient glow beneath pill */
.nav-pill::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.12), transparent 70%);
    filter: blur(16px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.nav-pill:hover::after,
.nav-wrapper.scrolled .nav-pill::after {
    opacity: 1;
}

/* Scroll state: smaller, more solid */
.nav-wrapper.scrolled .nav-pill {
    height: 52px;
    background: rgba(8, 8, 26, 0.85);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ═══ BRAND / LOGO ═══ */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.nav-brand-icon {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-brand-icon svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.nav-brand:hover .nav-brand-icon svg {
    filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.5));
    transform: scale(1.08);
}

/* Shield pulse ring */
.nav-brand-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.15);
    animation: shieldPulse 3s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0; }
}

.nav-brand-text {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text, #f0f0f8);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav-brand-text .gradient-text {
    background: var(--gradient-brand, linear-gradient(135deg, #EC4899, #8B5CF6, #3B82F6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ NAV LINKS — center group ═══ */
.nav-links-center {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Sliding pill indicator behind active link */
.nav-indicator {
    position: absolute;
    height: 32px;
    border-radius: 100px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: all 0.35s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

.nav-indicator.visible {
    opacity: 1;
}

/* Individual nav link */
.nav-link {
    position: relative;
    z-index: 1;
    padding: 6px 16px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted, #8080a0);
    text-decoration: none;
    border-radius: 100px;
    transition: color 0.25s ease, transform 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text, #f0f0f8);
}

.nav-link.active {
    color: var(--text, #f0f0f8);
}

/* Magnetic hover glow dot */
.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.nav-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

/* ═══ CTA BUTTON ═══ */
.nav-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 22px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 100px;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED, #6D28D9);
    overflow: hidden;
    z-index: 1;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    white-space: nowrap;
}

.nav-cta:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4),
                0 0 40px rgba(124, 58, 237, 0.15);
}

.nav-cta:active {
    transform: translateY(0) scale(0.98);
}

/* Shimmer sweep */
.nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: ctaShimmer 3s ease-in-out infinite;
}

@keyframes ctaShimmer {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}

/* CTA arrow */
.nav-cta-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.nav-cta:hover .nav-cta-arrow {
    transform: translateX(3px);
}

/* ═══ SCROLL PROGRESS BAR ═══ */
.nav-scroll-progress {
    position: absolute;
    bottom: 0;
    left: 28px;
    right: 28px;
    height: 2px;
    border-radius: 1px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-wrapper.scrolled .nav-scroll-progress {
    opacity: 1;
}

.nav-scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-brand, linear-gradient(135deg, #EC4899, #8B5CF6, #3B82F6));
    border-radius: 1px;
    transition: width 0.1s linear;
}

/* ═══ HAMBURGER — morphing icon ═══ */
.nav-hamburger {
    display: none;
    position: relative;
    z-index: 10002;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
}

.nav-hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text, #f0f0f8);
    border-radius: 2px;
    transition: transform 0.35s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)),
                opacity 0.25s ease,
                background 0.25s ease;
    transform-origin: center;
}

.nav-hamburger-line + .nav-hamburger-line {
    margin-top: 6px;
}

/* Morphed to X */
.nav-hamburger.active .nav-hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-hamburger.active .nav-hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-hamburger.active .nav-hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ═══ MOBILE MENU — cinematic fullscreen ═══ */
.nav-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

.nav-mobile-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Ambient orbs in mobile menu */
.nav-mobile-overlay::before,
.nav-mobile-overlay::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
}

.nav-mobile-overlay::before {
    top: 10%;
    left: -10%;
    background: rgba(236, 72, 153, 0.3);
    animation: mobileOrbFloat1 6s ease-in-out infinite;
}

.nav-mobile-overlay::after {
    bottom: 10%;
    right: -10%;
    background: rgba(59, 130, 246, 0.3);
    animation: mobileOrbFloat2 8s ease-in-out infinite;
}

@keyframes mobileOrbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 20px) scale(1.1); }
}

@keyframes mobileOrbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, -30px) scale(1.15); }
}

/* Mobile nav links — staggered entry */
.nav-mobile-link {
    position: relative;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-muted, #8080a0);
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 16px;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)),
                opacity 0.5s ease,
                color 0.25s ease,
                background 0.25s ease;
}

.nav-mobile-overlay.open .nav-mobile-link {
    transform: translateY(0);
    opacity: 1;
}

/* Staggered delays */
.nav-mobile-overlay.open .nav-mobile-link:nth-child(1) { transition-delay: 0.05s; }
.nav-mobile-overlay.open .nav-mobile-link:nth-child(2) { transition-delay: 0.10s; }
.nav-mobile-overlay.open .nav-mobile-link:nth-child(3) { transition-delay: 0.15s; }
.nav-mobile-overlay.open .nav-mobile-link:nth-child(4) { transition-delay: 0.20s; }
.nav-mobile-overlay.open .nav-mobile-link:nth-child(5) { transition-delay: 0.25s; }
.nav-mobile-overlay.open .nav-mobile-link:nth-child(6) { transition-delay: 0.30s; }

.nav-mobile-link:hover {
    color: var(--text, #f0f0f8);
    background: rgba(139, 92, 246, 0.08);
}

.nav-mobile-link.active {
    color: var(--text, #f0f0f8);
}

.nav-mobile-link.active::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 4px;
    height: 20px;
    border-radius: 4px;
    background: var(--gradient-brand, linear-gradient(135deg, #EC4899, #8B5CF6));
    transform: translateY(-50%);
}

/* Mobile CTA at bottom */
.nav-mobile-cta {
    margin-top: 24px;
    padding: 16px 40px;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: 100px;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)) 0.35s,
                opacity 0.5s ease 0.35s,
                box-shadow 0.25s ease;
}

.nav-mobile-overlay.open .nav-mobile-cta {
    transform: translateY(0);
    opacity: 1;
}

.nav-mobile-cta:hover {
    box-shadow: 0 4px 30px rgba(124, 58, 237, 0.5);
}

/* ═══ PAGE SPACER — pushes content below fixed nav ═══ */
.nav-spacer {
    height: 92px; /* 60px pill + 16px top padding + 16px breathing room */
    transition: height 0.5s ease;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 860px) {
    .nav-links-center {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .nav-hamburger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .nav-pill {
        max-width: 100%;
        padding: 0 20px;
    }

    .nav-wrapper {
        padding: 12px 16px 0;
    }
}

@media (max-width: 420px) {
    .nav-brand-text {
        font-size: 0.95rem;
    }

    .nav-pill {
        height: 52px;
    }

    .nav-spacer {
        height: 80px;
    }
}

/* ═══ HIDE OLD NAV (backwards compat) ═══ */
nav.nav#nav {
    display: none !important;
}

/* ═══ ENTRANCE ANIMATION ═══ */
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-wrapper {
    animation: navSlideDown 0.8s var(--ease, cubic-bezier(0.16, 1, 0.3, 1)) 0.2s both;
}

/* ═══ REDUCE MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    .nav-pill::before { animation: none; }
    .nav-cta::before { animation: none; }
    .nav-brand-icon::after { animation: none; }
    .nav-wrapper { animation: none; }
    .nav-mobile-overlay::before,
    .nav-mobile-overlay::after { animation: none; }
    .nav-mobile-link,
    .nav-mobile-cta { transition-delay: 0s !important; }
}
