/* style.css - Grid Fix for Recent/News Sections */

/* --- [기본 설정 및 변수] --- */
:root {
    --primary: #3D7684;
    --primary-light: #6fbccf;
    --primary-glow: #a5f3fc;
    --primary-dark: #2d5661;
    --secondary: #516F75;
    --accent: #FF6F00;
    --dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans KR', sans-serif; color: var(--text); line-height: 1.6; }

/* --- Navigation --- */
nav {
    position: fixed; top: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 1000;
}
.nav-container {
    max-width: 1400px; margin: 0 auto; padding: 0 40px;
    display: flex; justify-content: space-between; align-items: center; height: 80px;
}
.logo { font-size: 24px; font-weight: 800; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 500; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

.menu-toggle { display: none; font-size: 28px; color: var(--primary); cursor: pointer; background: none; border: none; padding: 8px; transition: background 0.3s; border-radius: 8px; }
.menu-toggle:hover { background: var(--bg-light); }
.menu-toggle:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.mobile-menu {
    display: none; position: absolute; top: 80px; left: 0; width: 100%;
    background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-direction: column; padding: 20px 0; border-top: 1px solid #eee;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    text-decoration: none; color: var(--text); padding: 15px 40px;
    font-weight: 500; font-size: 16px; transition: background 0.3s;
    border-bottom: 1px solid #f8fafc;
}
.mobile-menu a:hover, .mobile-menu a.active { color: var(--primary); background: var(--bg-light); }

/* --- Footer --- */
footer { background: var(--dark); color: white; padding: 60px 0 30px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; margin-bottom: 40px; }
.footer-section h4 { margin-bottom: 20px; font-size: 18px; }
.footer-section p, .footer-section a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; line-height: 2; }
.footer-section a:hover { color: var(--primary); }
.footer-bottom { padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; color: rgba(255,255,255,0.5); font-size: 14px; }

/* --- General Layout --- */
section { padding: 80px 0; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }
.section-title { font-size: 36px; font-weight: 800; margin-bottom: 40px; color: var(--primary); text-align: center; }
.page-header { margin-top: 80px; padding: 80px 0; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; text-align: center; }
.page-header h1 { font-size: 48px; margin-bottom: 20px; }
.page-header p { font-size: 20px; opacity: 0.9; }

/* --- Hero Section --- */
.hero { 
    margin-top: 80px; height: 90vh; 
    
    /* [수정] 아래 background 줄을 삭제하거나 주석 처리하세요. */
    /* background: radial-gradient(circle at 40% 50%, #1e293b 0%, #020617 90%); */ 
    
    /* 배경을 투명하게 하거나 삭제해야 뒤에 있는 애니메이션이 보입니다 */
    background: transparent; 

    display: flex; align-items: center; 
    position: relative; overflow: hidden; 
}
/* 캔버스를 화면 뒤에 고정시키는 스타일 */
#metabolic-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;        /* 글자보다 뒤에 위치 */
    pointer-events: none; /* 스크롤이나 터치를 방해하지 않음 */
    background-color: rgb(2, 6, 23); /* 배경색 지정 */
}
.hero-container { max-width: 1600px; width: 100%; margin: 0 auto; padding: 0 40px; position: relative; z-index: 1; display: grid; grid-template-columns: 0.6fr 1fr; align-items: center; }
.hero-visual-space { height: 100%; }

.hero-content {
    text-align: left; padding: 36px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    transition: transform 0.3s ease;
}
.hero-content:hover { transform: translateY(-5px); border-color: rgba(165, 243, 252, 0.3); }
.hero h2 { font-size: 48px; font-weight: 800; color: var(--primary-light); margin-bottom: 20px; line-height: 1.3; letter-spacing: -0.5px; }
.hero h1 { font-size: 32px; font-weight: 600; color: rgba(255, 255, 255, 0.85); margin-bottom: 35px; line-height: 1.4; letter-spacing: 0.5px; }
.hero p { font-size: 18px; color: #cbd5e1; margin-bottom: 40px; line-height: 1.8; }
.hero-btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 40px; background: rgba(61, 118, 132, 0.8); color: white; text-decoration: none; border-radius: 50px; font-weight: 600; font-size: 16px; border: 1px solid var(--primary-light); transition: all 0.3s; box-shadow: 0 0 20px rgba(61, 118, 132, 0.4); }
.hero-btn:hover { background: var(--primary); box-shadow: 0 0 40px rgba(61, 118, 132, 0.8); transform: translateX(5px); }

