/* ------------------------------
   General settings
------------------------------ */

:root {
    --text-color: #252525;
    --muted-color: #666666;
    --accent-color: #7c2d2d;
    --paper-title-color: #2f5f8f;
    --soft-accent-color: #eef4f8;
    --warm-accent-color: #f7f1ee;
    --border-color: #d9e0e4;
    --background-color: #fbfaf7;
    --content-background: #fffefa;
    --maximum-width: 850px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background-color);
    color: var(--text-color);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Helvetica,
        Arial,
        sans-serif;
    font-size: 17px;
    line-height: 1.65;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}


/* ------------------------------
   Header and navigation
------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(251, 250, 247, 0.94);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.header-content {
    max-width: var(--maximum-width);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.navigation a {
    color: var(--text-color);
    font-size: 0.98rem;
}

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

.sidebar-social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sidebar-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
}

.sidebar-social-links a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
}

.sidebar-social-links svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}


/* ------------------------------
   Main content
------------------------------ */

.main-content {
    max-width: var(--maximum-width);
    margin: 0 auto;
    padding: 70px 24px 40px;
    background: var(--content-background);
}

section {
    margin-bottom: 75px;
    scroll-margin-top: 110px;
}

.intro-section {
    padding-top: 10px;
    display: grid;
    grid-template-columns: minmax(220px, 30%) 1fr;
    align-items: stretch;
    gap: 32px;
}

.profile-picture {
    width: 100%;
    height: 100%;
    min-height: 260px;
    border-radius: 8px;
    border: 3px solid var(--content-background);
    box-shadow: 0 0 0 1px var(--border-color);
    object-fit: cover;
    object-position: center 44%;
}

.intro-copy {
    padding-left: 18px;
    border-left: 3px solid var(--warm-accent-color);
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
}

h1 {
    margin: 0 0 22px;
    font-size: 2.7rem;
    letter-spacing: -0.03em;
}

h2 {
    margin: 0 0 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: #24394a;
    font-size: 1.9rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

h3 {
    margin-top: 40px;
    margin-bottom: 18px;
    font-size: 1.2rem;
}

#research h3 {
    color: var(--muted-color);
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h4 {
    margin: 0 0 8px;
    font-size: 1.08rem;
    color: var(--paper-title-color);
    font-weight: 500;
}

h4 a {
    color: inherit;
}

p {
    margin-top: 0;
    margin-bottom: 16px;
}

.intro-text {
    max-width: 760px;
}

.research-item {
    margin-bottom: 35px;
    padding: 10px 0 6px 18px;
    border-left: 3px solid rgba(47, 95, 143, 0.18);
    background:
        linear-gradient(
            90deg,
            var(--soft-accent-color),
            rgba(238, 244, 248, 0)
        );
}

.coauthors,
.teaching-details,
.publication {
    margin-bottom: 6px;
    color: var(--muted-color);
}

.coauthors,
.teaching-details {
    font-size: 0.93rem;
}

.coauthors a {
    color: inherit;
}

.featured-in {
    color: var(--muted-color);
    font-size: 0.9rem;
    margin-top: -2px;
}

.featured-in a {
    color: var(--paper-title-color);
}

.publication {
    font-style: italic;
    color: var(--text-color);
    font-weight: 500;
}

.research-links,
.external-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.research-links a,
.external-links a {
    font-weight: 550;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-color);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.abstract-text {
    margin: 4px 0 4px;
    color: var(--muted-color);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition:
        max-height 320ms ease,
        opacity 240ms ease,
        transform 240ms ease;
}

.abstract-text.is-visible {
    max-height: 640px;
    opacity: 1;
    transform: translateY(0);
}

.education-item,
.teaching-item {
    margin-bottom: 25px;
}

.education-item h3,
.teaching-item h3 {
    margin-bottom: 5px;
    font-size: 1.08rem;
    font-weight: 400;
}


/* ------------------------------
   Footer
------------------------------ */

footer {
    max-width: var(--maximum-width);
    margin: 0 auto;
    padding: 30px 24px 50px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 0.9rem;
    background: var(--content-background);
}


/* ------------------------------
   Mobile layout
------------------------------ */

@media (max-width: 700px) {

    body {
        font-size: 16px;
    }

    .header-content {
        align-items: center;
        flex-direction: column;
        padding: 14px 24px;
        gap: 10px;
    }

    .navigation {
        gap: 15px;
    }

    .intro-section {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .profile-picture {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }

    .intro-copy {
        padding-left: 14px;
    }

    .main-content {
        padding-top: 45px;
    }

    h1 {
        font-size: 2.15rem;
    }

    .intro-text {
        font-size: 1.1rem;
    }

    section {
        scroll-margin-top: 35px;
    }

    .abstract-text.is-visible {
        max-height: none;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {

    .abstract-text {
        transition: none;
    }
}
