/* =========================================================
   LogicGraft Header
   File: assets/css/header.css
========================================================= */


/* =========================================================
   Header
========================================================= */

.site-header {
    position: sticky;
    top: 0;
    left: 0;

    width: 100%;

    z-index: 1000;

    background: rgba(8, 17, 29, .95);

    border-bottom:
        1px solid rgba(255, 255, 255, .07);

    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, .10);

    overflow: visible;
}


/* =========================================================
   Navigation Container
========================================================= */

.nav {
    position: relative;

    min-height: 84px;

    display: flex;
    align-items: center;

    gap: 30px;

    overflow: visible;
}


/* =========================================================
   Brand
========================================================= */

.brand {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;

    color: var(--lg-text);

    text-decoration: none;
}


.brand-logo {
    width: auto;
    height: 58px;

    display: block;

    object-fit: contain;
}


.brand-name {
    color: var(--lg-text) !important;

    font-size: 45px;
    font-weight: 800;

    line-height: 1;

    letter-spacing: -.045em;
}


/* =========================================================
   Main Navigation
========================================================= */

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1;

    height: 84px;

    overflow: visible;
}


.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 4px;

    height: 100%;

    margin: 0;
    padding: 0;

    list-style: none;
}


.nav-item {
    position: relative;

    height: 100%;

    display: flex;
    align-items: center;
}


/* =========================================================
   Navigation Links / Triggers
========================================================= */

.nav-link,
.nav-dropdown-trigger {
    position: relative;

    display: inline-flex;
    align-items: center;

    gap: 7px;

    min-height: 44px;

    padding: 0 15px;

    border: 0;

    background: transparent;

    color: rgba(248, 247, 244, .74);

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;

    cursor: pointer;

    transition:
        color .2s ease;
}


.nav-link::after,
.nav-dropdown-trigger::after {
    content: "";

    position: absolute;

    left: 15px;
    right: 15px;

    bottom: 3px;

    height: 1px;

    background: var(--lg-gold);

    transform: scaleX(0);
    transform-origin: center;

    transition:
        transform .22s ease;
}


.nav-link:hover,
.nav-link:focus-visible,
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger:focus-visible,
.nav-item-dropdown.is-open > .nav-dropdown-trigger {
    color: var(--lg-gold-soft);
}


.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-dropdown-trigger:hover::after,
.nav-dropdown-trigger:focus-visible::after,
.nav-item-dropdown.is-open > .nav-dropdown-trigger::after {
    transform: scaleX(1);
}


/* =========================================================
   Chevron
========================================================= */

.nav-chevron {
    width: 7px;
    height: 7px;

    border-right:
        1.5px solid currentColor;

    border-bottom:
        1.5px solid currentColor;

    transform:
        translateY(-2px)
        rotate(45deg);

    transition:
        transform .2s ease;
}


.nav-item-dropdown.is-open
> .nav-dropdown-trigger
.nav-chevron {
    transform:
        translateY(2px)
        rotate(225deg);
}


/* =========================================================
   Mega Menu
========================================================= */

.mega-menu {
    position: fixed;

    top: 84px;
    left: 50%;

    z-index: 1200;

    width:
        min(
            960px,
            calc(100vw - 48px)
        );

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform:
        translateX(-50%)
        translateY(10px);

    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .18s ease;
}


.nav-item-dropdown.is-open
> .mega-menu {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   Desktop Hover Fallback
========================================================= */

@media (min-width: 1081px) {

    .nav-item-dropdown:hover
    > .mega-menu {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        transform:
            translateX(-50%)
            translateY(0);
    }


    .nav-item-dropdown:hover
    > .nav-dropdown-trigger {
        color: var(--lg-gold-soft);
    }


    .nav-item-dropdown:hover
    > .nav-dropdown-trigger::after {
        transform: scaleX(1);
    }


    .nav-item-dropdown:hover
    > .nav-dropdown-trigger
    .nav-chevron {
        transform:
            translateY(2px)
            rotate(225deg);
    }

}


/* =========================================================
   Mega Menu Shell
========================================================= */

.mega-menu-inner {
    display: grid;

    grid-template-columns:
        .75fr
        1.25fr;

    gap: 42px;

    padding: 34px;

    border:
        1px solid rgba(255, 255, 255, .09);

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            rgba(10, 20, 32, .99),
            rgba(16, 28, 41, .99)
        );

    box-shadow:
        0 28px 80px rgba(0, 0, 0, .38);

    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}


/* =========================================================
   Mega Menu Intro
========================================================= */

