:root {
    --bg-main: #FCFBF7;
    --bg-surface: #FFFFFF;
    --bg-subtle: #F3EDE2;
    --text-main: #2B2620;
    --text-sub: #5C5449;
    --text-muted: #A39B8F;
    --accent-brown: #D4A373;
    --border-light: rgba(43, 38, 32, 0.08);
    --font-serif-en: 'Cormorant Garamond', serif;
    --font-serif-kr: 'Noto Serif KR', serif;
    --font-sans: 'Pretendard', -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   1. 상단 네비게이션 & BGM 컨트롤러
========================================= */
.sample-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(252, 251, 247, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 20px;
}

.sample-nav-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-back {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--accent-brown);
}

.bgm-controller {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid rgba(212, 163, 115, 0.35);
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(43, 38, 32, 0.04);
}

.bgm-icon {
    font-size: 12px;
}

.bgm-select {
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    padding-right: 12px;
}

.btn-bgm-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-brown);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================
   2. 레이아웃 & 인트로 프로필
========================================= */
.sample-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.memorial-intro {
    text-align: center;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-light);
}

.intro-badge {
    display: inline-block;
    font-family: var(--font-serif-en);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent-brown);
    border: 1px solid rgba(212, 163, 115, 0.35);
    background: #FFFFFF;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.intro-avatar-frame {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    padding: 4px;
    border: 1px solid rgba(212, 163, 115, 0.35);
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(43, 38, 32, 0.06);
}

.intro-avatar-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.intro-name {
    font-family: var(--font-serif-kr);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.intro-dates {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.intro-dates strong {
    color: var(--accent-brown);
    font-weight: 600;
}

/* =========================================
   3. 상호작용 인터랙션 (버튼 & 플로팅 파티클)
========================================= */
.interactive-row {
    position: relative;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 24px;
}

.btn-interact {
    position: relative;
    overflow: visible;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    padding: 9px 18px;
    border-radius: 24px;
    border: 1px solid rgba(43, 38, 32, 0.1);
    background: #FFFFFF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-interact:hover {
    border-color: var(--accent-brown);
    transform: translateY(-2px);
}

.btn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-brown);
}

.btn-interact .cnt {
    margin-left: 4px;
    font-weight: 600;
}

.cnt.count-bump {
    animation: countBump 0.22s ease-out;
}

@keyframes countBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
        color: var(--accent-brown);
    }

    100% {
        transform: scale(1);
    }
}

.interactive-floating-particle {
    position: absolute;
    bottom: 100%;
    left: 50%;
    font-size: 19px;
    pointer-events: none;
    user-select: none;
    z-index: 20;
    opacity: 0;
    animation: floatUpComfortable 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes floatUpComfortable {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.6) rotate(0deg);
    }

    20% {
        opacity: 1;
        transform: translateY(-8px) scale(1.1) rotate(-6deg);
    }

    70% {
        opacity: 0.9;
        transform: translateY(-26px) scale(1) rotate(6deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-38px) scale(0.8) rotate(0deg);
    }
}

.interact-welcome-bubble {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(43, 38, 32, 0.94);
    color: #FFFFFF;
    padding: 10px 14px 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.3px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(43, 38, 32, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.interact-welcome-bubble.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.btn-bubble-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-bubble-close:hover {
    color: #FFFFFF;
}

.intro-quote {
    font-family: var(--font-serif-kr);
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text-sub);
    background: #FFFFFF;
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid rgba(43, 38, 32, 0.06);
    letter-spacing: -0.3px;
    word-break: keep-all;
}

/* =========================================
   4. 공통 서브 섹션 타이틀
========================================= */
.sub-section {
    padding: 48px 0 20px;
    border-bottom: 1px solid var(--border-light);
}

.sub-header {
    margin-bottom: 24px;
    text-align: center;
}

.sub-tag {
    font-family: var(--font-serif-en);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent-brown);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.sub-title {
    font-family: var(--font-serif-kr);
    font-size: 20px;
    font-weight: 600;
}

/* =========================================
   5. 발자취 타임라인
========================================= */
.timeline-list {
    position: relative;
    padding-left: 20px;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(212, 163, 115, 0.3);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-brown);
}

.timeline-date {
    font-family: var(--font-serif-en);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-brown);
    display: block;
    margin-bottom: 2px;
}

.timeline-text {
    font-size: 14px;
    color: var(--text-sub);
}

