/* Flowing Menu Styles - Robust Fix */

:root {
    /* Integration values - matching site dark theme */
    --menu-text-color: #ffffff;
    --menu-bg-color: transparent;
    --marquee-bg-color: var(--accent, #4f46e5);
    /* Theme accent color */
    --marquee-text-color: #ffffff;
    --menu-border-color: rgba(255, 255, 255, 0.1);
}

.menu-wrap {
    width: 100%;
    position: relative;
    /* Do NOT set height: 100% or flex: 1 here, let it flow */
    overflow: hidden;
}

.menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
}

.menu__item {
    position: relative;
    overflow: hidden;
    text-align: left;
    /* Left align text */
    border-top: 1px solid var(--menu-border-color);

    /* Use padding for height, not fixed height, to avoid overflow issues */
    padding: 3rem 0;
    padding-left: 2rem;
    /* Add left padding */

    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Align content to start */
    box-sizing: border-box;
}

/* Ensure last item has a border if needed, or rely on footer/section border */
.menu__item:last-child {
    border-bottom: 1px solid var(--menu-border-color);
}

.menu__item-link {
    display: block;
    /* changed from flex to block/inline-block within the flex parent */
    position: relative;
    z-index: 10;
    /* Text on top */
    cursor: pointer;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;

    /* Font Styling */
    font-family: 'Space Grotesk', sans-serif;
    /* Explicitly use site font */
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 5rem);
    /* Responsive sizing */
    line-height: 1.1;
    color: var(--menu-text-color);
    transition: opacity 0.3s, color 0.3s;
}

.menu__item-link:hover {
    color: var(--menu-text-color);
}

/* Hide static text on hover to avoid overlap with marquee */
.menu__item:hover .menu__item-link {
    opacity: 0;
}

/* MARQUEE */
.marquee {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-color: var(--marquee-bg-color);
    transform: translate3d(0, 101%, 0);
    z-index: 5;
    /* Behind text (z-10) but above background */
    display: flex;
    align-items: center;
}

.marquee__inner-wrap {
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.marquee__inner {
    display: flex;
    align-items: center;
    position: relative;
    width: fit-content;
    will-change: transform;
}

.marquee__part {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 1rem;
}

.marquee span {
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 5rem);
    /* Match link size */
    line-height: 1;
    padding: 0 2vw;
    color: var(--marquee-text-color);
    font-family: 'Space Grotesk', sans-serif;
}

.marquee__img {
    width: 250px;
    height: 120px;
    margin: 0 2vw;
    border-radius: 50px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .menu__item {
        padding: 2rem 0;
        padding-left: 1rem;
    }

    .menu__item-link,
    .marquee span {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .marquee__img {
        width: 150px;
        height: 80px;
    }
}