.mega-menu-intro {
    padding:
        12px
        18px
        12px
        8px;

    border-right:
        1px solid rgba(255, 255, 255, .08);
}


.mega-menu-eyebrow {
    display: block;

    margin-bottom: 14px;

    color: var(--lg-gold);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .16em;

    text-transform: uppercase;
}


.mega-menu-intro h3 {
    max-width: 320px;

    margin:
        0
        0
        14px;

    color: var(--lg-text);

    font-size: 27px;

    line-height: 1.15;

    letter-spacing: -.035em;
}


.mega-menu-intro p {
    max-width: 330px;

    margin: 0;

    color:
        rgba(248, 247, 244, .52);

    font-size: 13px;

    line-height: 1.7;
}


/* =========================================================
   Mega Menu Links
========================================================= */

.mega-menu-links {
    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 8px;
}


.mega-menu-link {
    position: relative;

    display: grid;

    grid-template-columns:
        42px
        minmax(0, 1fr)
        auto;

    gap: 13px;

    align-items: center;

    padding: 14px;

    border-radius: 14px;

    border:
        1px solid transparent;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}


.mega-menu-link:hover,
.mega-menu-link:focus-visible {
    background:
        rgba(255, 255, 255, .045);

    border-color:
        rgba(199, 163, 90, .18);

    transform:
        translateY(-1px);
}


.mega-menu-icon {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(199, 163, 90, .08);

    border:
        1px solid rgba(199, 163, 90, .20);

    color: var(--lg-gold-soft);

    font-size: 10px;
    font-weight: 800;
}


.mega-menu-link strong {
    display: block;

    margin-bottom: 3px;

    color: var(--lg-text);

    font-size: 13px;
}


.mega-menu-link small {
    display: block;

    color:
        rgba(248, 247, 244, .44);

    font-size: 11px;

    line-height: 1.4;
}


.mega-menu-link i {
    color:
        rgba(224, 201, 142, .55);

    font-style: normal;

    font-size: 17px;

    transition:
        transform .2s ease,
        color .2s ease;
}


.mega-menu-link:hover i,
.mega-menu-link:focus-visible i {
    color: var(--lg-gold-soft);

    transform:
        translateX(3px);
}


/* =========================================================
   Header Actions
========================================================= */

.nav-actions {
    display: flex;
    align-items: center;

    gap: 12px;

    flex-shrink: 0;
}


.nav-actions .btn {
    min-height: 46px;

    padding:
        0
        20px;

    white-space: nowrap;
}


/* =========================================================
   Hamburger
========================================================= */

.menu-toggle {
    width: 46px;
    height: 46px;

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 0;

    border-radius: 12px;

    border:
        1px solid rgba(255, 255, 255, .14);

    background:
        rgba(255, 255, 255, .03);

    cursor: pointer;
}


.menu-toggle span {
    width: 19px;
    height: 1.5px;

    display: block;

    border-radius: 10px;

    background: var(--lg-text);

    transition:
        transform .2s ease,
        opacity .2s ease;
}


.menu-toggle[aria-expanded="true"]
span:nth-child(1) {
    transform:
        translateY(6.5px)
        rotate(45deg);
}


.menu-toggle[aria-expanded="true"]
span:nth-child(2) {
    opacity: 0;
}


.menu-toggle[aria-expanded="true"]
span:nth-child(3) {
    transform:
        translateY(-6.5px)
        rotate(-45deg);
}


/* =========================================================
   Mobile-only CTA Inside Open Menu
========================================================= */

.mobile-nav-cta {
    display: none;
}


/* =========================================================
   Tablet / Mobile Navigation
========================================================= */

