/* Nav Glow */
.nav-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 80px;
    background: radial-gradient(ellipse at center top,
            rgba(194, 209, 15, 0.08) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 999;
}

/* Floating Pill Navbar — Liquid Glass */
.pill-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 14px 32px;
    background: rgba(8, 8, 8, 0.55);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    border: 1px solid rgba(194, 209, 15, 0.2);
    border-radius: 999px;
    z-index: 1000;
    white-space: nowrap;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(194, 209, 15, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    transition: padding 0.3s ease, top 0.3s ease;
}

.pill-nav.shrunk {
    padding: 8px 20px;
}

.nav-left,
.nav-right {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-body, "helvetica-neue-lt-pro", sans-serif);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #C2D10F;
}

.nav-link.active {
    color: #C2D10F;
}

/* Active dot */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background-color: var(--accent, #C2D10F);
    border-radius: 50%;
}

/* Mobile Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100svh;
    background-color: var(--bg-secondary, #010101);
    z-index: 999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-link {
    font-family: var(--font-display, "helvetica-neue-lt-pro-cond", sans-serif);
    font-size: 32px;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

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

/* Stagger transition delay for mobile links done in CSS or JS. Let's do CSS for simplicity */
.mobile-overlay.active .mobile-nav-link:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-overlay.active .mobile-nav-link:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-overlay.active .mobile-nav-link:nth-child(3) {
    transition-delay: 0.3s;
}

.mobile-overlay.active .mobile-nav-link:nth-child(4) {
    transition-delay: 0.4s;
}

@media (max-width: 768px) {

    .nav-left,
    .nav-right {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .pill-nav {
        padding: 10px 20px;
        gap: 20px;
        /* Reduced gap */
    }

    .floating-logo {
        width: 40px;
        height: 40px;
        overflow: hidden;
        right: 24px;
        top: 20px;
    }
}

@media (max-width: 480px) {
    .floating-logo {
        width: 40px;
        height: 40px;
        overflow: hidden;
        right: 20px;
        top: 10px;
    }
}

/* Floating Logo - Top Right Capsule */
.floating-logo {
    position: fixed;
    top: 20px;
    right: 32px;
    z-index: 990;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 999px;

    background: rgba(8, 8, 8, 0.55);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    border: 1px solid rgba(194, 209, 15, 0.35);

    box-shadow:
        0 0 12px rgba(194, 209, 15, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 8px 40px rgba(0, 0, 0, 0.5);

    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.floating-logo img {
    width: 155%;
    height: 155%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.floating-logo:hover img {
    transform: scale(1.06);
}

.floating-logo:hover {
    border-color: rgba(194, 209, 15, 0.55);
    box-shadow:
        0 0 16px rgba(194, 209, 15, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ── AUDIO WAVE (floating, fuori dalla pill) ─────────────────────── */
.audio-wave-btn {
    position: fixed;
    top: 28px;
    right: 140px;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
}

.audio-wave-btn span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: #C2D10F;
    animation: wavebar 0.8s ease-in-out infinite alternate;
}

.audio-wave-btn span:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.audio-wave-btn span:nth-child(2) {
    height: 16px;
    animation-delay: 0.15s;
}

.audio-wave-btn span:nth-child(3) {
    height: 22px;
    animation-delay: 0.3s;
}

.audio-wave-btn span:nth-child(4) {
    height: 14px;
    animation-delay: 0.45s;
}

.audio-wave-btn span:nth-child(5) {
    height: 8px;
    animation-delay: 0.6s;
}

@keyframes wavebar {
    from {
        transform: scaleY(0.4);
    }

    to {
        transform: scaleY(1);
    }
}

.audio-wave-btn.paused span {
    animation: none;
    height: 2px !important;
    transform: none;
}

@media (max-width: 768px) {
    .audio-wave-btn {
        display: none !important;
    }
}

/* ── MOBILE: pill nav corretta ── */
@media (max-width: 768px) {

    /* Mantieni pill centrata, solo riduci dimensioni */
    nav,
    .pill-nav {
        top: 16px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: 90vw !important;
        border-radius: 999px !important;
        padding: 10px 20px !important;
        gap: 16px !important;
        justify-content: center !important;
    }

    /* Nascondi link testo, mostra solo hamburger */
    .nav-left,
    .nav-right {
        display: none !important;
    }

    .hamburger {
        display: flex !important;
    }

    /* Logo floating nascosto */
    .floating-logo {
        display: none !important;
    }

    /* Cookie banner su mobile */
    #cookie-banner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 16px 20px !important;
        gap: 12px !important;
    }

    #cookie-banner>div:last-child {
        justify-content: center !important;
        width: 100% !important;
        gap: 10px !important;
    }

    #cookie-banner button {
        width: auto !important;
        flex: 1 !important;
        max-width: 160px !important;
    }
}