/* ================================================================
   Header Styles
   ================================================================ */

/* [Navigation Bar] */
:root {
    --site-edge-inset: clamp(24px, 5vw, 100px);
}

#gnb {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: transparent !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--site-edge-inset);
    z-index: 1000;
}

#gnb::before {
    display: none;
}

/* Identity uses horizontal section navigation on desktop, so there is no
   vertical content-scroll state in which the fixed header should blur. */
@media (min-width: 901px) {
    body:has(#page-about-intro.identity-section-page) #gnb {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }
}

.logo {
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo img {
    width: 124px;
    height: auto;
    max-height: 70px;
    object-fit: contain;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 54px;
    z-index: 1001;
    height: 100%;
    align-items: center;
}

/* [Nav Item & Dropdown] */
.nav-item-group {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-item {
    font-size: 18px;
    font-weight: 450;
    cursor: pointer;
    text-transform: none;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
    text-decoration: none;
    padding: 10px 0;
}

/* 메뉴 활성화/호버 시 레이아웃 흔들림 없이 컬러만 변경 */
.nav-item:hover,
.nav-item.active,
.nav-item-group:hover > .nav-item {
    color: #ff6e2e;
    text-shadow: none;
}

.works-breadcrumb {
    font-size: 1rem;
    margin: 0 0 18px;
    color: #aaa;
    text-align: center;
}

.works-breadcrumb a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.works-breadcrumb a:hover {
    color: #ff6e2e;
}

.works-breadcrumb .current-noola {
    color: #ff6e2e !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Dropdown Content */
.dropdown-content {
    display: flex;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scaleY(0.94);
    transform-origin: top center;
    background: rgba(14, 14, 16, 0.9);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    width: auto;
    min-width: 154px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 1002;
    padding: 8px 0;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.22s ease;
}

.dropdown-content::before {
    display: none;
}

.nav-item-group:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scaleY(1);
}

.dropdown-item {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.66);
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    transition: color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                -webkit-text-fill-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.dropdown-item:hover,
.dropdown-item.active {
    background: transparent !important;
    color: #ffffff;
    font-weight: 400;
    opacity: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.contact-btn {
    font-size: 17px;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px 24px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 1002;
}

.contact-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* [Mobile Menu] */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 2000;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 2px;
}

/* [Local Navigation (Left Sidebar)] */
#local-nav {
    position: fixed;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 30px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#local-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.local-nav-item {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-left: 24px;
}

.local-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: 0.3s;
}

.local-nav-item:hover,
.local-nav-item.active {
    color: #ffffff;
    transform: translateX(5px);
}

.local-nav-item.active::before {
    background: #ffffff;
    box-shadow: 0 0 10px #ffffff;
}

/* Theme switch: supplied pill style in the preview accent color. */
.theme-switch {
    /* Compact switch with the original 3.5:2 track proportions. */
    font-size: 13px;
    position: relative;
    display: inline-block;
    flex: 0 0 3.5em;
    width: 3.5em;
    height: 2em;
    margin: 0;
}
.theme-switch #theme-input { opacity: 0; width: 0; height: 0; }
.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    border-radius: 30px;
    box-shadow: 0 0 0 2px #ff6e2e;
    border: 0.235294em solid transparent;
    overflow: hidden;
    transition: background-color .4s, box-shadow .4s;
    background: transparent;
}
.theme-switch .slider::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    border-radius: 30px;
    background-color: #ff6e2e;
    transform: translateX(-50%);
    transition: transform .4s;
}
.theme-switch #theme-input:checked + .slider { background-color: #ff6e2e40; }
.theme-switch #theme-input:focus-visible + .slider {
    box-shadow: 0 0 0 2px #ff6e2e, 0 0 0 5px #ff6e2e40;
}
.theme-switch #theme-input:checked + .slider::before { transform: translateX(1.5em); }
@media (prefers-reduced-motion: reduce) {
    .theme-switch .slider, .theme-switch .slider::before { transition: none; }
}

/* ===== Light Mode - Header ===== */
body.light-mode #gnb {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: none !important;
}

body.light-mode #gnb::before {
    display: none;
}

