/* Site-wide styles: fixed profile sidebar on the left, content column on the right. */

:root {
    --bg: #ffffff;
    --text: #4a4a4a;
    --strong: #1f1f1f;
    --muted: #7a7a7a;
    --heading: #043361;
    --link: #2f7fb8;
    --link-hover: #0b4f80;
    --venue: #a64d2a;
    --rule: #e5e5e5;
    --card: #ffffff;
    --panel: #f6f7f9;
    --shadow: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1d1f27;
        --text: #d3d5db;
        --strong: #f0f1f3;
        --muted: #9a9ca6;
        --heading: #6cc4f2;
        --link: #6cc4f2;
        --link-hover: #a8dcf7;
        --venue: #e39a74;
        --rule: #343743;
        --card: #262935;
        --panel: #262935;
        --shadow: rgba(0, 0, 0, 0.4);
    }
}

:root[data-theme="dark"] {
    --bg: #1d1f27;
    --text: #d3d5db;
    --strong: #f0f1f3;
    --muted: #9a9ca6;
    --heading: #6cc4f2;
    --link: #6cc4f2;
    --link-hover: #a8dcf7;
    --venue: #e39a74;
    --rule: #343743;
    --card: #262935;
    --panel: #262935;
    --shadow: rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.55 "Crimson Pro", Georgia, serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
strong, b { color: var(--strong); font-weight: 600; }
img { max-width: 100%; }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.15; }
h1 { font-size: 30px; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 26px; font-weight: 500; margin: 0 0 14px; }
h3 { font-size: 20px; font-weight: 600; margin: 28px 0 14px; }
p, ul, ol { margin: 0 0 18px; }

/* ---------- Layout ---------- */

.wrapper {
    width: 1340px;
    margin: 0 auto;
    padding: 0 16px;
}

.sidebar {
    position: fixed;
    width: 240px;
    padding-top: 56px;
    text-align: center;
}

.content {
    width: 1020px;
    margin-left: 300px;
    padding: 56px 0 60px;
}

.content > section { margin-bottom: 40px; }

/* ---------- Sidebar ---------- */

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    margin-bottom: 16px;
}

.sidebar .position { font-size: 18px; }
.sidebar .affiliation { color: var(--text); }
.sidebar .email { font-family: "Ubuntu Mono", monospace; font-size: 14px; }

.social-icons { margin: 16px 0 20px; }
.social-icons a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 2px;
    border-radius: 50%;
    color: var(--heading);
    font-size: 20px;
    transition: transform 0.15s ease, background 0.15s ease;
}
.social-icons a:hover { background: var(--panel); transform: scale(1.15); text-decoration: none; }

.nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    width: 240px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--panel);
    overflow: hidden;
}
.nav li { flex: 1; border-right: 1px solid var(--rule); }
.nav li:last-child { border-right: none; }
.nav a {
    display: block;
    padding: 8px 0;
    font-size: 15px;
    color: var(--muted);
}
.nav a:hover, .nav a.active { color: var(--strong); background: var(--bg); text-decoration: none; }

/* ---------- Home sections ---------- */

.interests li { margin-bottom: 4px; }

.news {
    list-style: none;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}
.news li { margin-bottom: 6px; }
.news .date {
    display: inline-block;
    min-width: 76px;
    font-weight: 600;
    color: var(--strong);
}

/* ---------- Publications ---------- */

.pub-group { margin-top: 44px; }
.pub-group:first-of-type { margin-top: 20px; }

/* Research-direction heading: accent bar + divider so each group starts clearly. */
.pub-group h3 {
    font-size: 23px;
    font-weight: 700;
    margin: 0 0 22px;
    padding: 2px 0 8px 14px;
    border-left: 5px solid var(--heading);
    border-bottom: 1px solid var(--rule);
}

.pub {
    display: flex;
    gap: 22px;
    align-items: center;
    margin-bottom: 26px;
}

.teaser {
    flex: 0 0 540px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 2px 2px 7px var(--shadow);
    position: relative;
}
.teaser img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.teaser .placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #0b3a66, #2f7fb8);
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.2;
}
.teaser .placeholder small { font-weight: 400; font-size: 13px; opacity: 0.85; margin-top: 6px; }
.teaser.missing .placeholder { display: flex; }

.pub-body { flex: 1; min-width: 0; }
.pub-title { font-weight: 600; font-size: 17.5px; line-height: 1.3; }
.pub-title a { color: var(--strong); }
.pub-title a:hover { color: var(--link); }
.pub-authors { margin-top: 3px; }
.pub-authors .me { color: var(--strong); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pub-venue { color: var(--venue); font-style: italic; }
.pub-venue strong { color: inherit; }
.pub-venue.preprint { color: var(--muted); }
.pub-links { margin-top: 4px; font-size: 15px; }
.pub-links a {
    display: inline-block;
    padding: 0 8px;
    margin: 3px 4px 0 0;
    border: 1px solid var(--muted);
    border-radius: 3px;
    color: var(--text);
}
.pub-links a:hover { border-color: var(--link); color: var(--link); text-decoration: none; }

.visitors { text-align: center; margin-top: 30px; }

.footer-note { color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- CV timeline ---------- */

.timeline {
    position: relative;
    padding: 8px 0;
}
.timeline:before {
    content: '';
    position: absolute;
    left: 99px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rule);
}

.tl-block {
    position: relative;
    margin-bottom: 26px;
    min-height: 80px;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.5s ease-in-out;
}
.tl-block.in-view { opacity: 1; transform: none; }

.tl-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
}
.tl-logo img {
    display: block;
    width: 100%;
    height: auto;
    padding: 4px;
    border-radius: 8px;
    background: #ffffff; /* keeps dark logo lettering readable in dark mode */
}

.tl-dot {
    position: absolute;
    left: 90px;
    top: 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--rule);
    z-index: 1;
}

.tl-content {
    margin-left: 130px;
    padding: 16px 20px;
    border-radius: 6px;
    background: var(--card);
    box-shadow: 0 2px 6px var(--shadow);
}
.tl-content h3 { margin: 0 0 4px; font-size: 19px; color: var(--strong); }
.tl-content .meta { display: block; color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.tl-content p, .tl-content ul { margin: 0; }

.tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 0 7px;
    border-radius: 3px;
    margin-right: 6px;
    color: #ffffff;
    vertical-align: 2px;
}
.tag.talk { background: #a64d2a; }
.tag.poster { background: #2f7fb8; }

/* ---------- Narrow screens ---------- */

@media (max-width: 1380px) {
    .wrapper { width: auto; }
    .sidebar { position: static; width: auto; padding-top: 32px; }
    .content { width: auto; margin-left: 0; padding-top: 24px; border-top: 1px solid var(--rule); margin-top: 20px; }
}

@media (max-width: 960px) {
    .pub { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 34px; }
    .teaser { flex-basis: auto; width: 100%; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .pub-links a { padding: 3px 10px; }
    .timeline:before, .tl-dot { display: none; }
    .tl-logo { position: static; transform: none; width: 64px; margin-bottom: 8px; }
    .tl-content { margin-left: 0; }
}
