/*
 * Modern, clean style inspired by roberttlange.com
 * Monospace body + serif headings on a warm cream background.
 */

* {
    box-sizing: border-box;
}

:root {
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-serif: 'Times New Roman', Times, serif;
    --bg: #F5F4EF;
    --fg: #000000;
    --muted: #666666;
    --faint: #888888;
    --line: #dddddd;
    --line-soft: #eeeeee;
}

body {
    font-family: var(--font-mono);
    margin: 0 auto;
    padding: 20px;
    max-width: 800px;
    background-color: var(--bg);
    color: var(--fg);
}

/* ---------- Header ---------- */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

header h1 {
    font-family: var(--font-serif);
    font-size: 1.9em;
    font-weight: normal;
    margin: 0;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    column-gap: 20px;
    row-gap: 4px;
}

nav a {
    font-family: var(--font-serif);
    text-decoration: none;
    color: var(--fg);
    font-size: 0.8em;
    padding-bottom: 5px;
}

nav a.active,
nav a:hover {
    border-bottom: 2px solid var(--fg);
}

/* ---------- Section headings ---------- */

h2 {
    font-family: var(--font-serif);
    font-size: 1.76em;
    font-weight: normal;
    margin: 40px 0 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

h2 sup a {
    font-family: var(--font-mono);
    font-size: 0.4em;
    color: var(--fg);
    text-decoration: underline;
}

h2 sup a:hover {
    text-decoration: none;
}

/* ---------- Intro ---------- */

.intro {
    padding: 20px 0 10px;
    font-size: 0.88em;
    line-height: 1.6;
    overflow: auto; /* clearfix for floated image */
}

.intro::after {
    content: "";
    clear: both;
    display: table;
}

.intro-image {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    object-fit: cover;
    float: right;
    margin-left: 25px;
    margin-top: 6px;
}

.intro-text p {
    margin: 0 0 0.8em;
    overflow-wrap: break-word;
}

.intro-location {
    color: var(--muted);
    font-size: 0.92em;
}

.intro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    align-items: center;
}

.intro-links a {
    color: var(--fg);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: inline-flex;
}

.intro-links a:hover {
    opacity: 1;
}

/* ---------- Experience ---------- */

.exp-item {
    padding: 15px 0 12px;
    border-bottom: 1px solid var(--line-soft);
}

.exp-item:last-child {
    border-bottom: none;
}

.exp-date {
    font-size: 0.72em;
    color: var(--faint);
}

.exp-item h3 {
    font-size: 0.96em;
    margin: 4px 0 5px;
    font-weight: bold;
}

.exp-item p {
    font-size: 0.8em;
    line-height: 1.5;
    margin: 0.4em 0 0;
    color: var(--muted);
}

/* ---------- Timeline (News, Selected posts) ---------- */

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: #cccccc;
}

.timeline li {
    position: relative;
    padding: 12px 10px 14px 30px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.84em;
    line-height: 1.5;
}

.timeline li:last-child {
    border-bottom: none;
}

.timeline li::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--fg);
    border: 3px solid var(--bg);
}

.timeline .entry-date {
    display: block;
    font-size: 0.85em;
    color: var(--faint);
    margin-bottom: 3px;
}

.timeline .entry-date.right {
    text-align: right;
    margin: 6px 0 0;
}

.timeline li h3 {
    font-family: var(--font-mono);
    font-size: 1.14em;
    font-weight: bold;
    margin: 0 0 4px;
}

.timeline li p {
    margin: 0;
}

.timeline li p.muted {
    color: var(--muted);
}

/* Hidden news entries, revealed by the [all] toggle */
#news .timeline li.extra {
    display: none;
}

#news .timeline li.extra.shown {
    display: list-item;
}

.view-toggle {
    padding: 0;
    border: none;
    background: none;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 0.4em;
    cursor: pointer;
    text-decoration: underline;
}

.view-toggle:hover {
    text-decoration: none;
}

/* ---------- Subpages (Publications, Research Code) ---------- */

h3 {
    font-family: var(--font-serif);
    font-size: 1.25em;
    font-weight: normal;
    margin: 30px 0 12px;
}

.page-note {
    font-size: 0.8em;
    color: var(--muted);
    margin: -10px 0 20px;
}

.pub-item,
.code-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.84em;
    line-height: 1.6;
}

.pub-item:last-child,
.code-item:last-child {
    border-bottom: none;
}

.pub-item p {
    margin: 0;
}

.pub-item i {
    color: var(--muted);
}

/* ---------- Links ---------- */

main a {
    color: var(--fg);
    text-decoration: underline;
}

main a:hover {
    text-decoration: none;
}

.intro-links a,
.intro-links a:hover {
    text-decoration: none;
}

/* ---------- Map ---------- */

#map {
    height: 420px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.map-caption {
    text-align: right;
    font-size: 0.68em;
    color: #999999;
    margin: 6px 0 0;
}

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

footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--line);
    font-size: 0.72em;
    color: #555555;
}

footer a {
    color: #555555;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    header h1 {
        font-size: 1.6em;
    }

    header nav {
        column-gap: 14px;
        justify-content: flex-start;
    }

    .intro-image {
        width: 110px;
        height: 110px;
        margin-left: 18px;
    }
}
