/* Modern Navigation Menu */
.menu-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    flex-wrap: nowrap;
    background: transparent;
    margin: 0 auto 30px;
    width: calc(100% - 64px);
    max-width: 1200px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.menu-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: clamp(6px, 1vw, 16px);
    width: 100%;
    min-width: 0;
}

.menu-toggle { display: none; }

/* Organic blob background shape - primary */
.menu-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -20px;
    right: -20px;
    bottom: -15px;
    background: linear-gradient(135deg, #fef5f5 0%, #fdeaea 100%);
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    z-index: -2;
    opacity: 0.55;
    box-shadow: 0 4px 20px rgba(128, 64, 56, 0.08);
    animation: blobWobble 8s ease-in-out infinite;
}

/* Secondary blob background shape - different animation */
.menu-container::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -15px;
    right: -15px;
    bottom: -10px;
    background: linear-gradient(135deg, #fce0e0 0%, #fef8f8 100%);
    border-radius: 45% 55% 50% 50% / 60% 40% 55% 45%;
    z-index: -1;
    opacity: 0.35;
    animation: blobWobble2 11s ease-in-out infinite;
}

/* Gentle organic wobble animation - primary blob */
@keyframes blobWobble {
    0%, 100% {
        border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    }
    25% {
        border-radius: 50% 50% 60% 40% / 60% 50% 50% 40%;
    }
    50% {
        border-radius: 40% 60% 50% 50% / 40% 60% 50% 50%;
    }
    75% {
        border-radius: 55% 45% 65% 35% / 55% 45% 60% 45%;
    }
}

/* Secondary blob animation - different timing and shapes */
@keyframes blobWobble2 {
    0%, 100% {
        border-radius: 45% 55% 50% 50% / 60% 40% 55% 45%;
    }
    30% {
        border-radius: 65% 35% 55% 45% / 50% 50% 60% 40%;
    }
    60% {
        border-radius: 50% 50% 40% 60% / 55% 45% 50% 50%;
    }
    85% {
        border-radius: 55% 45% 60% 40% / 45% 55% 55% 45%;
    }
}