/* Scroll Indicator */
.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    z-index: 10; display: flex; flex-direction: column; align-items: center; opacity: 0.7; cursor: pointer; 
}
.mouse { width: 26px; height: 40px; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 20px; position: relative; margin-bottom: 10px; }
.wheel { width: 2px; height: 6px; background-color: #fff; border-radius: 2px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); animation: scroll 1.5s infinite; }
.arrow { width: 10px; height: 10px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); animation: fadeArrow 1.5s infinite; }
@keyframes scroll { 0% { top: 8px; opacity: 1; } 100% { top: 20px; opacity: 0; } }
@keyframes fadeArrow { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }

/* --- Research Areas --- */
.research-areas { background: white; }
.research-grid { display: flex; flex-wrap: wrap; justify-content: center !important; gap: 30px; margin-top: 40px; max-width: 1200px; margin-left: auto; margin-right: auto; }
.research-card { flex: 0 0 calc((100% - 60px) / 3); background: white; padding: 30px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; min-height: 160px; }
.research-card i { font-size: 3rem; margin-bottom: 15px; color: #3d7684; }

/* --- Publications & News Grids --- */
.publications { background: var(--bg-light); }
.news-section { background: white; }

/* [PC Default] 3 Columns (기본적으로 3열 유지) */
.pub-grid, .news-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; 
}

