/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f6f3;
    --bg-card: #f1f1ef;
    --bg-callout: #fbf8f3;
    --text-primary: #37352f;
    --text-secondary: #6b6b6b;
    --text-muted: #9b9b9b;
    --accent: #2f81f7;
    --accent-hover: #1a73e8;
    --border: #e8e8e8;
    --divider: #e8e8e8;
    --shadow: rgba(0, 0, 0, 0.04);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    --tag-bg: #e8f4fd;
    --tag-text: #0969da;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --timeline-line: #e8e8e8;
    --timeline-dot: #37352f;
}

.dark-mode {
    --bg-primary: #191919;
    --bg-secondary: #202020;
    --bg-card: #2f2f2f;
    --bg-callout: #252525;
    --text-primary: #ebebeb;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --border: #3d3d3d;
    --divider: #3d3d3d;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --tag-bg: #1f3a5f;
    --tag-text: #58a6ff;
    --timeline-line: #3d3d3d;
    --timeline-dot: #ebebeb;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    box-shadow: 0 2px 12px var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--shadow-hover);
}

.dark-mode .sun-icon {
    display: inline;
}

.dark-mode .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: inline;
}

/* ===== Container ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* ===== Hero Section ===== */
.hero {
    margin-bottom: 48px;
}

.hero-content {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.vision-callout {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-callout);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.callout-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.callout-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vision-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.profile-image {
    flex-shrink: 0;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.3);
}

/* ===== Section Styles ===== */
.section {
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Divider ===== */
.divider {
    border: none;
    height: 1px;
    background: var(--divider);
    margin: 32px 0;
}

/* ===== Timeline (Education) ===== */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--timeline-line);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--timeline-dot);
    z-index: 1;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.timeline-content .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Tags (Research Interests) ===== */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.tag:hover {
    transform: translateY(-2px);
}

/* ===== Publication Card ===== */
.publication-card {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.publication-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

.pub-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pub-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.pub-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.pub-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.pub-link:hover {
    color: var(--accent-hover);
}

/* ===== Experience Cards ===== */
.experience-grid {
    display: grid;
    gap: 16px;
}

.experience-card {
    padding: 24px;
    background: var(--bg-card);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.experience-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.exp-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.exp-role {
    padding: 4px 12px;
    border-radius: 16px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.8rem;
    font-weight: 500;
}

.experience-card .date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.experience-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ===== Project Cards ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.project-card {
    display: block;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
    background: var(--bg-callout);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.project-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.project-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Awards Grid ===== */
.awards-grid {
    display: grid;
    gap: 16px;
}

.award-item {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.award-item:hover {
    transform: translateX(4px);
}

.award-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.award-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.award-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Links Section ===== */
.links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.link-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-hover);
}

.link-icon {
    font-size: 1.2rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--divider);
    margin-top: 48px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 40px 16px;
    }

    .hero-content {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .vision-callout {
        flex-direction: column;
        text-align: center;
    }

    .callout-content h1 {
        font-size: 1.6rem;
    }

    .avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }

    .tabs {
        width: 100%;
        justify-content: center;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

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

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

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
}

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

    .links-container {
        flex-direction: column;
    }

    .link-btn {
        justify-content: center;
    }
}