/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.8;
    color: #1a1a1a;
    background: #fafafa;
    min-height: 100vh;
}

/* CSS Variables - Museum/Gallery Theme */
:root {
    /* Colors - Elegant & Minimal */
    --primary-color: #1a1a1a;
    --primary-light: #333333;
    --primary-dark: #0a0a0a;
    --secondary-color: #666666;
    --accent-color: #B8860B;  /* Dark goldenrod for sophistication */
    --accent-light: #DAA520;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-light: #999999;
    --white: #ffffff;
    --off-white: #fafafa;
    --border-color: #e0e0e0;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;

    /* Shadows - Subtle & Refined */
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Transitions - Smooth & Elegant */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --space-unit: 8px;
    --space-xs: calc(var(--space-unit) * 1);
    --space-sm: calc(var(--space-unit) * 2);
    --space-md: calc(var(--space-unit) * 3);
    --space-lg: calc(var(--space-unit) * 4);
    --space-xl: calc(var(--space-unit) * 6);
    --space-2xl: calc(var(--space-unit) * 8);
}

/* 메인 컨테이너 */
.main-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    padding-top: 70px;
    padding-bottom: 0;
    background: var(--bg-secondary);
}

/* 페이지 래퍼 */
.page-wrapper {
    width: 400%;
    height: 100%;
    display: flex;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0%);
    touch-action: pan-x;
}

/* 개별 페이지 */
.page {
    width: 100vw;
    min-width: 100vw;
    height: calc(100vh - 70px);
    position: relative;
    display: block;
    padding: var(--space-2xl) var(--space-xl);
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary);
    flex-shrink: 0;
}

/* Dark page theme — 경력/블로그 페이지 반전 */
.page-career,
.page-thoughts {
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-light: #666666;
    --primary-light: #d0d0d0;
    --secondary-color: #999999;
    --bg-primary: #161616;
    --bg-secondary: #111111;
    --bg-tertiary: #1e1e1e;
    --border-color: #2a2a2a;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.5);
    background: #0e0e0e !important;
    color: #f0f0f0;
}

/* 헤더 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.logo:hover {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) 0;
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* 페이지 네비게이션 버튼 */
.page-nav {
    position: fixed;
    right: var(--space-xl);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    z-index: 999;
}

.page-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-subtle);
}

.page-nav-btn:hover {
    background: var(--text-primary);
    color: var(--white);
    border-color: var(--text-primary);
    box-shadow: var(--shadow-light);
}

.page-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

/* 전역 맨 위로 버튼 */
.scroll-top-btn {
    position: fixed;
    right: var(--space-xl);
    bottom: var(--space-xl);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: var(--transition-fast);
    z-index: 1002;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--text-primary);
    color: var(--white);
    border-color: var(--text-primary);
    box-shadow: var(--shadow-light);
}

body.blog-detail-active .page-nav,
body.blog-detail-active .page-indicators {
    display: none;
}

/* 페이지 인디케이터 */
.page-indicators {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-md);
    z-index: 1001;
    background: var(--bg-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.indicator.active {
    background: var(--text-primary);
    transform: scale(1.3);
}

.indicator:hover:not(.active) {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* 페이지별 인디케이터 라벨 */
.indicator::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.indicator:hover::after {
    opacity: 1;
}

/* 푸터 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    z-index: 998;
    display: none;
    transform: translateY(0);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

body.page-3.chrome-idle .page-indicators {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 16px);
}

body.page-3.chrome-idle .footer {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 유틸리티 클래스 */
.elegant-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: var(--space-xl);
    transition: var(--transition);
    box-shadow: var(--shadow-subtle);
}

.elegant-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .page {
        padding: 15px 20px;
        height: calc(100vh - 120px);  /* 모바일에서 높이 조정 */
    }
    
    .page-nav {
        right: 20px;
        gap: 15px;
    }
    
    .page-nav-btn {
        width: 45px;
        height: 45px;
    }

    .scroll-top-btn {
        right: 20px;
        bottom: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .footer {
        padding: 8px 20px;
        height: 40px;
    }
    
    .logo {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }
    
    .page {
        padding: 10px 15px;
        height: calc(100vh - 100px);
    }
    
    .page-nav {
        right: 15px;
        gap: 10px;
    }
    
    .page-nav-btn {
        width: 40px;
        height: 40px;
    }

    .scroll-top-btn {
        right: 15px;
        bottom: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .page-indicators {
        bottom: 70px;
        gap: 15px;
        padding: 12px 20px;
    }
    
    .indicator {
        width: 14px;
        height: 14px;
    }
    
    .indicator::after {
        font-size: 0.65rem;
        bottom: -30px;
    }
    
    .footer {
        height: 35px;
        padding: 5px 15px;
    }
}

/* 스크롤바 스타일링 */
.page::-webkit-scrollbar {
    width: 8px;
}

.page::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.page::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    border: 2px solid var(--bg-secondary);
}

.page::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
