:root {
  --bg: #fdfcf9;
  --surface: #ffffff;
  --text: #1a1d24;
  --muted: #5a6072;
  --line: #e6e2d8;
  --accent: #1f4f7a;
  --accent-hover: #133757;
  --max: 760px;
  --max-wide: 960px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(31,79,122,0.25);
  transition: color 0.12s, border-color 0.12s;
}
a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

h1, h2, h3, h4 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #11151c;
}
h1 { font-size: 2.1rem; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.45rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }

p { margin: 0 0 1rem; }

img { max-width: 100%; height: auto; display: block; }

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

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1ede4;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
pre {
  background: #1a1d24;
  color: #f1f1f1;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9em;
}
pre code { background: transparent; padding: 0; color: inherit; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(150%) blur(8px);
  background: rgba(255,255,255,0.85);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  max-width: var(--max-wide);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-name {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: none;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-name:hover { color: var(--accent); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.95rem;
}
.site-nav a {
  border-bottom: none;
  color: var(--muted);
}
.site-nav a:hover { color: var(--accent); }

/* ---------- hero / home ---------- */
.hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.75rem;
  align-items: center;
  margin: 2.25rem 0 1.5rem;
}
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 18px rgba(20, 30, 50, 0.10);
}
.hero h1 { margin: 0 0 0.35rem; font-size: 2rem; }
.hero .role {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 0.6rem;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.92rem;
}
.hero-links a { border-bottom: none; }

@media (max-width: 600px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .hero-photo { width: 140px; height: 140px; }
  .hero-links { justify-content: center; }
}

/* ---------- sections / cards ---------- */
section { margin: 2.5rem 0; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.section-title h2 { margin: 0; }
.section-title a { font-size: 0.92rem; }

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.news-list li:last-child { border-bottom: none; }
.news-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}
@media (max-width: 520px) {
  .news-list li { grid-template-columns: 1fr; gap: 0.15rem; }
}

.paper-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.paper-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
}
.paper-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.paper-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}
.paper-card h3 a { border-bottom: none; color: var(--text); }
.paper-card h3 a:hover { color: var(--accent); }
.paper-card .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.paper-card .summary {
  margin: 0;
  font-size: 0.97rem;
  color: #2c3140;
}

/* ---------- pages ---------- */
.page-header { margin: 1.5rem 0 1rem; }
.page-header .lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: -0.3rem;
}

/* ---------- paper detail ---------- */
.paper .back, .post .back {
  font-size: 0.9rem;
  margin: 1.25rem 0 0.5rem;
}
.paper-header { margin-bottom: 1.5rem; }
.paper-meta { color: var(--muted); margin: -0.4rem 0 0.75rem; }
.paper-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0.75rem 0 0;
}
.paper-links li a {
  display: inline-block;
  border: 1px solid var(--accent);
  border-bottom-color: var(--accent);
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-size: 0.88rem;
}
.paper-links li a:hover {
  background: var(--accent);
  color: #fff;
}

.paper-figure {
  margin: 1.75rem 0;
}
.paper-figure img {
  border-radius: 6px;
  border: 1px solid var(--line);
}
.paper-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.press {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.press h2 { margin-top: 0; font-size: 1.2rem; }
.press ul { padding-left: 1.2rem; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  background: #f5f1e8;
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.93rem;
  margin-bottom: 0.75rem;
}
.contact-row a { border-bottom: none; }
.footer-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- email reveal ---------- */
.email-reveal {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.email-reveal:hover {
  background: var(--accent);
  color: #fff;
}

/* ---------- publications list ---------- */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.pub-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.pub-list .pub-title { font-weight: 500; }
.pub-list .pub-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

/* ---------- talks / code lists ---------- */
.simple-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.simple-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.simple-list .meta {
  color: var(--muted);
  font-size: 0.9rem;
}
