:root {
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --border-color: #e0e0e0;
    --text-color: #333;
    --bg-color: #fff;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.4;
    overflow-x: hidden;
    word-break: keep-all;
}

a {
    text-decoration: none;
    color: inherit;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: none;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.title-box, .top-nav, #mobile-menu-btn {
    pointer-events: auto;
}

.title-box {
    border: 1px solid var(--border-color);
    background: #fff;
    font-family: monospace;
    font-weight: normal;
    line-height: 1.3;
    display: inline-block;
    white-space: nowrap;
    color: #333;
    padding: 8px 12px;
    font-size: 13px;
    height: auto;
    cursor: pointer;
}

.top-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    background: #fff;
    color: #333;
    font-size: 13px;
}

.nav-btn:hover {
    background: #f5f5f5;
}

.nav-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

#mobile-menu-btn {
    display: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    background: #fff;
    cursor: pointer;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.3;
    color: #333;
    user-select: none;
    pointer-events: auto;
}

footer {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: monospace;
    font-size: 11px;
    color: #ccc;
    letter-spacing: 0.05em;
    z-index: 50;
    pointer-events: none;
}

#page-index {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background-color: #000;
    color: var(--text-color);
}

#page-index header {
    background-color: transparent;
    padding: 20px;
}

#page-index .title-box {
    border: none;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(2px);
}

#page-index .nav-btn {
    border: none;
    padding: 6px 12px;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(2px);
    color: #333;
}

#page-index .nav-btn:hover {
    background: rgba(255,255,255,0.7);
}

#page-index #mobile-menu-btn {
    border: none;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(2px);
}

#bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #000;
    pointer-events: none;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 8s ease-in-out;
    filter: blur(30px) brightness(0.9);
    transform: scale(1.1);
    animation: drift 40s infinite alternate ease-in-out;
    will-change: transform, opacity;
}

.bg-layer.active {
    opacity: 1;
    z-index: 1;
}

@keyframes drift {
    0% { transform: scale(1.1) translate(0, 0); }
    25% { transform: scale(1.2) translate(-5%, 2%); }
    50% { transform: scale(1.15) translate(3%, -5%); }
    75% { transform: scale(1.25) translate(-3%, 4%); }
    100% { transform: scale(1.1) translate(0, 0); }
}

#page-index footer {
    color: rgba(255,255,255,0.4);
    z-index: 1000;
}

#page-contact {
    overflow: hidden;
}

.contact-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-bottom: 50px;
    text-align: center;
}

.contact-row {
    margin-bottom: 20px;
    font-size: 14px;
}

.contact-row .label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-row .link {
    font-family: monospace;
    font-size: 16px;
    color: #000;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.3s;
}

.contact-row .link:hover {
    border-bottom: 1px solid #000;
}

#page-cv header, #page-works header {
    background-color: transparent;
    padding: 20px;
}

#page-cv .nav-btn, #page-works .nav-btn {
    padding: 6px 12px;
}

#page-cv {
    line-height: 1.6;
}

#page-cv footer, #page-works footer, #page-text footer{
    position: static;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    text-align: center;
}

.cv-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 150px 20px 100px 20px;
}

.cv-block {
    margin-bottom: 100px;
}

.section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #000;
    text-transform: uppercase;
}

.cv-row {
    display: flex;
    margin-bottom: 8px;
}

.year {
    width: 60px;
    font-family: monospace;
    color: #888;
    flex-shrink: 0;
    margin-right: 15px;
}

.detail {
    flex-grow: 1;
}

.ex-title, .ex-title-en {
    font-weight: normal;
    color: #000;
}

.ex-title-en {
    font-style: italic;
}

#page-text {
    line-height: 1.6;
    word-break: normal;
    overflow-wrap: break-word;
}


.list-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 150px 20px 50px 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.year-group {
    margin-bottom: 80px;
}

.year-title {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-bottom: 20px;
    padding-left: 2px;
}

.text-item {
    border-top: 1px solid #eee;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.text-item:last-child {
    border-bottom: 1px solid #eee;
}

