/* ========================
   Shared Navbar — 2-state system
   ======================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 66px;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.navbar-inner {
    display: flex;
    align-items: center;
    height: 66px;
    padding: 0 min(40px, 3.333vw);
    position: relative;
}

.navbar-logo {
    flex-shrink: 0;
    transition: color 0.3s;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 2.41vw;
    position: absolute;
    white-space: nowrap;
}
.navbar-links a {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.3s;
}
.navbar-links a:hover { opacity: 1; }

.i18n-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
    margin-left: auto;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

/* --- Hamburger button (hidden on PC, shown on mobile) --- */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    margin-right: 16px;
    padding: 8px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}
.nav-hamburger svg {
    display: block;
}

/* --- Dropdown menu panel --- */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    z-index: 999;
}
.navbar.open .nav-dropdown {
    display: block;
}
.nav-dropdown a {
    display: block;
    padding: 14px min(40px, 3.333vw);
    font-size: 14px;
    font-weight: 400;
    color: #333;
    opacity: 0.75;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s, color 0.2s;
}
.nav-dropdown a:hover,
.nav-dropdown a.active {
    opacity: 1;
    color: #F18956;
}
/* --- Navbar A: White font (hero visible) --- */
.navbar-a {
    background: transparent;
    opacity: 1;
    transform: translateY(0);
}
.navbar-a .navbar-logo { color: #fff; }
.navbar-a .navbar-links { left: 41.735vw; }
.navbar-a .navbar-links a { color: #fff; }
.navbar-a .navbar-links a.active { opacity: 1; font-weight: 500; }
.navbar-a .i18n-btn {
    color: rgba(255, 255, 255, 0.7);
    border: 0.8px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    opacity: 0.8;
}
.navbar-a .i18n-btn:hover {
    color: #fff;
    border-color: rgba(240, 124, 68, 0.3);
    backdrop-filter: blur(20px);
    opacity: 0.8;
}
.navbar-a .i18n-btn:active {
    color: #fff;
    font-weight: 500;
    background: #F07C44;
    border-color: #F07C44;
}
.navbar-a .nav-hamburger { color: #fff; }

.navbar-a.hidden { opacity: 0; pointer-events: none; }

/* --- Navbar Scroll: Shown after hero scrolls out --- */
.navbar-scroll {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}
.navbar-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.navbar-scroll .navbar-logo { color: #F18956; }
.navbar-scroll .navbar-links a { color: #000; opacity: 0.75; }
.navbar-scroll .navbar-links a.active { color: #F18956; opacity: 1; }

/* Dark background override */
.navbar-scroll.on-dark .navbar-links a { color: #FFFFFF; }
.navbar-scroll.on-dark .navbar-links a.active { color: #F18956; }
.navbar-scroll.on-dark .navbar-brand-zh,
.navbar-scroll.on-dark .navbar-brand-dot,
.navbar-scroll.on-dark .navbar-brand-en { color: #FFFFFF; }
.navbar-scroll.on-dark .i18n-btn {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}
.navbar-scroll.on-dark .i18n-btn:hover {
    color: #F07C44;
    border-color: rgba(240, 124, 68, 0.3);
}
.navbar-scroll.on-dark .nav-hamburger { color: #fff; }
.navbar-scroll.on-dark .nav-dropdown {
    background: rgba(30, 30, 30, 0.95);
}
.navbar-scroll.on-dark .nav-dropdown a { color: #fff; }

.navbar-scroll .i18n-btn {
    color: rgba(51, 51, 51, 0.7);
    border: 0.8px solid rgba(51, 51, 51, 0.1);
    background: transparent;
    opacity: 0.8;
}
.navbar-scroll .i18n-btn:hover {
    color: #F07C44;
    border-color: rgba(240, 124, 68, 0.3);
    backdrop-filter: blur(20px);
}
.navbar-scroll .i18n-btn:active {
    color: #fff;
    font-weight: 500;
    background: #F07C44;
    border-color: #F07C44;
}

.navbar-brand {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-left: 12px;
    white-space: nowrap;
}
.navbar-brand-zh {
    font-family: 'Source Han Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #000;
}
.navbar-brand-dot {
    font-family: 'Source Han Sans SC', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000;
}
.navbar-brand-en {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #000;
}

/* ========================
   Mobile: hide inline links, show hamburger
   ======================== */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }
    .nav-hamburger {
        display: flex;
        margin-right: 0;
    }
    /* Container + dropdown tone unified: when section navbar is over dark
       content, the top bar turns dark glass and the dropdown softens to
       match — both stay in the dark glass family at the same strength. */
    .navbar-scroll.on-dark {
        background: rgba(30, 30, 30, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    .navbar-scroll.on-dark .nav-dropdown {
        background: rgba(30, 30, 30, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    /* Light (default) section navbar: lift dropdown to match the container's
       stronger frosted glass (0.55 / blur(20px)). Hero-stage .navbar-a
       dropdown keeps its lighter default. */
    .navbar-scroll .nav-dropdown {
        background: rgba(255, 255, 255, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    /* Hero stage (.navbar-a): when hamburger opens, lift container to the
       same frosted glass as its dropdown and flip the logo / hamburger /
       i18n button text from white to dark so they remain legible on the
       now-light surface. The dropdown also bumps to 0.55/blur(20) to match
       the container — fully unified with section-navbar's open state. */
    .navbar-a.open {
        background: rgba(255, 255, 255, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    .navbar-a.open .navbar-logo,
    .navbar-a.open .nav-hamburger {
        color: #333;
    }
    .navbar-a.open .i18n-btn {
        color: rgba(51, 51, 51, 0.7);
        border-color: rgba(51, 51, 51, 0.1);
        background: transparent;
    }
    .navbar-a.open .nav-dropdown {
        background: rgba(255, 255, 255, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}