@media (max-width: 1080px) {

    /*
     * Brand stays on the left.
     * Sticky CTA + hamburger stay together on the right.
     */

    .nav {
        justify-content: space-between;
    }


    .nav-actions {
        margin-left: auto;

        gap: 9px;
    }


    /*
     * Keep the CTA visible in the sticky header.
     */

    .nav-actions .btn {
        display: inline-flex;

        align-items: center;
        justify-content: center;

        min-height: 44px;

        padding:
            0
            17px;

        font-size: 12px;
    }


    /*
     * Hamburger is always the final item at the far right.
     */

    .menu-toggle {
        display: flex;

        flex: 0 0 46px;

        margin-left: 0;
    }


    /*
     * Dropdown panel.
     */

    .main-navigation {
        position: absolute;

        top: calc(100% + 10px);

        left: 13px;
        right: 13px;

        height: auto;

        display: block;

        padding: 16px;

        border:
            1px solid rgba(255, 255, 255, .10);

        border-radius: 20px;

        background:
            rgba(8, 17, 29, .985);

        box-shadow:
            0 24px 70px rgba(0, 0, 0, .38);

        -webkit-backdrop-filter: blur(22px);
        backdrop-filter: blur(22px);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        transform:
            translateY(-8px);

        transition:
            opacity .2s ease,
            visibility .2s ease,
            transform .2s ease;
    }


    .main-navigation.is-open {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;

        transform:
            translateY(0);
    }


    .nav-links {
        display: block;

        height: auto;
    }


    .nav-item {
        display: block;

        height: auto;

        border-bottom:
            1px solid rgba(255, 255, 255, .07);
    }


    .nav-item:last-child {
        border-bottom: 0;
    }


    .nav-link,
    .nav-dropdown-trigger {
        width: 100%;

        min-height: 54px;

        justify-content: space-between;

        padding:
            0
            6px;

        font-size: 14px;
    }


    .nav-link::after,
    .nav-dropdown-trigger::after {
        display: none;
    }


    .nav-chevron {
        margin-right: 4px;
    }


    /*
     * Mega menus become accordions.
     */

    .mega-menu {
        position: static;

        width: 100%;

        max-height: 0;

        overflow: hidden;

        opacity: 1;
        visibility: visible;

        pointer-events: none;

        transform: none;

        transition:
            max-height .35s ease;
    }


    .nav-item-dropdown.is-open
    > .mega-menu {
        max-height: 900px;

        pointer-events: auto;

        transform: none;
    }


    .mega-menu-inner {
        grid-template-columns: 1fr;

        gap: 16px;

        margin-bottom: 12px;

        padding:
            18px
            8px
            20px;

        border: 0;

        border-radius: 14px;

        background:
            rgba(255, 255, 255, .025);

        box-shadow: none;
    }


    .mega-menu-intro {
        display: none;
    }


    .mega-menu-links {
        grid-template-columns: 1fr;

        gap: 4px;
    }


    .mega-menu-link {
        padding:
            11px
            8px;
    }


    .mega-menu-link small {
        font-size: 11px;
    }


    /*
     * CTA is already permanently visible in sticky header,
     * so do not duplicate it inside the opened mobile menu.
     */

    .mobile-nav-cta {
        display: none;
    }

}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 600px) {

    .nav {
        min-height: 72px;

        gap: 8px;
    }


    .brand {
        gap: 8px;

        min-width: 0;
    }


    .brand-logo {
        height: 45px;

        flex-shrink: 0;
    }


    .brand-name {
        font-size: 23px;

        white-space: nowrap;
    }


    .nav-actions {
        margin-left: auto;

        gap: 7px;
    }


    .nav-actions .btn {
        min-height: 42px;

        padding:
            0
            13px;

        font-size: 11.5px;

        border-radius: 999px;
    }


    .menu-toggle {
        width: 44px;
        height: 44px;

        flex-basis: 44px;

        border-radius: 12px;
    }


    .main-navigation {
        top: calc(100% + 8px);

        left: 8px;
        right: 8px;

        max-height:
            calc(100dvh - 96px);

        overflow-y: auto;

        padding:
            12px
            14px
            16px;

        border-radius: 18px;

        overscroll-behavior: contain;
    }


    .mega-menu-icon {
        width: 36px;
        height: 36px;

        border-radius: 10px;
    }


    .mega-menu-link {
        grid-template-columns:
            38px
            minmax(0, 1fr)
            auto;
    }


    .mega-menu-link strong {
        font-size: 12px;
    }


    .mega-menu-link small {
        font-size: 10px;
    }

}


/* =========================================================
   Small Phones
========================================================= */

@media (max-width: 420px) {

    .nav {
        gap: 6px;
    }


    .brand {
        gap: 6px;
    }


    .brand-logo {
        height: 40px;
    }


    .brand-name {
        font-size: 20px;
    }


    .nav-actions {
        gap: 6px;
    }


    .nav-actions .btn {
        min-height: 40px;

        padding:
            0
            10px;

        font-size: 10.5px;
    }


    .menu-toggle {
        width: 41px;
        height: 41px;

        flex-basis: 41px;
    }


    .menu-toggle span {
        width: 17px;
    }

}


/* =========================================================
   Very Small Phones
========================================================= */

@media (max-width: 360px) {

    .brand-logo {
        height: 38px;
    }


    .brand-name {
        font-size: 18px;
    }


    .nav-actions .btn {
        min-height: 38px;

        padding:
            0
            8px;

        font-size: 10px;
    }


    .menu-toggle {
        width: 39px;
        height: 39px;

        flex-basis: 39px;
    }

}
