/* =========================================
   GUN-YEAL LEE - PERSONAL WEBSITE
   CSS Design System
   ========================================= */

/* =========================================
   CSS CUSTOM PROPERTIES (Easy to change!)
   ========================================= */
:root {
    /* Primary Colors - Change these when moving institutions */
    --color-primary: #8c1515;           /* Stanford Cardinal */
    --color-primary-light: #b83232;
    --color-link: #68f;
    --color-link-hover: #99bbff;
    
    /* Text Colors */
    --color-text: #1a1a2e;
    --color-text-light: #64648c;
    
    /* Background Colors */
    --color-bg: #fefefe;
    --color-bg-warm: #faf9f7;
    --color-card: #ffffff;
    --color-border: #eeeef2;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    
    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.7;
    color: var(--color-text);
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-warm) 100%);
    min-height: 100vh;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   NAVIGATION
   ========================================= */
nav {
    position: sticky;
    top: 1rem;
    z-index: 100;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* Hamburger Menu Button (hidden on desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--color-bg-warm);
    color: var(--color-primary);
}

/* =========================================
   MAIN CONTENT
   ========================================= */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 5vw, 2rem);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    margin-bottom: 4rem;
    padding: 3rem;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(140, 21, 21, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 136, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.profile-container {
    position: relative;
    z-index: 1;
}

.profile-photo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.profile-photo:hover {
    transform: scale(1.02) rotate(1deg);
    box-shadow: 0 25px 60px rgba(140, 21, 21, 0.2);
}

.bio {
    position: relative;
    z-index: 1;
}

.bio h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-text), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.bio .title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bio .title::before {
    content: '';
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-link));
    border-radius: 2px;
}

.bio p {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.bio a {
    font-weight: 500;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 2rem;
}

.social-links a {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-warm);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(140, 21, 21, 0.3);
}

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-link));
    border-radius: 2px;
}

.section-header a {
    color: var(--color-link);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-link);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.section-header a:hover {
    background: var(--color-link);
    color: white;
}

/* =========================================
   NEWS SECTION
   ========================================= */
.news-section {
    margin-bottom: 4rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--color-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 4px solid var(--color-primary);
}

.news-card.hidden {
    display: none;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.news-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.news-text {
    color: var(--color-text);
    font-weight: 500;
}

.news-toggle {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.news-toggle button {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text-light);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-toggle button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(140, 21, 21, 0.05);
}

/* =========================================
   PUBLICATIONS
   ========================================= */
.publications-section {
    margin-bottom: 4rem;
}

.publications-grid {
    display: grid;
    gap: 1.5rem;
}

.publication-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    background: var(--color-card);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.publication-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary), var(--color-link));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.publication-card:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.publication-card:hover::before {
    opacity: 1;
}

.pub-image-container {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pub-image {
    width: 100%;
    /* height: 150px; */
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.4s ease;
}

.publication-card:hover .pub-image {
    transform: scale(1.05);
}

.pub-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(140, 21, 21, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.publication-card:hover .pub-image-overlay {
    opacity: 1;
}

.pub-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pub-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    line-height: 1.4;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.publication-card:hover .pub-info h3 {
    color: var(--color-primary);
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.4rem;
}

.pub-venue {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.8rem;
}

.pub-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.pub-links a {
    color: var(--color-link);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    background: rgba(102, 136, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pub-links a:hover {
    background: var(--color-link);
    color: white;
}

/* =========================================
   SEARCH BOX
   ========================================= */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: var(--font-main);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card);
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--color-link);
    box-shadow: 0 0 0 4px rgba(102, 136, 255, 0.1);
}

.search-box::placeholder {
    color: var(--color-text-light);
}

/* =========================================
   CV PAGE STYLES
   ========================================= */
.cv-section {
    margin-bottom: 1.5rem;
}

.cv-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-primary);
}

.cv-item {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--color-border);
}

.cv-item:hover {
    border-left-color: var(--color-primary);
}

.cv-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.1rem;
}

.cv-item .date {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
}

.cv-item p {
    color: var(--color-text-light);
    margin-top: 0.1rem;
}

.cv-item ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    color: var(--color-text-light);
}

.cv-item li {
    margin-bottom: 0.3rem;
}

/* CV Compact Layout (for Honors & Awards, Invited Talks) */
.cv-compact .cv-item {
    margin-bottom: 0.3rem;
    padding-left: 1rem;
    padding-bottom: 0.3rem;
}

.cv-compact .cv-item h3 {
    display: inline;
    font-size: 1rem;
}

.cv-compact .cv-item .date {
    display: inline;
    margin-left: 0.5rem;
}

.cv-compact .cv-item .date::before {
    content: "—";
    margin-right: 0.5rem;
    color: var(--color-text-light);
}

.cv-compact .cv-item p {
    margin-top: 0rem;
    font-size: 0.95rem;
}

.cv-compact .cv-item .org {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* =========================================
   PAGE HEADER (for CV and Publications)
   ========================================= */
.page-header {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--color-text-light);
}

.page-header .meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.page-header .meta a {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-header .meta a:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
}

footer p {
    font-weight: 500;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    /* Mobile Navigation with Hamburger */
    nav {
        margin: 0.5rem;
        border-radius: var(--radius-md);
        top: 0.5rem;
        padding: 1rem 1.2rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 0 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 0.5rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    
    .nav-links.active {
        max-height: 300px;
        opacity: 1;
        padding: 1rem;
    }
    
    .nav-links a {
        text-align: center;
        padding: 1rem;
        border-radius: var(--radius-sm);
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        transform: none;
    }
}

@media (max-width: 900px) {

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem;
    }

    .profile-photo {
        max-width: 250px;
        margin: 0 auto;
    }

    .bio .title::before {
        display: none;
    }

    .bio .title {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .publication-card {
        grid-template-columns: 1fr;
    }

    .pub-image {
        width: 100%;
        height: 210px;
        object-fit: cover;
        object-position: center;
        display: block;
    }

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

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* =========================================
   PRINT STYLES (for CV)
   ========================================= */
@media print {
    nav, footer, .news-toggle {
        display: none;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .hero, .page-header, .publication-card, .cv-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        color: var(--color-text);
    }
}
