:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #66666c;
  --line: #e4e1da;
  --accent: #0028a5;          /* close to UZH blue */
  --accent-soft: #eef1fb;     /* tinted panels and tags */
  --accent-line: #c9d2f2;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315;
    --surface: #1a1b1e;
    --text: #ececef;
    --muted: #9a9aa2;
    --line: #2a2b30;
    --accent: #8aa6ff;
    --accent-soft: #1a2033;
    --accent-line: #2c3a66;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; gap: 1rem; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
nav { display: flex; gap: 1.25rem; font-size: 0.92rem; }
nav a { color: var(--muted); }
nav a:hover { color: var(--accent); text-decoration: none; }

/* Sections */
section { padding: 3.5rem 0 1.5rem; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: 2.6rem; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.7rem; margin: 0 0 1.5rem; }
h3 { font-size: 1.15rem; margin: 2.25rem 0 0.9rem; }

.label, .eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--muted); font-weight: 400; }

/* Hero band */
.hero {
  margin-top: 2.5rem;
  padding: 2.75rem;
  display: grid; grid-template-columns: 200px 1fr; gap: 2.75rem; align-items: start;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
}
.hero + section { border-top: none; }
.portrait {
  width: 200px; height: 200px; border-radius: 50%; overflow: hidden;
  padding: 5px; background: var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 30px -12px rgba(0, 40, 165, 0.35);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.role { color: var(--muted); font-size: 0.98rem; margin: 0 0 1.25rem; }

.links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.links a {
  display: inline-block; padding: 0.35rem 0.95rem; border: 1px solid var(--accent-line);
  background: var(--surface);
  border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--text);
  transition: border-color .15s, color .15s, background .15s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.links a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.links a.primary:hover { filter: brightness(1.12); color: #fff; }
@media (prefers-color-scheme: dark) { .links a.primary, .links a.primary:hover { color: #0d1020; } }
section#contact .links { margin-top: 1rem; }

/* Research interests grid */
.interests {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem;
}
.interests li {
  display: flex; gap: 0.9rem; align-items: flex-start;
  padding: 1.1rem 1.15rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 0.97rem; line-height: 1.45;
  transition: border-color .15s, transform .15s;
}
.interests li:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.interests svg {
  flex: none; width: 38px; height: 38px; padding: 8px; border-radius: 10px;
  background: var(--accent-soft); stroke: var(--accent); fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* Publication cards */
.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.pubs li {
  display: grid; gap: 0.35rem;
  padding: 1.15rem 1.3rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pubs li:hover {
  border-color: var(--accent-line); transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(0, 40, 165, 0.45);
}
.pub-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.venue-tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 0.2rem 0.55rem; border-radius: 5px;
}
.year { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-title { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.pub-authors { font-size: 0.9rem; color: var(--muted); }
.pub-authors b { color: var(--text); font-weight: 600; }
.read { font-size: 0.88rem; font-weight: 500; justify-self: start; margin-top: 0.15rem; }

/* CV timeline */
.timeline { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem 1.25rem; margin: 0 0 0.5rem; }
.timeline dt { color: var(--accent); font-size: 0.9rem; font-weight: 500; font-variant-numeric: tabular-nums; padding-top: 0.08rem; }
.timeline dd { margin: 0; }

/* Offline aside */
.offline {
  display: flex; align-items: center; gap: 1.25rem;
  margin: 2.5rem 0 1rem; padding: 1rem 1.25rem;
  background: var(--surface); border: 1px dashed var(--accent-line); border-radius: 14px;
  max-width: 620px;
}
.offline img {
  flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 40% 35%;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent-line);
}
.offline p { margin: 0; font-size: 0.97rem; line-height: 1.5; color: var(--muted); }
.offline strong { color: var(--accent); font-weight: 600; }
.offline + section { border-top: 1px solid var(--line); }

.footer { color: var(--muted); font-size: 0.85rem; padding-top: 2rem; padding-bottom: 3rem; }

@media (max-width: 680px) {
  body { font-size: 16px; }
  html { scroll-padding-top: 6rem; }
  .topbar-inner { flex-direction: column; align-items: flex-start; justify-content: center; height: auto; gap: 0.25rem; padding-top: 0.6rem; padding-bottom: 0.55rem; }
  nav { width: 100%; gap: 1.1rem; font-size: 0.88rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.75rem 1.4rem; margin-top: 1.25rem; }
  .portrait { width: 132px; height: 132px; padding: 4px; }
  h1 { font-size: 2.1rem; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline dd { margin-bottom: 0.9rem; }
}
