:root {
    --overlay-safe-gap: 5px;
    --navbar-height: 47px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --overlay-bottom-cushion: 60px;
    --blur-intensity: 70;
    --overlay-blur: 10px;
    --overlay-bg-alpha: 0.6;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body {
    padding-top: var(--navbar-height, 47px);
    overflow-x: hidden;
}
@media (min-width: 769px) {
  body { padding-top: calc(var(--navbar-height, 47px) + 15px); }
}

body.overlay-active {
    overflow: hidden;
}
#navbar {
    background-color: #fff;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--navbar-height, 47px);
    box-sizing: border-box;
    z-index: 11001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
}
.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1440px;
    padding: 0 20px;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
#navbar .logo {
    display: flex;
    align-items: center;
}
#navbar .logo img {
    height: 34px;
    display: block;
}
#navbar .menu {
    display: flex;
    align-items: center;
}
#navbar .menu ul {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
    align-items: center;
    gap: 8px;
    overflow-x: auto; 
    overflow-y: hidden; 
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) rgba(241, 245, 249, 0.3);
}
#navbar .menu ul li {
    display: flex;
    align-items: center;
}
#navbar .menu ul li a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#navbar .menu ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 
                0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    color: #333;
}
#navbar .menu ul li a:active {
    transform: translateY(0px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
#navbar .menu ul li a:focus {
    outline: none;
}

#navbar .menu ul::-webkit-scrollbar {
    height: 4px;
}

#navbar .menu ul::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.3);
    border-radius: 2px;
}

#navbar .menu ul::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 2px;
}

#navbar .menu ul::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

.hamburger {
    cursor: pointer;
    background: transparent;
    border: none;
    z-index: 11001;
    transition: all 0.3s ease;
    padding: 10px 12px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 44px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.hamburger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.hamburger:focus {
    outline: none;
}
#navbar .menu ul li:last-child {
    margin-left: 8px;
}
#navbar .menu ul li:last-child .hamburger {
    display: flex;
}
.hamburger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.line {
    background-color: #000;
    height: 3px;
    width: 24px;
    margin: 2px 0;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
}
.hamburger.active .line1 {
    transform: translateY(7px) rotate(45deg);
    background-color: black;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
}
.hamburger.active .line2 {
    opacity: 0;
    background-color: black;
    box-shadow: none;
}
.hamburger.active .line3 {
    transform: translateY(-7px) rotate(-45deg);
    background-color: black;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
}
@media screen and (min-width: 769px) {
    .mobile-hamburger {
        display: none;
    }
}

#overlayNav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 0;
    background-color: rgba(0, 0, 0, var(--overlay-bg-alpha));
    backdrop-filter: blur(var(--overlay-blur));
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
                background-color 180ms ease,
                backdrop-filter 180ms ease;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overscroll-behavior: contain;
}

body.overlay-blur-boost #overlayNav {
    --overlay-blur: calc(10px + (var(--blur-intensity) / 100 * 15px));
    --overlay-bg-alpha: calc(0.6 + (var(--blur-intensity) / 100 * 0.2));
}

@supports not ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))) {
    body.overlay-blur-boost #overlayNav {
        --overlay-bg-alpha: 0.82;
    }
}

#overlayNav.open {
    height: 100dvh;
}

.overlay-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.85) rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    padding-top: calc(var(--navbar-height, 47px) + var(--overlay-safe-gap) + var(--safe-area-top));
    padding-bottom: calc(var(--overlay-bottom-cushion) + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--overlay-bottom-cushion) + env(safe-area-inset-bottom, 0px));
}

@supports (height: 1lvh) {
    .overlay-content {
        max-height: 100lvh;
    }
}

@supports not (height: 1lvh) {
    .overlay-content {
        max-height: 100%;
    }
}

.overlay-content .menu-items-container {
    width: 85%;
    max-width: 500px;
    text-align: center;
    flex-shrink: 0;
    padding: 80px 0 80px 0;
}

.scroll-sentinel {
    height: 80px;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.overlay-content::-webkit-scrollbar {
    width: 16px;
}

.overlay-content::-webkit-scrollbar-track {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.overlay-content::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.85) 25%,
        rgba(240, 240, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.85) 75%,
        rgba(255, 255, 255, 0.95) 100%
    );
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.6),
        0 0 25px rgba(255, 255, 255, 0.4),
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        inset 0 -1px 3px rgba(200, 200, 255, 0.4);
    transition: all 0.3s ease;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(245, 245, 255, 0.95) 25%,
        rgba(235, 235, 255, 0.98) 50%,
        rgba(245, 245, 255, 0.95) 75%,
        rgba(255, 255, 255, 1) 100%
    );
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.9),
        0 0 35px rgba(255, 255, 255, 0.6),
        0 0 50px rgba(200, 200, 255, 0.4),
        inset 0 1px 4px rgba(255, 255, 255, 1),
        inset 0 -1px 4px rgba(180, 180, 255, 0.5);
    transform: scaleX(1.1);
}

.overlay-content::-webkit-scrollbar-thumb:active {
    background: linear-gradient(
        180deg,
        rgba(240, 240, 255, 0.95) 0%,
        rgba(230, 230, 255, 0.9) 50%,
        rgba(240, 240, 255, 0.95) 100%
    );
}

