/* 🌟 전역 변수 (기본 다크모드) */
:root {
    --point-color: #F8BBD0; 
    --point-dark: #d81b60;
    
    --text-main: #f0f0f0;
    --text-muted: #888888;
    
    /* 세련된 검정/다크그레이 모노크롬 색상 */
    --bg-intro: #111111;
    --bg-about: #1a1a1a;
    --bg-skills: #222222;
    --bg-cert: #1a1a1a;
    --bg-projects: #111111;
    --bg-contact: #050505;
    
    --panel-bg: #1e1e1e;
    --tape-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);

    --cursor-bg: #f0f0f0;
    --cursor-active-bg: rgba(255, 255, 255, 0.3);
    --cursor-active-border: #ffffff;
    --cursor-blend: normal;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Pretendard', sans-serif; cursor: none; }
body { color: var(--text-main); overflow-x: hidden; line-height: 1.6; background-color: var(--bg-intro); transition: background-color 0.5s ease; }

.bg-intro { background-color: var(--bg-intro); transition: background-color 0.5s ease; }
.bg-about { background-color: var(--bg-about); transition: background-color 0.5s ease; }
.bg-skills { background-color: var(--bg-skills); transition: background-color 0.5s ease; }
.bg-cert { background-color: var(--bg-cert); transition: background-color 0.5s ease; }
.bg-projects { background-color: var(--bg-projects); transition: background-color 0.5s ease; }
.bg-contact { background-color: var(--bg-contact); transition: background-color 0.5s ease; }
.bg-contact .section-title { color: #fff; }

.nav-hint {
    position: fixed; right: 0; top: 50%;
    background: var(--panel-bg); color: var(--point-dark);
    border: 1px solid var(--point-color); border-right: none;
    border-radius: 10px 0 0 10px; padding: 15px 5px; z-index: 940;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: hintBounce 1.5s ease-in-out infinite; box-shadow: -2px 2px 5px rgba(0,0,0,0.05);
}
.nav-hint.hidden { right: -50px; animation: none; }
@keyframes hintBounce {
    0% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-8px); }
    100% { transform: translateY(-50%) translateX(0); }
}

.memo-panel {
    position: relative; background: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: 0px !important; padding: 40px; box-shadow: 3px 5px 15px rgba(0, 0, 0, 0.08); 
    transition: background-color 0.5s ease, border-color 0.5s ease;
}
.memo-panel::before {
    content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg);
    width: 80px; height: 25px; background: var(--tape-bg); backdrop-filter: blur(4px);
    border: 1px solid var(--border-color); box-shadow: 0 1px 3px rgba(0,0,0,0.05); z-index: 10;
}

.memo-reveal {
    opacity: 0; transform-origin: top center;
    transform: perspective(800px) rotateX(40deg) translateY(-30px) scale(1.05);
    transition: all 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.memo-reveal.is-visible {
    opacity: 1; transform: perspective(800px) rotateX(0deg) translateY(0px) scale(1) rotateZ(-0.5deg);
}
.delay-1 { transition-delay: 0.15s; }

.wave-container { position: absolute; bottom: 0; left: 0; width: 100%; overflow: hidden; line-height: 0; z-index: 5; pointer-events: none; }
.waves { position: relative; width: 100%; height: 8vh; min-height: 60px; max-height: 120px; margin-bottom: -7px; transition: fill 0.5s ease; }
.parallax > use { animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; transition: fill 0.5s ease; }
.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }
@keyframes move-forever { 0% { transform: translate3d(-90px,0,0); } 100% { transform: translate3d(85px,0,0); } }

/* 커스텀 커서 */
.cursor { position: fixed; top: 0; left: 0; width: 20px; height: 20px; background: var(--cursor-bg); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: width 0.2s, height 0.2s, background-color 0.2s; mix-blend-mode: var(--cursor-blend); }
.cursor.active { width: 40px; height: 40px; background: var(--cursor-active-bg); border: 2px solid var(--cursor-active-border); }

