:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --accent: #3182ce;
    --accent-hover: #2c5aa0;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-muted: #a0aec0;
        --accent: #63b3ed;
        --accent-hover: #90cdf4;
        --border: #4a5568;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 3rem 2rem;
    }
}

header {
    margin-bottom: 3rem;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: 1fr 300px;
        gap: 3rem;
    }
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.hero-content .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.bio {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.contact-link:hover,
.contact-link:focus {
    color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    outline: none;
}

.hero-images {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.image-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.personal-photo {
    height: 250px;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem;
    font-size: 0.9rem;
}

main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    main {
        grid-template-columns: 2fr 1fr;
        gap: 4rem;
    }
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.publications {
    display: grid;
    gap: 2rem;
}

.publication {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.publication h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.publication h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.publication h3 a:hover,
.publication h3 a:focus {
    color: var(--accent);
    text-decoration: underline;
}

.publication-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    flex: 1;
}

.publication-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.conference-logo {
    height: 3rem;
    width: 4rem;
    object-fit: contain;
    object-position: right;
    flex-shrink: 0;
}

.publication-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.blog-posts {
    display: grid;
    gap: 1rem;
}

.blog-post {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.blog-post:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.blog-post h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.blog-post h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.blog-post h3 a:hover,
.blog-post h3 a:focus {
    color: var(--accent);
}

.blog-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.publication-links {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.publication-links a {
    color: var(--accent);
    text-decoration: none;
}

.publication-links a:hover,
.publication-links a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
}

.publication-links .separator {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.contact-link.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 500;
}

.contact-link.primary:hover,
.contact-link.primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}

@media (max-width: 767px) {
    .publication-meta-row:has(img[style*="width: auto"]) {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .hero-images,
    .contact-links {
        display: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted black;
    /* Add dots under the hoverable text */
    cursor: pointer;
}

/* Tooltip text */
.tooltiptext {
    visibility: hidden;
    /* Hidden by default */
    width: 130px;
    background-color: black;
    color: #ffffff;
    text-align: center;
    padding: 5px 0;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    /* Ensure tooltip is displayed above content */
}

/* Show the tooltip text on hover */
.tooltip:hover .tooltiptext {
    visibility: visible;
}