#overlayNav a {
    padding: 15px 30px;
    text-decoration: none;
    font-size: 42px;
    color: white;
    display: block;
    margin: 6px 0;
    border-radius: 8px;
    transition: all 0.4s ease;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#overlayNav a:hover {
    color: #ffffff;
    text-shadow: 
        0 0 4px rgba(255, 255, 255, 0.48),
        0 0 8px rgba(255, 255, 255, 0.36),
        0 0 12px rgba(255, 255, 255, 0.24);
    transform: scale(1.012);
    background: transparent;
}

#overlayNav a:focus {
    outline: none;
}

#overlayNav a.traveling {
    color: #ffffff;
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.8),
        0 0 16px rgba(255, 255, 255, 0.6),
        0 0 24px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    background: transparent; 
}

@media screen and (max-width: 1200px) {
    #navbar .menu ul {
        gap: 6px;
    }
    
    #navbar .menu ul li a {
        padding: 8px 10px;
        font-size: 15px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 6px;
    }
}

@media screen and (max-width: 1050px) {
    #navbar .logo img {
        height: 32px;
    }
    
    #navbar .menu ul {
        gap: 5px;
    }
    
    #navbar .menu ul li a {
        padding: 6px 8px;
        font-size: 15px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 5px;
    }
    
    .hamburger {
        padding: 8px 10px;
    }
}

@media screen and (max-width: 950px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    #navbar .logo img {
        height: 30px;
    }
    
    #navbar .menu ul {
        gap: 4px;
    }
    
    #navbar .menu ul li a {
        padding: 4px 6px;
        font-size: 14px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 4px;
    }
    
    .hamburger {
        height: 36px;
        padding: 6px 8px;
    }
    
    .line {
        width: 20px;
        height: 2.5px;
        margin: 1.5px 0;
    }
    
    .hamburger.active .line1 {
        transform: translateY(5.5px) rotate(45deg);
    }
    
    .hamburger.active .line3 {
        transform: translateY(-5.5px) rotate(-45deg);
    }
}

@media screen and (max-width: 900px) {
    #navbar .menu ul li:nth-child(4),
    #navbar .menu ul li:nth-child(6) {
        display: none;
    }
    
    #navbar .menu ul {
        gap: 5px;
    }
    
    #navbar .menu ul li a {
        padding: 4px 7px;
        font-size: 14px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 5px;
    }
    
    .hamburger {
        padding: 5px 8px;
    }
}

@media screen and (max-width: 850px) {
    .navbar-container {
        padding: 0 10px;
    }
    
    #navbar .menu ul li:nth-child(2),
    #navbar .menu ul li:nth-child(5) {
        display: none;
    }
    
    #navbar .menu ul {
        gap: 6px;
    }
    
    #navbar .menu ul li a {
        padding: 5px 8px;
        font-size: 14px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 6px;
    }
}

@media screen and (max-width: 820px) {
    .navbar-container {
        padding: 0 8px;
    }
    
    #navbar .menu ul {
        gap: 5px;
    }
    
    #navbar .menu ul li a {
        padding: 4px 6px;
        font-size: 14px;
    }
    
    #navbar .menu ul li:last-child {
        margin-left: 5px;
    }
    
    .hamburger {
        padding: 4px 6px;
    }
}

@media screen and (max-width: 768px) {
    #navbar .logo {
        padding-left: 15px;
    }
    
    #navbar .logo img {
        height: 32px;
    }
    
    #navbar .menu {
        display: none;
    }
    
    .mobile-hamburger {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 11001;
        display: flex;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 36px;
        transition: all 0.3s ease;
        border-radius: 4px;
        -webkit-tap-highlight-color: transparent;
        outline: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .mobile-hamburger:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    .mobile-hamburger:focus {
        outline: none;
    }
    
    .mobile-hamburger .line {
        width: 26px;
        height: 3.5px;
        margin: 2px 0;
        background-color: #000;
        box-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
    }
    
    .mobile-hamburger.active .line1 {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-hamburger.active .line2 {
        opacity: 0;
    }
    
    .mobile-hamburger.active .line3 {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .overlay-content .menu-items-container {
        width: 95%;
        padding: 60px 0 60px 0;
    }
    
    #overlayNav a {
        font-size: 28px;
        padding: 10px 15px;
        margin: 3px 0;
    }
    
    .overlay-content::-webkit-scrollbar {
        width: 14px;
    }
}

@media screen and (max-width: 480px) {
    #navbar .logo img {
        height: 30px;
    }
    
    .mobile-hamburger {
        height: 34px;
        padding: 6px;
    }
    
    .mobile-hamburger .line {
        width: 24px;
        height: 2.5px;
        margin: 1.5px 0;
    }
    
    .mobile-hamburger.active .line1 {
        transform: translateY(5.5px) rotate(45deg);
    }
    
    .mobile-hamburger.active .line3 {
        transform: translateY(-5.5px) rotate(-45deg);
    }
    
    .overlay-content .menu-items-container {
        padding: 50px 0 50px 0;
    }
    
    #overlayNav a {
        font-size: 24px;
        padding: 8px 12px;
    }
    
    .overlay-content::-webkit-scrollbar {
        width: 12px;
    }
}

@media screen and (max-width: 320px) {
    #navbar .logo img {
        height: 28px;
    }
    
    .mobile-hamburger {
        height: 32px;
        right: 15px;
    }
    
    .mobile-hamburger .line {
        width: 22px;
        height: 2.5px;
    }
    
    .overlay-content .menu-items-container {
        padding: 40px 0 40px 0;
    }
    
    #overlayNav a {
        font-size: 22px;
        padding: 6px 10px;
    }
}