@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nav-bg: #0f172a;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navigation ── */
nav {
  background: var(--nav-bg);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.01em;
}
.site-name:hover { color: #93c5fd; text-decoration: none; }
nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}
nav ul a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}
nav ul a:hover { color: #f8fafc; background: rgba(255,255,255,0.08); text-decoration: none; }
nav ul a.active { color: #93c5fd; background: rgba(59,130,246,0.15); }

/* ── Banner ── */
.banner {
  width: 100%;
  height: 280px;
  overflow: hidden;
  position: relative;
}
.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
}
.banner-title {
  position: absolute;
  bottom: 1.75rem;
  left: 0;
  right: 0;
  padding: 0 2rem;
  z-index: 1;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  max-width: 820px;
  margin: 0 auto;
}

/* ── Page layout ── */
main {
  padding: 2.5rem 0 4rem;
}
main > .container {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  padding: 2.75rem 3rem;
}

/* ── Home hero ── */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 155px;
  height: 155px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 8px;
  border: 3px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.hero-text h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.hero-text p {
  margin-bottom: 0.75rem;
  color: #334155;
}

/* ── Section headings ── */
section { margin-bottom: 0; }
section + section { margin-top: 2.5rem; }

h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Post list (home + blog) ── */
.post-list { list-style: none; }
.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; padding-bottom: 0; }
.post-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.post-list h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}
.post-list h3 a { color: var(--text); }
.post-list h3 a:hover { color: var(--accent); text-decoration: none; }
.post-list p { font-size: 0.92rem; color: #475569; line-height: 1.6; }
.view-all {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--accent);
}
.view-all:hover { color: var(--accent-dark); text-decoration: none; }

/* ── Publication list ── */
.pub-list { list-style: none; }
.pub-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
  line-height: 1.65;
}
.pub-list li:last-child { border-bottom: none; padding-bottom: 0; }
.pub-authors { color: var(--muted); font-size: 0.88rem; display: block; margin-bottom: 0.15rem; }
.pub-title { color: var(--text); font-style: italic; }
.pub-venue { color: #475569; font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem; }

/* ── Blog post page ── */
.post-header { margin-bottom: 2rem; }
.post-header h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.post-body { margin-bottom: 1.5rem; }
.post-body p { margin-bottom: 0.6rem; color: #334155; }

.pdf-embed {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.pdf-embed iframe {
  width: 100%;
  height: 660px;
  display: block;
  border: none;
}
.pdf-actions { margin-top: 0.75rem; }

.btn {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent); color: white; text-decoration: none; }

.back-link {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 2.5rem;
  display: inline-block;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Blog post: math + diagrams ── */
.def-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.97rem;
  color: #111827;
  margin-top: 1.6rem;
  margin-bottom: 0.15rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.55rem;
}
.tikz-diagram {
  margin: 1.5rem auto;
  text-align: center;
  overflow-x: auto;
}
.tikz-diagram svg {
  display: block;
  margin: 0 auto;
  max-width: 80%;
  height: auto;
}
.post-img {
  margin: 1.5rem auto;
  text-align: center;
}
.post-img img {
  display: block;
  margin: 0 auto;
  max-width: 70%;
  height: auto;
  border-radius: 4px;
}
.post-body h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--nav);
}
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: #334155;
}
.post-body li { margin-bottom: 0.4rem; line-height: 1.7; }

/* ── CV / Contact ── */
.contact-list { list-style: none; }
.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.contact-list li:last-child { border-bottom: none; }
.label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-width: 6rem;
  flex-shrink: 0;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  main > .container { padding: 1.75rem 1.25rem; border-radius: 0; }
  .hero { flex-direction: column; gap: 1.25rem; }
  .avatar { width: 110px; height: 110px; }
  .post-header h1 { font-size: 1.4rem; }
  .pdf-embed iframe { height: 480px; }
  nav ul a { padding: 0.35rem 0.5rem; }
}