body.light-mode .nav-item,
body.light-mode .logo {
    color: #1a1a1a !important;
}

body.light-mode .logo img {
    filter: invert(1) !important;
}

/* 라이트 모드에서도 컬러만 변경 */
body.light-mode .nav-item:hover,
body.light-mode .nav-item.active,
body.light-mode .nav-item-group:hover > .nav-item {
    color: #0b0b0b !important;
    text-shadow: none !important;
}

body.light-mode .contact-btn {
    border-color: #1a1a1a !important;
    color: #1a1a1a !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .contact-btn:hover {
    background: #1a1a1a !important;
    color: #fff !important;
}

body.light-mode .nav-center {
    background: transparent !important;
}

body.light-mode .dropdown-content {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(11, 11, 11, 0.1);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

body.light-mode .dropdown-item {
    color: rgba(11, 11, 11, 0.62);
}

body.light-mode .dropdown-item:hover,
body.light-mode .dropdown-item.active {
    background: transparent !important;
    color: #0b0b0b;
    font-weight: 400;
    opacity: 1;
}

body.light-mode .mobile-menu-toggle span {
    background-color: #1a1a1a !important;
}

body.light-mode .local-nav-item {
    color: rgba(0, 0, 0, 0.4) !important;
}

body.light-mode .local-nav-item::before {
    background: rgba(0, 0, 0, 0.3) !important;
}

body.light-mode .local-nav-item:hover,
body.light-mode .local-nav-item.active {
    color: #ff6e2e !important;
}

body.light-mode .local-nav-item.active::before {
    background: #ff6e2e !important;
    box-shadow: 0 0 10px rgba(255, 110, 46, 0.5) !important;
}

/* ===== Light Mode - Mobile Menu ===== */
body.light-mode .nav-center.active {
    background: rgba(255, 255, 255, 0.98) !important;
}

/* 라이트모드 기본 메뉴 텍스트 - 우선순위 강화 */
body.light-mode .nav-center.active > .nav-item,
body.light-mode .nav-center.active .nav-item-group > .nav-item {
    color: #000000 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

/* 라이트모드에서 모든 메뉴 링크 강제 검정색 - 최고 우선순위 */
body.light-mode .nav-center.active a.nav-item,
body.light-mode .nav-center.active .nav-item-group a.nav-item {
    color: #000000 !important;
    font-weight: 600 !important;
}

/* 라이트모드 호버/활성 상태 */
body.light-mode .nav-center.active > .nav-item:hover,
body.light-mode .nav-center.active > .nav-item.active,
body.light-mode .nav-center.active .nav-item-group > .nav-item:hover,
body.light-mode .nav-center.active .nav-item-group > .nav-item.active,
body.light-mode .nav-center.active .nav-item-group:hover > .nav-item,
body.light-mode .nav-center.active a.nav-item:hover,
body.light-mode .nav-center.active a.nav-item.active {
    color: #ff6e2e !important;
}

/* 라이트모드 드롭다운 */
body.light-mode .nav-center.active .dropdown-item {
    color: #0b0b0b !important;
    font-weight: 400 !important;
}

body.light-mode .nav-center.active .dropdown-item:hover,
body.light-mode .nav-center.active .dropdown-item.active {
    background: transparent !important;
    color: #0b0b0b !important;
    font-weight: 400 !important;
}

/* ===== 강제 색상 적용 - 모든 메뉴 항목 ===== */
/* 다크모드에서 모든 메뉴 강제 흰색 (선택되지 않은 상태) */
body:not(.light-mode) .nav-center.active a.nav-item:not(.active) {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 다크모드에서 선택된 메뉴 강제 빨간색 */
body:not(.light-mode) .nav-center.active a.nav-item.active {
    color: #ff6e2e !important;
}

/* ===== Mobile Responsive - Header ===== */
@media (max-width: 600px) {
    #gnb {
        height: auto;
        padding: 0 var(--site-edge-inset);
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-center {
        position: static;
        transform: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
        height: auto;
        align-items: flex-start;
    }

    .nav-item-group {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }

    .nav-item {
        font-size: 16px;
        padding: 12px 0;
        width: 100%;
        word-break: keep-all;
        white-space: normal;
        text-align: left;
    }
}

@media (max-width: 1400px) {
    #gnb::before {
        display: none;
    }

    #gnb {
        padding: 0 var(--site-edge-inset);
        height: 70px;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    #gnb .mobile-menu-toggle {
        justify-self: start;
    }

    #gnb .logo {
        justify-self: center;
        grid-column: 2;
        grid-row: 1;
    }

    #gnb .nav-right {
        display: flex;
        justify-self: end;
    }

    #gnb .nav-right .contact-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .logo img {
        width: 92px;
        height: auto;
        max-height: 50px;
    }

    .nav-center {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-center.active {
        display: flex !important;
        position: fixed !important;
        transform: none !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        justify-content: flex-start; 
        align-items: center;
        gap: 0;
        z-index: 300000 !important;
        padding: 130px 20px 60px 20px; 
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .nav-center.active .nav-item-group {
        display: contents !important;
    }

    .nav-center.active > .nav-item,
    .nav-center.active .nav-item-group > .nav-item {
        font-size: 28px;
        padding: 25px 0; 
        text-align: center;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
        color: rgba(255, 255, 255, 0.8) !important;
    }

    /* 라이트모드에서 기본 모바일 스타일 오버라이드 */
    body.light-mode .nav-center.active > .nav-item,
    body.light-mode .nav-center.active .nav-item-group > .nav-item {
        color: #000000 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
    }

    .nav-center.active > .nav-item:last-child {
        border-bottom: none;
    }

    .nav-center.active .dropdown-content {
        display: flex;
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 10px;
    }

    .nav-center.active .dropdown-content::before {
        display: none;
    }

    .nav-center.active .dropdown-item {
        font-size: 20px;
        padding: 12px 0;
        color: rgba(255, 255, 255, 0.7) !important;
        font-weight: 400;
    }

    /* 라이트모드에서 드롭다운 스타일 오버라이드 */
    body.light-mode .nav-center.active .dropdown-item {
        color: #0b0b0b !important;
    }

    body.light-mode .nav-center.active .dropdown-item:hover,
    body.light-mode .nav-center.active .dropdown-item.active {
        color: #0b0b0b !important;
        font-weight: 400 !important;
    }

    /* 다크모드 기본 호버 상태 */
    .nav-center.active > .nav-item:hover,
    .nav-center.active .nav-item-group > .nav-item:hover,
    .nav-center.active .dropdown-item:hover {
        background: transparent !important;
        color: #ffffff !important;
    }

    .nav-center.active .nav-item-group:hover > .nav-item {
        color: #ff6e2e !important;
    }

    /* 다크모드 선택된 메뉴 (.active) 상태 */
    .nav-center.active > .nav-item.active,
    .nav-center.active .nav-item-group > .nav-item.active {
        color: #ff6e2e !important;
    }

    /* 다크모드에서 기본 모바일 스타일의 선택된 메뉴 오버라이드 */
    body:not(.light-mode) .nav-center.active > .nav-item.active,
    body:not(.light-mode) .nav-center.active .nav-item-group > .nav-item.active {
        color: #ff6e2e !important;
    }

    #local-nav {
        display: none !important;
    }
}

