/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
  --color-text: #1a1a1a;
  --color-text-secondary: #5a5a5a;
  --color-link: #1a5276;
  --color-link-hover: #0d3b5e;
  --color-accent: #2980b9;
  --color-bg: #fff;
  --color-bg-alt: #f8f9fa;
  --color-border: #e5e5e5;
  --color-code-bg: #f8f9fa;
  --color-code-text: #2c2c2c;
  --color-code-border: #e0e0e0;
  --color-code-title-bg: #eef0f2;
  --max-width: 960px;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Menlo, Consolas, 'Liberation Mono', monospace;
  --transition: 0.2s ease;
}
body {
  font-family: var(--font-body); color: var(--color-text);
  background: var(--color-bg); margin: 0; padding: 0;
  line-height: 1.75; font-size: 17px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: ''; display: block; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #3498db, #1abc9c);
}
.site-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
/* ── Header — photo left, name+nav right ── */
.site-header { padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--color-border); }
.header-row { display: flex; align-items: flex-start; gap: 1.25rem; }
.header-photo {
  width: 100px; height: 100px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
}
.header-text { display: flex; flex-direction: column; padding-top: 0.2rem; }
.site-header .name {
  font-size: 1.5rem; font-weight: 700; color: var(--color-text);
  text-decoration: none; letter-spacing: -0.02em; transition: color var(--transition);
  line-height: 1.2;
}
.site-header .name:hover { color: var(--color-accent); text-decoration: none; }
.site-header nav { margin-top: 0.35rem; font-size: 0.85rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.site-header nav a {
  color: var(--color-text-secondary); text-decoration: none;
  transition: color var(--transition);
}
.site-header nav a:hover { color: var(--color-accent); text-decoration: none; }
/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--color-text); line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 1.5rem; margin: 2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.8rem 0 0.8rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.6rem; color: var(--color-text-secondary); font-weight: 600; }
p { line-height: 1.75; margin: 0 0 1rem; }
ul, ol { line-height: 1.75; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }
a { color: var(--color-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-link-hover); text-decoration: underline; }
/* ── Code blocks ── */
code {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--color-bg-alt); color: #c7254e;
  padding: 0.15em 0.4em; border-radius: 4px; border: 1px solid var(--color-border);
}
pre {
  position: relative; background: var(--color-code-bg);
  border: 1px solid var(--color-code-border); border-radius: 6px;
  padding: 1rem 1.25rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.6;
  margin: 1.5rem 0;
}
pre code {
  display: block; background: none; border: none;
  color: var(--color-code-text); font-size: inherit; overflow-x: auto;
  padding: 0;
}
/* Prism overrides to match site theme */
pre[class*='language-'], code[class*='language-'] { font-family: var(--font-mono); }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955; font-style: italic; }
.token.keyword { color: #7c3aed; font-weight: 600; }
.token.function { color: #0369a1; }
.token.string, .token.char { color: #b45309; }
.token.number { color: #0e7490; }
.token.operator { color: #64748b; }
.token.punctuation { color: #64748b; }
.token.builtin, .token.class-name { color: #0369a1; }
.token.variable { color: var(--color-text); }
.token.boolean { color: #7c3aed; }
.token.property { color: #0e7490; }
.hl.lean pre { background: var(--color-code-bg); border-color: var(--color-code-border); }
/* ── Verso interactive Lean code ── */
code.hl.lean.block {
  display: block; padding: 1rem 1.25rem; margin: 1.5rem 0;
  background: var(--color-code-bg); border: 1px solid var(--color-code-border);
  border-radius: 8px; font-family: var(--font-mono); font-size: 0.85rem;
  line-height: 1.6; overflow-x: auto; white-space: pre;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); position: relative;
}
code.hl.lean.block .keyword.token { color: #7c3aed; font-weight: 600; }
code.hl.lean.block .const.token { color: #0369a1; }
code.hl.lean.block .var.token { color: #1a1a1a; }
code.hl.lean.block .sort.token { color: #b45309; }
code.hl.lean.block .typed.token { color: #0e7490; }
code.hl.lean.block .unknown.token { color: #64748b; }
code.hl.lean.block .inter-text { color: var(--color-text-secondary); }
/* Hover info popups */
code.hl.lean.block .has-info { cursor: pointer; border-bottom: 1px dotted #ccc; }
code.hl.lean.block .has-info:hover { border-bottom-color: var(--color-accent); }
.hover-container {
  position: absolute; z-index: 100; background: #fff;
  border: 1px solid var(--color-border); border-radius: 6px;
  padding: 0.75rem 1rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 0.82rem; max-width: 500px;
}
/* Tactic states — click to expand */
code.hl.lean.block .tactic-toggle { display: none; }
code.hl.lean.block .tactic-state {
  display: none; background: #f0f4ff; border: 1px solid #d0d8e8;
  border-radius: 6px; padding: 0.6rem 0.8rem; margin: 0.5rem 0;
  font-size: 0.8rem; line-height: 1.5;
}
code.hl.lean.block .tactic-toggle:checked + .tactic-state { display: block; }
code.hl.lean.block .tactic > label { cursor: pointer; }
code.hl.lean.block .tactic > label:hover .keyword.token { text-decoration: underline; }
code.hl.lean.block .goal { margin-bottom: 0.4rem; }
code.hl.lean.block .goal-name { font-weight: 700; color: var(--color-accent); margin-right: 0.3rem; }
code.hl.lean.block .hypothesis { margin-bottom: 0.2rem; }
code.hl.lean.block .hypothesis .name { font-weight: 600; }
code.hl.lean.block .hypothesis .colon { margin: 0 0.3rem; color: #999; }
code.hl.lean.block .prefix { color: #999; font-weight: 600; }
/* Verso messages */
.verso-message { display: block; padding: 0.4rem 0.6rem; margin: 0.3rem 0; border-radius: 4px; font-size: 0.82rem; }
.verso-message.information { background: #f0f4ff; border-left: 3px solid var(--color-accent); }
/* ── Publication list ── */
.publication-list { list-style: none; padding: 0; max-width: none; }
.publication-entry {
  margin-bottom: 0.7rem; padding: 0.65rem 0.8rem;
  border-left: 2px solid transparent; border-radius: 0 5px 5px 0;
  transition: border-color var(--transition), background var(--transition);
}
.publication-entry:hover { border-left-color: var(--color-accent); background: var(--color-bg-alt); }
.pub-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; line-height: 1.4; }
.pub-title a { color: var(--color-link); text-decoration: none; }
.pub-title a:hover { color: var(--color-accent); text-decoration: underline; }
.pub-meta {
  font-size: 0.81rem; color: var(--color-text-secondary);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; line-height: 1.4;
}
.pub-badge {
  display: inline-block; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem; border-radius: 3px; white-space: nowrap; text-decoration: none;
  transition: all var(--transition);
}
.pub-badge-venue { background: #eef3f9; color: #1a5276; border: 1px solid #c5d8ea; }
.pub-badge-pdf {
  background: #edf9f0; color: #1e8449; border: 1px solid #b2dfbb;
}
.pub-badge-pdf:hover { background: #d5f0dc; text-decoration: none; }
/* ── Project cards ── */
.project-card {
  margin-bottom: 1rem; padding: 1rem 1.25rem; border-radius: 6px;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.project-card h3 { font-size: 1rem; font-weight: 600; color: var(--color-text); margin: 0 0 0.3rem; }
.project-card h3 a { color: var(--color-link); }
.project-card h3 a:hover { text-decoration: none; color: var(--color-accent); }
.project-institution { color: var(--color-text-secondary); font-weight: normal; font-size: 0.88rem; }
.project-card p { font-size: 0.9rem; color: var(--color-text-secondary); margin: 0; line-height: 1.5; }
/* ── News badges ── */
.news-badge {
  display: inline-block; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem; border-radius: 3px; white-space: nowrap;
  text-decoration: none; transition: all var(--transition);
}
.news-badge-venue { background: #eef3f9; color: #1a5276; border: 1px solid #c5d8ea; }
.news-badge-venue:hover { background: #dde9f5; text-decoration: none; }
.news-badge-paper { background: #edf9f0; color: #1e8449; border: 1px solid #b2dfbb; }
.news-badge-paper:hover { background: #d5f0dc; text-decoration: none; }
.news-item-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.55rem; }
/* ── News listing (full page) ── */
.news-item {
  padding: 1rem 1.2rem; border-radius: 6px;
  border: 1px solid var(--color-border); margin-bottom: 0.9rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.news-item:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.07); border-color: #c8d3db; }
.news-date {
  font-size: 0.76rem; color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums; display: block; margin-bottom: 0.25rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.news-item h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--color-text); }
.news-item-detail p { font-size: 0.9rem; color: var(--color-text-secondary); margin: 0 0 0; line-height: 1.65; }
/* ── News home preview ── */
.news-item-home {
  margin-bottom: 0.45rem; padding: 0.35rem 0.75rem;
  border-left: 2px solid var(--color-border); line-height: 1.5;
  transition: border-color var(--transition);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem;
}
.news-item-home:hover { border-left-color: var(--color-accent); }
.news-date-home {
  color: var(--color-text-secondary); font-size: 0.78rem;
  font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0;
}
.news-preview-title { font-size: 0.91rem; color: var(--color-text); }
.news-preview-badges { display: inline-flex; gap: 0.3rem; align-items: center; flex-shrink: 0; }
/* ── Talks ── */
.talk-list { display: flex; flex-direction: column; gap: 0.65rem; }
.talk-card {
  padding: 0.8rem 1rem; border-radius: 6px; border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.talk-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.07); transform: translateY(-1px); }
.talk-title { font-size: 0.95rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.3rem; line-height: 1.4; }
.talk-venue { font-size: 0.82rem; }
.talk-venue-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem; border-radius: 3px; white-space: nowrap;
  background: #eef3f9; color: #1a5276; border: 1px solid #c5d8ea;
  text-decoration: none; transition: all var(--transition);
}
.talk-venue-badge:hover { background: #dde9f5; text-decoration: none; }
.talk-venue-badge-plain { color: var(--color-text-secondary); background: var(--color-bg-alt); border-color: var(--color-border); }
/* ── Teaching / Courses ── */
.course-list { display: flex; flex-direction: column; gap: 0.55rem; }
.course-entry {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.6rem 0.9rem; border-radius: 6px;
  background: var(--color-bg-alt); border: 1px solid var(--color-border);
}
.course-code {
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700;
  color: #1a5276; background: #dde9f5; border: 1px solid #c5d8ea;
  padding: 0.18rem 0.45rem; border-radius: 3px; white-space: nowrap;
  flex-shrink: 0; margin-top: 0.15rem;
}
.course-info { display: flex; flex-direction: column; gap: 0.1rem; }
.course-name { font-size: 0.92rem; font-weight: 500; color: var(--color-text); }
.course-meta { font-size: 0.78rem; color: var(--color-text-secondary); }
/* ── Post list ── */
.post-item { list-style: none; margin-bottom: 1.5rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--color-border); }
.post-item:last-child { border-bottom: none; margin-bottom: 0; }
.post-item-title {
  font-size: 1.1rem; font-weight: 600; color: var(--color-text);
  text-decoration: none; transition: color var(--transition); display: block;
}
.post-item-title:hover { color: var(--color-accent); text-decoration: none; }
/* Remove bullets from post/news listing ul */
ul:has(> .post-item), ol:has(> .post-item) { list-style: none; padding-left: 0; max-width: none; }
article > ul, article > ol { max-width: none; }
/* ── Post page ── */
.post-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.post-title { font-size: 1.5rem; margin-bottom: 0.4rem; }
.post-meta { color: var(--color-text-secondary); font-size: 0.85rem; }
.post-author { font-weight: 500; }
.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
/* ── Categories / Tags ── */
.post-categories { margin-top: 0.6rem; }
.categories { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.categories h2 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-secondary); margin: 0 0 1rem;
}
.category-list {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: none;
}
.category-list li { margin: 0; }
.category-button, .tag-button {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.55rem; margin: 0.15rem 0.2rem 0.15rem 0;
  border-radius: 4px; text-decoration: none;
  color: var(--color-text-secondary); background: var(--color-bg-alt);
  border: 1px solid var(--color-border); transition: all var(--transition);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.category-button:hover, .tag-button:hover {
  color: var(--color-accent); border-color: var(--color-accent);
  background: #f0f7ff; text-decoration: none;
}
/* ── TOC ── */
.toc {
  background: var(--color-bg-alt); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; max-width: 380px;
}
.toc-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-secondary);
  margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--color-border);
}
.toc ul { list-style: none; padding-left: 0; margin: 0; max-width: none; }
.toc ul ul { padding-left: 1.25rem; margin-top: 0.2rem; }
.toc li { margin-bottom: 0.3rem; }
.toc a { color: var(--color-link); text-decoration: none; font-size: 0.9rem; transition: color var(--transition); }
.toc a:hover { color: var(--color-accent); text-decoration: underline; }
/* ── CV ── */
.cv-experience h3 { font-size: 1rem; margin: 1rem 0 0.2rem; color: var(--color-text); }
.cv-dates { color: var(--color-text-secondary); font-size: 0.9rem; margin: 0 0 0.5rem; }
/* ── Hero / bio ── */
.hero { margin: 1.5rem 0 0.5rem; }
.hero-bio { font-size: 0.95rem; line-height: 1.7; color: var(--color-text); }
/* ── Home sections ── */
.home-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.home-section h2 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-secondary); margin: 0 0 1rem;
}
/* ── Footer ── */
.site-footer { border-top: 1px solid var(--color-border); margin-top: 4rem; padding: 1.5rem 0; text-align: center; }
.footer-links { margin-bottom: 0.75rem; display: flex; justify-content: center; gap: 1rem; }
.footer-links a {
  color: var(--color-text-secondary); font-size: 1.2rem;
  text-decoration: none; transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-accent); text-decoration: none; }
.footer-text { color: #999; font-size: 0.78rem; letter-spacing: 0.01em; }
/* ── LaTeX environments ── */
.theorem, .definition, .lemma, .corollary, .remark {
  border-left: 3px solid var(--color-accent); background: var(--color-bg-alt);
  padding: 0.8rem 1.2rem; margin: 1.5rem 0; border-radius: 0 4px 4px 0;
}
.proof { border-left: 2px solid #ddd; padding-left: 1rem; margin: 1rem 0; font-style: italic; }
.proof::before { content: 'Proof. '; font-weight: 700; font-style: normal; }
.error-container { text-align: center; margin: 5rem 0; }
.error-title { font-size: 3rem; font-weight: 300; color: var(--color-text-secondary); }
::selection { background: #d4e6f7; color: var(--color-text); }
@media (max-width: 700px) {
  body { font-size: 16px; }
  .site-header { padding: 1.5rem 0 0.75rem; }
  .header-row { flex-direction: column; align-items: center; text-align: center; }
  .header-photo { width: 100px; height: 100px; }
  .site-header nav { justify-content: center; }
  .project-card { padding: 0.75rem 1rem; }
  .toc { max-width: 100%; }
}
