/* --- 0. 기본 변수 및 초기화 --- */
:root {
    /* 기본 색상 변수 */
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --accent-color: #007bff;
    --text-color: #333;
    --sub-text-color: #666;
    --secondary-bg-color: #ffffff;
    /* 카드 배경 색상 */
}

/* 기본 스타일 및 초기화 */
body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* 다크 모드 예시 */
body.dark-mode {
    --primary-color: #f4f4f4;
    --secondary-color: #1a1a1a;
    --accent-color: #55aaff;
    --text-color: #f4f4f4;
    --sub-text-color: #aaa;
    --secondary-bg-color: #2a2a2a;
}


/* --- 1. Header 및 Navigation 스타일 --- */
header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem 0;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* style.css 파일의 Header 섹션 (--- 1. Header 및 Navigation 스타일 ---)에 추가 */

.site-title-link {
    color: var(--secondary-color);
    /* 링크 색상을 흰색/배경색과 동일하게 설정 */
    text-decoration: none;
    /* 밑줄 제거 */
    margin: 0;
    padding: 0;
    display: inline-block;
    transition: opacity 0.3s;
}

.site-title-link:hover {
    opacity: 0.8;
    /* 호버 시 약간 흐려지도록 효과 부여 */
}

/* h1 태그 자체의 스타일은 그대로 유지 */
h1 {
    margin: 0;
    font-size: 1.5rem;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
}

nav a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 10px;
    transition: color 0.3s, border-bottom 0.3s;
}

nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}


/* --- 1.5 Hero Section (Home Screen) Styles --- */

.hero-section {
    padding: 100px 20px;
    text-align: center;
    background-color: var(--secondary-bg-color);
    border-bottom: 2px solid #ddd;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-greeting {
    font-size: 1.2em;
    color: var(--sub-text-color);
    margin-bottom: 5px;
}

.hero-title {
    font-size: 3em;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
}

.hero-title .highlight {
    color: var(--accent-color);
}

.hero-tagline {
    font-size: 1.2em;
    color: var(--sub-text-color);
    line-height: 1.8;
    margin-bottom: 40px;
}

.hero-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
}

.hero-button:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.hero-button i {
    margin-left: 10px;
}


/* --- 2. Main Content 레이아웃 및 섹션 전환 (핵심) --- */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 20px;
    background-color: var(--secondary-color);
}

.content-section {
    /* 섹션 전환을 위한 필수 설정: 기본적으로 숨김 */
    display: none;
    padding: 40px 0;
    border-bottom: 1px solid #ddd;
}

.content-section.active {
    /* JavaScript로 활성화될 때만 보이게 함 */
    display: block;
}


/* --- 3. Profile/Archive 등 내부 레이아웃 --- */

.profile-content {
    /* 🚩 Profile 레이아웃을 세로(column)로 변경 */
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 20px;
}

.profile-content .bio,
.profile-content .history-timeline {
    width: 100%;
    margin-top: 0;
}

/* Archive 탭 네비게이션 스타일 */
.archive-tabs {
    display: flex;
    margin: 20px 0;
    border-bottom: 2px solid #eee;
}

.archive-tab-link {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.archive-tab-link:hover {
    opacity: 1;
}

.archive-tab-link.active {
    opacity: 1;
    border-bottom: 3px solid var(--accent-color);
}

/* 서브 콘텐츠 숨김/표시 처리 (Archive 탭) */
.archive-tab-content {
    display: none;
    padding: 20px 0;
}

.archive-tab-content.active {
    display: block;
}

/* 이미지 그리드 (Photo 섹션 전용) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.image-grid img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.02);
}

/* Lightbox (Modal) Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    animation-name: zoom;
    animation-duration: 0.6s;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}


/* --- 4. Project Section Styles --- */
.section-description {
    margin-bottom: 30px;
    font-size: 1.1em;
    color: var(--sub-text-color);
}

.projects-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    justify-items: center;
}

.project-card {
    background-color: var(--secondary-bg-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 650px;
    width: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.project-title {
    color: var(--accent-color);
    margin-top: 0;
    font-size: 1.3em;
}

.project-meta {
    margin-bottom: 10px;
}

.meta-item {
    display: inline-block;
    font-size: 0.9em;
    color: var(--sub-text-color);
    margin-right: 15px;
}

.project-tech {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
}

.project-links {
    text-align: center;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    margin-top: 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

.demo-link {
    background-color: var(--accent-color);
    color: white;
}

.demo-link:hover {
    background-color: #007bff;
}

.project-links a i {
    margin-right: 8px;
}


/* --- 5. Contact Section Styles --- */

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    color: white;
    transition: transform 0.3s, opacity 0.3s;
}

.contact-link:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.contact-link i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* 플랫폼별 색상 지정 */
.contact-link.github {
    background-color: #333;
}

.contact-link.linkedin {
    background-color: #0077B5;
}

.contact-link.instagram {
    background-color: #E4405F;
}

.footer-note {
    text-align: center;
    margin-top: 50px;
    font-size: 1.1em;
    color: var(--sub-text-color);
}

/* --- 6. Footer Styles --- */
footer {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #ddd;
    color: var(--sub-text-color);
    font-size: 0.9em;
}


/* --- 7. 반응형 미디어 쿼리 --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }

    nav {
        margin-top: 10px;
    }

    nav a {
        margin: 0 5px;
    }

    main {
        margin: 1rem auto;
        padding: 10px;
    }

    .profile-content {
        flex-direction: column;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}