/* Colours and font. Change the palette here. */
:root {
  --bg: #FFFFFF;      /* page background */
  --text: #2B2F31;    /* body text */
  --muted: #6B7A7D;   /* secondary text */
  --tab: #ECECEA;     /* light grey tabs and pills */
  --sage: #839DA0;    /* brand: sage */
  --mist: #B7C9CC;    /* brand: mist */
  --rose: #E7C9C9;    /* brand: rose */
  --link: #5A7579;    /* darkened sage so link text stays readable */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
main { max-width: 940px; margin: 0 auto; padding: 24px 16px 48px; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--mist); text-underline-offset: 3px; }
a:hover { color: var(--sage); text-decoration-color: var(--rose); }
h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 48px 0 16px; padding-bottom: 6px; border-bottom: 2px solid var(--mist); }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 12px 0 4px; }
p { margin: 0 0 1em; }
section, article.cv, article.page { scroll-margin-top: 72px; }

/* Header with tabs */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--tab); }
.site-header .inner { max-width: 940px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a {
  color: var(--text); text-decoration: none; font-size: 0.95rem; white-space: nowrap;
  padding: 2px 0; border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--link); border-bottom-color: var(--rose); }
nav a.current { border-bottom-color: var(--mist); }
.links a, .pub-links a {
  background: var(--tab); color: var(--text); text-decoration: none;
  padding: 3px 12px; border-radius: 999px; font-size: 0.9rem; white-space: nowrap;
}
.links a:hover, .pub-links a:hover { background: var(--rose); color: var(--text); }

/* Bio */
.about { display: flex; gap: 32px; align-items: flex-start; margin-top: 16px; }
.about-text { flex: 1; min-width: 0; }
.portrait { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 4px solid var(--mist); }
.affiliation { color: var(--muted); margin: 0 0 10px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }

/* News and talks */
ul.news, ul.talks { list-style: none; padding: 0; margin: 0; }
ul.news li, ul.talks li { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 12px; }
ul.news .date, ul.talks .date {
  flex: 0 0 auto; min-width: 88px; margin-top: 3px;
  background: var(--tab); border-radius: 999px; padding: 2px 10px;
  font-size: 0.8rem; text-align: center; white-space: nowrap;
}
ul.news li div p { margin: 0; }
details.older summary { cursor: pointer; color: var(--link); margin: 4px 0 14px; }
.type { font-weight: 600; }
.pill { background: var(--rose); border-radius: 999px; padding: 1px 9px; font-size: 0.75rem; vertical-align: middle; }

/* Publications: title, authors, venue, then figure beside the abstract */
.pub { margin: 0 0 44px; }
.pub .authors { margin: 0; }
.pub .venue { margin: 0; color: var(--muted); }
.pub .pub-links { display: flex; gap: 8px; margin: 8px 0; }
.pub .posters { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; }
.pub-body { display: flex; gap: 22px; align-items: flex-start; margin-top: 10px; }
.pub-figure { flex: 0 0 46%; }
.pub-figure .figure { display: block; width: 100%; padding: 8px; border: 1px solid var(--mist); border-radius: 8px; }
.pub .abstract { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.55; }
.pub .abstract p:last-child { margin-bottom: 0; }

/* CV page */
.cv ul { padding-left: 20px; margin: 0 0 1em; }
.cv li { margin-bottom: 6px; }
.cv .when { color: var(--muted); white-space: nowrap; }

footer { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 24px 16px; }

@media (max-width: 640px) {
  .about { flex-direction: column-reverse; align-items: center; }
  .portrait { width: 160px; height: 160px; }
  ul.news li, ul.talks li { flex-direction: column; gap: 4px; }
  ul.news .date, ul.talks .date { align-self: flex-start; }
  .pub-body { flex-direction: column; }
  .pub-figure { flex: none; width: 100%; }
}
