:root {
    --header-height: 96px;

    @media (max-width: 768px) {
        --header-height: 80px;
    }
}

.header-filler {
    height: var(--header-height);
}

.header-mask {
  height: var(--header-height); /* you can define this variable in :root or replace with a fixed value like 80px */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(10px); /* similar to backdrop-blur-md in Tailwind */
  pointer-events: none;
  z-index: 40;

  /* Mask for fade effect */
  -webkit-mask: linear-gradient(to bottom, black 40%, transparent 100%);
  mask: linear-gradient(to bottom, black 40%, transparent 100%);
}


.site-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
    z-index: 50;
}

.site-header .container {
    position: relative;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-header .container > div:nth-child(1) {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.desktop-header-cta {
    flex: 1;
    display: flex;
    justify-content: flex-end;

    @media (max-width: 1024px) {
        display: none;   
    }
}

.site-logo-link {
    width: 96px;
    height: auto;
    overflow: hidden;
    display: block;
    position: relative;
    z-index: 20;

    @media (max-width: 768px) {
        width: 64px;
    }
}

.site-logo-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

ul.header-menu:not(.mobile) {
    padding: 0 2rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    font-size: 0.875rem;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
    color: var(--color-foreground);
}

ul.header-menu:not(.mobile) > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

ul.header-menu:not(.mobile) > li {
    opacity: 0.7;
    transition: opacity 0.3s ease-in-out;
}

ul.header-menu:not(.mobile) > li:hover {
    opacity: 1;
}

ul.header-menu:not(.mobile) > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%); /* center vertically */
    width: 6px;   /* circle size */
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    background: var(--background-gradient);
    transition: opacity 0.3s ease-in-out;
}

ul.header-menu:not(.mobile) > li:hover::before {
    opacity: 1;
}

ul.header-menu:not(.mobile) > li {
    position: relative;
    display: flex;
    align-items: center;
}

ul.header-menu:not(.mobile) > li.menu-item-has-children:hover a::after {
    transform: rotate(45deg);
}

ul.header-menu:not(.mobile) > li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXBsdXMtaWNvbiBsdWNpZGUtcGx1cyI+PHBhdGggZD0iTTUgMTJoMTQiLz48cGF0aCBkPSJNMTIgNXYxNCIvPjwvc3ZnPg==") no-repeat center;
    background-size: contain;
    transition: transform 0.3s ease-in-out;
}

ul.header-menu:not(.mobile) > li .sub-menu:first-of-type {
    position: absolute;
    top: 100%;
    width: max-content;
    left: 0;
    opacity: 0;
    background: white;
    z-index: 20;
    transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    pointer-events: none;
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    min-width: 100%;
}

ul.header-menu:not(.mobile) > li .sub-menu:first-of-type a {
    display: block;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    border-radius: 0.25rem;
    min-width: 100%;
}

ul.header-menu:not(.mobile) > li .sub-menu:first-of-type a:hover {
    background-color: var(--color-muted);
}

ul.header-menu:not(.mobile) > li:hover .sub-menu:first-of-type {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    ul.header-menu {
        display: flex;
        flex-direction: column;
        align-items: start;
        position: absolute;
        inset: 0;
        opacity: 0;
        z-index: 10;
        font-size: 1.125rem;
        line-height: 2;
        color: var(--color-muted-foreground);
        padding: calc(var(--header-height) + 1rem) 1rem 0 1rem;
        height: fit-content;
        pointer-events: none;
    }

    ul.header-menu > li {
        opacity: 0;
        will-change: opacity, transform;
        width: 100%;
    }

    ul.header-menu > li a {
        max-width: 100%;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
    }

    ul.header-menu.open {
        opacity: 1;
        pointer-events: auto;
    }
}

.toggle-mobile-menu-btn {
    position: absolute;
    right: 1rem;
    background-color: var(--color-background);
    color: var(--color-muted-foreground);
    border: none;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    z-index: 10;
    border: 0.5px solid var(--color-muted-foreground);

    @media (min-width: 769px) {
        display: none;
    }
}

.toggle-mobile-menu-btn > svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.open-menu-icon { 
    opacity: 1;
}

.close-menu-icon { 
    opacity: 0;
}

.toggle-mobile-menu-btn.open .open-menu-icon {
    opacity: 0;
}

.toggle-mobile-menu-btn.open .close-menu-icon {
    opacity: 1;
}

.mobile-menu-bg {
    flex-shrink: 0;
    position: relative;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    background-color: var(--color-background);
    opacity: 1;
    color: var(--color-foreground);
    pointer-events: none;
    transform: scale(0, 0);

    @media (min-width: 769px) {
        display: none;
    }

    transition: transform 0.6s ease-in;
}

.mobile-menu-bg.open {
    transform: scale(50, 50);
}

.header-menu-mobile {
    position: absolute;
    transform: scale(1, 1) !important;
}