:root {
  --fg: #1a1a1a;
  --fg-muted: #555;
  --bg: #ffffff;
  --accent: #0050b3;
  --accent-hover: #003c87;
  --rule: #e6e6e6;
  --max-width: 760px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Noto Sans Georgian", "Noto Sans Arabic", "Noto Sans CJK SC";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover, a:focus {
  border-bottom-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  color: var(--fg);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 1rem; color: var(--fg-muted); }

p { margin: 0 0 1rem; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre { background: #f6f8fa; padding: 0.75rem 1rem; overflow-x: auto; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  margin-bottom: 2rem;
}
.header-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}
.site-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  border-bottom: none;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--fg-muted);
  border-bottom: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* ---------- Hero (home) ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.hero-photo img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.hero-text { flex: 1 1 300px; }
.hero-name { margin: 0 0 0.25rem; font-size: 1.6rem; }
.hero-role { margin: 0 0 0.25rem; color: var(--fg-muted); }
.hero-affiliation { margin: 0 0 0.85rem; color: var(--fg-muted); }

.socials {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.92rem;
}
.socials li { margin: 0; }

/* ---------- Bio + News ---------- */
.bio { margin-bottom: 2rem; }

.news h2 { margin-top: 1.5rem; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-item time {
  flex: 0 0 7.5rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.news-body { flex: 1; }
.news-body p { margin: 0; }

/* ---------- Page header ---------- */
.page-header { margin-bottom: 1rem; }
.page-header h1 { margin: 0; }
.page-subtitle { color: var(--fg-muted); margin-top: 0.25rem; }

/* ---------- Publication / talk / teaching list ---------- */
.entry-list { list-style: none; padding: 0; margin: 1rem 0; }
.entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: none; }
.entry .when {
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.entry .what .title { font-weight: 600; }
.entry .what .venue { color: var(--fg-muted); font-size: 0.95rem; display: block; margin-top: 0.15rem; }
.entry .what .meta { color: var(--fg-muted); font-size: 0.9rem; display: block; margin-top: 0.15rem; }
.entry .what .self { font-weight: 700; }

/* Publication grouping */
.pub-group { margin-top: 1.75rem; }
.pub-group > h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* ---------- CV embed ---------- */
.cv-embed {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.cv-actions { margin: 1rem 0 1.5rem; }
.cv-actions a { margin-right: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.footer-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.footer-wrap .sep { opacity: 0.5; }
.site-footer a { color: var(--fg-muted); border-bottom-color: var(--rule); }
.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-text { text-align: center; }
  .socials { justify-content: center; }
  .news-item { flex-direction: column; gap: 0.1rem; }
  .news-item time { flex-basis: auto; }
  .entry { grid-template-columns: 1fr; }
  .entry .when { font-size: 0.85rem; }
  .header-wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