/* Intro 레이아웃 */
.intro-layout { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.intro-text { flex: 1.2; }
.intro-image { flex: 0.8; display: flex; justify-content: flex-end; }
.character-img { 
    width: 100%; max-width: 380px; aspect-ratio: 1; object-fit: contain; 
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
}

/* 🌟 플로팅 아바타 */
#floating-avatar-container {
    position: fixed; z-index: 2000; pointer-events: none;
    transition: top 0.7s cubic-bezier(0.25, 1, 0.5, 1), left 0.7s cubic-bezier(0.25, 1, 0.5, 1), width 0.7s cubic-bezier(0.25, 1, 0.5, 1), height 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    filter: drop-shadow(5px 5px 0px rgba(0,0,0,0.5));
}
#floating-avatar {
    width: 100%; height: 100%; object-fit: contain; 
    transition: transform 0.2s;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
}

.wiggle-anim { animation: avatarWiggle 0.4s infinite; }
@keyframes avatarWiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
    100% { transform: rotate(0deg); }
}

/* 🌟 말풍선 (띄어쓰기 붕괴 버그 해결: white-space 적용) */
#guide-bubble {
    position: absolute; left: 110%; top: 20%;
    background: var(--panel-bg); border: 1px solid var(--point-dark); padding: 15px 20px;
    min-width: 220px; max-width: 300px;
    color: var(--text-main); font-weight: 700; font-size: 1.05rem; box-shadow: 3px 5px 15px rgba(0,0,0,0.08);
    opacity: 0; transform: translateX(-10px); transition: opacity 0.4s, transform 0.4s, background-color 0.5s; pointer-events: auto;
}
#guide-bubble span {
    white-space: pre-wrap; /* 띄어쓰기 및 줄바꿈을 완벽히 인식합니다 */
    line-height: 1.4;
}
#guide-bubble::before {
    content: ''; position: absolute; top: -10px; left: 15px; width: 35px; height: 12px; background: var(--tape-bg); border: 1px solid var(--border-color); transform: rotate(-4deg); z-index: 10; backdrop-filter: blur(2px);
}
#guide-bubble.visible { opacity: 1; transform: translateX(0); }
#guide-bubble.hidden { display: none; }

