/* Hero 섹션 (index.html) */
#hero {
    background: var(--dark-color);
    color: #fff;
    
    min-height: calc(60vh - var(--nav-height)); /* 네비게이션 바 높이 제외 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#hero {
    background-color: var(--dark-color);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), /* 옅은 가로선 */
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); /* 옅은 세로선 */
    background-size: 20px 20px; /* 격자 크기 조절 */
    /* 추가적으로 어두운 그라데이션을 background-color 대신 사용 가능 */
    /* background: linear-gradient(135deg, var(--dark-color) 0%, #1e2a38 100%),
                  url('path/to/micro-pattern.png') repeat; */
    color: #fff;
    /* 기존 #hero 스타일 유지 */
}
#hero h1 {
    font-size: 3.2rem; /* 크기 조정 */
    margin-bottom: 1rem;
    color: #fff;
}
#hero .container {
    max-width: 50rem;
}

#hero .container .lead {
    font-size: 1.4rem; /* 크기 조정 */
    margin-bottom: 2rem;
    color: #f0f0f0;
}


/* 공통 콘텐츠 스타일 */
.content-section h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}
.content-section ul {
    margin-left: 20px;
    list-style: disc;
}
.content-section ul li {
    margin-bottom: 0.7rem;
}
.content-section p {
    margin-bottom: 1rem;
}

/* 플로팅 목차 (Floating TOC) */
.floating-toc {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px; /* 기본 너비 */
    padding: 10px; /* 내부 패딩 약간 줄임 */
    background-color: rgba(248, 249, 250, 0.9); /* 약간 더 불투명하게 */
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 900;
    transition: width 0.3s ease, padding 0.3s ease, left 0.3s ease; /* 너비, 패딩, 위치 변경 시 애니메이션 */
}

.floating-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block; /* 기본적으로 펼쳐진 상태 */
    max-height: 60vh; /* 목차 내용이 너무 길 경우 스크롤 */
    overflow-y: auto;
}

.floating-toc ul li {
    margin-bottom: 8px; /* 간격 약간 줄임 */
}

.floating-toc ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem; /* 약간 작게 */
    font-weight: 500;
    display: block;
    padding: 6px 10px; /* 패딩 약간 조정 */
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap; /* 텍스트가 한 줄로 표시되도록 */
    overflow: hidden;
    text-overflow: ellipsis; /* 넘치는 텍스트는 ...으로 표시 */
}

.floating-toc ul li a:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.floating-toc ul li a.active {
    color: var(--primary-color);
    font-weight: 700;
    background-color: rgba(0, 123, 255, 0.08);
    border-left: 3px solid var(--primary-color);
}

