:root {
    --primary-color: #2e3440;
    --secondary-color: #4c566a;
    --accent-color: #5e81ac;
    --text-color: #3b4252;
    --bg-color: #ffffff;
    --light-bg: #f8f9fa;
    --border-color: #e5e9f0;
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #eceff4;
    --secondary-color: #d8dee9;
    --accent-color: #88c0d0;
    --text-color: #e5e9f0;
    --bg-color: #2e3440;
    --light-bg: #3b4252;
    --border-color: #4c566a;
    --card-bg: #3b4252;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2rem;
    position: relative;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 3px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.contact-info a {
    color: var(--accent-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

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

.lang-switch {
    text-align: right;
    margin-bottom: 1rem;
}

.lang-switch a {
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--secondary-color);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.lang-switch a.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

section {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-bg);
}

.section-header {
    background-color: var(--light-bg);
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    gap: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
    border-left: none;
    padding-left: 0;
}

.section-header i {
    transition: transform 0.3s;
    color: var(--accent-color);
}

.section-content {
    padding: 1.5rem;
    display: none;
}

section.active .section-content {
    display: block;
}

section.active .section-header i {
    transform: rotate(180deg);
}

h2 {
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.entry {
    margin-bottom: 1.5rem;
}

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

.entry-title {
    font-weight: 700;
    color: var(--primary-color);
}

.entry-location {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.entry-details {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.3rem;
}

.publications ol {
    margin-left: 1.5rem;
}

.publications li {
    margin-bottom: 1rem;
}

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

.skill-category strong {
    display: block;
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--secondary-color);
}

@media (max-width: 768px) {
    body {
        padding: 1.5rem 1rem;
    }

    header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    nav {
        gap: 0.8rem;
        flex-wrap: wrap;
        margin-bottom: 1.5rem;
        justify-content: center;
    }

    nav a {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
        background-color: var(--light-bg);
        border-radius: 4px;
        border: 1px solid var(--border-color);
        transition: all 0.2s;
    }

    nav a:active {
        background-color: var(--accent-color);
        color: white;
    }

    .lang-switch {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .lang-switch a {
        padding: 0.3rem 0.8rem;
    }

    .contact-info {
        gap: 0.8rem;
        width: 100%;
        justify-content: center;
    }

    .section-header {
        padding: 0.8rem 1.2rem;
    }

    .section-content {
        padding: 1.2rem;
    }

    .entry-header {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;
    }

    header h1 {
        font-size: 1.6rem;
        word-wrap: break-word;
    }

    .profile-photo {
        width: 110px;
        height: 110px;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    nav {
        gap: 0.5rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    nav a {
        font-size: 0.8rem;
        padding: 0.5rem 0.2rem;
        text-align: center;
    }

    .entry-location {
        font-size: 0.85rem;
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        top: 0;
        right: 0;
    }
    
    .lang-switch {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .lang-switch a {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}