@media (max-width: 1400px) {
    #gnb {
        z-index: 250000 !important;
    }

    .mobile-menu-toggle {
        z-index: 300001 !important;
    }

    .nav-center.active {
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding-top: calc(var(--site-header-h, 70px) + 48px) !important;
    }
}


/* ===== Auth Buttons ===== */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 0;
}

.nav-auth-btn {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}
.nav-auth-btn--active { color: rgba(255, 255, 255, 1) !important; }
.nav-auth-btn:hover { color: rgba(255, 255, 255, 1); }

.nav-auth-sep {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
}

body.light-mode .nav-auth-btn { color: rgba(9, 11, 16, 0.5) !important; }
body.light-mode .nav-auth-btn--active { color: rgba(9, 11, 16, 1) !important; }
body.light-mode .nav-auth-btn:hover { color: rgba(9, 11, 16, 1) !important; }
body.light-mode .nav-auth-sep { color: rgba(9, 11, 16, 0.25) !important; }

body.light-mode[data-page="home"] .nav-auth-btn { color: rgba(255, 255, 255, 0.7) !important; }
body.light-mode[data-page="home"] .nav-auth-btn--active { color: rgba(255, 255, 255, 1) !important; }
body.light-mode[data-page="home"] .nav-auth-btn:hover { color: rgba(255, 255, 255, 1) !important; }
body.light-mode[data-page="home"] .nav-auth-sep { color: rgba(255, 255, 255, 0.3) !important; }