/* 목차 토글 버튼 스타일 */
.toc-toggle-button {
    display: none; /* 큰 화면에서는 숨김 */
    position: absolute;
    top: 10px;
    right: -45px; /* 접혔을 때 목차 오른쪽에 위치 (목차가 left: -값으로 숨겨질 때) */
    /* 또는 목차가 접혔을 때 목차 자체의 오른쪽에 위치시키려면 right: 10px; 등 */
    width: 35px;
    height: 35px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    z-index: 901; /* 목차 내용보다 위에 */
    padding: 0;
    transition: background-color 0.3s ease, right 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.toc-toggle-button:hover {
    background-color: var(--secondary-color);
}
.toc-toggle-button .icon-bar {
    display: block;
    width: 18px;
    height: 2px;
    background-color: white;
    margin: 4px auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 토글 버튼 'X' 모양 (펼쳐졌을 때) */
.floating-toc.is-open .toc-toggle-button .icon-bar:nth-child(1) {
    transform: translateX(8.5px) translateY(12px) rotate(45deg);
}
.floating-toc.is-open .toc-toggle-button .icon-bar:nth-child(2) {
    transform: translateX(-8.5px) translateY(12px) rotate(-45deg);
}




.timeline {
    position: relative;
    max-width: 800px;
    margin: 3rem auto;
    padding-top: 20px; 
}
.timeline::after { /* 기본 타임라인 바 (연한 회색 배경) */
    content: '';
    position: absolute;
    width: 3px;
    background-color: #e0e0e0; /* 연한 회색 */
    top: 0; 
    bottom: 0; /* 바닥까지 그려지도록 */
    left: 20px;
    z-index: 0; 
}

.timeline::before { /* 채워지는 바 (JS로 높이 조절) */
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color); 
    top: 0; /* 항상 타임라인 상단에서 시작 */
    left: 20px;
    height: var(--timeline-fill-height, 0px); /* JS에서 제어할 CSS 변수 */
    z-index: 1; 
    /* transition: height 0.1s linear; /* 바가 부드럽게 따라오도록 (또는  transition: none; 으로 즉각 반응) */
    /* transition을 없애거나 매우 짧게 하여 스크롤에 즉각 반응하도록 하는 것이 자연스러울 수 있습니다. */
}

.timeline-item {
    padding: 10px 0 20px 50px;
    position: relative;
    opacity: 0; 
    transform: translateY(40px); 
    transition: opacity 0.4s ease-out, transform 0.4s ease-out; 
    z-index: 2; 
}
.timeline-item::before { /* Dot icon 기본 스타일 */
    content: '';
    position: absolute;
    left: 11px; 
    top: 5px; 
    width: 16px;
    height: 16px;
    background-color: white; /* 기본 배경 흰색 */
    border: 3px solid #e0e0e0; /* ★ 기본 테두리도 연한 회색으로 변경 */
    border-radius: 50%;
    z-index: 3; 
    transition: background-color 0.3s ease-out, border-color 0.3s ease-out; 
}

.timeline-item.is-visible { /* 아이템 나타날 때 */
    opacity: 1;
    transform: translateY(0);
}

/* 아이템이 is-visible 일 때 점(dot) 스타일 변경 */
.timeline-item.is-visible::before {
    background-color: var(--primary-color); /* 채워진 점 색상 */
    border-color: var(--primary-color); 
}
.timeline-content {
    background-color: var(--light-color);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    position: relative; 
}
.timeline-content h4 {
    color: var(--primary-color);
    margin-top:0;
    font-size: 1.2rem;
}




/* 자기소개 - 주요 프로젝트 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.project-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.project-card-content {
    padding: 1.5rem;
    flex-grow: 1; /* 내용이 카드 전체를 채우도록 */
    display: flex;
    flex-direction: column;
}
.project-card-content h4 {
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
}
.project-card-content p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}
.project-card-content .tech-tags {
    margin-bottom: 1rem;
}
.project-card-content .tech-tags span {
    background-color: #e9ecef;
    color: var(--text-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.project-card-content .btn {
    margin-top: auto; /* 버튼을 카드 하단에 위치 */
    align-self: flex-start; /* 버튼 너비를 내용에 맞춤 */
}
/* 데스크톱 3열에서 처음 3개만 보이도록 */
.project-grid.show-initial .project-card:nth-child(-n+3) {
    display: flex; /* flex로 다시 보이게 (project-card의 기본 display가 flex임) */
}

/* 프로젝트 섹션 - 더보기 버튼 */
.more-projects-button-container {
    text-align: center; /* 버튼 가운데 정렬 */
    margin-top: 2.5rem; /* 위쪽 여백 */
    margin-bottom: 2rem; /* 아래쪽 여백 */
}

#toggle-projects-button {
    padding: 0.8rem 2rem; /* 버튼 크기 조정 */
    font-size: 1.1rem; /* 글자 크기 조정 */
    background-color: var(--primary-color); /* 기본 버튼과 다른 색상 */
}

#toggle-projects-button:hover {
    background-color: var(--secondary-color);
}



.challenge-highlight {
    background-color: #f0f7ff; /* 연한 파란색 배경 */
    padding: 1.5rem;
    border-radius: 5px;
    border-left: 5px solid var(--primary-color);
    margin-top: 2rem;
}
.challenge-highlight h4 {
    color: var(--dark-color);
    font-size: 1.3rem;
}

/* 자기소개 - 보유 역량 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.skill-category {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: 6px;
}
.skill-category h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}
.skill-category ul li {
    margin-bottom: 0.6rem;
    list-style-type: none;
    padding-left: 1.5rem;
    position: relative;
}
.skill-category ul li::before {
    content: '✓';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}