/* ========================================================

HEADER

======================================================== */

/* MAIN */
header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;

    position: fixed;

    top: 0;
    left: 0;

    background-color: rgba(255, 255, 255, 0.975);
    border-bottom: 1px solid rgb(240, 240, 240);
    backdrop-filter: blur(8px);
    
    width: 100%;
    height: 6rem;
    padding: 0 var(--default-padding-horizontal);

    z-index: 1024;
    transform: translateZ(0);
    will-change: backdrop-filter;
}

/* BRAND */
header > .brand {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    
    transition: color var(--default-transition);
}

header > .brand:hover {
    color: rgba(0, 0, 0, 0.375);
}

header > .brand,
header > .brand > span {
    color: rgba(0, 0, 0, 1);
    font-weight: 700;
    font-size: 1.25rem;
    
    line-height: 3rem;
    letter-spacing: calc(1.25rem * var(--default-letter-spacing));
    
    flex-shrink: 0;
    flex-grow: 0;

    width: auto;
    height: 3rem;
}

header > .brand > img {
    width: 100%;
    height: 100%;
    padding-top: 0.3rem;
    margin-right: 0.75rem;
}

/* NAVIGATION */
nav {
    position: fixed;
    
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    
    top: 0;
    left: 50%;
    
    width: auto;
    height: 6rem;

    transform: translateX(-50%);
    z-index: 2048;
}

nav > a {
    color: rgba(0, 0, 0, 0.75);

    font-weight: 500;
    font-size: 0.75rem;

    border-radius: 16em;

    text-align: center;
    text-transform: uppercase;
    letter-spacing: calc(0.75rem * var(--default-letter-spacing) * 2.25);
    line-height: 3rem;

    flex-shrink: 0;
    flex-grow: 0;

    width: auto;
    height: 3rem;
    padding: 0 1.5rem;

    transition: color var(--default-transition), outline-color var(--default-transition), outline-offset var(--default-transition);
}

nav > a:hover {
    color: rgba(0, 0, 0, 0.25);
}

/* BUTTONS */
header > .button {
    color: rgb(255, 255, 255);
    background-color: rgb(0, 0, 0);
    border-radius: 1.5rem;
    
    font-weight: 500;
    font-size: 0.75rem;
    
    position: relative;
    
    text-transform: uppercase;
    letter-spacing: calc(0.75rem * var(--default-letter-spacing) * 2.25);
    line-height: 3rem;
    
    flex-shrink: 0;
    height: 3rem;
    padding: 0 1.5rem;
    
    transform-style: preserve-3d;
    transform: translateX(-0px);
}

header > .button:hover {
    transform: translateX(-47px);
}

header > .button::before {
    content: "";
    position: absolute;
    
    top: 0;
    left: 0;
    
    width: 100%;
    height: 100%;
    
    transition: width var(--default-transition);
}

header > .button:hover::before {
    width: calc(100% + 48px);
}

header > .button::after {
    content: "";
    
    background-color: rgb(0, 0, 0);
    border-radius: 1.5rem;
    
    background-image: url("https://p01ar.com/icons/redirect.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.35rem;
    
    position: absolute;
    pointer-events: none;
    
    top: 50%;
    right: 0;
    
    flex-shrink: 0;
    
    width: 3rem;
    height: 3rem;
    
    z-index: -1;
    transform: translateX(0px) translateY(-50%) translateZ(-1px);
}

header > .button,
header > .button::after {
    transition: transform var(--default-transition);
}

header > .button:hover::after {
    transform: translateX(47px) translateY(-50%) translateZ(-1px);
}

@media (max-width: 1024px) {
    section.header-buffer {
        --mobile-header-enabled: 1 !important;
    }
    
    body {
        padding-bottom: 6rem;
    }
    
    header,
    nav{
        background-color: rgb(255, 255, 255);
        backdrop-filter: none;
    }
    
    nav {
        border-top: 1px solid rgb(240, 240, 240);
        border-bottom: 1px solid rgb(240, 240, 240);
        
        top: auto;
        left: 0;
        bottom: 0;
        
        width: 100%;
        height: 6rem;
        padding: 0 12px;
        
        transform: none;
    }
    
    nav > a {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        
        position: relative;
        
        color: rgba(0, 0, 0, 0.75);
        outline-color: rgba(0, 0, 0, 0) !important;
        
        font-weight: 600;
        font-size: 11px;
        
        flex-shrink: 1;
        line-height: 11px;
        letter-spacing: calc(11px * var(--default-letter-spacing) * 1.5);
        
        width: 100%;
        height: 100%;
        padding: 0;
        gap: 2px;
    }
    
    nav > a::before {
        content: "";
        opacity: 0.75;
        
        background-repeat: no-repeat;
        background-size: contain;
        
        flex-shrink: 0;
        
        width: 40px;
        height: 40px;

        transition: opacity var(--default-transition);
    }

    nav > a:hover::before {
        opacity: 0.25;
    }
    
    nav > a[data-icon="home"]::before { background-image: url("https://p01ar.com/icons/home.png"); }
    nav > a[data-icon="about"]::before { background-image: url("https://p01ar.com/icons/users.png"); }
    nav > a[data-icon="projects"]::before { background-image: url("https://p01ar.com/icons/briefcase.png"); }
    nav > a[data-icon="contact"]::before { background-image: url("https://p01ar.com/icons/message.png"); }
}