
/* =========================================================
   MAYZAY.DEV — SIGNATURE NAVIGATION
   File: components/navigation.css
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

/* ---------- Brand and navigation tokens ---------- */

.mz-nav {
    --mz-nav-bg: #111111;
    --mz-nav-panel: #151311;
    --mz-nav-text: #F7E9D7;
    --mz-nav-muted: #C8BEB3;
    --mz-nav-accent: #ffbd59;

    --mz-logo-light: #C49A6C;
    --mz-logo-dark: #3A2A1E;
    --mz-logo-cream: #F7E9D7;

    --mz-nav-height: 78px;
    --mz-nav-transition: 0.25s ease;

    position: fixed;
    inset: 0 0 auto;
    z-index: 10000;

    width: 100%;
    margin: 0;
    padding: 0;

    color: var(--mz-nav-text);
    background: var(--mz-nav-bg);
    font-family: "DM Sans", sans-serif;

    isolation: isolate;
    pointer-events: auto;

    /* Keep the background identical at every scroll position. */
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.mz-nav,
.mz-nav *,
.mz-nav *::before,
.mz-nav *::after {
    box-sizing: border-box;
}

.mz-nav a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mz-nav button {
    font: inherit;
    touch-action: manipulation;
}

/* ---------- Header bar ---------- */

.mz-nav__bar {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    width: 100%;
    max-width: 1440px;
    min-height: var(--mz-nav-height);
    margin-inline: auto;
    padding: 0 clamp(20px, 5vw, 76px);
}

/* No background, blur, or height change on scroll. */
.mz-nav.is-scrolled {
    background: var(--mz-nav-bg);
    box-shadow: 0 5px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mz-nav.is-scrolled .mz-nav__bar {
    min-height: var(--mz-nav-height);
}

/* ---------- Three-tone M logo and wordmark ---------- */

.mz-nav__brand {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    gap: 12px;

    flex: 0 0 auto;
    min-width: 0;

    color: var(--mz-nav-text);
    cursor: pointer;
}

.mz-nav__logo {
    display: block;
    flex: 0 0 auto;

    width: 52px;
    height: 42px;
    overflow: visible;
}

.mz-nav__logo-left {
    fill: var(--mz-logo-light);
}

.mz-nav__logo-middle {
    fill: var(--mz-logo-dark);
}

.mz-nav__logo-right {
    fill: var(--mz-logo-cream);
}

.mz-nav__brand-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.mz-nav__brand-name {
    display: block;
    margin: 0;

    color: var(--mz-nav-text);
    font-family: "Playfair Display", serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 5px;
}

.mz-nav__brand-label {
    display: block;
    margin: 0;

    color: var(--mz-nav-muted);
    font-size: 8px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* Subtle brand interaction; colors remain consistent. */

.mz-nav__brand:hover .mz-nav__logo {
    transform: translateY(-1px);
}

.mz-nav__logo {
    transition: transform 0.25s ease;
}

/* ---------- Desktop navigation ---------- */

.mz-nav__panel {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(18px, 2.5vw, 36px);

    min-width: 0;
}

.mz-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    margin: 0;
    padding: 0 0 2px;

    color: var(--mz-nav-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;

    cursor: pointer;
    pointer-events: auto;

    transition: color var(--mz-nav-transition);
}

/* Underline is hidden until hover or keyboard focus. */
.mz-nav__link::after {
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;

    height: 2px;
    border-radius: 2px;

    background: var(--mz-nav-accent);
    content: "";

    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;

    transition: transform 0.25s ease;
}

.mz-nav__link:hover,
.mz-nav__link:focus-visible {
    color: var(--mz-nav-text);
}

.mz-nav__link:hover::after,
.mz-nav__link:focus-visible::after {
    transform: scaleX(1);
}

/* Active page stays readable but has no permanent underline. */
.mz-nav__link.is-active {
    color: var(--mz-nav-text);
}

.mz-nav__link.is-active::after {
    transform: scaleX(0);
}

/* ---------- Contact link ---------- */

.mz-nav__contact {
    position: relative;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 42px;
    margin: 0;
    padding: 0 18px;

    border: 1px solid var(--mz-nav-accent);
    border-radius: 3px;

    color: var(--mz-nav-accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;

    cursor: pointer;
    pointer-events: auto;

    transition:
        color var(--mz-nav-transition),
        background-color var(--mz-nav-transition);
}

.mz-nav__contact:hover,
.mz-nav__contact:focus-visible {
    color: #111111;
    background: var(--mz-nav-accent);
}

.mz-nav__contact span {
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

/* ---------- Mobile controls: hidden on desktop ---------- */

.mz-nav__toggle,
.mz-nav__close,
.mz-nav__mobile-heading,
.mz-nav__backdrop {
    display: none;
}

/* =========================================================
   TABLET AND MOBILE DRAWER
   ========================================================= */

@media (max-width: 900px) {
    .mz-nav {
        --mz-nav-height: 70px;
    }

    .mz-nav__bar,
    .mz-nav.is-scrolled .mz-nav__bar {
        min-height: var(--mz-nav-height);
        gap: 16px;
        padding-inline: 22px;
    }

    .mz-nav__logo {
        width: 44px;
        height: 36px;
    }

    .mz-nav__brand {
        gap: 9px;
    }

    .mz-nav__brand-name {
        font-size: 21px;
        letter-spacing: 4px;
    }

    .mz-nav__brand-label {
        font-size: 7px;
        letter-spacing: 1.5px;
    }

    /* Menu toggle */

    .mz-nav__toggle {
        position: relative;
        z-index: 10003;

        display: flex;
        flex: 0 0 44px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;

        width: 44px;
        height: 44px;
        padding: 10px;

        border: 1px solid rgba(247, 233, 215, 0.25);
        border-radius: 3px;

        background: transparent;
        color: var(--mz-nav-text);
        cursor: pointer;
        pointer-events: auto;
    }

    .mz-nav__toggle-line {
        display: block;
        width: 20px;
        height: 2px;

        border-radius: 2px;
        background: currentColor;
        pointer-events: none;

        transition:
            transform 0.25s ease,
            opacity 0.2s ease;
    }

    .mz-nav.is-open .mz-nav__toggle-line:first-child {
        transform: translateY(8px) rotate(45deg);
    }

    .mz-nav.is-open .mz-nav__toggle-line:nth-child(2) {
        opacity: 0;
    }

    .mz-nav.is-open .mz-nav__toggle-line:last-child {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Drawer */

    .mz-nav__panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 10002;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;

        width: min(84vw, 380px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;

        padding: 22px 28px 36px;

        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;

        background: var(--mz-nav-panel);
        box-shadow: -15px 0 50px rgba(0, 0, 0, 0.3);

        transform: translateX(105%);
        visibility: hidden;
        pointer-events: none;

        transition:
            transform 0.35s ease,
            visibility 0.35s ease;
    }

    .mz-nav.is-open .mz-nav__panel {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    /* Drawer heading */

    .mz-nav__mobile-heading {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;

        min-height: 54px;
        margin-bottom: 18px;

        border-bottom: 1px solid rgba(247, 233, 215, 0.14);
    }

    .mz-nav__mobile-title {
        margin: 0;

        color: var(--mz-logo-light);
        font-family: "Playfair Display", serif;
        font-size: 22px;
        font-weight: 600;
    }

    /* Drawer close button */

    .mz-nav__close {
        display: inline-flex;
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;

        width: 40px;
        height: 40px;
        padding: 0;

        border: 0;
        border-radius: 3px;

        background: transparent;
        color: var(--mz-nav-text);
        font-size: 30px;
        line-height: 1;

        cursor: pointer;
        pointer-events: auto;
    }

    /* Drawer links */

    .mz-nav__link {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: flex-start;

        min-height: 55px;
        padding: 0 0 2px;

        border-bottom: 1px solid rgba(247, 233, 215, 0.08);

        font-size: 15px;
        white-space: normal;
    }

    .mz-nav__link::after {
        right: auto;
        bottom: 12px;
        left: 0;
        width: 32px;
    }

    .mz-nav__contact {
        display: flex;
        flex: 0 0 auto;
        justify-content: space-between;

        min-height: 48px;
        margin-top: 28px;
        padding-inline: 16px;
    }

    /* Backdrop must remain behind the drawer. */

    .mz-nav__backdrop {
        position: fixed;
        inset: 0;
        z-index: 10001;

        display: block;
        margin: 0;
        padding: 0;

        border: 0;
        background: rgba(0, 0, 0, 0.65);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        cursor: pointer;

        transition:
            opacity 0.3s ease,
            visibility 0.3s ease;
    }

    .mz-nav.is-open .mz-nav__backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.mz-nav-locked {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

/* ---------- Compact mobile screens ---------- */

@media (max-width: 380px) {
    .mz-nav__bar,
    .mz-nav.is-scrolled .mz-nav__bar {
        padding-inline: 15px;
    }

    .mz-nav__brand {
        gap: 7px;
    }

    .mz-nav__logo {
        width: 38px;
        height: 33px;
    }

    .mz-nav__brand-name {
        font-size: 18px;
        letter-spacing: 3px;
    }

    .mz-nav__brand-label {
        font-size: 6px;
        letter-spacing: 1.2px;
    }

    .mz-nav__panel {
        width: min(90vw, 340px);
        padding-inline: 22px;
    }
}

/* ---------- Hide header while scrolling down ---------- */

.mz-nav.is-hidden {
    transform: translateY(-100%);
}

.mz-nav.is-open,
.mz-nav.is-open.is-hidden {
    transform: translateY(0);
}

/* ---------- Keyboard focus ---------- */

.mz-nav a:focus-visible,
.mz-nav button:focus-visible {
    outline: 2px solid var(--mz-nav-accent);
    outline-offset: 4px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .mz-nav,
    .mz-nav *,
    .mz-nav *::before,
    .mz-nav *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
