:root {
    --bg-color: #fdfbf7;
    --text-color: #334155;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    padding: 1rem 5%;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f472b6, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    letter-spacing: -0.5px;
}

.site-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    -webkit-text-fill-color: initial; /* 그라데이션 텍스트 영향을 받지 않도록 초기화 */
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #f472b6;
}

.login-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--glass-bg);
    border-color: #f472b6;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    overflow: hidden;
}

.hero-content {
    max-width: 700px;
    z-index: 2;
    position: relative;
}

.blur-glass {
    background: var(--glass-bg);
    padding: 4rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, #f472b6, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientMove 5s ease infinite;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 300;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px -10px rgba(167, 139, 250, 0.6);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(167, 139, 250, 0.8);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Floating Shapes in Hero */
.hero-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    z-index: 1;
}

/* Floating Shapes in Hero (Restored) */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 10s infinite alternate ease-in-out;
    z-index: 1;
}

.shape-1 {
    width: 350px;
    height: 350px;
    background: rgba(244, 114, 182, 0.35);
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(167, 139, 250, 0.35);
    bottom: 0px;
    right: 0px;
    animation-delay: -3s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(129, 140, 248, 0.35);
    top: 200px;
    right: 150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { transform: translate(40px, 60px) scale(1.1) rotate(20deg); }
}

/* Tabs System */
.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.tabs-wrapper {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    box-shadow: none;
}

.tab-btn {
    width: 95px;
    height: 95px;
    border: none;
    border-radius: 50%;
    background: white;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tab-btn.active {
    background: #f472b6;
    color: white;
    box-shadow: 0 8px 20px rgba(244, 114, 182, 0.3);
    transform: translateY(-4px);
}

.tab-btn:hover:not(.active) {
    color: #f472b6;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* Category Filter Styling */
.category-filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 0.6rem 1.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: white;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cat-btn.active {
    background: #f472b6;
    color: white;
    border-color: #f472b6;
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.2);
}

.cat-btn:hover:not(.active) {
    border-color: #f472b6;
    color: #f472b6;
    background: #fff5f8;
}

.tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.tab-pane.active {
    display: block;
    animation: tabFadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tabFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Styling */
.gallery-wrapper {
    max-width: 1400px; /* 더 넓은 레이아웃 확보 */
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr; /* 1열 배치 */
    justify-items: center;
    gap: 3rem;
}

.gallery-item {
    aspect-ratio: 16 / 12; /* 정비율보다 세로를 약간 더 확보 */
    min-height: 450px;
    width: 100%;
}

/* Heart Lab Premium UI (Refined for Gallery) */
.glass-lab {
    width: 100%;
    height: 100%;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-lab:hover {
    transform: translateY(-5px);
    box-shadow: 0 40px 70px -15px rgba(0, 0, 0, 0.15);
}

#heart-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* 상단 수식 패널 */
.lab-header-panel {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    width: 90%;
    display: flex;
    justify-content: center;
}

.formula-box {
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(244, 114, 182, 0.2);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #f472b6;
    pointer-events: auto;
    box-shadow: 0 10px 25px -5px rgba(244, 114, 182, 0.15);
    background: rgba(255, 255, 255, 0.6);
}

/* 하단 제어 패널 */
.lab-controls-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px; /* 가로 폭 조정 */
    z-index: 10;
    pointer-events: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column; /* 기본적으로 세로로 쌓기 (공간 절약) */
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.7);
}

@media (min-width: 1200px) {
    .lab-controls-panel {
        flex-direction: row; /* 넓은 화면에선 가로 배치 */
        max-width: 600px;
        gap: 1.5rem;
    }
}

.control-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

.control-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.control-group input[type="range"] {
    flex: 1;
    min-width: 80px;
    accent-color: #f472b6;
    height: 5px;
    background: #e2e8f0;
    border-radius: 2px;
    cursor: pointer;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Programs Section */
.programs-section {
    padding: 8rem 5%;
    background: #f8fafc;
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    word-break: keep-all;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.program-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.program-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    border-color: rgba(244, 114, 182, 0.5);
    background: rgba(255, 255, 255, 0.8);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.program-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.program-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
}

.card-link {
    color: #f472b6;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.program-card:hover .card-link {
    gap: 0.8rem;
}

/* Locked Program State */
.program-card.locked {
    filter: grayscale(0.8);
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.program-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
}

.program-card.locked::after {
    content: "곧 만나요! 🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: #ffd6e0;
    color: #c026d3;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.program-card.locked .card-link {
    display: none;
}

/* Footer */
.footer {
    padding: 4rem 5% 2rem;
    background: #f1f5f9;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content {
        padding: 0;
    }
    .blur-glass {
        padding: 2.5rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 3rem;
    }
    .nav-links {
        display: none; /* 모바일용 햄버거 메뉴는 추후 구현 */
    }
    .hero-visual {
        opacity: 0.5;
    }

    /* Heart Lab Mobile Optimization */
    .gallery-wrapper {
        padding: 1rem;
        grid-template-columns: 1fr; /* 모바일 1열 */
        gap: 2rem;
    }

    .gallery-item {
        aspect-ratio: auto;
        height: 500px;
    }

    .formula-box {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        width: 85%;
        text-align: center;
    }

    .lab-controls-panel {
        flex-direction: column;
        gap: 1rem;
        padding: 1.2rem;
        bottom: 16px;
        width: 94%;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .control-group input[type="range"] {
        flex: 1;
        max-width: none;
    }

    .status-badge {
        font-size: 0.6rem;
    }
}