.meta-row {
    font-family: monospace;
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}

.category {
    color: #666;
    transition: color 0.3s;
}

.date {
    margin-left: 15px;
    color: #999;
    transition: color 0.3s;
}

.item-title {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}

.hidden-content {
    display: none;
}

.text-item.hovered-bg .item-title { color: #fff; }
.text-item.hovered-bg .meta-row { color: rgba(255,255,255,0.9); }
.text-item.hovered-bg .category { color: #fff; }
.text-item.hovered-bg .date { color: rgba(255,255,255,0.8); }

.text-item.hovered-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

#detail-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 2000;
    padding-top: var(--header-height);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#page-text .detail-wrapper {
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px 100px 20px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#page-text .detail-wrapper::-webkit-scrollbar {
    display: none;
}

.back-btn {
    display: block;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 20;
    padding: 30px 0 20px 0;
    width: 100%;
    font-family: monospace;
    cursor: pointer;
    color: #888;
    border-bottom: 1px solid #eee;
    margin-bottom: 40px;
}

.back-btn:hover {
    color: #000;
}

.detail-header {
    margin-bottom: 40px;
}

.detail-meta {
    font-family: monospace;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.3;
    color: #000;
}

.detail-body {
    font-size: 14px;
    text-align: left;
    line-height: 1.8;
    color: #333;
    margin-bottom: 100px;
}

.detail-body p {
    margin-bottom: 20px;
}

.detail-body img {
    max-width: 60%;
    width: auto;
    height: auto;
    display: block;
    margin: 40px auto;
    box-shadow: none;
}

.post-nav {
    border-top: 1px solid #000;
    padding-top: 25px;
    margin-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-link {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: #888;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #000;
}

.nav-link.disabled {
    display: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex-grow: 1;
}

.nav-arrow {
    font-size: 10px;
    color: #888;
}

.nav-link:hover .nav-arrow {
    color: #000;
}

.nav-post-title {
    font-size: 14px;
    font-family: var(--font-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-date {
    font-family: monospace;
    font-size: 12px;
    color: #bbb;
    margin-left: 15px;
    flex-shrink: 0;
}

.nav-link:hover .nav-date {
    color: #888;
}

.intro-area {
    margin-top: var(--header-height);
    padding: 20px;
    height: 100px;
}

.grid-container {
    display: flex;
    flex-wrap: wrap;
    padding: 0 40px 100px 40px;
    align-items: flex-end;
    gap: 40px 30px;
    justify-content: flex-start;
}

.item {
    position: relative;
    cursor: pointer;
    width: auto;
    margin-bottom: 10px;
}

.img-box {
    display: block;
}

.img-box img {
    display: block;
    width: auto;
    height: var(--h-px);
    transition: opacity 0.4s ease;
    opacity: 1;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.08);
}

.h-162 { --h-px: 360px; }
.h-145 { --h-px: 330px; }
.h-130 { --h-px: 300px; }
.h-100 { --h-px: 240px; }
.h-60  { --h-px: 180px; }
.h-45  { --h-px: 150px; }
.h-40  { --h-px: 140px; }
.h-37  { --h-px: 130px; }
.h-33  { --h-px: 120px; }
.h-25  { --h-px: 100px; }
.h-22  { --h-px: 90px; }
.h-20  { --h-px: 85px; }

.item .caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    font-family: monospace;
    font-size: 11px;
    color: #000;
    font-weight: 500;
    line-height: 1.6;
    background: none;
    text-shadow: 0 0 8px rgba(255,255,255,0.9);
}

.caption .row { display: block; margin-bottom: 2px; }
.caption .src { color: #000; font-style: italic; }
.item .caption .size { display: none; }

@media (hover: hover) and (pointer: fine) {
    .item:hover .img-box img { opacity: 0.7; }
    /* .item:hover .caption { opacity: 1; } */
}

#top-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    background: #fff;
    color: var(--text-color);
    font-size: 13px;
    font-family: var(--font-main);
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.2s;
}

#top-btn:hover {
    background: #f5f5f5;
}

#top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}
/* =========================================
   Works Lightbox Animation
   ========================================= */
#lightbox {
    display: none; /* 평소에는 아예 안 보임 (공간 차지 X) */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    /* [핵심] 애니메이션 설정 */
    opacity: 0; 
    transition: opacity 0.3s ease-in-out; /* 0.3초 동안 부드럽게 변함 */
}

