/* --- 기본 레이아웃 --- */

.home-container {
    min-height: 100vh;
    padding: 80px 100px;
    position: relative;
    box-sizing: border-box;
}

/* --- 🏢 로고 애니메이션 (총천연색 + 로드러너) --- */
.home-header {
    position: fixed;
    left: 32px;
    top: 32px;
    text-align: left;
    z-index: 100;
}

.home-logo {
    display: flex;
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1px;
}

.logo-char {
    display: inline-block;
    color: var(--char-color);
    transform: translateX(120vw);
    opacity: 0;
    animation: roadRunner 1.2s cubic-bezier(0.17, 0.84, 0.44, 1) forwards;
    animation-delay: calc(var(--index) * 0.08s);
}

.home-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 16px;
    margin-left: 4px;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
    animation-delay: 1.8s;
    white-space: nowrap;
}

/* --- 🌐 수직 메뉴: 한글(좌) + 영문(우) --- */
.home-nine-menu {
    position: absolute;
    height: 700px;
    bottom: -330px;
    right: 150px;
    display: flex;
    flex-direction: column;
    text-align: right;
    pointer-events: auto;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards;
    animation-delay: 2.5s;
}

.home-nine-item {
    text-decoration: none;
    transition: all 0.3s;
    height: 36px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 4px;
}

.menu-ko {
    font-size: 0.65rem;
    font-weight: 400;
    color: #444;
    letter-spacing: -0.5px;
    transition: all 0.3s;
}

.menu-en {
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    transition: all 0.3s;
}

.home-nine-item:hover .menu-en { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.home-nine-item:hover .menu-ko { color: #888; }

/* 📍 PC 곡률 수치 */
.home-nine-item:nth-child(1) { transform: translateX(-260px); }
.home-nine-item:nth-child(2) { transform: translateX(-300px); }
.home-nine-item:nth-child(3) { transform: translateX(-320px); }
.home-nine-item:nth-child(4) { display: none; transform: translateX(-335px); }
.home-nine-item:nth-child(5) { display: none; transform: translateX(-348px); }
.home-nine-item:nth-child(6) { display: none; transform: translateX(-350px); }
.home-nine-item:nth-child(7) { display: none; transform: translateX(-350px); }
.home-nine-item:nth-child(8) { display: none; transform: translateX(-348px); }
.home-nine-item:nth-child(9) { display: none; transform: translateX(-335px); }

/* --- 🌐 지구 레이아웃 --- */
.home-bottom-layout {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 700px;
    height: 700px;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
    animation-delay: 2.2s;
}

.home-globe-wrapper {
    position: absolute;
    bottom: -200px;
    right: -200px;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    z-index: 1;
}

.globe-image-box {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: url('../images/earth.png');
    background-size: cover;
    animation: rotateEarth 360s linear infinite;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
    filter: brightness(0.6) contrast(1.2) blur(1px); /* 💡 지구를 더 어둡고 흐리게 배경화 */
    display: block;
}

.home-footer {
    position: fixed;
    bottom: 4px;
    right: 8px;
    color: #666;
    font-size: 0.75rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 3s;
}

/* --- 🎞️ 애니메이션 --- */
@keyframes roadRunner {
    0% { transform: translateX(100vw) skewX(-20deg); opacity: 0; }
    60% { opacity: 1; }
    85% { transform: translateX(-15px) skewX(5deg); }
    100% { transform: translateX(0) skewX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rotateEarth {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#root { border-inline: none !important; }

/* --- 📱 모바일 반응형 (768px 이하) --- */
@media (max-width: 768px) {
    .home-container { padding: 20px; min-height: 100vh; overflow: hidden; }

    .home-logo { font-size: 1.6rem; }
    .home-subtitle { font-size: 0.8rem; margin-top: 8px; max-width: 180px; }

    /* 모바일 지구: 가독성을 위해 더 어둡게 */
    .home-bottom-layout {
        width: 300px;
        height: 300px;
        bottom: -60px;
        right: -80px;
        z-index: 1;
    }
    .globe-image-box {
        filter: brightness(0.6) contrast(1.1) blur(2px); /* 💡 모바일에서 더 어둡고 흐리게 */
    }

    /* 모바일 메뉴: 가독성 핵심 */
    .home-nine-menu {
        position: absolute;
        width: auto;
        height: auto;
        bottom: 120px;
        right: 100px; /* 💡 부모 레이아웃 영향 해결을 위해 수치 조정 */
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
        z-index: 10;
        opacity: 0;
        animation: fadeIn 1.2s ease forwards;
        animation-delay: 2s;
    }

    .home-nine-item {
        transform: none !important;
        height: 32px;
        gap: 8px;
        /* 💡 텍스트 뒤에 어두운 그림자를 넣어 지구 배경에서도 잘 보이게 함 */
        filter: drop-shadow(0 0 5px rgba(0,0,0,0.8));
    }

    .menu-ko {
        font-size: 0.55rem;
        color: #888; /* 💡 조금 더 밝게 조정 */
        white-space: nowrap;
    }

    .menu-en {
        font-size: 0.8rem; /* 💡 영문을 살짝 키움 */
        font-weight: 800;
        color: #eee; /* 💡 확실하게 밝은 색으로 변경 */
        letter-spacing: 1px;
    }

    .home-footer {
        left: 20px;
        bottom: 20px;
        font-size: 0.6rem;
        z-index: 3;
        color: #444;
    }
}


/* --- 📱 모바일 가로모드 (Landscape) 대응 전용 --- */
@media (max-width: 932px) and (orientation: landscape) {
    .home-container {
        padding: 20px 40px;
        min-height: 100vh;
        overflow-y: auto; /* 혹시나 넘칠 경우를 대비해 스크롤 허용 */
    }

    /* 로고: 가로모드에서는 공간 확보를 위해 더 작고 얇게 */
    .home-header {
        position: absolute; /* fixed보다 absolute가 가로모드에서 더 안정적 */
        top: 20px;
        left: 20px;
    }
    .home-logo {
        font-size: 1.4rem;
    }
    .home-subtitle {
        font-size: 0.7rem;
        margin-top: 4px;
        max-width: 250px;
    }

    /* 🌐 가로모드 지구: 구석으로 더 밀어넣기 */
    .home-bottom-layout {
        width: 200px;
        height: 200px;
        bottom: -40px;
        right: -40px;
    }

    /* 🌐 가로모드 메뉴: 우측 중앙 정렬 (핵심 수정) */
    .home-nine-menu {
        width: max-content; /* 💡 내용물 중 가장 긴 놈에 맞춰 너비를 쫙 펴줌 */
    }

    .home-nine-item {
        height: 30px;
        white-space: nowrap;        /* 💡 글자가 절대 밑으로 안 떨어지게 강제 */
    }

    .menu-ko {
        font-size: 0.45rem; /* 한글 폰트 최소화 */
        color: #666;
    }

    .menu-en {
        font-size: 0.6rem;  /* 영문 폰트 최소화 */
        font-weight: 800;
        color: #ddd;
    }

    /* 푸터: 가로모드에서는 가독성을 위해 오른쪽 아래 작게 배치 */
    .home-footer {
        position: fixed;
        left: auto;
        right: 20px;
        bottom: 10px;
        font-size: 0.5rem;
        color: #333;
    }
}