@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --accent-color: #FF758C; /* Pink color matching the logo */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

html, body {
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(18, 18, 18, 0.5);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: 'Pretendard', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    z-index: 102;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    color: white;
    z-index: 102;
}

.hamburger-menu svg {
    width: 28px;
    height: 28px;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    margin-left: 24px;
    font-weight: 500;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 1;
}

.hero {
    position: relative;
    height: 400vh;
    width: 100%;
    overflow-x: clip; /* clip은 sticky를 고장내지 않으면서 가로 넘침을 막습니다 */
}

.hero-content {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

.hero-title {
    font-family: 'Pretendard', sans-serif;
    font-weight: 800;
    font-size: 7.5rem;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-title .left {
    color: var(--accent-color);
}

.hero-title .right {
    color: #ffffff;
}

.hero-desc {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.titles-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 10;  /* 카드보다 위 */
}

.main-titles, .scroll-titles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform, opacity, filter;
}

.scroll-titles {
    flex-direction: row;
    font-size: 3.5rem;
    font-weight: 800;
    justify-content: center;
    gap: 1.5rem;
    color: #ffffff;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scroll-word {
    display: inline-block;
}

/* 타이틀 전환 클래스 */
.title-switched .main-titles {
    opacity: 0;
    filter: blur(10px);
    transform: translate(-50%, calc(-50% - 30px));
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}
.title-switched .scroll-titles {
    opacity: 1;
}

.cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;  /* 타이틀(z-index:10) 뒤 */
    overflow: visible;
}

.card {
    position: absolute;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.2);
    will-change: transform, opacity;
}

.center-card {
    width: 320px;
    height: 640px;
    left: 50%;
    top: 50vh;
    transform: translate(-50%, -50%);
    border-radius: 40px;
    z-index: 1; /* Keep it behind the text */
}

.floating-card {
    width: 220px;
    height: 300px;
    border-radius: 20px;
    opacity: 1;
}

/* Dynamic cards will use inline styles for positioning, no static classes needed */
/* 3D Zoom Tunnel Section */
.zoom-section {
    position: relative;
    height: 300vh; /* 3개의 작품이 지나가기에 딱 맞게 축소 */
    background: var(--bg-color); /* 배경색을 통일하여 끊기는 느낌 제거 */
}

.zoom-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px; /* 3D 깊이감을 위한 원근법 */
}

.artwork-layer {
    position: absolute;
    width: 70vw;
    height: 70vh;
    max-width: 1200px;
    border-radius: 30px;
    display: flex;
    align-items: flex-end;
    padding: 4rem;
    box-shadow: 0 40px 100px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.1);
    will-change: transform, opacity, filter;
    opacity: 0;
    transform: scale(0.1) translateZ(0); /* 멀리서 시작 */
    z-index: 1; /* 작품 레이어가 로고보다 위에 오도록 설정 */
}

.artwork-info {
    color: white;
}

.artwork-info h2 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 5px 20px rgba(0,0,0,0.8);
}

.artwork-info p {
    font-size: 1.5rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.spacer {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw;
        height: 100vh;
        background: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 101;
    }
    .nav-menu.active {
        right: 0;
    }
    .nav-menu a {
        margin: 20px 0;
        font-size: 1.8rem;
        font-weight: 700;
    }

    .hero-title {
        font-size: 4rem;
        flex-direction: column;
        gap: 0;
    }
    .center-card {
        width: 260px;
        height: 520px;
    }
    .floating-card {
        width: 150px;
        height: 200px;
    }
}

/* Logo Reveal Section Styles */
.logo-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    position: relative;
    z-index: 3;
    width: 100%;
    overflow: hidden; /* 가로 스크롤 방지 */
}

.logo-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

.logo-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Simple Image Popup */
.simple-popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; /* Allow clicking the page behind it */
    z-index: 9999;
    display: none;
    opacity: 0; /* for animation */
}

.simple-popup-box {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 300px; /* A bit smaller for a floating corner widget */
    max-width: 90%;
    background: transparent;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    text-align: left;
    transform: scale(0.9) translateY(20px); /* for animation */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: none;
    pointer-events: auto; /* Enable clicks on the box itself */
}

.simple-popup-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 20px; /* Fix the bottom border overlap */
}

.simple-popup-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 40px 20px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-bottom-left-radius: 20px; /* Ensure gradient follows borders */
    border-bottom-right-radius: 20px;
}

.simple-popup-text {
    color: #fff; font-size: 1.5rem; font-weight: 800;
    margin: 0; letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.simple-popup-cta {
    background: #fff;
    color: #111;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}
.simple-popup-cta:hover { transform: scale(1.05); background: #eee; }

.simple-popup-close {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0,0,0,0.5); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    color: #fff; font-size: 1.2rem;
    cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.simple-popup-close:hover { background: rgba(0,0,0,0.8); transform: rotate(90deg); }

/* ── 모바일 반응형 최적화 ── */
@media (max-width: 768px) {
    /* 첫 타이틀 '예술의 시작' */
    .hero-title {
        font-size: 4rem;
        gap: 0.5rem;
        flex-direction: column; /* 글자가 커서 줄바꿈 처리 */
        margin-bottom: 1.5rem;
    }
    
    .hero-desc {
        font-size: 1rem;
        padding: 0 1rem;
        line-height: 1.5;
        word-break: keep-all;
    }

    /* 두번째 타이틀 '내 꿈을 펼쳐봐' */
    .scroll-titles {
        font-size: 2.5rem;
        gap: 0.8rem;
    }

    /* 중앙 메인 카드 축소 (화면에 꽉 차지 않게) */
    .center-card {
        width: 200px;
        height: 400px;
    }

    /* 플로팅 카드 약간 축소 (옵션) */
    .floating-card {
        transform: scale(0.8); /* JS의 matrix transform 위에 적용되진 않지만, width/height를 강제할 순 없음. JS에서 인라인으로 들어가므로 이건 생략 */
    }

    /* 로고 텍스트 스케일 다운 */
    .logo-main-text {
        font-size: 3rem;
    }
    .logo-sub-text {
        font-size: 0.9rem;
    }
    
    /* 햄버거 메뉴 보이고 GNB 숨김 */
    .nav-links {
        display: none;
    }
}
