/*----------------------------------------------------------*/
/* NAVIGATION BAR */
/*----------------------------------------------------------*/

/* walter white */
#walter_white {
    position: fixed;
    z-index: 97;
    /*background-color: var(--dark-text-color);*/
    background: linear-gradient(var(--dark-text-color), rgba(0,0,0,0));
    height: 0;
    width: 100%;
    transition: .2s;
}

#walter_white.active {
    height: 80px;
}

/* desktop buttons */
.desktop-nav {
    position: fixed;
    z-index: 98;
    width: 90%;
    left: 5%;
    top: 5%;
    display: flex !important;
    flex-direction: row;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 1.5s ease-out, top .7s;
}

body.loaded .desktop-nav {
    opacity: 1;
}

body.loaded .desktop-nav.active {
    top: 1%;
    opacity: .1;
}

body.loaded .desktop-nav.active:hover {
    opacity: 1;
}

.desktop-nav-logo-container {
    display: flex;
    align-items: center !important;
    cursor: pointer;
}

.desktop-nav-logo-container > a {
    display: flex;
    align-items: center;
}

.desktop-nav-logo-container .nav-logo-large {
    height: 28px;
    opacity: 1;
    transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0s;
}

.desktop-nav:not(.is-nav-collapsed) .nav-logo-large {
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s;
}

.desktop-nav-logo-container .nav-logo-small {
    position: absolute;
    height: 24px;
    opacity: 0;
    transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0s;
}

.desktop-nav.is-nav-collapsed .nav-logo-small {
    opacity: 1;
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1s;
}

.desktop-nav.is-nav-collapsed .nav-logo-large,
.desktop-nav.is-nav-collapsed .desktop-nav-buttons {
    opacity: 0;
}

.desktop-nav-buttons {
    position: relative;
    z-index: 95;
    opacity: 1;
    transition: opacity 0.7s ease-out;
}

.desktop-nav-buttons-container {
    display: flex;
    align-items: center !important;
    position: relative;
    /* Increase hover area for better UX */
    padding: 20px 0;
}

.desktop-nav-buttons-container ul {
    margin: 0 -30px 0 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-nav-buttons-container ul li {
    --nav-item-spacing: 30px;
    --nav-label-height: 15px;
    display: inline-block;
    position: relative;
    padding: 0 var(--nav-item-spacing);
}

.desktop-nav-buttons-container ul li a {
    color: var(--text-color-light);
    cursor: pointer;
    text-transform: lowercase;
    font-family: var(--font-primary);
    font-size: 0.93em;
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: .5;
    transition: .3s;
}

.desktop-nav-buttons-container ul li a::before {
    content: "";
    position: absolute;
    inset: 50% calc(var(--nav-item-spacing) - 4px) auto;
    height: calc(var(--nav-label-height) + 8px);
    transform: translateY(-50%);
}

.desktop-nav-buttons-container ul li a .mask {
    height: var(--nav-label-height);
}

.desktop-nav-buttons-container ul li .call-cta::before {
    padding-bottom: 1px;
}

.desktop-nav-buttons-container ul li a:is(:hover, [aria-current="page"]) {
    opacity: 1;
}

.desktop-nav .changed {
    color: var(--dark-text-color);
}

.desktop-nav-buttons-container .nav-second-color {
    color: var(--light-text-color);
    font-weight: 400;
}

.nav-apply-button {
	overflow: hidden;
    margin-top: 5px;
    padding: 14px 30px 12px 30px;
    border-radius: 6px;
	color: var(--light-text-color);
    background: var(--gradient-color);
    transition: all .3s;
    display: inline-block;
    opacity: .5;
}

.desktop-nav-buttons:hover {
    opacity: 1 !important;
    pointer-events: auto;
}

.desktop-nav-buttons .call-cta {
    opacity: 1 !important;
}

.desktop-nav-buttons .link .mask-cta {
    border-bottom: solid 1px var(--text-color-light);
}  

.desktop-nav-hr-container {
    position: absolute;
    z-index: 90;
    display: flex;
    align-items: center;
    right: 0%;
    width: 0;
    height: 60px;
    opacity: 1;
    pointer-events: none;
    margin-left: auto;
    transform-origin: right; 
    /* Increase hover area with padding */
    padding: 20px 0;
    /* Transition WITH delay when returning to opacity 1 (after hover ends) */
    transition: width 1.8s var(--motion-ease-out),
                opacity 0.8s var(--motion-ease-out) 0.5s; /* Added delay here */
}

.desktop-nav.is-nav-collapsed .desktop-nav-hr-container {
    width: 100%;
}

.desktop-nav.is-nav-collapsed .desktop-nav-buttons-container:is(:hover, :focus-within) .desktop-nav-hr-container {
    opacity: 0;
    transition: width 1.8s var(--motion-ease-out),
                opacity 0.8s var(--motion-ease-out) 0s; /* No delay here */
}

/* When hovering the line container, show the navigation buttons */
.desktop-nav.is-nav-collapsed .desktop-nav-buttons-container:is(:hover, :focus-within) .desktop-nav-buttons {
    opacity: 1;
}

.desktop-nav-hr {
    width: 100%;
    height: 1px;
    background-color: var(--text-color-light);
    opacity: .5;
}



/* mobile */
#nav {
    --mobile-nav-inset: clamp(1.25rem, 6vw, 4rem);
    position: fixed;
    inset: 0 0 auto;
    z-index: 95;
    display: none;
    background: linear-gradient(var(--global-color-dark), transparent);
}

