/* ==========================================
   1. 기본 스타일 초기화 & 폰트 시스템
   ========================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    font-size: 22px; /* 전체 상대 크기의 기준점 확립 */
    background-color: #ffffff; /* body와 동일하게 */
    height: 100%;
}

body {
    /* 영문: IM Fell DW Pica / 한글: Noto Serif KR */
    font-family: 'IM Fell DW Pica', 'Noto Serif KR', serif;
    color: #111111;
    background-color: #ffffff;
    font-size: 22px; 
    font-weight: 400; 
    letter-spacing: -0.025em; 
    line-height: 1.65;
    padding: 60px 50px; 
    display: flex;
    flex-direction: column;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 🔗 기본 링크 및 호버 반응 */
a { 
    text-decoration: none; 
    color: inherit; 
    cursor: pointer; 
    transition: color 0.2s ease-out; /* 마우스 올릴 때 0.2초간 부드럽게 색 변경 */
}

a:hover {
    color: #4A6245; /* 올렸을 때 깊은 올리브 그린으로 전환 */
}

ul { list-style: none; }


/* ==========================================
   2. 상단 네비게이션 헤더 레이아웃
   ========================================== */
header {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
    margin-bottom: 70px; 
    padding-bottom: 15px;
}

/* 좌측 작가명 (Jung Yu) */
.site-title {
    font-size: 24px; 
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* 우측 메뉴 + 언어 통합 영역 */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px; 
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-menu li {
    font-size: 20px; 
    line-height: 1;
    display: flex;
    align-items: center;
}

/* 메뉴 구분 슬래시(/) */
.nav-menu li:not(:last-child)::after {
    content: "/";
    margin-left: 14px;
    color: #999; 
    font-style: normal;
}

.nav-menu li a:hover, .nav-menu li a.active {
    font-style: italic; 
}

/* 언어 선택 구분선 */
.lang-select {
    font-size: 18px; 
    font-weight: 400;
    line-height: 1;
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.lang-select::before {
    content: "│";
    margin-right: 20px;
    color: #ddd;
    font-size: 14px;
}


/* ==========================================
   3. 콘텐츠 탭 & 레이아웃
   ========================================== */
.tab-content {
    display: none; 
    width: 100%;
    flex: 1;
    margin-bottom: 60px;
}

.tab-content.active {
    display: block !important;
}

/* [HOME 탭] */
.home-container {
    display: block; /* 💡 flex를 풀고 block으로 변경하여 자유로운 배치 허용 */
    width: 100%;
    padding-top: 10px;
}

.home-main-img {
    max-width: 720px;
    width: 100%;
    height: auto;
    display: block;
}

.archive-collage {
    width: 1200px;
    margin: 0 auto;
}


/* [WORKS 탭] - 4열 그리드 */
.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    column-gap: 24px; 
    row-gap: 48px;    
    width: 100%;
}

.grid-item {
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.grid-item img {
    width: 100%;
    aspect-ratio: 4 / 3; 
    object-fit: cover;
    display: block;
    margin-bottom: 12px;
}

.item-title {
    font-size: 18px; 
    font-weight: 500;
    color: #111;
    margin-top: 12px;
    line-height: 1.4;
}

.grid-item .item-details {
    display: none;
}

/* 'About / 소개' 토글 버튼 스타일 */
.statement-toggle-btn {
    display: inline-block;
    cursor: pointer;
    font-weight: 500;
    font-size: 20px;
    font-style: italic;
    transition: color 0.2s ease-out;
    user-select: none;
}

.statement-toggle-btn:hover {
    color: #4A6245;
}

/* 작가 소개 박스 (절대 위치 유지로 아래 이미지들을 밀어내지 않음) */
.artist-statement {
    position: absolute !important; 
    top: 120px !important; 
    left: 30px !important; 
    width: 700px !important; 
    z-index: 1000 !important; /* 이미지나 푸터 뒤에 숨지 않도록 가장 위로 올림 */
    padding: 0 !important;
    background: transparent !important;
}

/* 펼쳐지는 줄글 내용 박스 */
.statement-content {
    display: none;
    position: absolute;
    top: 40px;                /* 토글 버튼 바로 아래에 위치하도록 */
    left: 0;
    width: 100%;
    margin-top: 10px;
    z-index: 1000;     
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-size: 16px; 
    font-weight: 400; 
    line-height: 1.8; 
    color: #111; 
    letter-spacing: -0.01em; 
    text-align: justify;
    max-height: 350px;
    overflow-y: auto;         /* 내용이 max-height 넘으면 스크롤 (잘림 방지) */
    background: #ffffff;      /* 아래 이미지와 겹칠 수 있으니 배경색 지정 권장 */
}


/* ==========================================
   4. 작품 개별 상세 페이지 (가시성 대폭 강화)
   ========================================== */
#single-work-view {
    position: relative; 
}

.single-work-container {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    text-align: left; 
    padding-top: 40px;
    position: relative;
}

.single-work-container.active {
    display: block !important;
}

.single-work-img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 50px;
}

.single-work-title {
    font-size: 30px; 
    font-weight: 600; 
    color: #000000;
    margin-top: 20px;
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

/* 🔥 [수정] 스펙/메타데이터는 17px로 살짝 눌러주어 제목을 더욱 돋보이게 함 */
.single-work-details {
    font-size: 18px;
    font-weight: 400;
    color: #222222; 
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 35px;
}

/* 작품 상세 설명/본문 */
#detail-description, .single-work-description {
    font-size: 15px; 
    font-weight: 300;
    color: #111111;
    line-height: 1.8;
    letter-spacing: -0.01em;
    text-align: left; 
    word-break: keep-all; 
    margin-top: 30px;
    margin-bottom: 30px;
    white-space: pre-line;
}

/* 1. 기본 상태: List 버튼은 무조건 숨김 */
.back-to-list {
    display: none;
    position: absolute;
    top: 150px;
    right: 40px;
    font-size: 22px;
    font-weight: 400;
    font-family: 'IM Fell DW Pica', serif;
    font-style: italic;
    color: #000000;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease-out;
}

/* 2. 🔥 핵심: 상세 페이지(.active)가 열렸을 때만 List 버튼을 띄움 */
.single-work-container.active .back-to-list,
#single-work-view.active .back-to-list {
    display: block !important;
}

