:root {
  --bg: #fbfbf9;
  --fg: #1c1e21;
  --muted: #5d636b;
  --accent: #1f3a5f;
  --accent-soft: #e6ecf4;
  --rule: #e1e3e6;
  --side-bg: #f2f3f0;
  --sidebar-w: 280px;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e8e9eb;
    --muted: #9aa1aa;
    --accent: #8fb3e0;
    --accent-soft: #1f2a3a;
    --rule: #2b3037;
    --side-bg: #1a1d22;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--side-bg);
  border-right: 1px solid var(--rule);
  padding: 2.25rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.brand .name { display: block; font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: var(--fg); line-height: 1.2; margin-bottom: 0.5rem; }
.brand .name:hover { text-decoration: none; color: var(--accent); }
.tagline { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.contact { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; line-height: 1.8; }

.menu-toggle { display: none; }

.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.menu a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.menu a.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* Content */
.content { flex: 1; min-width: 0; padding: 2.75rem clamp(1.25rem, 5vw, 4rem) 3rem; max-width: 900px; }
.content:focus { outline: none; }
.panel[hidden] { display: none; }
h2 { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; margin: 0 0 1.25rem; color: var(--accent); padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); }
/* (about paragraphs styled via .bio) */

/* Timeline lists */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0.65rem 0; }
.timeline li + li { border-top: 1px dashed var(--rule); }
.tl-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.tl-title { font-weight: 600; }
.tl-date { flex-shrink: 0; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tl-sub { color: var(--muted); font-size: 0.95rem; }

/* Publications */
.pubs { margin: 0; padding-left: 1.5rem; }
.pubs li { margin-bottom: 1rem; }
.pubs .authors { display: block; }
.pubs .title { display: block; font-weight: 600; }
.pubs .venue { display: block; color: var(--muted); font-size: 0.95rem; font-style: italic; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; font-style: normal; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; margin-right: 0.25rem; }

/* Footer */
.site-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
.site-footer p { margin: 0; }

/* Mobile: sidebar becomes a top bar with a collapsible menu */
@media (max-width: 760px) {
  body { display: block; }
  .sidebar {
    width: auto; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--rule);
    padding: 1.5rem 1.25rem 0.75rem; gap: 0.75rem;
  }
  .brand .name { font-size: 1.6rem; }
  .menu-toggle {
    display: flex; align-items: center; gap: 0.6rem;
    background: none; border: 1px solid var(--rule); border-radius: 6px;
    color: var(--fg); font: inherit; font-size: 0.95rem; font-weight: 600;
    padding: 0.5rem 0.85rem; cursor: pointer; width: 100%;
  }
  .menu-toggle-icon { width: 18px; height: 2px; background: currentColor; position: relative; display: inline-block; }
  .menu-toggle-icon::before, .menu-toggle-icon::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
  .menu-toggle-icon::before { top: -6px; }
  .menu-toggle-icon::after { top: 6px; }
  .menu { display: none; }
  .menu.open { display: block; }
  .menu ul { padding-top: 0.5rem; }
  .content { padding: 1.5rem 1.25rem 2.5rem; max-width: none; }
  h2 { font-size: 1.5rem; }
  .tl-head { flex-direction: column; gap: 0; }
}

@media print {
  body { display: block; }
  .sidebar { position: static; height: auto; border: 0; }
  .menu, .menu-toggle, .site-footer { display: none; }
  .panel { display: block !important; page-break-inside: avoid; }
  body { font-size: 11pt; }
}

/* Subsections and intro text */
h3 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.6rem; color: var(--fg); }
.bio p { font-size: 1.05rem; margin: 0 0 1rem; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.themes { margin: 0 0 1rem; padding-left: 1.2rem; }
.themes li { margin-bottom: 0.4rem; }
