/* --- 기본 설정 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Noto Sans KR', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- 헤더 --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 40px;
    z-index: 1000;
    color: rgba(255, 255, 255, 0.85);
}

#header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#header .logo a {
    font-weight: 700;
    font-size: 22px;
}

/* --- 데스크탑 메뉴 --- */
#header .gnb-desktop ul {
    display: flex;
    align-items: center;
    gap: 50px;
}

#header .gnb-desktop li a {
    position: relative;
    padding: 5px 0;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

#header .gnb-desktop li a:hover {
    color: #fff;
}

#header .gnb-desktop li:not(:last-child) a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}

#header .gnb-desktop li:not(:last-child) a:hover::after {
    transform: scaleX(1);
}

/* --- Contact 버튼 스타일 (핵심 수정) --- 
*/
#header .gnb-desktop .btn-contact {
    /* [수정 1] a태그의 display 속성 변경으로 여백 문제 해결 */
    display: inline-block; 
    
    position: relative;
    z-index: 1;
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 12px 28px;
    border-radius: 30px;
    transition: color 0.4s ease, border-color 0.3s ease;
    overflow: hidden;
    vertical-align: middle;
}

#header .gnb-desktop .btn-contact:hover {
    color: #000;
    border-color: #fff;
}

#header .gnb-desktop .btn-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: #fff;
    transition: width 0.4s ease-out;
    z-index: -1;
}

#header .gnb-desktop .btn-contact:hover::before {
    width: 100%;
}


/* --- 메인 콘텐츠 --- */
#main { height: 100vh; display: flex; justify-content: center; align-items: center; text-align: center; position: relative; }
#bg-video { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translateX(-50%) translateY(-50%); z-index: -1; filter: brightness(0.5); }
.main-content { color: #fff; z-index: 1; }
.main-content h2 { font-size: 3rem; font-weight: 700; margin-bottom: 20px; }
.main-content .lab-text { font-size: 1.5rem; margin-bottom: 30px; transition: color 0.3s ease; }
.main-content .chat-trigger { font-size: 1.2rem; cursor: pointer; border-bottom: 1px solid #aaa; padding-bottom: 5px; transition: color 0.3s ease, border-color 0.3s ease; }
.text-highlight { color: #00aaff !important; border-color: #00aaff !important; }

/* --- 모바일 메뉴 및 햄버거 버튼 --- */
.hamburger-menu { display: none; background: none; border: none; cursor: pointer; width: 30px; height: 22px; position: relative; z-index: 1001; }
.hamburger-menu span { display: block; position: absolute; left: 0; width: 100%; height: 2px; background-color: #fff; transition: all 0.3s ease; }
.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { bottom: 0; }
.hamburger-menu.is-active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.hamburger-menu.is-active span:nth-child(2) { opacity: 0; }
.hamburger-menu.is-active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }
.mobile-nav { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: rgba(0, 0, 0, 0.95); z-index: 999; display: flex; justify-content: center; align-items: center; transform: translateY(-100%); transition: transform 0.5s ease-out; }
.mobile-nav.is-active { transform: translateY(0); }
.mobile-nav ul { text-align: center; }
.mobile-nav li { margin: 30px 0; }
.mobile-nav a { font-size: 2.5rem; font-weight: bold; color: #fff; }

/* --- 반응형 웹 분기점 --- */
@media (max-width: 991px) {
    #header { padding: 20px 30px; }
    .gnb-desktop { display: none; }
    .hamburger-menu { display: block; }
}

/* --- 메인 인터랙티브 메뉴 --- */
.main-nav-container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.main-nav {
    text-align: left;
}

.main-nav a.hover-link {
    display: block;
    color: #fff;
    font-size: 7vw; /* 화면 너비에 따라 크기 가변 */
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 0 2rem;
    cursor: pointer;
    position: relative;
}

/* --- 마우스 따라다니는 이미지 --- */
.img-follower {
    position: fixed;
    z-index: 5;
    top: 0;
    left: 0;
    width: 30vw; /* 이미지 너비 */
    height: 45vh; /* 이미지 높이 */
    background-size: cover;
    background-position: center;
    
    /* [핵심] 텍스트 색상 반전 효과 */
    mix-blend-mode: difference; 

    /* [핵심] 이미지 요소가 마우스 이벤트를 가로채지 않도록 설정 */
    pointer-events: none; 

    /* 부드러운 등장을 위한 초기 상태 */
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* JS로 컨트롤할 활성화 클래스 */
.img-follower.is-visible {
    opacity: 1;
    transform: scale(1);
}


/* --- 배경색 변경 효과 --- */
body.bg-white {
    background-color: #fff !important;
}

/* 배경색이 흰색일 때, 다른 요소들의 색상 변경 */
.bg-white #header,
.bg-white .main-nav a.hover-link {
    color: #000;
}

.bg-white .hamburger-menu span {
    background-color: #000;
}

/* --- 배경색 오버레이 --- */
#page-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* 동영상(-1)과 콘텐츠(10) 사이 */
    background-color: #000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#page-bg-overlay.is-active {
    opacity: 1;
}

/* --- 메인 인터랙티브 메뉴 --- */
.main-nav-container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.main-nav {
    text-align: left;
}

.main-nav a.hover-link {
    display: block;
    color: #fff;
    font-size: 7vw;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 0 2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.4s ease; /* 텍스트 색상 변경 트랜지션 */
}

/* --- 마우스 따라다니는 이미지 --- */
.img-follower {
    position: fixed;
    z-index: 5;
    top: 0;
    left: 0;
    width: 30vw;
    height: 45vh;
    background-size: cover;
    background-position: center;
    mix-blend-mode: difference;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.img-follower.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* --- JS 상태 제어 클래스 --- */

/* Production 호버 상태 */
body.state-production-hover #page-bg-overlay {
    background-color: #fff;
}
body.state-production-hover .main-nav a.hover-link {
    color: #000; /* 기본 텍스트 검은색으로 */
}
body.state-production-hover #header {
    color: #000;
}
body.state-production-hover .hamburger-menu span {
    background-color: #000;
}

/* Post-production 호버 상태 (기본과 동일하므로 별도 스타일 불필요) */