.back-to-list:hover {
    color: #4A6245 !important; /* List 버튼에 마우스 올렸을 때도 동일한 딥 그린 */
}

.grid-item:hover .item-title {
    color: #4A6245;
}

/* 하단 뒤로가기 화살표 컨테이너 (상세 페이지 안에서만 존재함) */
.back-link-container {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 60px;
    margin-bottom: 40px;
}

/* 화살표 모양 및 호버 효과 */
.btn-back-arrow {
    text-decoration: none;
    display: inline-block;
}

.arrow-icon {
    font-size: 24px;
    font-weight: 300;
    color: #111111;
    transition: all 0.2s ease-out;
}

.btn-back-arrow:hover .arrow-icon {
    color: #4A6245;
    transform: translateX(-4px);
}


/* ==========================================
   5. 줄글 레이아웃 (TEXTS / CV / CONTACT 등)
   ========================================== */
.text-container {
    max-width: 800px;
    margin: 0 auto; 
    padding-top: 20px;
    font-size: 16px;
}

.text-container h2 {
    font-size: 18px; 
    font-weight: 500;
    margin-top: 40px;
    margin-bottom: 16px;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.text-container h2:first-of-type {
    margin-top: 0;
}

.text-container p {
    margin-bottom: 16px;
    color: #111;
    line-height: 1.75;
}

/* CV 레이아웃 */
.cv-row {
    display: flex;
    margin-bottom: 16px;
    line-height: 1.65;
    font-size: 16px;
}

.cv-year {
    width: 150px;
    flex-shrink: 0;
    color: #000;
    font-weight: 500;
}

.cv-content {
    flex: 1;
    color: #222;
}


/* ==========================================
   6. 푸터 & 모바일 반응형
   ========================================== */
.site-footer {
    clear: both;         
    width: 100%;
    text-align: center;
    margin-top: 100px;   /* 콘텐츠와 푸터 사이의 간격 (원하시는 픽셀로 조절) */
    padding-bottom: 30px;
    position: relative;  /* fixed나 absolute가 아닌 일반 흐름으로 설정 */
    display: block;
}

.site-footer p {
    font-size: 11px;             
    font-weight: 300;            
    color: #b5b5b5;              
    letter-spacing: 0.08em;      
    text-transform: uppercase;   
}

@media (max-width: 768px) {
    body { 
        padding: 30px 20px; 
        font-size: 18px;
        overflow-x: hidden;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px; 
        margin-bottom: 40px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between; 
        gap: 10px;
        padding-right: 4px;
    }

    .nav-menu li {
        font-size: 14px; 
    }

    .single-work-title {
        font-size: 23px;
    }

    .works-grid {
        grid-template-columns: repeat(3, 1fr) ; 
        column-gap: 15px;
        row-gap: 30px;
    }

    .item-title {
        font-size: 12px;
    }

    .cv-row {
        flex-direction: column;
        margin-bottom: 15px;
    }

    /* 💡 홈 화면 전체를 Flex 컨테이너로 전환하여 순서 제어 + 오버레이 기준점 확보 */
    #home.tab-content {
        display: flex !important;
        flex-direction: column;
        position: relative;   /* ✅ 추가: artist-statement의 absolute 기준점 */
    }

    /* 바깥 wrapper — 실제 화면에 보이는 창 역할 */
    .chaotic-home-wall-wrapper {
        width: 100%;
        height: 435px;
        overflow: hidden;
        position: relative;
        order: 1;
    }

    /* 안쪽 — 원래 PC 크기 그대로 두고 scale만 적용 */
    .chaotic-home-wall {
        max-width: none !important;
        transform-origin: top left;
        position: relative !important;
        overflow: visible;
    }

    /* 💡 이미지 콜라주 위쪽 빈 공간에 겹쳐서 뜨도록 오버레이 처리 */
    .artist-statement {
        position: absolute !important;   /* ✅ relative → absolute */
        top: 10px !important;             /* ✅ 콜라주의 빈 공간 위치에 맞춰 조정 */
        left: 5% !important;              /* ✅ 추가 */
        width: 90% !important;            /* ✅ 80% → 90%로 조정 (left 5%와 합쳐 좌우 대칭) */
        max-width: 700px !important;

        margin: 0 !important;             /* ✅ auto 마진 제거 (absolute라 불필요) */

        transform: none !important;

        font-size: 10px !important;
        line-height: 1.5 !important;

        padding: 0 !important;
        background: transparent !important;

        z-index: 100;
    }

    /* 언어 버튼 터치 영역 확장 + 화면 끝 여백 확보 */
    .lang-select {
        margin-left: 0;
        flex-shrink: 0;
    }

    #lang-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 32px;
        padding: 6px 8px;
        font-size: 16px;
    }
}