/* 자바스크립트가 이 클래스를 붙여주면 서서히 나타남 */
#lightbox.show {
    opacity: 1;
}

#lightbox-img {
    max-width: 90%;
    max-height: 75vh;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    cursor: pointer;
    color: #333;
    z-index: 2001;
}

#lightbox-img {
    max-width: 90%;
    max-height: 75vh;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

#lightbox-caption {
    text-align: center;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

#lightbox-caption .row { display: block; margin-bottom: 3px; }
#lightbox-caption .row:nth-child(1) { font-weight: bold; color: #000; font-size: 14px; }
#lightbox-caption .row:nth-child(2) { font-style: italic; color: #999; }
#lightbox-caption .row.size { display: block; color: #999; font-style: normal; }
#lightbox-caption .row:nth-child(4) { color: #999; }
#lightbox-caption .row:nth-child(5) { color: #000; margin-top: 5px; }

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #ddd;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: color 0.3s;
}

.arrow:hover { color: #333; }
.prev { left: 20px; }
.next { right: 20px; }

#page-archive {
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.archive-container {
    max-width: 100%;
    margin: 0;
    padding: 150px 50% 120px 40px;
    position: relative;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px 30px;
}

@media (max-width: 1300px) and (min-width: 801px) {
    .archive-grid { grid-template-columns: 1fr; }
}

.archive-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.poster-wrapper {
    width: 100%;
    height: auto;
    background-color: transparent;
    margin-bottom: 15px;
    overflow: hidden;
}

.poster-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.archive-item .item-title {
    font-size: 14px;
    font-weight: normal;
    color: #000;
    margin-bottom: 6px;
    line-height: 1.3;
    transition: font-weight 0.1s;
}

.archive-item:hover .item-title {
    font-weight: bold;
}

.item-info {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    line-height: 1.4;
}

.fixed-image-viewer {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 50%;
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 5;
    padding: 40px;
}

.fixed-image-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fixed-image-viewer img.visible { opacity: 1; }

#page-archive .detail-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    height: 100%;
    padding: 0 40px;
}

.detail-left {
    width: 35%;
    padding: 0 60px 120px 0;
    height: 100%;
    overflow-y: auto;
    position: relative;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.detail-left::-webkit-scrollbar { display: none; }

.detail-info {
    font-family: monospace;
    color: #666;
    margin-bottom: 40px;
}

.detail-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    text-align: left;
    padding-bottom: 100px;
}

.detail-text p {
    margin-bottom: 20px;
    margin-top: 0;
}

.detail-credits {
    display: block;
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 12px;
    font-family: var(--font-main);
    line-height: 1.5;
    text-align: left;
    white-space: normal;
}

.detail-credits p { margin: 0; padding: 0; }
.detail-credits .spacer { height: 15px; }

.detail-right {
    width: 65%;
    padding: 40px 0 100px 0;
    overflow-y: auto;
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.detail-right::-webkit-scrollbar { display: none; }

.detail-image-list img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.mobile-slider-container {
    display: none;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
}

.mobile-slider-track {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease-out;
}

.mobile-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-slide img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 24px;
    color: #333;
    user-select: none;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
}

.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

.slider-dots {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s;
}

