@import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@400;700;800&family=Noto+Serif+KR:wght@300;400;600;700&display=swap');

@font-face {
    font-family: 'GabiaMaeumgyeol';
    src: url('../Font/GabiaMaeumgyeol.otf') format('opentype'),
         url('../Font/GabiaMaeumgyeol.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --main-dark: #8E8680;
    --main-light-blue: #A0D8EF;
    --main-white: #FFFFFF;
    --main-bg: #F7F9FA;
    --magenta: #FF007F;
    --border-width: 1.5px; /* 워크숍 버튼 굵기 기준 1.4배 굵어진 1.5px 통일 테두리 변수 */
    --font-serif: 'GabiaMaeumgyeol', 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--main-bg);
    color: var(--main-dark);
    font-family: var(--font-serif);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 메인 컬러(#8E8680 / var(--main-dark)) 테두리의 서정적 종이새 커스텀 마우스 커서 */
html, body, a, button, input, textarea, select, label, [role="button"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 100 100' fill='none'%3E%3Cpolygon points='54.5,44.5 50,88 43.3,75' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='50,12 80,8 55,45' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='50,12 82,15 55,45' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='25,45 50,12 55,45' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='25,45 55,45 47,65' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='23,27 25,45 38,28' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='23,27 14,33 23.7,33' fill='%23ffffff' stroke='%238E8680' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 4 9, pointer !important;
}

/* 2D 외곽선 컴포넌트 기본 스타일 */
.outline-box {
    border: var(--border-width) solid var(--main-dark);
    background-color: var(--main-white);
    padding: 15px;
    border-radius: 4px;
    transition: transform 0.15s ease;
}

.outline-box:hover {
    transform: translate(-1px, -1px);
}

.outline-btn {
    border: var(--border-width) solid var(--main-dark);
    background-color: var(--main-white);
    color: var(--main-dark);
    font-family: var(--font-serif);
    font-size: 1rem;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.outline-btn:hover {
    background-color: var(--main-light-blue);
    transform: translate(-1px, -1px);
}

.outline-btn:active {
    transform: translate(1px, 1px);
}

#waterCanvas {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    background: transparent;
}

/* 레이어 팝업 (Modal) 기본 구조 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    width: 90%;
    max-width: 500px;
    position: relative;
    padding: 30px;
    animation: modal-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
    from {
        transform: scale(0.9) translateY(10px);
    }

    to {
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--main-dark);
}

/* 영어 번역 롤오버 스타일 */
.archive-link {
    display: inline;
    text-decoration: underline;
    text-underline-offset: 6px;
    font-weight: bold;
    color: var(--main-dark);
    transition: color 0.15s ease;
    letter-spacing: 0;
    margin-right: 0;
}

.archive-link::before {
    content: attr(data-kor);
}

.archive-link:hover {
    text-decoration: none;
    /* 호버 번역어 노출 시 밑줄 제거 */
}

.archive-link:hover::before {
    content: attr(data-eng);
    color: var(--main-light-blue);
}

/* 뒤로가기 공통 버튼 */
.back-home-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 500;
    text-decoration: none;
    font-weight: bold;
}

/* 종이배 홈 버튼 스타일 */
.boat-home-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.boat-home-link .boat-element {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.boat-home-link svg {
    transition: filter 0.3s ease, transform 0.3s ease;
    /* 기본 그림자 효과 제거 */
}

.boat-home-text {
    position: absolute;
    bottom: 15px;
    /* 종이배 전면 몸통(중앙 아래)에 얹히도록 정렬 */
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--main-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.15s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.boat-home-text::before {
    content: attr(data-kor);
}

.boat-home-link:hover .boat-home-text {
    text-decoration: none; /* 호버 시 한글 밑줄 제거 */
}

.boat-home-link:hover .boat-home-text::before {
    content: attr(data-eng);
    color: var(--main-light-blue);
}

/* 호버 및 클릭(active) 시 텍스트 색상 변경 및 물결 흔들림 모션 */
.boat-home-link:hover svg,
.boat-home-link:active svg {
    filter: none;
}

.boat-home-link:hover .boat-element {
    animation: boat-float-tilt 2.5s ease-in-out infinite;
}

.boat-home-link:hover .boat-home-text,
.boat-home-link:active .boat-home-text {
    color: #76c0e6;
    /* 기존 하늘색 유지 */
}



/* 물 위에 찰랑찰랑 떠서 움직이는 듯한 float & tilt 애니메이션 */
@keyframes boat-float-tilt {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-3px) rotate(2deg);
    }

    50% {
        transform: translateY(-1px) rotate(-1deg);
    }

    75% {
        transform: translateY(-4px) rotate(1deg);
    }
}

/* 768px 이하 모바일 디바이스 반응형 미디어 쿼리 */
@media (max-width: 768px) {
    .modal-content,
    .modal-overlay .outline-box,
    #info-panel {
        max-width: 92% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 20px 16px !important;
    }

    .outline-btn {
        min-height: 44px;
        padding: 10px 18px;
    }

    .boat-home-link {
        position: fixed !important;
        top: auto !important;
        bottom: 25px !important;
        left: 25px !important;
        right: auto !important;
        transform: none !important;
        z-index: 100 !important;
    }
}