/* 모바일에서 데스크탑 auth 숨김 */
@media (max-width: 1400px) {
    .nav-auth { display: none; }
}

/* 모바일 전용 auth - 기본 숨김 (nav-center 안에서만 표시) */
.nav-auth-mobile { display: none; }

.nav-auth-mobile-btn {
    font-size: 22px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 500 !important;
}
.nav-auth-mobile-btn.nav-auth-btn--active { color: rgba(255, 255, 255, 1) !important; }
.nav-auth-mobile-btn:hover { color: rgba(255, 255, 255, 1) !important; }

body.light-mode .nav-auth-mobile-btn { color: rgba(0, 0, 0, 0.4) !important; }
body.light-mode .nav-auth-mobile-btn.nav-auth-btn--active { color: rgba(0, 0, 0, 1) !important; }
body.light-mode .nav-auth-mobile-btn:hover { color: rgba(0, 0, 0, 1) !important; }

@media (max-width: 1400px) {
    .nav-center.active .nav-auth-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    body.light-mode .nav-center.active .nav-auth-mobile {
        border-top-color: rgba(0, 0, 0, 0.1);
    }
    .nav-auth-mobile-btn {
        padding: 20px 0 !important;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    body.light-mode .nav-auth-mobile-btn {
        border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    }
    .nav-auth-mobile-btn:last-child {
        border-bottom: none !important;
    }

    .nav-center.active .nav-auth-mobile-btn.nav-auth-btn--active,
    .nav-center.active .nav-auth-mobile-btn.nav-auth-btn--active:hover,
    .nav-center.active .nav-auth-mobile-btn.active,
    .nav-center.active .nav-auth-mobile-btn.active:hover,
    body:not(.light-mode) .nav-center.active a.nav-auth-mobile-btn.nav-auth-btn--active,
    body:not(.light-mode) .nav-center.active a.nav-auth-mobile-btn.nav-auth-btn--active:not(.active),
    body:not(.light-mode) .nav-center.active a.nav-auth-mobile-btn.active,
    body.light-mode .nav-center.active .nav-auth-mobile-btn.nav-auth-btn--active,
    body.light-mode .nav-center.active .nav-auth-mobile-btn.nav-auth-btn--active:hover,
    body.light-mode .nav-center.active .nav-auth-mobile-btn.active,
    body.light-mode .nav-center.active .nav-auth-mobile-btn.active:hover {
        color: #ff6e2e !important;
    }
}

@media (max-width: 1400px) {
    body.is-home-active.is-home-footer-zone #gnb {
        background: rgba(8, 8, 8, 0.58) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    }

    body.light-mode.is-home-active.is-home-footer-zone #gnb {
        background: rgba(8, 8, 8, 0.42) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    }
}


/* Dropdown boxed style */
.dropdown-content {
    background: rgba(14, 14, 16, 0.9) !important;
    backdrop-filter: blur(20px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(130%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    outline: 0 !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
}
.dropdown-content::before {
    display: none !important;
}
.dropdown-item {
    color: rgba(255, 255, 255, 0.66);
    transition: color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                -webkit-text-fill-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.dropdown-item:hover,
.dropdown-item.active {
    color: rgba(255, 255, 255, 0.96);
    background: transparent !important;
    font-weight: 400 !important;
}
body.light-mode .dropdown-content {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    outline: 0 !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.13) !important;
}
body.light-mode .dropdown-item {
    color: rgba(15, 23, 42, 0.66);
}
body.light-mode .dropdown-item:hover,
body.light-mode .dropdown-item.active {
    color: rgba(15, 23, 42, 0.96);
    background: transparent !important;
    font-weight: 400 !important;
}

#gnb .nav-item-group.has-submenu .dropdown-item:hover,
#gnb .nav-item-group.has-submenu .dropdown-item.active {
    color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
    font-weight: 400 !important;
}

body.light-mode #gnb .nav-item-group.has-submenu .dropdown-item:hover,
body.light-mode #gnb .nav-item-group.has-submenu .dropdown-item.active {
    color: rgba(15, 23, 42, 0.96) !important;
    background: transparent !important;
    font-weight: 400 !important;
}

