/* ===== Design Tokens ===== */
:root {
    --bg: #0a0a0b;
    --bg-elev: #131316;
    --bg-card: #1a1a1f;
    --bg-hover: #222229;
    --border: #2a2a33;
    --border-light: #33333d;
    --text: #e8e8ea;
    --text-secondary: #a0a0a8;
    --text-muted: #6b6b75;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-soft: rgba(99, 102, 241, 0.08);
    --tag-bg: rgba(99, 102, 241, 0.1);
    --tag-text: #a5b4fc;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 14px;
    --radius-sm: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f5f5f7;
    --border: #e5e5ea;
    --border-light: #d1d1d6;
    --text: #1a1a1f;
    --text-secondary: #555560;
    --text-muted: #8e8e93;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.1);
    --accent-soft: rgba(99, 102, 241, 0.05);
    --tag-bg: rgba(99, 102, 241, 0.08);
    --tag-text: #4f46e5;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

ul {
    list-style: none;
}

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

[data-theme="light"] .navbar {
    background: rgba(250, 250, 250, 0.85);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

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

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

/* ===== Sidebar ===== */
.sidebar {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 3px solid var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 8px;
}

.profile-role {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
}

.profile-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ===== Social Links ===== */
.social-links {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.social-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.social-link {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
}

.social-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.social-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elev);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid var(--border);
    pointer-events: none;
    z-index: 10;
}

/* ===== Sidebar decoration ===== */
.sidebar-decoration {
    position: relative;
    height: 80px;
    overflow: hidden;
    border-radius: var(--radius);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
}

.orb-1 {
    width: 120px;
    height: 120px;
    background: var(--accent);
    top: -30px;
    left: -20px;
    animation: float 6s ease-in-out infinite;
}

.orb-2 {
    width: 100px;
    height: 100px;
    background: #ec4899;
    top: -20px;
    right: -10px;
    animation: float 6s ease-in-out infinite 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== Content Area ===== */
.content {
    min-width: 0;
}

.section {
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease-out;
}

.section:nth-child(2) { animation-delay: 0.1s; animation-fill-mode: both; }
.section:nth-child(3) { animation-delay: 0.2s; animation-fill-mode: both; }
.section:nth-child(4) { animation-delay: 0.3s; animation-fill-mode: both; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

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

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
    transition: all var(--transition);
}

.timeline-item:hover .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), transform var(--transition);
}

.timeline-content:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.company {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.job-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.job-title {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.job-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.job-bullets {
    margin-bottom: 16px;
    padding-left: 0;
}

.job-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.job-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

/* ===== Tags ===== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition);
}

.tag:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== Education ===== */
.education-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.education-card .company {
    margin-bottom: 4px;
}

.education-card .job-period {
    display: inline-block;
    margin-top: 12px;
}

/* ===== Publications ===== */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publications-list li {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    padding-left: 44px;
}

.publications-list li a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.publications-list li:hover a {
    color: var(--accent);
}

.pub-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: color var(--transition);
}

.publications-list li:hover .pub-title {
    color: var(--accent);
}

.pub-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    transition: color var(--transition);
}

.publications-list li:hover .pub-desc {
    color: var(--text-secondary);
}

.publications-list li::before {
    content: '📄';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.7;
}

.publications-list li:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateX(4px);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 32px 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 16px;
    }

    .sidebar {
        position: static;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
    }

    .container {
        padding: 20px 12px;
    }

    .profile-card {
        padding: 24px 20px;
    }

    .social-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-dot {
        left: -24px;
    }

    .job-header {
        flex-direction: column;
        gap: 4px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .timeline-content {
        padding: 20px 16px;
    }
}

/* Print styles */
@media print {
    .navbar, .theme-toggle, .social-links, .sidebar-decoration {
        display: none;
    }

    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0;
    }

    .sidebar {
        position: static;
    }

    .timeline-content, .profile-card, .education-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
        color: black;
    }
}
