/* ========================================
   Eric Minwei Liu - Clean Single-Column
   ======================================== */

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

:root {
    --primary: #2e7d68;
    --primary-light: #e8f5f0;
    --accent: #f59e0b;
    --text: #111827;
    --text-secondary: #6b7280;
    --bg: #F4F3EE;
    --bg-gray: #f5faf8;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 780px;
}

/* ===== DARK MODE ===== */
body.dark {
    --primary: #4ecca3;
    --primary-light: #1a3a30;
    --accent: #fbbf24;
    --text: #e5e7eb;
    --text-secondary: #9ca3af;
    --bg: #111827;
    --bg-gray: #1f2937;
    --border: #374151;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
}

body.dark .nav {
    background: rgba(17,24,39,0.92);
}

body.dark a:hover { color: #3db890; }
body.dark .nav-logo:hover { color: var(--primary); }
body.dark .btn { color: #111827; }
body.dark .btn:hover { background: #3db890; color: #111827; }
body.dark .hero-icon { color: #111827; }
body.dark .hero-icon:hover { background: #3db890; color: #111827; }
body.dark .footer-social a:hover { color: #111827; }
body.dark .pub-badge { color: #111827; }
body.dark .exp-card { border-color: var(--border); }
body.dark .pub { border-color: var(--border); }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: #1b5e4b; }
img { max-width: 100%; display: block; }
strong { font-weight: 600; }

/* ===== CONTAINER ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== NAV ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 1.5rem;
}

.nav-logo {
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.nav-logo:hover { color: var(--primary); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-links a {
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-gray);
}

/* Push nav-right to far end */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.25s;
}

/* ===== HERO ===== */
.hero {
    padding: 5rem 0 4rem;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-family: var(--font);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text > p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.75rem;
    max-width: 480px;
}

.hero-text > p strong {
    color: var(--text);
}

#about-content {
    margin-bottom: 1rem;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    letter-spacing: 0.01em;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.15rem;
    transition: all 0.2s;
}

.hero-icon:hover {
    background: #1b5e4b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #1b5e4b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.hero-photo {
    flex-shrink: 0;
}

.hero-photo img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ===== SECTIONS ===== */
.section {
    padding: 4rem 0;
}

.section--gray {
    background: var(--bg-gray);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.section-header h2 {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary);
    margin-top: 0.5rem;
    border-radius: 2px;
}

.section-link {
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.section-link i { font-size: 0.75rem; }

/* ===== EDUCATION GRID ===== */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.edu-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.edu-icon {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.edu-card h3 {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.edu-card p {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.edu-card span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ===== EXPERIENCE ===== */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exp-card {
    display: flex;
    gap: 2rem;
    background: var(--bg);
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.exp-card:hover {
    box-shadow: var(--shadow-md);
}

.exp-left {
    flex-shrink: 0;
    width: 220px;
}

.exp-badge {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.exp-badge--current {
    background: #d1fae5;
    color: #065f46;
}

.exp-left h3 {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.exp-org {
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.exp-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.exp-right {
    flex: 1;
}

.exp-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.exp-right > p:last-child {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ===== PUBLICATIONS ===== */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pub {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid #d1d5db;
    position: relative;
    transition: box-shadow 0.2s;
}

.pub:hover {
    box-shadow: var(--shadow-md);
}

.pub--hl {
    border-left: 3px solid var(--accent);
}

.pub-num {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 1.6rem;
    text-align: right;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.pub-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.4rem;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pub-body { flex: 1; min-width: 0; }

.pub-body p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.pub-body strong { color: var(--text); }

.pub-body a {
    color: var(--primary);
    font-weight: 500;
}

.pub-body a:hover { text-decoration: underline; }

.pub-body em {
    color: var(--text);
    font-weight: 600;
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== EXPERIENCE DESCRIPTION LIST ===== */
.exp-desc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exp-desc-list li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

.exp-desc-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ===== FOOTER ===== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
}

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem 1.5rem 1rem;
    }

    .nav-links.active { display: flex; }

    .hero { padding: 3rem 0 2.5rem; }

    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-text h1 { font-size: 1.85rem; }
    .hero-text > p { max-width: none; }

    #about-content p { text-align: center; }
    .hero-tags { justify-content: center; }
    .hero-actions { justify-content: center; }

    .hero-photo img {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }

    .edu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exp-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .exp-left { width: auto; }

    .pub {
        flex-direction: column;
        gap: 0.25rem;
    }

    .pub-num {
        text-align: left;
        min-width: auto;
        font-size: 0.85rem;
    }

    .pub-badge {
        margin-left: 0.3rem;
    }
}

@media (max-width: 480px) {
    .edu-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 { font-size: 1.6rem; }
}