#gnb .nav-works-menu .dropdown-item,
#gnb .nav-services-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.66) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.66) !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

#gnb .nav-works-menu .dropdown-item:hover,
#gnb .nav-works-menu .dropdown-item.active,
#gnb .nav-services-menu .dropdown-item:hover,
#gnb .nav-services-menu .dropdown-item.active {
    color: rgba(255, 255, 255, 0.96) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

body.light-mode #gnb .nav-works-menu .dropdown-item,
body.light-mode #gnb .nav-services-menu .dropdown-item {
    color: rgba(15, 23, 42, 0.66) !important;
    -webkit-text-fill-color: rgba(15, 23, 42, 0.66) !important;
}

body.light-mode #gnb .nav-works-menu .dropdown-item:hover,
body.light-mode #gnb .nav-works-menu .dropdown-item.active,
body.light-mode #gnb .nav-services-menu .dropdown-item:hover,
body.light-mode #gnb .nav-services-menu .dropdown-item.active {
    color: rgba(15, 23, 42, 0.96) !important;
    -webkit-text-fill-color: rgba(15, 23, 42, 0.96) !important;
}

/* Mobile menu submenu separators - no dropdown box */
@media (max-width: 1400px) {
    .nav-center.active .nav-item-group {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .nav-center.active .nav-item-group.has-submenu > .nav-item {
        border-bottom: none !important;
    }

    .nav-center.active .nav-item-group:not(.has-submenu) > .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .nav-center.active .dropdown-content {
        display: flex !important;
        width: min(100%, 360px) !important;
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 7px 0 9px !important;
        margin: -2px auto 0 !important;
        overflow: visible !important;
    }

    .nav-center.active .dropdown-item {
        width: 100%;
        padding: 9px 0 !important;
        font-size: 17px !important;
        line-height: 1.25;
        color: rgba(255, 255, 255, 0.62) !important;
        background: transparent !important;
    }

    .nav-center.active .nav-works-menu .dropdown-item,
    .nav-center.active .nav-services-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.62) !important;
        -webkit-text-fill-color: rgba(255, 255, 255, 0.62) !important;
        background: transparent !important;
        font-weight: 400 !important;
    }

    .nav-center.active .nav-works-menu .dropdown-item:hover,
    .nav-center.active .nav-works-menu .dropdown-item.active,
    .nav-center.active .nav-services-menu .dropdown-item:hover,
    .nav-center.active .nav-services-menu .dropdown-item.active {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        background: transparent !important;
        font-weight: 400 !important;
    }

    body.light-mode .nav-center.active .nav-item-group:not(.has-submenu) > .nav-item {
        border-bottom-color: rgba(0, 0, 0, 0.15) !important;
    }

    body.light-mode .nav-center.active .dropdown-content {
        border-top-color: rgba(0, 0, 0, 0.12) !important;
        border-bottom-color: rgba(0, 0, 0, 0.07) !important;
    }

    body.light-mode .nav-center.active .dropdown-item {
        color: rgba(0, 0, 0, 0.58) !important;
        background: transparent !important;
    }

    body.light-mode .nav-center.active .nav-works-menu .dropdown-item,
    body.light-mode .nav-center.active .nav-services-menu .dropdown-item {
        color: rgba(0, 0, 0, 0.58) !important;
        -webkit-text-fill-color: rgba(0, 0, 0, 0.58) !important;
        background: transparent !important;
        font-weight: 400 !important;
    }

    body.light-mode .nav-center.active .nav-works-menu .dropdown-item:hover,
    body.light-mode .nav-center.active .nav-works-menu .dropdown-item.active,
    body.light-mode .nav-center.active .nav-services-menu .dropdown-item:hover,
    body.light-mode .nav-center.active .nav-services-menu .dropdown-item.active {
        color: #0b0b0b !important;
        -webkit-text-fill-color: #0b0b0b !important;
        background: transparent !important;
        font-weight: 400 !important;
    }
}

