/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    color: #333;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

.fade-in {
  will-change: transform, opacity;
  opacity: 1; /* 초기값을 1로 변경 */
  transform: none; /* 처음부터 위치를 고정 */
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    z-index: 1000;
    transition: transform 0.3s ease; /* 부드러운 이동 효과 */
}

/* 헤더 숨김 상태 */
.header.hidden {
    transform: translateY(-100%); /* 위로 숨김 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

header h1 a {
    text-decoration: none;
    color: #000;
    font-weight: 900;
    letter-spacing: -3.5px;
    transition: color 0.3s;
    font-family: 'Montserrat', sans-serif; /* 제목에 Montserrat 폰트 적용 */
}

header h1 a:hover {
    color: #555;
}

header nav a {
    margin-left: 1rem;
    text-decoration: none;
    color: #ccc;
    font-weight: normal;
    transition: color 0.3s, font-weight 0.3s;
}

/* 활성화된 상태 */
header nav a.active {
    color: #000;
    font-weight: bold;
}

header nav a:hover {
    color: #555;
}

/* Works Section */
main.works {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 60px; /* 기본값을 설정 */
    padding: 2rem;
}

/* 전체 컨테이너 */
.grid-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    max-width: 1200px;
    margin: auto;
}

.grid-container p{
font-size: .9rem;
margin-top: .3rem;
}

/* 개별 컬럼 (3개) */
.column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: calc(33.333% - 10px);
}

/* 썸네일 기본 스타일 */
.grid-item {
    position: relative;
    width: 100%;
    overflow: hidden;
    opacity: 0; /* 초기 투명도 */
    transition: transform 0.3s ease-in-out;
    will-change: transform; /* 🔥 미리 렌더링 준비 */
}

/* 🏗️ 썸네일 크기 개별 조정 */
.grid-item[data-size="1"] { height: 550px; }
.grid-item[data-size="2"] { height: 620px; }
.grid-item[data-size="3"] { height: 360px; }
.grid-item[data-size="4"] { height: 430px; }
.grid-item[data-size="5"] { height: 270px; }
.grid-item[data-size="6"] { height: 370px; }
.grid-item[data-size="7"] { height: 260px; }
.grid-item[data-size="8"] { height: 440px; }
.grid-item[data-size="9"] { height: 290px; }
.grid-item[data-size="10"] { height: 290px; }
.grid-item[data-size="11"] { height: 480px; }
.grid-item[data-size="12"] { height: 430px; }
.grid-item[data-size="13"] { height: 230px; }



/* 📷 이미지 스타일 */
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-in-out; /* ✅ 부드러운 애니메이션 */
    will-change: transform; /* 🔥 미리 GPU 가속 */
}

/* 🖱️ 마우스를 올리면 이미지 확대 (부드럽게) */
.grid-item:hover img {
    transform: scale(1.04); /* ✅ 확대 비율 줄임 (1.05 → 1.02) */
}

/* 🔥 overlay 스타일 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: opacity 0.4s ease-in-out; /* ✅ 부드러운 투명도 변경 */
    text-align: center;
}

/* 🖱️ 마우스를 올리면 overlay 보이기 */
.grid-item:hover .overlay {
    opacity: 1;
}

/* 🔥 fade-in 애니메이션 */
.fade-in {
    animation: fadeInEffect 1s ease-in-out forwards;
}

/* 🔥 fade-in 애니메이션 키프레임 */
@keyframes fadeInEffect {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 📐 반응형 조정 */
@media (max-width: 768px) {
    .grid-container {
        flex-direction: column;
    }
    .column {
        width: 100%;
    }
}




/* Footer */
footer {
  padding: 4rem 2rem 0.5rem 2rem; /* 아래쪽 패딩 조정 */
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9rem;
    color: #333;
    letter-spacing: -1.3px;
}
