:root {
  --bg: #fbfbf9;
  --fg: #1c1b19;
  --muted: #6b6862;
  --rule: #e6e3dc;
  --accent: #2f52b3;
  --accent-soft: #eef1fa;
  --maxw: 43rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.35rem 5rem;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
p { margin: 0 0 1rem; }

/* ---- header ---- */
/* The avatar floats so the name, subtitle and bio wrap around it and
   text reflows to full width below it. */
.header::after { content: ""; display: table; clear: both; }
.avatar {
  float: right;
  width: 132px;
  height: 132px;
  margin: 0.5rem 0 1.1rem 1.9rem;
  border-radius: 12px;
  object-fit: cover;
  filter: saturate(0.96);
}
.name {
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 0.25rem;
}
.subtitle { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.25rem; }
.bio { font-size: 1.06rem; }
.bio p:last-child { margin-bottom: 0; }

/* ---- link row ---- */
.links {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem;
  margin: 1.4rem 0 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem; letter-spacing: 0.01em;
}
.links a { color: var(--muted); }
.links a:hover { color: var(--accent); text-decoration: none; }
.links a::before { content: "↗ "; opacity: 0.5; }

/* ---- sections ---- */
section { margin-top: 3rem; }
h2.section {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
}

/* ---- publications ---- */
.pub { margin-bottom: 1.55rem; }
.pub-title { font-size: 1.08rem; font-weight: 600; line-height: 1.35; }
.pub-authors { color: var(--fg); font-size: 0.98rem; }
.pub-authors b { font-weight: 600; }
.pub-venue { color: var(--muted); font-style: italic; font-size: 0.98rem; }
.pub-links {
  margin-top: 0.15rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
}
.pub-links a {
  display: inline-block; margin-right: 0.55rem;
  padding: 0.05rem 0.4rem; border-radius: 5px;
  background: var(--accent-soft);
}
.pub-links a:hover { text-decoration: none; }

/* ---- projects ---- */
.proj { display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.15rem; align-items: baseline; }
.proj-main { min-width: 0; }
.proj-title { font-weight: 600; font-size: 1.04rem; }
.proj-desc { color: var(--muted); font-size: 0.95rem; }
.proj-tag {
  flex: none; color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding-top: 0.3rem;
}

/* ---- more / back links ---- */
.more {
  margin-top: 1.4rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}
.back {
  display: inline-block;
  margin-bottom: 2rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.back:hover { color: var(--accent); text-decoration: none; }

/* ---- paper page (gcmarl) ---- */
/* Wider than the index column so the result figures stay legible. */
.paper { max-width: 52rem; }
.paper-head { text-align: center; margin-bottom: 2.5rem; }
.paper-title {
  font-size: 1.9rem; font-weight: 600; line-height: 1.25;
  letter-spacing: -0.015em; margin: 0 0 1rem;
}
.paper-authors { font-size: 1.02rem; line-height: 1.7; margin-bottom: 0.4rem; }
.paper-authors sup { font-size: 0.72em; color: var(--muted); }
.paper-affil { font-size: 0.95rem; color: var(--muted); margin-bottom: 1.5rem; }
.paper-affil sup { font-size: 0.8em; }
.paper-btns { display: flex; justify-content: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.paper-btns a {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg);
}
.paper-btns a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.paper-email {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem; color: var(--muted);
}

.paper h2 {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
}
.lede {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.4rem 1.6rem;
  margin: 2.5rem 0;
  font-size: 1.02rem;
}
.lede p:last-child { margin-bottom: 0; }
.lede strong { font-weight: 600; }

figure { margin: 2.5rem 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 10px; }
figcaption {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: left;
}
figcaption strong { color: var(--fg); font-weight: 600; }
figcaption .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; }

/* Equal-height crops so the two captions sit on the same baseline
   despite the clips having different aspect ratios. */
.policies { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 2rem 0; }
.policies figure { flex: 1; min-width: 260px; margin: 0; }
.policies img { width: 100%; height: 280px; object-fit: cover; }
.policies figcaption { text-align: center; font-size: 0.95rem; color: var(--fg); }

pre {
  background: #f4f2ed;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .paper-title { font-size: 1.5rem; }
  .avatar {
    width: 88px; height: 88px;
    margin: 0.35rem 0 0.85rem 1.1rem;
    border-radius: 10px;
  }
  .name { font-size: 1.75rem; }
}
