/* ==========================================
   기본 설정 및 테마
========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
body.dark-theme { font-family: 'Pretendard', 'Outfit', sans-serif; background: #0A0A0A; color: #E0E0E0; overflow-x: hidden; word-break: keep-all; }
a { text-decoration: none; color: inherit; display: inline-block; }
button { background: none; border: none; outline: none; font-family: inherit; }

/* 줄바꿈 제어 클래스 */
.pc-br { display: block; }
.mobile-br { display: none; }

/* Lenis 스크롤 */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }

/* ==========================================
   고급 인터랙션 기교 (노이즈, 조명, 클릭 파동)
========================================== */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9998; opacity: 0.04;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter )"/%3E%3C/svg%3E');
}
.glow-orb {
    position: fixed; top: 50%; left: 50%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0,255,204,0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 0; filter: blur(50px);
    transition: top 0.1s, left 0.1s;
}
.click-burst {
    position: fixed; width: 40px; height: 40px;
    border: 1px solid #00FFCC; border-radius: 50%;
    pointer-events: none; transform: translate(-50%, -50%);
    z-index: 999999; box-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
}

/* 커스텀 커서 */
.custom-cursor { position: fixed; top: 0; left: 0; width: 15px; height: 15px; background-color: #00FFCC; border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, background-color 0.3s; display: flex; justify-content: center; align-items: center; mix-blend-mode: difference; }
.cursor-text { color: #0A0A0A; font-size: 12px; font-weight: 700; opacity: 0; font-family: 'Outfit', sans-serif; }

/* ==========================================
   네비게이션
========================================== */
.detail-nav { position: fixed; top: 0; left: 0; width: 100%; padding: 30px 50px; display: flex; justify-content: space-between; align-items: center; z-index: 1000; color: #E0E0E0; mix-blend-mode: difference; }
.back-btn { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.nav-logo { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.5rem; color: #00FFCC; }
.lang-toggle { display: flex; background: rgba(255,255,255,0.1); border-radius: 30px; padding: 4px; backdrop-filter: blur(10px); }
.lang-btn { padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; color: #888; transition: 0.3s; }
.lang-btn.active { background: #00FFCC; color: #0A0A0A; }

/* ==========================================
   1. 히어로 섹션
========================================== */
.web-hero { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.grid-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(rgba(0, 255, 204, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 204, 0.05) 1px, transparent 1px); background-size: 50px 50px; z-index: -1; transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px); animation: gridMove 10s linear infinite; }
@keyframes gridMove { 0% { transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px); } 100% { transform: perspective(500px) rotateX(60deg) translateY(50px) translateZ(-200px); } }

.hero-content { text-align: center; z-index: 2; width: 100%; padding: 0 20px; }
.code-comment { font-family: 'Space Mono', monospace; color: #888; font-size: 1.2rem; margin-bottom: 20px; }
.hero-title { font-family: 'Outfit', sans-serif; font-size: 7vw; font-weight: 900; line-height: 1.1; text-transform: uppercase; margin-bottom: 30px; }
.outline-text { color: transparent; -webkit-text-stroke: 2px #00FFCC; }
.hero-desc { font-size: 1.5rem; color: #AAA; line-height: 1.6; max-width: 800px; margin: 0 auto; }

.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: 'Space Mono', monospace; font-size: 0.8rem; color: #888; }
.mouse { width: 24px; height: 36px; border: 2px solid #888; border-radius: 12px; position: relative; }
.mouse::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: #00FFCC; border-radius: 50%; animation: scrollWheel 2s infinite; }
@keyframes scrollWheel { 0% { top: 6px; opacity: 1; } 100% { top: 20px; opacity: 0; } }

/* ==========================================
   2. 터미널 인포 섹션
========================================== */
.web-info { padding: 100px 5%; display: flex; justify-content: center; }
.terminal-window { width: 100%; max-width: 800px; background: #111; border: 1px solid #333; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,255,204,0.05); position: relative; }
.terminal-header { background: #1A1A1A; padding: 15px 20px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #333; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #FF5F56; } .dot.yellow { background: #FFBD2E; } .dot.green { background: #27C93F; }
.terminal-header .title { margin-left: auto; margin-right: auto; font-family: 'Space Mono', monospace; font-size: 0.9rem; color: #888; transform: translateX(-24px); }
.terminal-body { padding: 30px; font-family: 'Space Mono', monospace; font-size: 1.2rem; line-height: 1.8; overflow-x: auto; opacity: 0; }
.key { color: #00FFCC; } .string { color: #F2C94C; } .number { color: #E65A45; }

/* ==========================================
   3. 가로 스크롤 갤러리 & 3D 틸트
========================================== */
.web-gallery-container { width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: #050505; position: relative; }
.horizontal-scroll-wrapper { display: flex; width: 300vw; height: 100%; }
.panel { width: 100vw; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 5%; }
.mockup-card { display: flex; align-items: center; gap: 60px; width: 100%; max-width: 1400px; }
.mockup-info { flex: 1; }
.mockup-info h3 { font-family: 'Outfit', sans-serif; font-size: 3.5rem; color: #00FFCC; margin-bottom: 20px; line-height: 1.1; }
.mockup-info p { font-size: 1.4rem; color: #AAA; line-height: 1.6; }

.mockup-img-wrap { flex: 1.5; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.5); border: 1px solid #333; position: relative; perspective: 1000px; }
.curtain { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #0A0A0A; z-index: 2; transform-origin: right; }
.mockup-img { width: 100%; height: 100%; overflow: hidden; transform-style: preserve-3d; will-change: transform; }
.mockup-img img { width: 120%; height: auto; display: block; transform: translateX(-10%); transition: filter 0.5s; filter: grayscale(20%) contrast(110%); }
.mockup-img-wrap:hover img { filter: grayscale(0%) contrast(100%); }

.gallery-progress-wrap { position: absolute; bottom: 50px; right: 5%; display: flex; align-items: center; gap: 15px; z-index: 10; opacity: 0; white-space: nowrap; }
.progress-numbers { font-family: 'Space Mono', monospace; font-size: 1.2rem; color: #00FFCC; font-weight: 700; white-space: nowrap; }
.progress-bar-bg { width: 100px; height: 2px; background: rgba(255, 255, 255, 0.2); position: relative; overflow: hidden; }
.progress-bar-fill { position: absolute; top: 0; left: 0; width: 0%; height: 100%; background: #00FFCC; }

/* ==========================================
   4. 다음 프로젝트
========================================== */
.next-project.dark { background-color: #00FFCC; color: #0A0A0A; padding: 150px 5%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.next-project.dark .next-label { font-family: 'Space Mono', monospace; font-size: 1.2rem; margin-bottom: 20px; opacity: 0.8; }
.next-project.dark .next-title { font-family: 'Outfit', sans-serif; font-size: 6vw; font-weight: 900; color: #0A0A0A; transition: transform 0.3s; }
.next-project.dark .next-title:hover { transform: scale(1.05); }

.fade-up { opacity: 0; transform: translateY(50px); }
.magnetic-item { display: inline-block; }

/* ==========================================
   반응형 (모바일 최적화 완벽 적용)
========================================== */
@media screen and (max-width: 1024px) {
    .mockup-card { flex-direction: column; text-align: center; gap: 40px; }
    .mockup-info h3 { font-size: 2.8rem; }
    .pc-br { display: none; }
}

@media screen and (max-width: 768px) {
    .custom-cursor { display: none; } 
    * { cursor: auto !important; }
    
    /* 성능 최적화: 모바일에서 렉을 유발하는 노이즈와 조명 제거 */
    .noise-overlay, .glow-orb { display: none !important; }
    
    .detail-nav { padding: 15px 20px; gap: 10px; }
    .back-btn .lang-text { display: none; } 
    .back-btn .arrow { font-size: 1.5rem; }
    .nav-logo { font-size: 1.2rem; }
    .lang-btn { padding: 4px 8px; font-size: 0.75rem; }
    
    .hero-title { font-size: 3.5rem; }
    .hero-desc { font-size: 1.1rem; padding: 0 20px; }
    .mobile-br { display: block; }
    
    .web-info { padding: 60px 5%; }
    .terminal-window { border-radius: 8px; }
    .terminal-body { font-size: 0.85rem; padding: 20px; overflow-x: auto; white-space: pre; }
    
    .mockup-card { gap: 20px; padding-top: 40px; }
    .mockup-info h3 { font-size: 2rem; margin-bottom: 10px; }
    .mockup-info p { font-size: 1rem; }
    
    /* ★ 수정: 이미지 잘림 완벽 해결 (원본 비율 유지) */
    .mockup-img-wrap { 
        width: 100%; 
        height: auto; /* 강제 비율 제거 */
        border-radius: 12px; 
        transform: none !important; 
        display: block;
    }
    .mockup-img {
        width: 100%;
        height: auto;
        transform: none !important;
    }
    .mockup-img img {
        width: 100% !important;
        height: auto !important; /* 강제 높이 제거, 원본 비율대로 */
        object-fit: contain; /* 잘림 방지 */
        transform: none !important; 
        filter: none; /* 모바일에서는 흑백 필터 없이 원본 색상 그대로 */
    }
    
    .gallery-progress-wrap { bottom: 20px; right: 50%; transform: translateX(50%); width: max-content; }
    .progress-bar-bg { width: 60px; }
    
    .next-project.dark { padding: 100px 5%; }
    .next-project.dark .next-title { font-size: 3rem; }
}