/* Final submenu color lock: keep Works identical to Services after all overrides. */
#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item,
#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:link,
#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:visited,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:link,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:visited {
    color: rgba(255, 255, 255, 0.66) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.66) !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-shadow: none !important;
    transition: color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                -webkit-text-fill-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:hover,
#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:focus,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:hover,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:focus {
    color: rgba(255, 255, 255, 0.96) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item,
body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:link,
body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:visited,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:link,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:visited {
    color: rgba(11, 11, 11, 0.58) !important;
    -webkit-text-fill-color: rgba(11, 11, 11, 0.58) !important;
    background: transparent !important;
    font-weight: 400 !important;
}

body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:hover,
body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item:focus,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:hover,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item:focus {
    color: #0b0b0b !important;
    -webkit-text-fill-color: #0b0b0b !important;
    background: transparent !important;
    font-weight: 400 !important;
}

#gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item.active,
#gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item.active {
    color: rgba(255, 255, 255, 0.96) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

body.light-mode #gnb .nav-center .nav-works-menu .dropdown-content a.dropdown-item.active,
body.light-mode #gnb .nav-center .nav-services-menu .dropdown-content a.dropdown-item.active {
    color: #0b0b0b !important;
    -webkit-text-fill-color: #0b0b0b !important;
    background: transparent !important;
    font-weight: 400 !important;
}

/* Global selection inversion for every page that uses the shared header. */
:root {
    --site-selection-bg: #ffffff;
    --site-selection-text: #0b0b0b;
}

html.light-mode,
body.light-mode {
    --site-selection-bg: #0b0b0b;
    --site-selection-text: #ffffff;
}

*::selection {
    color: var(--site-selection-text) !important;
    -webkit-text-fill-color: var(--site-selection-text) !important;
    background-color: var(--site-selection-bg) !important;
    text-shadow: none !important;
}

*::-moz-selection {
    color: var(--site-selection-text) !important;
    background-color: var(--site-selection-bg) !important;
    text-shadow: none !important;
}

/* Reserve space for both edge groups as the header moves further inward. */
.nav-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 40px;
    color: #fff;
    text-decoration: none;
}
.nav-account svg { width: 32px; height: 32px; }
body.light-mode .nav-account { color: #0b0b0b; }
#gnb .nav-account:hover,
#gnb .nav-account.is-active { color: #ff6e2e; }
.nav-account:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }

@media (min-width: 1401px) {
    #gnb {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        column-gap: clamp(16px, 2vw, 36px);
    }
    #gnb .nav-center {
        position: static;
        transform: none;
        justify-content: center;
        gap: clamp(16px, 2.5vw, 54px);
        min-width: 0;
    }
    #gnb .nav-item {
        font-size: clamp(14px, 1.25vw, 18px);
        white-space: nowrap;
    }
    #gnb .nav-auth-btn { white-space: nowrap; }
    #gnb .nav-right {
        width: auto;
        justify-content: flex-end;
        gap: 24px;
    }
}

@media (max-width: 1400px) {
    #gnb .nav-right { gap: 14px; }
    /* Keep the same proportions at the smaller mobile size. */
    #gnb .theme-switch { font-size: 11px; }
    #gnb .nav-account { flex-basis: 28px; width: 28px; }
    #gnb .nav-account svg { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
    #gnb .logo img { width: 76px; }
}

@media (max-width: 360px) { #gnb .logo img { width: 68px; } }

/* Large tablets use the same centered-logo navigation as phones. */
@media (min-width: 600px) and (max-width: 1400px) {
    #gnb { height: 84px; }
    #gnb .logo img { width: 120px; max-height: 60px; }
    #gnb .nav-right { gap: 18px; }
    #gnb .theme-switch { font-size: 13px; }
    #gnb .nav-account { flex-basis: 32px; width: 32px; }
    #gnb .nav-account svg { width: 32px; height: 32px; }
}
