/* 1. 폰트 설정 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css");

@font-face {
    font-family: 'BookkMyungjo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/BookkMyungjo-Lt.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'BookkMyungjo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/BookkMyungjo-Bd.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* 2. 변수 및 기본 스타일 */
:root {
    --bg-color: #F8F4E2; 
    --text-color: #282828;
    --gray-color: #666;
    --border-color: #282828;
    --font-heading: 'BookkMyungjo', serif; 
    --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: 100px; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 100px;
}

a { text-decoration: none; color: inherit; transition: opacity 0.4s var(--ease-smooth); }
a:hover { opacity: 0.6; }

/* 3. 레이아웃 공통 */
main, footer { padding: 0 5%; max-width: 1400px; margin: 0 auto; }

/* 4. 헤더 (고정 + 그라디언트 블러) */
header {
    height: 100px;
    width: 100%;
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 9999;
    background-color: rgba(248, 244, 226, 0.6);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    pointer-events: none;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo a { display: flex; align-items: center; }
.logo img { height: 32px; width: auto; display: block; }
nav ul { display: flex; gap: 30px; list-style: none; }
nav ul li a { font-family: var(--font-body); font-weight: 500; font-size: 0.95rem; cursor: pointer; }

/* 5. 섹션 스타일 */
.hero-section { padding: 120px 0 80px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; }
.hero-text h1 { font-family: var(--font-heading); font-weight: 700; font-size: 3.8rem; line-height: 1.3; letter-spacing: -1.5px; }
.hero-desc { max-width: 400px; font-size: 1.1rem; color: var(--gray-color); }
.arrow-down { margin-top: 40px; font-size: 1.5rem; }

.work-list { margin-top: 50px; margin-bottom: 100px; }
.project-item { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; padding: 80px 0; align-items: flex-start; }
.project-info { padding-right: 20px; }
.project-num { display: block; font-family: var(--font-body); font-size: 0.9rem; margin-bottom: 20px; font-weight: 500; letter-spacing: 0.5px; }
.project-info h3 { font-family: var(--font-heading); font-weight: 700; font-size: 2.2rem; margin-bottom: 20px; letter-spacing: -1px; line-height: 1.2; }
.project-info p { font-size: 1rem; color: var(--gray-color); margin-bottom: 40px; max-width: 350px; }
.view-project { display: inline-block; border-bottom: 1px solid var(--text-color); padding-bottom: 2px; font-size: 0.9rem; }

/* 6. 미디어(이미지 & 비디오) 스타일 설정 */
.project-thumb { width: 100%; overflow: hidden; }

/* (1) 기본 설정: 리스트, 갤러리 (높이 400px 고정) */
.project-img, 
.detail-image img, 
/* 비디오는 여기서 제외 (아래에서 따로 설정) */
.detail-gallery img, 
.detail-gallery video {
    width: 100%;
    height: 400px !important;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-smooth);
}

/* (2) 상세 페이지 메인 '이미지': 높이 600px 고정 */
.detail-image.large img {
    height: 600px !important;
    object-fit: cover;
}

/* (3) 상세 페이지 메인 '비디오': 16:9 비율 (높이 자동) */
.detail-image.large video {
    width: 100%;
    height: auto !important; /* 높이 제한 해제 */
    aspect-ratio: 16 / 9;    /* 비율 고정 */
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-smooth);
}

/* 호버 효과 */
.project-thumb:hover .project-img,
.detail-image:hover img,
.detail-image:hover video,
.detail-gallery:hover img,
.detail-gallery:hover video {
    transform: scale(1.02);
}

hr { border: 0; border-top: 1px solid var(--text-color); opacity: 0.2; }

/* 7. 푸터 */
footer { padding-top: 50px; padding-bottom: 50px; display: flex; justify-content: space-between; font-size: 0.9rem; border-top: 1px solid rgba(40, 40, 40, 0.2); margin-top: 50px; }
.footer-right a { margin-left: 20px; }

/* 8. 상세 페이지 레이아웃 */
.detail-page { padding-top: 80px; padding-bottom: 100px; }
.project-header { margin-bottom: 60px; }
.project-header h1 { font-family: var(--font-heading); font-weight: 700; font-size: 3.5rem; margin-bottom: 15px; letter-spacing: -1px; }
.project-subtitle { font-family: var(--font-body); font-size: 1.1rem; color: var(--gray-color); }
.detail-image { margin-bottom: 60px; overflow: hidden; }
.project-desc-block { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; margin-bottom: 80px; }
.desc-title h3 { font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem; }
.detail-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 80px; }
.next-project { text-align: right; padding-top: 50px; border-top: 1px solid rgba(40, 40, 40, 0.2); }
.next-project span { display: block; font-size: 0.9rem; color: var(--gray-color); margin-bottom: 10px; }
.next-project a { font-family: var(--font-heading); font-weight: 700; font-size: 2rem; }

/* 9. 애니메이션 */
.reveal { opacity: 0; transform: translateY(40px); transition: all 1.2s var(--ease-smooth); will-change: opacity, transform; }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* 10. 모바일 반응형 */
@media (max-width: 768px) {
    .hero-section { flex-direction: column; }
    .hero-text h1 { font-size: 2.8rem; }
    .project-item { grid-template-columns: 1fr; padding: 50px 0; gap: 20px; }
    .project-thumb { order: -1; }
    
    .project-img, 
    .detail-image img, 
    .detail-gallery img, 
    .detail-gallery video { height: 250px !important; }
    
    .detail-image.large img { height: 350px !important; }

    /* 모바일에서도 비디오는 16:9 유지 */
    .detail-image.large video {
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    .project-desc-block, .detail-gallery { grid-template-columns: 1fr; }
    .project-info h3 { font-size: 1.8rem; }
    .next-project a { font-size: 1.5rem; }
}

/* 11. Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

.lenis.lenis-scrolling iframe { pointer-events: none; }