.pub-card { background: white; padding: 30px; border-radius: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.3s; display: flex; flex-direction: column; height: 100%; }
.pub-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.pub-card h4 { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--text); line-height: 1.4; flex-grow: 1; }
.pub-card .authors { display: block; color: var(--text-light); font-size: 14px; margin-bottom: 15px; }
.pub-card .journal { display: inline-block; background: var(--primary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; width: fit-content; }
.view-more { text-align: center; margin-top: 40px; }

.news-card { background: white; padding: 30px; border-radius: 16px; transition: all 0.3s; display: flex; flex-direction: column; height: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.news-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.news-date { color: var(--primary); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.news-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.news-desc { color: var(--text-light); font-size: 14px; line-height: 1.6; flex-grow: 1; }

/* --- Subpages --- */
.pi-card { background: white; border-radius: 16px; padding: 50px; margin-bottom: 60px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-align: center; }
.pi-photo { width: 200px; height: 200px; border-radius: 50%; background: var(--bg-light); margin: 0 auto 30px; display: flex; align-items: center; justify-content: center; font-size: 64px; color: var(--primary); overflow: hidden; }
.pi-photo img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: 0.3s; }
.pi-photo img:hover { transform: scale(1.05); }
.pi-card h2 { font-size: 32px; color: var(--text); margin-bottom: 10px; }
.pi-card .title { font-size: 18px; color: var(--primary); margin-bottom: 20px; font-weight: 600; }
.pi-card .bio { color: var(--text-light); line-height: 1.8; margin-bottom: 20px; }
.pi-card .contact { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: 20px; }
.pi-card .contact a { color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }

.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; }
.member-card { background: white; border-radius: 12px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: all 0.3s; text-align: center; }
.member-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.member-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-light); margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); overflow: hidden; }
.member-icon img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: 0.3s; }
.member-icon img:hover { transform: scale(1.05); }
.member-card h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.member-card .degree { color: var(--primary); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.member-card .info { color: var(--text-light); font-size: 14px; line-height: 1.6; }

.alumni-section { background: var(--bg-light); padding: 40px; border-radius: 16px; }
.alumni-list { columns: 2; column-gap: 40px; }
.alumni-list li { color: var(--text-light); margin-bottom: 12px; break-inside: avoid; }

.filter-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.filter-btn { padding: 8px 24px; border-radius: 50px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; background-color: #f1f5f9; color: var(--text); }
.filter-btn:hover { background-color: #e2e8f0; }
.filter-btn.active { background-color: var(--dark); color: white; }
.year-section { margin-bottom: 60px; scroll-margin-top: 100px; }
.year-section.hidden { display: none; }
.year-section.fade-in { animation: fadeIn 0.5s; }
.year-title { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 30px; padding-bottom: 15px; border-bottom: 3px solid var(--primary); }
.pub-item { background: white; padding: 25px 30px; margin-bottom: 15px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 4px solid var(--primary); transition: all 0.3s; }
.pub-item:hover { transform: translateX(10px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.pub-item h3 { font-size: 17px; color: var(--text); margin-bottom: 8px; line-height: 1.5; font-weight: 700; }
.pub-authors { color: var(--text-light); font-size: 14px; margin-bottom: 10px; line-height: 1.5; }
.pub-meta { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.pub-journal { display: inline-block; background: var(--primary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pub-year { color: var(--text-light); font-weight: 600; font-size: 13px; }
.pub-doi { color: var(--primary); text-decoration: none; font-size: 13px; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.pub-doi:hover { border-color: var(--primary); }
.note { background: var(--bg-light); padding: 20px 30px; border-radius: 12px; margin-bottom: 40px; border-left: 4px solid var(--accent); }
.note p { color: var(--text-light); font-size: 14px; }
.news-item { background: white; padding: 30px; margin-bottom: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 4px solid var(--primary); transition: all 0.3s; }
.news-item:hover { transform: translateX(10px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.news-item h3 { font-size: 20px; color: var(--text); margin-bottom: 10px; }
.news-item p { color: var(--text-light); line-height: 1.6; }
.news-item .badge { display: inline-block; background: var(--primary); color: white; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; margin-top: 10px; }
.software-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 40px; }
.software-card { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: all 0.3s; }
.software-card:hover { transform: translateY(-10px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); }
.software-icon { width: 80px; height: 80px; background: var(--primary); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: white; margin-bottom: 25px; }
.software-card h3 { font-size: 24px; color: var(--text); margin-bottom: 15px; }
.software-card .description { color: var(--text-light); margin-bottom: 20px; line-height: 1.8; }
.software-card .tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.software-card .tag { background: var(--bg-light); color: var(--primary); padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.software-card .links { display: flex; gap: 15px; }
.software-card .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: var(--primary); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; transition: all 0.3s; }
.software-card .btn:hover { background: var(--primary-dark); }
.software-card .btn-secondary { background: var(--bg-light); color: var(--primary); }
.software-card .btn-secondary:hover { background: #e2e8f0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.contact-card { background: white; padding: 50px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.contact-card h2 { font-size: 28px; color: var(--primary); margin-bottom: 30px; display: flex; align-items: center; gap: 15px; }
.contact-card h2 i { font-size: 32px; }
.contact-item { margin-bottom: 25px; }
.contact-item h3 { font-size: 16px; color: var(--text-light); margin-bottom: 8px; font-weight: 600; }
.contact-item p { color: var(--text); font-size: 18px; }
.contact-item a { color: var(--primary); text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }
.map-container { background: var(--bg-light); padding: 40px; border-radius: 16px; text-align: center; }
.map-placeholder { background: white; height: 400px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 18px; border: 2px dashed var(--primary); }
.directions { margin-top: 30px; text-align: left; padding: 30px; background: white; border-radius: 12px; }
.directions h3 { color: var(--primary); margin-bottom: 15px; font-size: 20px; }
.directions ul { margin-left: 20px; }
.directions li { margin-bottom: 10px; color: var(--text-light); }
.research-detail { background: white; border-radius: 16px; padding: 50px; padding-top: 20px;margin-bottom: 40px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-left: 5px solid var(--primary); }
.research-detail h3 { font-size: 28px; color: var(--primary); margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
.research-detail h3 i { font-size: 36px; }
.research-detail h4 { font-size: 20px; color: var(--text); margin: 30px 0 15px 0; }
.research-detail p { color: var(--text-light); line-height: 1.8; margin-bottom: 15px; }
.research-detail ul { margin-left: 20px; margin-bottom: 15px; }
.research-detail li { color: var(--text-light); line-height: 1.8; margin-bottom: 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.album-card { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: transform 0.3s; cursor: pointer; }
.album-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); }
.album-cover { height: 200px; overflow: hidden; position: relative; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.album-card:hover .album-cover img { transform: scale(1.05); }
.album-info { padding: 20px; }
.album-date { color: var(--primary); font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.album-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 0; line-height: 1.4; }
.photo-count { display: inline-block; background: rgba(0,0,0,0.6); color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; position: absolute; bottom: 10px; right: 10px; }
.modal { display: none; position: fixed; z-index: 2000; padding-top: 50px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9); backdrop-filter: blur(5px); }
.modal-content { margin: auto; display: block; width: 80%; max-width: 800px; max-height: 80vh; object-fit: contain; animation: zoomIn 0.3s; }
.close { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close:hover { color: var(--accent); }
#caption { margin: auto; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; padding: 10px 0; height: 150px; font-size: 18px; }
@keyframes zoomIn { from {transform:scale(0)} to {transform:scale(1)} }
.modal-prev, .modal-next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -50px; color: white; font-weight: bold; font-size: 30px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; z-index: 2001; }
.modal-next { right: 0; border-radius: 3px 0 0 3px; }
.modal-prev { left: 0; border-radius: 3px 0 0 3px; }
.modal-prev:hover, .modal-next:hover { background-color: rgba(0,0,0,0.8); }
.numbertext { color: #f2f2f2; font-size: 14px; padding: 8px 12px; position: absolute; top: 10px; left: 10px; z-index: 2001; background: rgba(0,0,0,0.5); border-radius: 4px; }

/* Journal Filter Dropdown Styles */
.journal-filter-wrapper { position: relative; display: inline-block; margin-left: 10px; vertical-align: middle; }
.journal-filter-btn { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid #ddd; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 600; color: var(--text-light); transition: all 0.2s; }
.journal-filter-btn:hover, .journal-filter-btn.active { border-color: var(--primary); color: var(--primary); background: #f0fdf4; }
.journal-dropdown { display: none; position: absolute; top: 100%; left: 0; margin-top: 8px; background: white; border: 1px solid #eee; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 300px; max-height: 400px; overflow-y: auto; z-index: 1000; padding: 10px; }
.journal-dropdown.show { display: block; }
.journal-option { display: flex; align-items: flex-start; padding: 8px 10px; cursor: pointer; border-radius: 6px; transition: background 0.2s; }
.journal-option:hover { background-color: #f5f5f5; }
.journal-option input[type="checkbox"] { margin-right: 10px; margin-top: 4px; accent-color: var(--primary); cursor: pointer; }
.journal-name { font-size: 14px; color: var(--text); line-height: 1.4; }
.journal-count { font-size: 12px; color: #999; margin-left: auto; }
.dropdown-header { display: flex; justify-content: space-between; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #eee; font-size: 13px; }
.btn-clear { color: #e74c3c; cursor: pointer; background: none; border: none; font-weight: 600; }

.mobile-only { display: none; }

/* --- Responsive Styles --- */

/* 1. Tablet & Laptop (max-width: 1024px) */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-content { padding-left: 0; margin-top: 300px; padding: 20px; } 
    .hero h1 { font-size: 28px; }
    .hero h2 { font-size: 38px; justify-content: center; }
    .footer-content { grid-template-columns: 1fr; gap: 40px; }
    .contact-grid { grid-template-columns: 1fr; }
    .alumni-list { columns: 1; }
    
    /* PC/Tablet에서 Pub/News는 3열 유지 */
    .research-grid, .members-grid, .software-grid, .gallery-grid { grid-template-columns: 1fr; }
    .pub-item, .news-item, .contact-card, .research-detail { padding: 20px; }
}

/* 2. Smaller Tablet / Large Phone (max-width: 900px) */
@media (max-width: 900px) {
    /* 900px 이하에서 2열로 변경 */
    .pub-grid, .news-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

/* 3. Mobile (max-width: 768px) - FIXED LAYOUT */
@media (max-width: 768px) {
    .mobile-only { display: inline; }

    /* Hero Section Fix */
    .hero {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 상단 정렬 강제 */
        align-items: center !important;
        
        height: 100dvh !important;
        min-height: 100dvh;
        padding-top: 130px !important; /* 상단 메뉴(80px) + 여백(50px) = 130px */
        padding-bottom: 20px !important;
        
        background: radial-gradient(circle at 50% 50%, #1e293b 0%, #020617 90%);
        overflow: hidden;
    }

    .hero-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 내부 컨테이너도 상단 정렬 */
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 20px !important;
        z-index: 10;
        position: relative;
    }

    .hero-content {
        width: 100%;
        max-width: 500px;
        text-align: center;
        margin-top: 0 !important; /* 불필요한 상단 여백 제거 */
        margin-bottom: 20px;
        background: rgba(15, 23, 42, 0.5); 
        backdrop-filter: blur(5px);
        padding: 25px;
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: none;
    }

    .hero h2 { font-size: 32px; margin-bottom: 15px; }
    .hero h1 { font-size: 22px; line-height: 1.3; margin-bottom: 20px; word-break: keep-all; }
    .hero p { font-size: 15px; margin-bottom: 25px; }

    #metabolic-canvas {
        position: absolute;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 0;
    }

    .hero-visual-space { display: none; }
    .scroll-indicator { display: none; }
    .research-card { flex: 0 0 100%; }

    /* [FIX] Force 1 Column for Mobile Grid */
    .pub-grid, .news-grid, .research-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}
/* 3. Mobile (max-width: 768px) - FIXED LAYOUT */
@media (max-width: 768px) {
    .mobile-only { display: inline; }

    /* Hero Section Fix */
    .hero {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 무조건 위쪽 정렬 */
        align-items: center !important;
        
        height: 85dvh !important;
        min-height: 85dvh;
        
        padding-top: 30px !important; 
        padding-bottom: 0 !important;
        
        background: radial-gradient(circle at 50% 50%, #1e293b 0%, #020617 90%);
        overflow: hidden;
    }

    .hero-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 20px !important;
        z-index: 10;
        position: relative;
        height: auto !important; /* 높이 제한 해제 */
    }

    .hero-content {
        width: 100%;
        max-width: 500px;
        text-align: center;
        
        /* [핵심 수정] 상단 여백 완전 제거 */
        margin-top: 0 !important; 
        margin-bottom: 10px; /* 아래쪽 애니메이션과 간격 */
        
        background: rgba(15, 23, 42, 0.6); /* 가독성을 위해 배경 조금 더 진하게 */
        backdrop-filter: blur(8px);
        padding: 20px; /* 패딩도 살짝 줄임 */
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: none;
    }

    /* [공간 확보] 모바일 폰트 사이즈 최적화 */
    .hero h2 { font-size: 26px !important; margin-bottom: 10px; }
    .hero h1 { font-size: 18px !important; line-height: 1.4; margin-bottom: 15px; }
    .hero p { font-size: 14px !important; margin-bottom: 20px; }
    .hero-btn { padding: 12px 30px !important; font-size: 14px !important; }

    #metabolic-canvas {
        position: absolute;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 0;
    }

    .hero-visual-space { display: none; }
    .scroll-indicator { display: none; }
    .research-card { flex: 0 0 100%; }

    .pub-grid, .news-grid, .research-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* ========================================
   INDEX PAGE SPECIFIC STYLES
   ======================================== */

        /* Compact sections - reduce spacing */
        section {
            padding: 50px 0;
        }
        
        .research-areas {
            padding-bottom: 40px;
        }
        
        .publications,
        .news-section {
            padding: 40px 0;
        }
        
        /* Section header with inline button */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 35px;
        }
        
        .section-title {
            margin-bottom: 0 !important;
        }
        
        .view-all-inline {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 15px;
            transition: all 0.3s;
            padding: 10px 20px;
            border: 2px solid var(--primary);
            border-radius: 25px;
        }
        
        .view-all-inline:hover {
            background: var(--primary);
            color: white;
            gap: 12px;
        }
        
        .view-all-inline i {
            font-size: 18px;
            transition: transform 0.3s;
        }
        
        .view-all-inline:hover i {
            transform: translateX(3px);
        }
        
        /* Remove old view-more sections */
        .view-more {
            display: none;
        }
        
        /* Mobile-optimized Research Grid */
        .research-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }
        
        @media (max-width: 968px) {
            .research-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
            }
            
            .section-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
        }
        
        @media (max-width: 640px) {
            .research-grid {
                grid-template-columns: 1fr;
                gap: 15px;
                max-width: 400px;
                margin: 0 auto;
            }
            
            section {
                padding: 40px 0;
            }
            
            .publications,
            .news-section {
                padding: 30px 0;
            }
        }
        
        /* Research Card - Complete Styles */
        .research-card-link {
            text-decoration: none;
            display: block;
        }

        .research-card {
            position: relative;
            background: white;
            padding: 35px 25px 65px 25px;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            transition: all 0.4s ease;
            cursor: pointer;
            overflow: visible;
            min-height: 200px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .research-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(61, 118, 132, 0.95), rgba(45, 90, 101, 0.95));
            opacity: 0;
            transition: opacity 0.4s ease;
            z-index: 1;
            border-radius: 16px;
        }

        .research-card:hover::before {
            opacity: 1;
        }

        .card-content {
            position: relative;
            z-index: 2;
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .research-card i {
            font-size: 42px;
            color: var(--primary);
            margin-bottom: 15px;
            display: block;
            transition: all 0.4s ease;
            position: relative;
            z-index: 2;
        }

        .research-card h3 {
            font-size: 16px;
            color: var(--text);
            margin: 0;
            line-height: 1.3;
            transition: all 0.4s ease;
            position: relative;
            z-index: 2;
        }

        .research-card:hover i,
        .research-card:hover h3 {
            color: white;
        }

        .view-detail-btn {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 7px 20px;
            border: 2px solid white;
            color: white;
            border-radius: 20px;
            font-weight: 600;
            font-size: 13px;
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s ease;
            z-index: 2;
            white-space: nowrap;
        }

        .research-card:hover .view-detail-btn {
            opacity: 1;
            visibility: visible;
        }

        .research-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 12px 24px rgba(0,0,0,0.15);
        }

        /* FIXED: Scroll offset for anchor links */
        .research-detail {
            scroll-margin-top: 100px;
            padding-top: 20px;
        }
        
        /* FIXED: Index page research section scroll */
        #research {
            scroll-margin-top: 100px;
        }

        /* Mobile adjustments */
        @media (max-width: 640px) {
            .research-card {
                padding: 30px 20px 60px 20px;
                min-height: 180px;
            }
            
            .research-card i {
                font-size: 38px;
                margin-bottom: 12px;
            }
            
            .research-card h3 {
                font-size: 15px;
            }
            
            .view-detail-btn {
                font-size: 12px;
                padding: 6px 18px;
                bottom: 18px;
            }
            
            .research-detail {
                scroll-margin-top: 80px;
            }
            
            #research {
                scroll-margin-top: 80px;
            }
        }
        
        /* Responsive Publications Grid */
        .pub-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 25px;
        }
        
        @media (max-width: 968px) {
            .pub-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 640px) {
            .pub-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
        }
        
        /* Responsive News Grid */
        .news-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 25px;
        }
        
        @media (max-width: 968px) {
            .news-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 640px) {
            .news-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
        }
        
        /* Hero Section Mobile */
        @media (max-width: 640px) {
            .hero h1 {
                font-size: 36px;
            }
            
            .hero h2 {
                font-size: 18px;
            }
            
            .hero-btn {
                padding: 12px 28px;
                font-size: 14px;
            }
        }
        
        /* Section Titles Mobile */
        @media (max-width: 640px) {
            .section-title {
                font-size: 28px;
            }
            
            .section-header {
                margin-bottom: 25px;
            }
        }
        
        /* Container Padding Mobile */
        @media (max-width: 640px) {
            .container {
                padding: 0 20px;
            }
        }
