:root {
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --link-color: #0066cc;

    --background: #ffffff;
    --background-secondary: #f5f5f5;
    --divider: #cccccc;

    --font-family-sans: -apple-system, system-ui, Helvetica, Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, monospace;

    /* Grid with 16px baseline */
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem;  /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem;    /* 16px */
    --space-5: 1.5rem;  /* 24px */
    --space-6: 2rem;    /* 32px */
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #eaeaea;
        --text-secondary: #bbbbbb;
        --link-color: #62aaff;

        --background: #1e1e1e;
        --background-secondary: #2a2a2a;
        --divider: #444444;
    }
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    display: flex;
    flex-direction: column;
    font-family: var(--font-family-sans) ;
    font-size: 1rem;
    line-height: 1.5; /* 24px */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color: var(--text-primary);
    background-color: var(--background-secondary);
}

html, body {
    height: 100%;
}

.content {
    background-color: var(--background);
    flex: 1;
}

main {
    max-width: 768px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
}

header, footer {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    padding: var(--space-2) var(--space-5);
    background-color: var(--background-secondary);
}

header {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

footer {
    font-size: 0.875rem;
}

p {
    margin-bottom: 1em;
}

#contact address {
    margin-bottom: 1em;
}

ul, ol {
    list-style-position: outside;
    padding-left: var(--space-5);
    margin-bottom: 1em;
}

ul ul, ol ol {
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
}

/* links */

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

a:hover {
    background-color: var(--background-secondary);
}

.link-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: left;
    column-gap: var(--space-4);
}

.link-group a {
    position: relative;
}

.link-group a:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0.8em;
    margin: 0 var(--space-2);
    pointer-events: none;
    background-color: var(--divider);
}

/* profile section */

#profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: var(--space-6);
}

/* avatar and name */
.profile-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: var(--space-5);
    text-align: left;
}

.avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--divider);
}

.profile-title h1 {
    font-size: 1.75rem;
    font-weight: 400;
    margin: var(--space-2) 0;
}

.profile-title p {
    font-size: 1rem;
    margin: var(--space-1) 0;
}

.profile-links {
    justify-content: center;
}

.profile-statement {
    text-align: justify;
    max-width: 640px;
}

/* news */

.news-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--space-4);
    margin-bottom: var(--space-4)
}

/* publications */

.pub-grouptitle {
    font-size: 1.25rem;
    font-weight: 400;
    border-bottom: 1px solid var(--divider);
}

.publication {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.pub-teaser {
    width: 112px;
    flex-shrink: 0;
}

.pub-teaser img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.pub-info {
    flex: 1;
}

.pub-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
}

.pub-title a,
.pub-authors a,
.teaching-course a {
    color: var(--text-primary);
}

.pub-venue {
    font-style: italic;
}

/* teaching */

.teaching-course {
    font-weight: bold;
}

.teaching-year {
    font-style: italic;
}
