:root {
  --bg: #ffffff;
  --fg: #1d2330;
  --muted: #5b6475;
  --accent: #1f5fbf;
  --accent-hover: #e0791a;
  --card: #f6f8fb;
  --border: #e3e7ee;
  --badge-accepted: #0f7b4b;
  --badge-review: #8a6d00;
  --badge-ongoing: #6b3fa0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --fg: #e6e9ef;
    --muted: #9aa3b2;
    --accent: #6ea8ff;
    --accent-hover: #ffb366;
    --card: #1b2029;
    --border: #2a313d;
    --badge-accepted: #3ccf8e;
    --badge-review: #e6c34a;
    --badge-ongoing: #b993ea;
  }
  .teaser img { background: #fff; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Lato', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-hover); }

.container { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
nav .container { display: flex; justify-content: space-between; align-items: center; height: 54px; }
nav .brand { font-weight: 700; color: var(--fg); }
nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
nav ul a { color: var(--muted); font-size: 15px; }
nav ul a:hover { color: var(--accent); }

/* ---------- Header ---------- */
header { display: flex; gap: 40px; align-items: center; padding: 48px 0 24px; }
header .intro { flex: 1; }
header h1 { font-size: 38px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.5px; }
header .role { color: var(--muted); margin: 0 0 18px; font-size: 17px; }
header .photo img { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card); }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.links a {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 14px; font-size: 14px; color: var(--fg); background: var(--card);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

.callout {
  border-left: 4px solid var(--accent); background: var(--card);
  padding: 10px 16px; border-radius: 6px; margin: 8px 0 0;
}

/* ---------- Sections ---------- */
section { padding: 28px 0 8px; scroll-margin-top: 60px; }
h2 { font-size: 24px; margin: 0 0 16px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 17px; margin: 28px 0 10px; color: var(--muted); font-weight: 700; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: flex; gap: 16px; padding: 4px 0; }
.news .date { flex: 0 0 82px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Paper cards ---------- */
.paper { display: flex; gap: 24px; padding: 18px 0; border-bottom: 1px dashed var(--border); }
.paper:last-child { border-bottom: none; }
.paper.highlight { background: var(--card); border-radius: 10px; padding: 18px; border-bottom: none; margin-bottom: 12px; }

.teaser { flex: 0 0 280px; position: relative; align-self: flex-start; }
.teaser img { width: 100%; border-radius: 6px; display: block; border: 1px solid var(--border); }
.teaser img.hover { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity .25s ease-in-out; }
.paper:hover .teaser img.hover { opacity: 1; }

.paper .body { flex: 1; min-width: 0; }
.paper .title { font-weight: 700; font-size: 17px; line-height: 1.35; margin: 0 0 4px; }
.paper .authors { margin: 0; font-size: 15px; }
.paper .authors b { color: var(--fg); }
.paper .venue { margin: 2px 0 8px; font-size: 15px; color: var(--muted); }
.paper p.desc { margin: 6px 0 8px; font-size: 15px; }
.paper .plinks a { font-size: 14px; margin-right: 14px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 8px; border-radius: 4px; border: 1px solid currentColor; margin-left: 6px;
  vertical-align: 1px;
}
.badge.accepted { color: var(--badge-accepted); }
.badge.review { color: var(--badge-review); }
.badge.ongoing { color: var(--badge-ongoing); }

.pubs-compact { padding-left: 20px; margin: 0; }
.pubs-compact li { margin-bottom: 10px; font-size: 15px; }

/* ---------- Experience ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 16px; padding: 6px 0; }
.timeline .when { flex: 0 0 150px; color: var(--muted); font-size: 15px; }
.timeline .what { flex: 1; font-size: 15px; }

/* ---------- Project grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card img { width: 100%; height: 150px; object-fit: cover; background: #fff; }
.card .content { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card .content b { font-size: 15px; line-height: 1.35; }
.card .content p { font-size: 14px; color: var(--muted); margin: 6px 0 10px; flex: 1; }
.card .content a { font-size: 14px; }

footer { color: var(--muted); font-size: 13px; padding: 40px 0 30px; text-align: center; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  nav ul { gap: 14px; }
  nav ul li.hide-sm { display: none; }
  header { flex-direction: column-reverse; padding-top: 28px; gap: 16px; }
  header h1, header .role { text-align: center; }
  header .photo img { width: 150px; height: 150px; }
  .links { justify-content: center; }
  .paper { flex-direction: column; gap: 12px; }
  .teaser { flex-basis: auto; width: 100%; }
  .timeline li, .news li { flex-direction: column; gap: 0; }
  .timeline .when, .news .date { flex: none; }
}
