/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #a855f7;
    --secondary-color: #6366f1;
    --gradient-primary: linear-gradient(90deg, #a855f7, #6366f1);
    --bg-primary: #ffffff;
    --bg-secondary: #fdfdfd;
    --bg-tertiary: #fafafa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-accent: #1a202c;
    --text-muted: #718096;
    --link-color: #4c51bf;
    --link-hover: #5b21b6;
    --canvas-bg: linear-gradient(135deg, #ffffff 0%, #fefefe 50%, #fcfcfc 100%);
    --body-bg: linear-gradient(135deg, #ffffff 0%, #fdfdfd 50%, #fafafa 100%);
    --glass-bg: rgba(255, 255, 255, 0);
    --glass-bg-hover: rgba(99, 102, 241, 0.05);
    --glass-border: rgba(99, 102, 241, 0.06);
    --shadow-light: rgba(99, 102, 241, 0.08);
    --shadow-medium: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #262626;
    --text-primary: #f8fbff;
    --text-secondary: #d0d7e1;
    --text-accent: #f9fafb;
    --text-muted: #6b7280;
    --link-color: #a78bfa;
    --link-hover: #c4b5fd;
    --canvas-bg: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #1f1f1f 100%);
    --body-bg: linear-gradient(135deg, #1a1a1a 0%, #1f1f1f 50%, #262626 100%);
    --glass-bg: rgba(26, 26, 26, 0);
    --glass-bg-hover: rgba(99, 102, 241, 0.1);
    --glass-border: rgba(99, 102, 241, 0.2);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.2);
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px var(--shadow-light);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(10deg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
    font-size: 16px;
    letter-spacing: -0.01em;
    background: var(--body-bg);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* Header styles */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    box-shadow: 0 8px 32px var(--shadow-light);
    margin-bottom: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}

.text-content {
    flex: 1;
    text-align: left;
}

.text-content h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-accent);
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.about-text {
    margin-bottom: 2rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.contact-info {
    margin-top: 1.5rem;
}

.email {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.email a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.email a:hover {
    text-decoration: underline;
    color: var(--text-accent);
}

.social-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    color: white;
    background: var(--secondary-color);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

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

.profile-picture img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 8px var(--shadow-light);
}

/* Navigation styles */
nav {
    position: sticky;
    top: 1rem;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
    box-shadow: 0 6px 24px var(--shadow-medium);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

nav li {
    margin: 0;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--primary-color);
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
}

nav a.active {
    font-weight: bold;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    animation: slideIn 0.3s ease-out forwards;
}

/* Content sections */
main {
    opacity: 1;
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

section {
    margin-bottom: 4rem;
    position: relative;
}

/* Modern typography for headings and content */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 0.25rem;
    background: var(--gradient-primary);
    border-radius: 0.125rem;
}

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 70ch;
}

/* Links styling */
a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-color: var(--primary-color);
    text-underline-offset: 0.2em;
}

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

@keyframes slideIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

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

/* Page transition overlay */
.transition-overlay {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
    }

    .text-content {
        text-align: center;
    }

    .text-content h1 {
        font-size: 2rem;
    }

    .profile-picture img {
        width: 150px;
        height: 150px;
    }

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

    nav {
        padding: 0.5rem;
        top: 0;
        border-radius: 0 0 12px 12px; /* Flatten top corners if it touches top */
    }

    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

#dnaCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--canvas-bg);
}

/* Publications styles */
.publications-list {
    margin-top: 0.5rem;
}

.publication-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 3px solid var(--secondary-color);
    margin-bottom: 0.25rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.publication-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-medium);
}

.publication-item h3 {
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

.publication-item h3 a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.publication-item h3 a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.publication-item .authors {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
    font-weight: 400;
}

.publication-item .journal {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.publication-item .year {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.publication-item .type {
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.publication-item .type small {
    font-size: 0.75rem;
}

/* News Styles */
#news-list {
    position: relative;
    padding-left: 0;
}

#news-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 130px;
    width: 2px;
    background: var(--secondary-color);
    opacity: 0.2;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 0;
    margin-bottom: 2rem;
    background: none;
    border: none;
    position: relative;
}

.news-item:hover {
    transform: none;
    box-shadow: none;
}

.news-date {
    flex-shrink: 0;
    width: 130px;
    text-align: right;
    padding-right: 2rem;
    padding-top: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Timeline Dot */
.news-item::after {
    content: '';
    position: absolute;
    left: 130px;
    top: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--secondary-color);
    transform: translateX(-50%);
    z-index: 1;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 4px var(--body-bg); /* Ring to separate from line */
}

.news-item:hover::after {
    background: var(--secondary-color);
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 0 4px var(--body-bg), 0 0 10px var(--shadow-medium);
}

/* News Content Card */
.news-content {
    flex: 1;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.news-content p {
    margin-bottom: 0.75rem;
}

.news-content p:last-of-type {
    margin-bottom: 0.5rem;
}

.news-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

/* Add a small arrow pointing to the line */
.news-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.8rem;
    width: 10px;
    height: 10px;
    background: var(--glass-bg);
    border-left: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-50%) rotate(45deg);
}

.news-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.news-content p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.news-link {
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

@media (max-width: 650px) {
    #news-list::before {
        left: 16px;
    }
    
    .news-item {
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 3rem;
    }
    
    .news-date {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-top: 0;
        font-size: 0.8rem;
    }
    
    .news-item::after {
        left: 16px;
        top: 0.4rem;
    }

    .news-content::before {
        display: none; /* Hide arrow on mobile */
    }
}

/* Show More Button */
.news-actions {
    margin-left: 130px; /* Align with content */
    padding-top: 0.5rem;
}

.show-more-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--link-color);
    border-color: var(--link-color);
    transform: translateY(-1px);
}

@media (max-width: 650px) {
    .news-actions {
        margin-left: 3rem;
    }
}