/* [1. 전역 스타일 및 기본 설정] */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #ffffff;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 20px;
    /* [유닛 시스템] 기본 행간 20px 고정 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

p,
div,
span {
    word-break: keep-all;
    overflow-wrap: break-word;
}

canvas {
    display: block;
    opacity: 0;
    transition: opacity 3.0s ease-in-out, color 0.4s ease;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    z-index: 1;
}

canvas.modal-active {
    pointer-events: none;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-family: 'nanumgothiccoding', monospace;
    font-size: 0.85rem;
}

/* [2. 타이포그래피 및 통합 인터페이스] */
.link-style,
a,
.top-email,
.top-instagram,
.modal-close {
    text-decoration: underline !important;
    text-underline-position: from-font !important;
    text-decoration-skip-ink: auto !important;
    -webkit-text-decoration-skip-ink: auto !important;
    cursor: pointer;
}

.link-style,
a,
.top-email,
.modal-close,
.selected,
.active-planet {
    color: #0000ff !important;
}

/* [유닛 시스템] 좌상단 수직 정렬 */
.top-interface {
    position: absolute;
    top: 40px;
    /* 2 units */
    left: 60px;
    /* 3 units */
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    /* [유닛 시스템] 한 행 높이와 일치 */
}

.top-email,
.top-instagram {
    background: none;
    border: none;
    padding: 0;
    font-family: 'nanumgothiccoding', monospace;
    font-size: 0.85rem;
    text-transform: lowercase;
    transition: color 0.4s ease;
    text-align: left;
}

.modal-footer {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 120px;
    /* 6 units */
    padding-bottom: 120px;
    /* 6 units */
    font-size: 0.8rem;
    color: #000000 !important;
    text-decoration: none !important;
    pointer-events: none;
    text-align: left;
}

.blue {
    color: #0000ff !important;
    font-weight: normal;
}

.column-list {
    white-space: pre-line;
}

/* [3. 사이드바 설정] */
.sidebar {
    position: fixed;
    left: 60px;
    /* 3 units */
    top: 120px;
    /* 6 units */
    width: 320px;
    z-index: 10;
    font-family: 'nanumgothiccoding', monospace;
    font-size: 0.85rem;
    color: #000000;
    text-transform: lowercase;
    pointer-events: none;
}

.sidebar-content {
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 2s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sidebar p {
    margin: 0;
    line-height: 20px;
    /* [유닛 시스템] 행간 동기화 */
    pointer-events: none;
}

.sidebar p:empty::before {
    content: '\00a0';
}

.link-style,
a {
    pointer-events: auto !important;
}

.intro {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 1.2s ease, opacity 0.4s ease;
}

.intro.active {
    max-height: 400px;
    opacity: 1;
}

/* [4. 모달 시스템 및 유동적 그리드] */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
    font-family: 'nanumgothiccoding', monospace;
    overflow: hidden;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.modal-scroll-area {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-close {
    position: absolute;
    top: 40px;
    /* 2 units */
    right: 40px;
    background: none;
    border: none;
    font-family: 'nanumgothiccoding', monospace;
    font-size: 0.85rem;
    z-index: 1101;
    padding: 0;
    text-transform: lowercase;
}

.modal-content {
    display: grid;
    gap: 60px;
    /* 3 units */
    width: 100%;
    padding: 120px 60px 0 60px;
    /* [유닛 시스템] 6u-3u-0-3u */
    box-sizing: border-box;
    text-align: left;
    align-items: start;
    justify-items: start;
    font-size: 0.85rem;
    line-height: 20px;
    /* [유닛 시스템] */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

.profile-layout {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 1400px !important;
}

.column-intro {
    font-size: 0.85rem;
    line-height: 20px;
    /* [유닛 시스템] */
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-align: left;
    text-wrap: pretty;
}

/* [5. 작업물 배치 및 반응형 설정] */
.work-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* [유닛 시스템] 이미지-캡션 간격 1u */
    width: 100%;
    align-items: flex-start;
}

.work-item.w2 {
    grid-column: span 2;
}

.work-item.w3 {
    grid-column: span 3;
}

.work-item.w4 {
    grid-column: span 4;
}

.work-item.w6 {
    grid-column: 1 / -1;
}

.grid-breaker {
    grid-column: 1 / -1;
    height: 0;
    margin: 0;
    padding: 0;
}

.work-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80vh;
    object-fit: contain;
    object-position: left;
}

.work-caption {
    margin: 0;
    line-height: 20px;
    /* [유닛 시스템] */
    color: #000000;
    font-size: 0.8rem;
    text-align: left;
}

.video-content,
.web-content,
.construct-content,
.show-content {
    display: flex;
    flex-direction: column;
    gap: 120px;
    /* [유닛 시스템] 섹션 간격 6u */
    width: 100%;
    max-width: 1400px;
    padding: 120px 60px 0 60px;
    box-sizing: border-box;
}

.video-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* [유닛 시스템] 1u */
    width: 100%;
    max-width: 800px;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.video-wrapper iframe,
.video-wrapper img {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    object-fit: cover;
}

/* [6. 모바일 설정] */
@media (max-width: 900px) {
    .modal-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px;
    }

    .profile-layout {
        grid-template-columns: 1fr !important;
    }

    .work-item.w2,
    .work-item.w3,
    .work-item.w4,
    .work-item.w6 {
        grid-column: span 1 !important;
    }
}

@media (max-width: 600px) {
    .sidebar {
        left: 20px;
        top: 120px;
        width: 85%;
    }

    .modal-content,
    .video-content,
    .web-content,
    .construct-content,
    .show-content {
        padding: 120px 20px 0 20px;
    }

    .modal-footer {
        padding-bottom: 80px;
    }

    .top-interface {
        top: 20px;
        left: 20px;
    }

    .modal-close {
        top: 20px;
        right: 20px;
    }
}