.dot.active { background: #333; }

@media (max-width: 1200px) {
    .h-162 { --h-px: 290px; }
    .h-145 { --h-px: 260px; }
    .h-130 { --h-px: 240px; }
    .h-100 { --h-px: 200px; }
    .h-60  { --h-px: 150px; }
    .h-45  { --h-px: 120px; }
    .h-40  { --h-px: 110px; }
    .h-37  { --h-px: 100px; }
    .h-33  { --h-px: 90px; }
    .h-25  { --h-px: 80px; }
    .h-22  { --h-px: 70px; }
}

@media (max-width: 800px) {
    .archive-container { padding: 120px 20px 80px 20px; }
    .archive-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .fixed-image-viewer { display: none !important; }
    #page-archive .detail-container { flex-direction: column; padding: 0 20px; }
    .detail-right { display: none; }
    .detail-left { width: 100%; padding: 0 0 80px 0; }
    #page-archive .back-btn { position: sticky; top: 0; padding: 15px 0 10px 0; margin-bottom: 10px; border-bottom: 1px solid #eee; order: 1; }
    #detail-title-area { order: 2; margin-bottom: 20px; }
    .mobile-slider-container { display: block; order: 3; }
    .slider-dots { display: flex; order: 4; }
    #detail-text-area { order: 5; margin-top: 10px;}
}

@media (max-width: 600px) {
    header { justify-content: space-between; align-items: center; padding: 15px 20px; }
    .title-box, #mobile-menu-btn { display: block; font-size: 11px; padding: 6px 10px; height: auto; line-height: 1.3; margin: 0; box-sizing: border-box; }
    #mobile-menu-btn { display: block; }
    .top-nav { display: none; position: fixed; top: 60px; right: 20px; flex-direction: column; align-items: flex-end; gap: 5px; z-index: 9998; background-color: transparent; border: none; left: auto; width: auto; }
    .top-nav.active { display: flex; }
    .nav-btn { display: block; width: auto; min-width: 80px; text-align: center; margin: 0; font-size: 11px; border: 1px solid var(--border-color); background: #fff; padding: 6px 10px; font-family: monospace; color: #333; }
    .nav-btn.active { background: #333; color: #fff; border-color: #333; text-decoration: none; font-weight: normal; }
    footer { bottom: 20px; letter-spacing: 0; }
    
    .contact-wrapper { height: 80vh; }
    
    #page-cv header { flex-direction: row; padding: 15px 20px; gap: 0; }
    .cv-container { padding-top: 120px; }

    .item { width: 100%; margin-bottom: 40px; }
    .img-box img { width: 100%; height: auto; --h-px: auto; }
    .grid-container { padding: 0 20px 100px 20px; gap: 40px; }
    .arrow { font-size: 30px; padding: 10px; color: #888; }
    #top-btn { bottom: 20px; right: 20px; }

    .list-container { padding-top: 120px; padding-left: 20px; padding-right: 20px;}
    .year-title { font-size: 20px; }
    .item-title { font-size: 16px; }
    .text-item { padding: 25px 15px; }
    .detail-body img { max-width: 100%; max-height: 100vw; width: auto; margin: 30px auto; object-fit: contain; }

    #page-index .bg-layer { animation-duration: 20s; transition-duration: 4s; }
}



/* =========================================
   Custom Cursor (모바일 완벽 차단 버전)
   ========================================= */

/* 1. PC: 시스템 커서 숨기고 커서 스타일 적용 */
@media (hover: hover) and (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }

    #custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 15px;
        height: 15px;
        background-color: #fff;
        border-radius: 50%;
        pointer-events: none;
        z-index: 10000;
        mix-blend-mode: difference;
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease, transform 0.05s linear;
        display: block; /* PC에서는 보임 */
    }

    #custom-cursor.hovered {
        width: 50px;
        height: 50px;
        mix-blend-mode: difference;
    }
}

/* 2. 모바일/태블릿: 커서 기능 아예 끄기 (안드로이드 포함) */
@media (hover: none), (pointer: coarse), (max-width: 512px) {
    #custom-cursor {
        display: none !important; /* 강제로 숨김 */
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    *, *::before, *::after {
        cursor: auto !important; /* 시스템 기본 터치 커서 사용 */
    }
}

/* 드래그금지 */
#page-text, 
#page-archive {
    -webkit-user-select: none; /* 크롬, 사파리 */
    -moz-user-select: none;    /* 파이어폭스 */
    -ms-user-select: none;     /* 인터넷익스플로러/엣지 */
    user-select: none;         /* 표준 브라우저 */
}

