/* Floating circle menu (home page + scroll-triggered on inner pages) */

.menu-toggle,
.menu-close {
    position: fixed;
    z-index: 1001;
    border: none;
    font-family: var(--font-header);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    text-transform: uppercase;
}

.menu-toggle {
    top: 30px;
    left: 40px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    color: transparent;
    box-shadow: none;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle::before,
.menu-toggle::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: menuFlip 10s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.menu-toggle::before {
    content: "MENU";
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 0.85rem;
    transform: rotateY(180deg);
    animation-name: menuFlipBack;
}

.menu-toggle::after {
    background: url('../assets/NOLA_CitySeal_Brown.png') center/100% no-repeat;
    background-color: var(--bg-primary);
    transform: rotateY(0deg);
    animation-name: menuFlip;
}

@keyframes menuFlip {
    0%, 45% { transform: rotateY(0deg); }
    50%, 95% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes menuFlipBack {
    0%, 45% { transform: rotateY(180deg); }
    50%, 95% { transform: rotateY(360deg); }
    100% { transform: rotateY(540deg); }
}

.menu-toggle:hover {
    transform: scale(1.08) rotate(5deg);
}

.menu-toggle:hover::before {
    background: linear-gradient(145deg, var(--brand-red), var(--accent));
    color: var(--bg-primary);
}

.menu-toggle:active,
.menu-close:active {
    transform: scale(0.95);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(160deg, var(--brand-red) 0%, var(--accent) 55%, #0F1626 100%);
    z-index: 1000;
    clip-path: circle(0px at 76px 66px);
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: calc(30px + 72px + 100px) clamp(24px, 8vw, 120px) 48px;
    overflow: hidden;
}

.menu-overlay.active {
    clip-path: circle(150vw at 76px 66px);
}

.menu-close {
    top: 30px;
    right: 40px;
    left: auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(15, 22, 38, 0.38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: rgba(203, 160, 82, 0.78);
    border: 1px solid rgba(203, 160, 82, 0.22);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.menu-close-icon {
    width: 26px;
    height: 26px;
    display: block;
    flex-shrink: 0;
}

.menu-overlay.active .menu-close {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.menu-close:hover {
    background: rgba(15, 22, 38, 0.52);
    color: rgba(203, 160, 82, 0.95);
    border-color: rgba(203, 160, 82, 0.38);
    transform: scale(1.04);
}

.menu-overlay nav.menu-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    width: min(100%, 360px);
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    backdrop-filter: none;
    position: static;
}

.menu-links a {
    display: block;
    width: 100%;
    font-family: var(--font-header);
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    color: var(--bg-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.35;
    padding: 12px 0;
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    text-align: right;
    text-shadow: none;
    border-bottom: 1px solid rgba(15, 22, 38, 0.18);
}

.menu-links a:last-child {
    border-bottom: none;
}

.menu-links a:hover {
    color: var(--text-primary);
    transform: translateX(-6px);
}

body.menu-open {
    overflow: hidden;
}

/* Scroll-triggered mode: hidden until top nav leaves viewport */
floating-menu[scroll-trigger]:not(.is-visible) .menu-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.85);
}

floating-menu[scroll-trigger].is-visible .menu-toggle {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .menu-toggle {
        top: 20px;
        left: 20px;
        width: 60px;
        height: 60px;
    }

    .menu-toggle::before {
        font-size: 0.72rem;
    }

    .menu-close {
        top: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    .menu-close-icon {
        width: 22px;
        height: 22px;
    }

    .menu-overlay {
        clip-path: circle(0px at 50px 50px);
        align-items: stretch;
        padding: calc(20px + 60px + 100px) 24px 32px;
    }

    .menu-overlay.active {
        clip-path: circle(150vw at 50px 50px);
    }

    .menu-overlay nav.menu-links {
        width: 100%;
        align-items: stretch;
    }

    .menu-links a {
        font-size: 1.1rem;
        font-weight: 900;
        padding: 11px 0;
        text-align: left;
    }

    .menu-links a:hover {
        transform: translateX(4px);
    }
}