.mobile-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: max(0.75rem, env(safe-area-inset-top)) max(var(--mobile-nav-inset), env(safe-area-inset-right)) 0.75rem max(var(--mobile-nav-inset), env(safe-area-inset-left));
}

.mobile-nav-logo img {
    display: block;
    width: clamp(8rem, 34vw, 10rem);
    height: auto;
}

.mobile-nav-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mobile-nav-toggle img {
    display: block;
    width: 22px;
    height: auto;
}

.mobile-menu-close img {
    width: 18px;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    overflow: auto;
    overscroll-behavior: contain;
    color: var(--text-color-light);
    background: var(--global-color-dark);
    font-family: var(--font-quaternary), sans-serif;
}

.mobile-menu::backdrop {
    background: transparent;
}

html:has(.mobile-menu[open]) {
    overflow: hidden;
}

.mobile-menu-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mobile-menu-content,
.mobile-menu-social {
    padding-inline: max(var(--mobile-nav-inset), env(safe-area-inset-left)) max(var(--mobile-nav-inset), env(safe-area-inset-right));
}

.mobile-menu-content {
    margin-block: auto;
    padding-block: clamp(1rem, 4dvh, 3rem);
}

.mobile-menu-links {
    display: grid;
    gap: clamp(1rem, 2.8dvh, 2rem);
    list-style: none;
}

.mobile-menu-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    min-height: 44px;
    color: var(--text-color-light);
    font-size: clamp(2rem, min(10vw, 6dvh), 4rem);
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.02em;
    opacity: 0.65;
    transition: opacity 0.7s var(--motion-ease-out);
}

.mobile-menu-links a:is(:hover, :focus-visible, [aria-current="page"]) {
    opacity: 1;
}

.mobile-menu-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: clamp(1.5rem, 4dvh, 3rem);
    color: var(--text-color-light);
    font-size: 1.25rem;
    font-weight: 200;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;
}

.mobile-menu .noise-effect {
    view-transition-name: none;
}

.mobile-menu-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.mobile-menu-social a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: rgb(255 254 234 / 68%);
    font-size: 1rem;
    font-weight: 200;
}

#nav :is(a, button):focus-visible {
    outline: 2px solid var(--text-color-light);
    outline-offset: 4px;
}

@media (hover: hover) {
    .mobile-menu-links a:hover,
    .mobile-menu-social a:hover {
        text-decoration: underline;
        text-underline-offset: 0.15em;
        text-decoration-thickness: 1px;
    }
}

/* TABLET OPTIMIZATION */
@media (max-width: 1000px) {
    .desktop-nav {
        display: none !important;
    }

    #nav {
        display: block;
    }
}