/* Clean minimal buttons with animated blobs */
.menu-button {
    font-family: "Timeless", serif;
    font-size: 17px;
    font-weight: 500;
    color: #804038;
    text-decoration: none;
    padding: 12px 14px;
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1.4;
    border: none;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    box-shadow: none;
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.menu-button:focus {
    outline: none;
    box-shadow: none;
}

.menu-button:focus-visible, .menu-toggle:focus-visible {
    outline: 2px solid #804038;
    outline-offset: 4px;
    border-radius: 8px;
}

.menu-button::-moz-focus-inner {
    border: 0;
}

/* Keep navigation labels free of individual background shapes. */
.menu-button::before {
    content: none;
    position: absolute;
    top: -2px;
    left: 10px;
    right: 10px;
    bottom: -2px;
    background: linear-gradient(135deg, #804038 0%, #a04a45 100%);
    opacity: 0.06;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: 55% 45% 60% 40% / 50% 60% 40% 50%;
    animation: buttonBlob1 7s ease-in-out infinite;
}

/* Randomized blob animations for variety */
.menu-button:nth-child(2)::before {
    animation: buttonBlob2 8s ease-in-out infinite;
    border-radius: 45% 55% 50% 50% / 60% 40% 50% 50%;
}

.menu-button:nth-child(3)::before {
    animation: buttonBlob3 9s ease-in-out infinite;
    border-radius: 50% 50% 65% 35% / 45% 55% 50% 50%;
}

.menu-button:nth-child(4)::before {
    animation: buttonBlob4 7.5s ease-in-out infinite;
    border-radius: 60% 40% 55% 45% / 55% 45% 55% 45%;
}

.menu-button:nth-child(5)::before {
    animation: buttonBlob5 8.5s ease-in-out infinite;
    border-radius: 40% 60% 45% 55% / 50% 50% 60% 40%;
}

.menu-button:nth-child(6)::before {
    animation: buttonBlob6 9.5s ease-in-out infinite;
    border-radius: 65% 35% 50% 50% / 50% 50% 45% 55%;
}

.menu-button:hover::before {
    opacity: 0.16;
}

.menu-button:hover {
    color: #a04a45;
    transform: translateY(-1px);
    box-shadow: none;
}

.menu-button:active {
    transform: translateY(0px);
    box-shadow: none;
}

/* Active state - visible blob for current page */
.menu-button.active::before {
    opacity: 1;
}

.menu-button.active {
    color: #804038;
    box-shadow: none;
}

.menu-button[aria-current="page"]::before { opacity: 0.12; }
.menu-button[aria-current="page"] { color: #804038; }
.menu-button[aria-current="page"]:hover { color: #a04a45; }

/* Button blob animations - each unique, constrained to prevent clipping */
@keyframes buttonBlob1 {
    0%, 100% { border-radius: 52% 48% 55% 45% / 48% 52% 48% 52%; }
    33% { border-radius: 48% 52% 50% 50% / 55% 45% 52% 48%; }
    66% { border-radius: 55% 45% 52% 48% / 48% 52% 50% 50%; }
}

@keyframes buttonBlob2 {
    0%, 100% { border-radius: 48% 52% 50% 50% / 55% 45% 50% 50%; }
    33% { border-radius: 52% 48% 57% 43% / 50% 50% 48% 52%; }
    66% { border-radius: 50% 50% 48% 52% / 52% 48% 55% 45%; }
}

@keyframes buttonBlob3 {
    0%, 100% { border-radius: 50% 50% 57% 43% / 48% 52% 50% 50%; }
    33% { border-radius: 55% 45% 50% 50% / 50% 50% 55% 45%; }
    66% { border-radius: 45% 55% 52% 48% / 57% 43% 50% 50%; }
}

@keyframes buttonBlob4 {
    0%, 100% { border-radius: 55% 45% 52% 48% / 52% 48% 52% 48%; }
    33% { border-radius: 50% 50% 48% 52% / 45% 55% 50% 50%; }
    66% { border-radius: 48% 52% 55% 45% / 50% 50% 57% 43%; }
}

@keyframes buttonBlob5 {
    0%, 100% { border-radius: 45% 55% 48% 52% / 50% 50% 55% 45%; }
    33% { border-radius: 57% 43% 50% 50% / 52% 48% 50% 50%; }
    66% { border-radius: 50% 50% 55% 45% / 48% 52% 52% 48%; }
}

@keyframes buttonBlob6 {
    0%, 100% { border-radius: 57% 43% 50% 50% / 50% 50% 48% 52%; }
    33% { border-radius: 50% 50% 52% 48% / 55% 45% 50% 50%; }
    66% { border-radius: 52% 48% 45% 55% / 50% 50% 52% 48%; }
}

/* Responsive mobile menu */
@media (max-width: 959px) {
    .menu-container {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        width: calc(100% - 32px);
        overflow: visible;
        box-sizing: border-box;
    }

    .menu-container::before, .menu-container::after {
        left: 0;
        right: 0;
        top: -5px;
        bottom: -5px;
    }

    .menu-toggle:not([hidden]) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 44px;
        padding: 10px 18px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #804038;
        font: 17px "Timeless", serif;
        cursor: pointer;
    }

    .menu-toggle-icon { display: grid; gap: 4px; width: 20px; }
    .menu-toggle-icon span { display: block; height: 1px; background: currentColor; }
    .menu-links { flex-direction: column; gap: 4px; }
    .menu-container[data-enhanced="true"] .menu-links { display: none; }
    .menu-container[data-enhanced="true"][data-expanded="true"] .menu-links { display: flex; padding-top: 8px; }

    .menu-button {
        width: 100%;
        max-width: 360px;
        text-align: center;
        padding: 14px 16px;
        font-size: 17px;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .menu-button::before {
        top: -1px;
        left: 20%;
        right: 20%;
        bottom: -1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .menu-container::before, .menu-container::after, .menu-button::before { animation: none; }
    .menu-button { transition: none; }
    .menu-button:hover { transform: none; }
}


/* Compact navigation stays available without fixing the decorative header. */
.menu-container {
    position: sticky;
    top: 8px;
    z-index: 1100;
}
.menu-container[data-stuck="true"] {
    background: #fff8f8;
    border-radius: 20px;
    box-shadow: 0 3px 14px rgba(128, 64, 56, .10);
}
html { scroll-padding-top: 112px; }
@media (max-width: 959px) {
    .menu-container[data-enhanced="true"][data-expanded="true"] .menu-links {
        max-height: calc(100dvh - 112px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* One continuous surface in both normal and sticky navigation states. */
.menu-container,
.menu-container[data-stuck="true"] {
    top: 0;
    background: linear-gradient(90deg, #fffdfc, #fff7f5 50%, #fffdfc);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 8px 16px;
    box-shadow: none;
    transition: box-shadow 240ms ease, border-color 240ms ease;
}
.menu-container[data-stuck="true"] {
    border-color: transparent;
    box-shadow: 0 3px 14px rgba(128, 64, 56, .025);
}
.menu-container::before,.menu-container::after,.menu-button::before { content: none; animation: none; }
.menu-button,.menu-button:hover { transform: none; background: transparent; box-shadow: none; }
.menu-button { transition: color 180ms ease; }
.menu-button::after {
    content: ''; position: absolute; height: 1px; bottom: 7px;
    left: 14px; right: 14px; background: #b78427;
    transform: scaleX(0); transform-origin: center;
    transition: transform 200ms ease;
}
.menu-button:hover::after,.menu-button:focus-visible::after,.menu-button[aria-current="page"]::after { transform: scaleX(1); }
.menu-toggle-icon span { transition: transform 200ms ease, opacity 150ms ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 959px) {
    .menu-container,.menu-container[data-stuck="true"] { padding: 4px 12px; border-radius: 14px; }
    .menu-container[data-expanded="true"] .menu-links { border-top: 1px solid rgba(183,132,39,.18); }
    .menu-container[data-enhanced="true"][data-expanded="true"] .menu-links { animation: menu-unfold 180ms ease-out; }
    .menu-button::after { left: 30%; right: 30%; }
}
@keyframes menu-unfold { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }


.menu-toggle { display:none; }
@media(max-width:959px) { .menu-toggle:not([hidden]) { display:inline-flex; } }