/* 모달창 */
.skill-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.skill-modal.visible { opacity: 1; pointer-events: auto; }
.skill-modal.hidden { display: none; }
.modal-content { max-width: 500px; width: 90%; text-align: center; transform: scale(0.8); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.skill-modal.visible .modal-content { transform: scale(1) rotate(-1deg); } 
.close-btn { position: absolute; top: 15px; right: 25px; background: transparent; border: none; font-size: 2.2rem; color: var(--point-dark); transition: transform 0.2s; }
.close-btn:hover { transform: scale(1.2); }
#modal-title { font-size: 2.5rem; color: var(--point-dark); margin-bottom: 20px; font-weight: 900; text-transform: uppercase; }
#modal-desc { font-size: 1.1rem; color: var(--text-main); line-height: 1.6; word-break: keep-all;}

/* 버튼, 네비게이션 */
.btn-glass { border-radius: 0 !important; text-decoration: none; font-weight: 700; color: var(--point-dark); background: var(--panel-bg); border: 1px solid var(--point-color); padding: 12px 30px; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 2px 2px 0px var(--point-color); }
.btn-glass:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0px var(--point-dark); }
.flex-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.progress-bar { position: fixed; top: 0; left: 0; height: 4px; background: linear-gradient(90deg, #b3e5fc, var(--point-dark)); width: 0%; z-index: 1000; }
.top-marquee { position: fixed; top: 0; width: 100%; background: var(--tape-bg); backdrop-filter: blur(10px); padding: 10px 0; z-index: 900; overflow: hidden; display: flex; border-bottom: 1px solid var(--border-color); }
.marquee-content { display: flex; white-space: nowrap; animation: marqueeLeft 20s linear infinite; }
.marquee-content span { font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; color: var(--text-muted); margin-right: 50px; }
@keyframes marqueeLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.side-nav { position: fixed; right: -70px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 15px; z-index: 950; transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.side-nav.active-nav { right: 25px; }
.nav-btn { width: 52px; height: 52px; display: flex; justify-content: center; align-items: center; background: var(--panel-bg); border-radius: 0 !important; border: 1px solid var(--border-color); box-shadow: 2px 2px 5px rgba(0,0,0,0.05); transition: all 0.3s ease; }
.nav-btn svg { width: 24px; height: 24px; fill: #5a738e; transition: fill 0.3s ease; }
.nav-btn:hover { transform: scale(1.1) rotate(5deg); }
.nav-btn.active { border-color: var(--point-color); box-shadow: 2px 2px 0px var(--point-color); }
.nav-btn.active svg { fill: var(--point-dark); }

/* 컨텐츠 공통 레이아웃 */
.panel { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 100px 0; position: relative; }
.content-wrapper { width: 100%; max-width: 1100px; padding: 0 5%; position: relative; z-index: 10; }
.full-width { max-width: 100%; padding: 0; }

.section-title {
    font-size: 3rem; font-weight: 900; margin-bottom: 40px; letter-spacing: -1px; text-transform: uppercase;
    background: linear-gradient(120deg, #ffffff 45%, var(--point-dark) 50%, #ffffff 55%);
    background-size: 300% 100%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 4s linear infinite; 
}
@keyframes textShine {
    0% { background-position: 100% center; } 
    15% { background-position: 0% center; }  
    100% { background-position: 0% center; } 
}

.hero-title { font-size: 5.5rem; font-weight: 900; display: flex; gap: 10px; margin-bottom: 20px; overflow: hidden; }
.hero-title span { display: inline-block; transform: translateY(100%); opacity: 0; animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-title span:nth-child(1) { animation-delay: 0.1s; color: #ffffff; }
.hero-title span:nth-child(2) { animation-delay: 0.2s; color: #ffffff; }
.hero-title span:nth-child(3) { animation-delay: 0.3s; color: #ffffff; }
@keyframes slideUp { to { transform: translateY(0); opacity: 1; } }

.subtitle { font-size: 1.4rem; color: var(--text-muted); margin-bottom: 40px; }
.highlight { color: var(--point-dark); font-weight: 700; }
.grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.panel-title { margin-bottom: 10px; color: var(--point-dark); font-size: 1.4rem; }
.panel-subtitle { font-weight: 700; margin-bottom: 15px; }
.custom-list { padding-left: 20px; line-height: 1.8; }
.custom-list li { margin-bottom: 8px; }

/* 타임라인 */
#skills-3d-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: auto; }
.section-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; }
.timeline { border-left: 2px solid var(--point-color); padding-left: 30px; }
.timeline-item { position: relative; margin-bottom: 35px; }
.timeline-item::before { content: ''; position: absolute; left: -37px; top: 5px; width: 12px; height: 12px; background: var(--bg-cert); border: 3px solid var(--point-color); }
.timeline-date { font-weight: 700; color: var(--point-dark); margin-bottom: 5px; }
.timeline-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }

/* 가로 스크롤 프로젝트 섹션 */
.horizontal-section { height: 300vh; position: relative; }
.sticky-wrapper { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.horizontal-scroll-content { display: flex; gap: 60px; padding: 0 10vw; will-change: transform; z-index: 10; }

.project-card { 
    width: 45vw; min-width: 400px; height: auto; min-height: 55vh; 
    display: flex; flex-direction: column; justify-content: flex-start; padding: 30px; 
}
.project-img-wrapper {
    width: 100%; height: 220px; background: rgba(0,0,0,0.05); margin-bottom: 20px;
    border: 1px solid var(--border-color); overflow: hidden;
}
.project-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.project-card h2 { font-size: 2.2rem; color: var(--point-dark); margin-bottom: 5px; }
.project-card h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 15px; }
.badge-container { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; padding-top:20px; }
.badge { background: var(--panel-bg); color: var(--text-main); padding: 6px 14px; font-size: 0.85rem; font-weight: 700; border: 1px solid var(--point-color); border-radius: 0 !important; box-shadow: 1px 1px 0px var(--point-color); }

/* 🌟 반응형 웹(Responsive) 미디어 쿼리 완벽 적용 */
@media (max-width: 1024px) {
    .intro-layout { flex-direction: column; text-align: center; }
    .intro-image { justify-content: center; margin-top: 30px; }
    .grid-container { grid-template-columns: 1fr; }
    .project-card { width: 70vw; min-width: 320px; }
    #guide-bubble { left: auto; right: -80px; top: -60px; min-width: 180px; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 4rem; justify-content: center; }
    .section-title { font-size: 2.2rem; }
    .subtitle { font-size: 1.1rem; }
    .project-card { width: 85vw; min-width: 280px; padding: 20px; }
    .project-img-wrapper { height: 180px; }
    #floating-avatar-container { left: 10px !important; }
    #guide-bubble { right: -60px; top: -80px; font-size: 0.95rem; padding: 10px; }
    .contact-btns { flex-direction: column; }
    .nav-hint { display: none; /* 모바일에서는 힌트 가림 */ }
}