/* ==========================================
   1. 기본 설정 및 초기화
========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
html { scroll-behavior: initial; }
body { font-family: 'Pretendard', 'Outfit', sans-serif; background: #F5F4EC; color: #1A1A1A; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; display: inline-block; }
button { background: none; border: none; outline: none; font-family: inherit; }

html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ==========================================
   2. 커스텀 커서 & 네비게이션
========================================== */
.custom-cursor { position: fixed; top: 0; left: 0; width: 15px; height: 15px; background-color: #E65A45; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, background-color 0.3s; display: flex; justify-content: center; align-items: center; }
.cursor-text { color: white; font-size: 12px; font-weight: 700; opacity: 0; font-family: 'Outfit', sans-serif; }

.detail-nav { position: fixed; top: 0; left: 0; width: 100%; padding: 30px 50px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; mix-blend-mode: difference; color: #F5F4EC; }
.back-btn { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; transition: opacity 0.3s; }
.back-btn:hover { opacity: 0.7; }
.back-btn .arrow { font-size: 1.5rem; transition: transform 0.3s; }
.back-btn:hover .arrow { transform: translateX(-5px); }
.nav-logo { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.5rem; }

.lang-toggle { display: flex; background: #ffffff; border-radius: 30px; padding: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.lang-btn { padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; color: #888; transition: 0.3s; }
.lang-btn.active { background: #E65A45; color: white; }

/* ==========================================
   3. 히어로 섹션 (반응형 이미지 최적화)
========================================== */
.detail-hero { position: relative; width: 100vw; min-height: 100vh; padding-top: 150px; display: flex; flex-direction: column; align-items: center; }
.blob-bg { position: absolute; top: -10%; left: 50%; transform: translateX(-50%); width: 800px; height: 800px; background: #FFD3C4; border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; filter: blur(80px); opacity: 0.5; z-index: -1; animation: morph 15s ease-in-out infinite alternate; }
@keyframes morph { 0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; } 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } }

.hero-title-wrap { text-align: center; margin-bottom: 60px; z-index: 2; }
.hero-title { font-family: 'Outfit', sans-serif; font-size: 5rem; font-weight: 900; line-height: 1.1; color: #425DA8; }
.highlight { color: #F2C94C; display: inline-block; position: relative; font-style: italic; }
.highlight::after { content: ''; position: absolute; bottom: 10px; left: 0; width: 100%; height: 12px; background-color: rgba(230, 90, 69, 0.6); z-index: -1; transform: skewX(-15deg); }

/* [핵심] PC에서는 16:9로 와이드하게, 피사체는 중앙 보호 */
.hero-image-wrap { width: 90%; max-width: 1400px; aspect-ratio: 16 / 9; border-radius: 30px; overflow: hidden; position: relative; z-index: 2; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.hero-image { width: 100%; height: 120%; object-fit: cover; object-position: center; transform: translateY(-10%); }

/* ==========================================
   4. 프로젝트 정보 & 본문 갤러리
========================================== */
.detail-info { padding: 100px 5%; max-width: 1400px; margin: 0 auto; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; border-top: 2px solid rgba(0,0,0,0.1); border-bottom: 2px solid rgba(0,0,0,0.1); padding: 40px 0; }
.info-item h4 { font-family: 'Outfit', sans-serif; font-size: 1rem; color: #888; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.info-item p { font-size: 1.2rem; font-weight: 600; color: #1A1A1A; }

.detail-content { padding: 50px 5% 150px; max-width: 1400px; margin: 0 auto; }
.content-text { max-width: 800px; margin: 0 auto 100px; text-align: center; }
.content-text h3 { font-family: 'Outfit', sans-serif; font-size: 2.5rem; font-weight: 900; color: #425DA8; margin-bottom: 30px; }
.content-text p { font-size: 1.5rem; line-height: 1.8; color: #1A1A1A; word-break: keep-all; font-weight: 700; }
.word { opacity: 0.15; display: inline-block; transition: opacity 0.1s; }

.content-gallery { display: flex; flex-direction: column; gap: 40px; }
/* [핵심] 갤러리 이미지는 원본 4:3 비율을 100% 유지 (잘림 없음) */
.gallery-img-wrap { width: 100%; border-radius: 20px; overflow: hidden; }
.gallery-img-wrap img { width: 100%; height: auto; display: block; transition: transform 0.5s ease; }
.gallery-img-wrap:hover img { transform: scale(1.03); }
.gallery-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* ==========================================
   5. 다음 프로젝트 & 유틸리티
========================================== */
.next-project { background-color: #425DA8; color: white; padding: 150px 5%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.next-label { font-family: 'Outfit', sans-serif; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px; opacity: 0.8; }
.next-title { font-family: 'Outfit', sans-serif; font-size: 6vw; font-weight: 900; color: #F2C94C; transition: color 0.3s, transform 0.3s; }
.next-title:hover { color: white; transform: scale(1.05); }

.fade-up { opacity: 0; transform: translateY(50px); }
.magnetic-item { display: inline-block; }

/* ==========================================
   6. 반응형 미디어 쿼리 (Tablet & Mobile)
========================================== */
@media screen and (max-width: 1024px) {
    .hero-title { font-size: 4rem; }
    .info-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .gallery-grid-2 { gap: 20px; }
}

@media screen and (max-width: 768px) {
    .custom-cursor { display: none; }
    * { cursor: auto !important; }
    
    .detail-nav { padding: 20px; mix-blend-mode: normal; color: #1A1A1A; }
    .detail-hero { padding-top: 120px; }
    .hero-title { font-size: 2.5rem; }
    
    /* [핵심] 모바일에서는 히어로 이미지를 4:3으로 변경하여 잘림 방지 */
    .hero-image-wrap { aspect-ratio: 4 / 3; border-radius: 15px; }
    
    .detail-info { padding: 60px 5%; }
    .info-grid { grid-template-columns: 1fr; gap: 20px; padding: 20px 0; }
    
    .detail-content { padding: 30px 5% 80px; }
    .content-text h3 { font-size: 2rem; }
    .content-text p { font-size: 1.2rem; }
    
    .gallery-grid-2 { grid-template-columns: 1fr; }
    .gallery-img-wrap { border-radius: 10px; }
    
    .next-project { padding: 100px 5%; }
    .next-title { font-size: 3rem; }
}

/* ==========================================
   프로젝트 상세 페이지: 모바일 화면 보정
   PC 디자인에는 적용되지 않음
========================================== */
@media screen and (max-width: 768px) {

    /* 화면 밖으로 밀리는 요소 방지 */
    .detail-hero,
    .detail-info,
    .detail-content,
    .next-project {
        width: 100%;
        min-width: 0;
    }

    /* 상단 메뉴: 작은 화면에서도 겹치지 않게 */
    .detail-nav {
        gap: 8px;
        padding: 14px 16px;
        background: rgba(245, 244, 236, 0.94);
        color: #1A1A1A;
        mix-blend-mode: normal;
    }

    .back-btn {
        flex-shrink: 0;
        gap: 4px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    /* ★ 모바일에서 '홈으로' 글자 숨기기 */
    .back-btn .lang-text {
        display: none;
    }

    /* ★ 화살표 크기 키우기 */
    .back-btn .arrow {
        font-size: 1.5rem;
    }

    .nav-logo {
        min-width: 0;
        font-size: 1.1rem;
        white-space: nowrap;
    }

    .lang-toggle {
        flex-shrink: 0;
    }

    .lang-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    /* 히어로 제목과 이미지 */
    .detail-hero {
        min-height: 0;
        padding: 110px 16px 50px;
    }

    .blob-bg {
        width: min(110vw, 480px);
        height: min(110vw, 480px);
        top: 40px;
        filter: blur(45px);
    }

    .hero-title-wrap {
        width: 100%;
        margin-bottom: 28px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7.5vw, 2.5rem);
        line-height: 1.16;
        overflow-wrap: normal;
    }

    .hero-title .highlight {
        max-width: 100%;
    }

    /* 모바일에서는 사진을 추가 확대하거나 스크롤로 움직이지 않음 */
    .hero-image-wrap {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 16px;
    }

    .hero-image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: none !important;
    }

    /* Client / Role / Year / Category */
    .detail-info {
        padding: 24px 20px 55px;
    }

    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
        padding: 24px 0;
    }

    .info-item {
        min-width: 0;
    }

    .info-item h4 {
        font-size: 0.78rem;
        margin-bottom: 7px;
    }

    .info-item p {
        font-size: 0.95rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    /* 설명과 작품 이미지 */
    .detail-content {
        padding: 10px 20px 80px;
    }

    .content-text {
        margin-bottom: 45px;
    }

    .content-text h3 {
        font-size: 1.75rem;
        margin-bottom: 20px;
    }

    .content-text p {
        font-size: 1rem;
        line-height: 1.8;
    }

    .content-gallery {
        gap: 16px;
    }

    .gallery-grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-img-wrap {
        border-radius: 12px;
    }

    /* 다음 프로젝트 제목이 화면 밖으로 나가지 않게 */
    .next-project {
        padding: 80px 20px;
    }

    .next-title {
        max-width: 100%;
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
}

/* 특히 폭이 좁은 폰에서 상단 메뉴 겹침 방지 */
@media screen and (max-width: 360px) {
    .detail-nav {
        padding-inline: 10px;
        gap: 5px;
    }

    .nav-logo {
        font-size: 0.95rem;
    }

    .back-btn {
        font-size: 0.7rem;
    }
}