* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Black', sans-serif;
}

body {
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.15;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.star.bright {
    opacity: 1 !important;
    transform: scale(1.8);
    box-shadow: 0 0 8px #fff;
}

/* 헤더 레이아웃 수정 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 8%;
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    flex: 1;
}

/* 중앙 내비게이션 스타일 */
.main-nav {
    display: flex;
    gap: 30px;
    flex: 2;
    justify-content: center;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.5;
    transition: 0.3s;
    letter-spacing: 1px;
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
}

.contact-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.contact-trigger {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.contact-trigger:hover { opacity: 1; }

.contact-box {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background-color: rgba(60, 60, 60, 0.9);
    min-width: 160px;
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.contact-box.show { display: block; animation: fadeIn 0.3s ease; }

.contact-box a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    gap: 10px;
}

.contact-box a:hover { background-color: rgba(255, 255, 255, 0.1); }

.arrow-up {
    position: absolute;
    top: -8px;
    right: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(60, 60, 60, 0.9);
}

/* 메인 히어로 섹션 */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 0 10%;
    gap: 60px;
}

.hero-content { flex: 1; }

.intro-text {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.name {
    font-size: 5.5rem;
    line-height: 0.85;
    font-weight: 900;
    margin-bottom: 1.2rem;
    letter-spacing: -3px;
}

.description {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.view-work-btn {
    display: inline-block;
    background-color: #fff;
    color: #000;
    padding: 14px 38px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.view-work-btn:hover { transform: scale(1.05); }

.hero-image img {
    width: 100%;
    max-width: 580px;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 반응형 수정: 모바일에서는 중앙 메뉴를 숨기거나 햄버거 메뉴로 대체하는 것이 좋지만, 
일단은 세로 정렬 시 메뉴가 겹치지 않게 간격을 조절했습니다. */
@media (max-aspect-ratio: 1/1), (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 2rem;
    }
    .main-nav {
        gap: 15px;
    }
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        gap: 30px;
    }
    .name { font-size: 3.2rem; }
}

/* ==========================================
   📱 모바일 세로 화면 최적화 (가로폭이 좁을 때 조건)
   ========================================== */
@media (max-width: 768px) {
    header {
        flex-direction: column !important; /* 로고와 메뉴를 위아래 세로로 배치 */
        gap: 15px !important;              /* 로고와 메뉴 사이의 간격 */
        padding: 20px 10px !important;     /* 모바일 화면 여백 줄임 */
        text-align: center !important;
    }

    /* 네비게이션 바가 화면 중앙으로 오도록 설정 */
    header .main-nav {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important; /* 글씨들을 가로 정가운데로 정렬 */
        gap: 15px !important;               /* 글씨들 사이의 간격 조절 */
    }

    /* 연한 글씨 스타일 비율 보정 */
    header .nav-item {
        font-size: 0.85rem !important;      /* 세로 화면에 맞게 글자 크기 축소 */
        letter-spacing: 0.5px !important;   /* 자간 조여서 한 줄 배치 유도 */
        white-space: nowrap !important;     /* 글자가 아래로 쪼개지는 현상 방지 */
    }
}

/* ==========================================
   📱 모바일 세로 화면 최적화 (가로폭 768px 이하 조건)
   ========================================== */
@media (max-width: 768px) {
    header {
        flex-direction: column !important; /* IZDHFS 로고와 메뉴를 위아래 세로로 배치 */
        gap: 15px !important;              /* 로고와 메뉴 사이의 상하 간격 */
        padding: 20px 10px !important;     /* 양옆 여백을 줄여 모바일 공간 확보 */
        text-align: center !important;
    }

    /* 네비게이션 컨테이너를 가로 정가운데로 정렬 */
    header .main-nav {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important; /* 메뉴 글씨들을 가로 정가운데로 정렬 */
        gap: 15px !important;               /* 글씨들 사이의 좌우 간격 */
    }

    /* 연한 글씨 메뉴 아이템 비율 보정 */
    header .nav-item {
        font-size: 0.85rem !important;      /* 세로 화면에 맞게 글자 크기 축소 */
        letter-spacing: 0.5px !important;   /* 자간을 조여 한 줄에 들어가도록 처리 */
        white-space: nowrap !important;     /* 화면이 좁아도 글자가 위아래로 깨지지 않게 고정 */
    }
}

/* 스마트폰 화면이 극단적으로 좁을 때 (아이폰 SE 등 가로 380px 이하) */
@media (max-width: 380px) {
    header .main-nav {
        gap: 10px !important;               /* 메뉴 간격을 더 좁혀서 겹침 방지 */
    }
    header .nav-item {
        font-size: 0.78rem !important;      /* 글씨를 조금 더 축소 */
    }
}