/* =========================================
   6. 갤러리 섹션
========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(43, 38, 32, 0.08);
    background: #EFE9E0;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-item.approved-memory {
    position: relative;
}

.gallery-item.approved-memory::after {
    content: '추억 조각';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(43, 38, 32, 0.65);
    color: #FFFFFF;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

/* =========================================
   7. 비디오 섹션
========================================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.video-card {
    background: #FFFFFF;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(43, 38, 32, 0.08);
    box-shadow: 0 4px 14px rgba(43, 38, 32, 0.03);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(43, 38, 32, 0.08);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #1A1816;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-play-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.play-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-main);
    padding-left: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.video-card:hover .play-icon {
    transform: scale(1.1);
}

.video-card.playing .video-play-overlay {
    opacity: 0;
}

.video-card.playing:hover .video-play-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.15);
}

.video-info {
    padding: 14px 16px;
}

.video-date {
    font-family: var(--font-serif-en);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-brown);
    display: block;
    margin-bottom: 3px;
}

.video-desc {
    font-size: 12.5px;
    color: var(--text-sub);
    line-height: 1.5;
    word-break: keep-all;
}

/* =========================================
   8. 미디어 아카이브 배너
========================================= */
.gallery-archive-cta {
    margin-top: 48px;
    background: #FCFAF8;
    border: 1px dashed rgba(212, 163, 115, 0.45);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

.archive-cta-content {
    flex: 1;
    text-align: left;
}

.archive-cta-tag {
    font-family: var(--font-serif-en, serif);
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--accent-brown, #B89065);
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.archive-cta-title {
    font-family: var(--font-serif-kr, serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main, #2B2620);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.archive-cta-desc {
    font-size: 13px;
    color: var(--text-sub, #7A7269);
    line-height: 1.5;
    word-break: keep-all;
    margin: 0;
}

.btn-archive-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--text-main, #2B2620);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-archive-cta:hover {
    background: var(--accent-brown, #B89065);
}

.cta-btn-icon {
    width: 16px;
    height: 16px;
}

/* =========================================
   9. 이미지 & 비디오 팝업 모달
========================================= */
.image-modal,
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(18, 16, 14, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.image-modal.active,
.video-modal.active {
    display: flex;
    opacity: 1;
}

.btn-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: var(--accent-brown);
    border-color: var(--accent-brown);
    transform: rotate(90deg);
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.image-box {
    max-width: 800px;
    max-height: 75vh;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(212, 163, 115, 0.25);
    background: #111;
}

.image-box img {
    width: 100%;
    height: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.modal-image-caption {
    margin-top: 14px;
    font-size: 13.5px;
    color: #E6E1D8;
    text-align: center;
    letter-spacing: -0.2px;
    font-family: var(--font-serif-kr);
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: #1F1C19;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 163, 115, 0.2);
    animation: modalPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-player-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.modal-player-box video {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

.modal-video-meta {
    padding: 16px 20px;
    background: #1F1C19;
}

.modal-date {
    font-family: var(--font-serif-en);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-brown);
    display: block;
    margin-bottom: 4px;
}

.modal-desc {
    font-size: 13.5px;
    color: #E2DDD5;
    line-height: 1.5;
    word-break: keep-all;
}

@keyframes modalPopUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

/* =========================================
   10. 무지개 우체통 섹션
========================================= */
.letter-form {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(43, 38, 32, 0.08);
    margin-bottom: 24px;
}

.letter-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.letter-input {
    flex: 1;
    padding: 10px 12px;
    background: #FCFAF7;
    border: 1px solid rgba(43, 38, 32, 0.12);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.letter-textarea {
    width: 100%;
    padding: 10px 12px;
    background: #FCFAF7;
    border: 1px solid rgba(43, 38, 32, 0.12);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    resize: none;
    height: 70px;
    margin-bottom: 10px;
}

.btn-letter-submit {
    background: var(--text-main);
    color: #FFFFFF;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.btn-letter-submit:hover {
    background: var(--accent-brown);
}

.letter-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 6px;
    -webkit-overflow-scrolling: touch;
}

.letter-list::-webkit-scrollbar {
    width: 5px;
}

.letter-list::-webkit-scrollbar-track {
    background: rgba(43, 38, 32, 0.04);
    border-radius: 4px;
}

.letter-list::-webkit-scrollbar-thumb {
    background: rgba(212, 163, 115, 0.4);
    border-radius: 4px;
}

.letter-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-brown);
}

.letter-card {
    background: #FFFFFF;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(43, 38, 32, 0.06);
}

.letter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
}

.letter-author {
    font-weight: 600;
    color: var(--accent-brown);
}

.letter-date {
    color: var(--text-muted);
}

.letter-content {
    font-family: var(--font-serif-kr);
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.letter-card.new-arrival {
    animation: letterSlideDown 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letterSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        background-color: rgba(212, 163, 115, 0.12);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        background-color: #ffffff;
    }
}

/* =========================================
   11. 하단 배너, 공유 및 플로팅 관리자
========================================= */
.sample-cta-banner {
    margin-top: 48px;
    background: #FFFFFF;
    border: 1px solid rgba(212, 163, 115, 0.4);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(43, 38, 32, 0.04);
}

.sample-cta-banner h4 {
    font-family: var(--font-serif-kr);
    font-size: 18px;
    margin-bottom: 6px;
}

.sample-cta-banner p {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.btn-banner {
    display: inline-block;
    background: var(--text-main);
    color: #FFFFFF;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-banner:hover {
    background: var(--accent-brown);
}

.share-container {
    display: flex;
    justify-content: center;
    margin: 32px 0 20px;
}

.btn-share-link {
    background: transparent;
    border: 1px solid var(--accent-brown);
    color: var(--accent-brown);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share-link:hover {
    background: var(--accent-brown);
    color: #fff;
}

.toast-popup {
    visibility: hidden;
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(43, 38, 32, 0.88);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
}

.toast-popup.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.btn-admin-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-main);
    color: #FFFFFF;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(212, 163, 115, 0.3);
    z-index: 1000;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-admin-floating:hover {
    background: var(--accent-brown);
    transform: translateY(-2px);
}

/* =========================================
   12. 반응형 미디어 쿼리
========================================= */
@media (max-width: 640px) {
    .sample-nav {
        padding: 12px 16px;
    }

    .bgm-select {
        max-width: 140px;
    }

    .sample-container {
        padding: 28px 16px 60px;
    }

    .gallery-grid {
        gap: 8px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .gallery-archive-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 18px;
        margin-top: 36px;
    }

    .btn-archive-cta {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .interact-welcome-bubble {
        font-size: 11.5px;
        padding: 9px 12px 9px 14px;
        white-space: normal;
        width: 90%;
        text-align: left;
    }
}