:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --faint: #999999;
  --line: #e5e5e5;
  --soft: #f6f6f6;
  --accent: #0f766e;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] {
  --bg: #1c1c1d;
  --text: #e6e6e6;
  --muted: #a8a8a8;
  --faint: #7a7a7a;
  --line: #333336;
  --soft: #232325;
  --accent: #2dd4bf;
  --on-accent: #042f2e;
  --header-bg: rgba(28, 28, 29, 0.92);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 500; }

/* Top nav */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.icons { display: flex; gap: 16px; font-size: 20px; }
.icons a { color: var(--text); }
.icons a:hover { color: var(--accent); text-decoration: none; }
nav { display: flex; align-items: center; gap: 22px; font-weight: 400; }
nav a { color: var(--text); }
nav a:hover, nav a.active { color: var(--accent); text-decoration: none; }
.toggle { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); font-size: 16px; }
.toggle:hover { color: var(--accent); }
[data-theme="dark"] .fa-moon, :root:not([data-theme="dark"]) .fa-sun { display: none; }

/* Layout */
main { max-width: 960px; margin: 0 auto; padding: 40px 20px 60px; }
section { scroll-margin-top: 72px; margin-bottom: 48px; }
h1 { font-size: 44px; font-weight: 300; margin: 0 0 4px; }
h1 b { font-weight: 700; }
.subtitle { color: var(--muted); margin: 0 0 24px; }
h2 { font-size: 30px; font-weight: 300; margin: 0 0 16px; }
p { margin: 0 0 14px; }

.profile { float: right; width: 30%; max-width: 240px; margin: 0 0 16px 32px; text-align: center; }
.profile img { width: 100%; height: auto; border-radius: 50%; display: block; }

.themes { padding-left: 20px; margin: 0 0 16px; }
.themes li { margin-bottom: 14px; }
.themes .papers { display: block; }
.sep { color: var(--faint); margin: 0 4px; }

/* News */
.news { width: 100%; border-collapse: collapse; }
.news td { padding: 6px 0; vertical-align: top; }
.news td:first-child { width: 120px; font-weight: 500; white-space: nowrap; }

/* Publications */
.year { font-size: 22px; font-weight: 300; color: var(--faint); text-align: right; border-top: 1px solid var(--line); padding-top: 8px; margin: 24px 0 8px; }
.pub { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 14px 0; }
.pub .thumb { display: block; width: 100%; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
.badge {
  display: block;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 3px 6px;
  border-radius: 3px;
  margin-top: 3px;
}
.pub .title { font-weight: 500; }
.pub .authors { font-size: 15px; }
.pub .authors em { font-style: normal; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.credit { font-size: 11px; color: var(--faint); margin-top: 4px; text-align: center; }
.credit a { color: var(--faint); text-decoration: underline; }
.pub .venue { font-size: 15px; font-style: italic; color: var(--muted); }
.pub .venue b { font-weight: 500; color: var(--text); }
.pub .abstract { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.btns { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.btns a {
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 3px;
  padding: 1px 10px;
}
.btns a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Experience */
.exp { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 10px 0; }
.exp .when { font-size: 14px; color: var(--faint); padding-top: 2px; }
.exp .title { font-weight: 500; }
.exp .where { color: var(--muted); font-size: 15px; }
.exp p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.exp ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.exp li { margin-bottom: 4px; }

/* CV page */
.cv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 4px;
}
.download:hover { text-decoration: none; opacity: 0.9; }
.skills { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 20px; font-size: 15px; }
.skills dt { font-weight: 500; }
.skills dd { margin: 0; color: var(--muted); }
.cvpubs { padding-left: 20px; font-size: 15px; }
.cvpubs li { margin-bottom: 8px; }
.cvpubs .venue { color: var(--muted); font-style: italic; }

.social { text-align: center; font-size: 36px; display: flex; justify-content: center; gap: 24px; margin: 40px 0 8px; }
.social a { color: var(--text); }
.social a:hover { color: var(--accent); text-decoration: none; }
.contact { text-align: center; color: var(--muted); font-size: 15px; }

footer { background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer div { max-width: 960px; margin: 0 auto; padding: 12px 20px; }

@media (max-width: 720px) {
  .bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  nav { gap: 16px; overflow-x: auto; width: 100%; font-size: 15px; }
  .profile { float: none; width: 160px; margin: 0 0 20px; }
  h1 { font-size: 36px; }
  .pub, .exp, .skills { grid-template-columns: 1fr; gap: 6px; }
  .badge { display: inline-block; }
  .pub .thumb { max-width: 320px; }
  .skills dd { margin-bottom: 10px; }
}
