/* Variables */
:root {
    /* Solarized Light Palette */
    --bg-color: #fdf6e3;       /* Base3 */
    --text-color: #586e75;     /* Base01 (Darker) */
    --accent-color: #268bd2;   /* Blue */
    --secondary-text: #657b83; /* Base00 (Darker) */
    --card-bg: #eee8d5;        /* Base2 */
    --border-color: #eee8d5;   /* Base2 */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 800px;
    --spacing-unit: 1rem;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    font-size: 18px; /* Increased base font size */
}

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

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

.container {
    max-width: 1200px; /* Increased max-width for two columns */
    margin: 0 auto;
    padding: 2rem;
}

.layout-wrapper {
    display: grid;
    grid-template-columns: 400px 1fr; /* Increased sidebar width to 400px */
    gap: 4rem;
    align-items: start;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 2rem;
}

.profile-pic-container {
    margin-bottom: 1.5rem;
    text-align: center;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.profile-pic:hover {
    border-color: var(--accent-color);
}

.profile-email {
    display: block;
    margin-top: 1rem;
    color: var(--secondary-text);
    font-size: 1.5rem;
    text-align: center;
    transition: color 0.2s ease;
}

.profile-email:hover {
    color: var(--accent-color);
}

.profile-info {
    text-align: left;
}

.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem; /* Reduced bottom margin */
}

.affiliation {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.long-bio {
    margin-top: 1rem;
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.long-bio p {
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    color: var(--secondary-text);
    background: var(--card-bg);
    border-radius: 50%;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.social-link span {
    display: none; /* Hide text, show only icons for cleaner sidebar */
}

.social-link:hover {
    border-color: var(--accent-color);
    color: var(--text-color);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    min-width: 0; /* Prevent grid blowout */
}

/* Experience Timeline */
.timeline {
    position: relative;
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-marker {
    position: absolute;
    left: -6px;
    top: 6px; /* Adjusted for summary alignment */
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--bg-color);
    z-index: 1;
}

details > summary {
    list-style: none;
    cursor: pointer;
    outline: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

.job-summary {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.job-summary:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed from baseline to center for icon alignment */
    flex-wrap: wrap;
}

.job-toggle-icon {
    color: var(--secondary-text);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

details[open] > .job-summary .job-toggle-icon {
    transform: rotate(180deg);
}

.job-location {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-top: 0.25rem;
}

.job-location i {
    margin-right: 0.5rem;
}

.company {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.2rem; /* Increased font size */
}
.role {
    color: var(--accent-color);
    font-weight: 500;
    margin-left: 0.5rem; /* Added separation */
}
.date { font-size: 0.85rem; color: var(--secondary-text); font-family: monospace; }

.job-details {
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.job-details ul {
    list-style-type: none;
    padding-left: 0;
}

.job-details li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--secondary-text);
}

.project-name {
    color: var(--text-color);
    font-weight: 600;
}

.job-details li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Publications */
#publications h2 {
    margin-bottom: 1.5rem;
}

.publication-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease;
}

.publication-item:hover {
    border-color: var(--accent-color);
}

.pub-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: block;
}

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

.pub-venue {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-family: monospace;
}

/* Footer */
footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

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

/* Responsive */
/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 {
    font-size: 1.5rem;
    margin: 0; /* Reset margin for summary usage */
    display: inline-block;
}
h3 { font-size: 1.1rem; }

.section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    list-style: none;
}

.section-summary::-webkit-details-marker {
    display: none;
}

.section-summary:hover h2 {
    color: var(--accent-color);
}

.toggle-icon {
    color: var(--secondary-text);
    transition: transform 0.3s ease;
}

details[open] > .section-summary .toggle-icon {
    transform: rotate(180deg);
}

p { margin-bottom: 1rem; color: var(--secondary-text); }

/* Responsive */
@media (max-width: 900px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar {
        position: static;
        text-align: center;
        padding-right: 0;
    }

    .profile-info {
        text-align: center;
    }

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

    .profile-pic {
        width: 150px;
        height: 150px;
    }

    .job-header {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
}
