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

:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #60a5fa;
  --accent-soft: #93c5fd;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

strong { color: var(--text); font-weight: 600; }

p {
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
p:last-child { margin-bottom: 0; }

/* ── Navigation ─────────────────────────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Align with .content max-width */
  padding: 0 max(2rem, calc(50% - 390px));
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

/* ── Layout ─────────────────────────────────────────────── */

.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

section { margin-bottom: 3.5rem; }

/* ── Section headings ───────────────────────────────────── */

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

/* ── Hero / About ───────────────────────────────────────── */

.hero { padding: 0.5rem 0 0; }

.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.hero-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.hero-role {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

.hero-bio {
  max-width: 660px;
  margin-bottom: 1.5rem;
}

/* Contact link chips */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: var(--bg-card);
  transition: border-color 0.15s, color 0.15s;
}
.links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Research items ─────────────────────────────────────── */

.research-item {
  border-left: 2px solid var(--accent);
  padding: 0.6rem 0 0.6rem 1.25rem;
  margin-bottom: 1.5rem;
}
.research-item:last-child { margin-bottom: 0; }

.research-item h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.badge {
  display: inline-block;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Publications ───────────────────────────────────────── */

.paper {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.paper:last-child { border-bottom: none; }

.paper-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}
.paper-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.paper-me {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border);
}
.paper-venue {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}
.paper-note {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Teaching ───────────────────────────────────────────── */

.teaching-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.teaching-item:last-child { border-bottom: none; }

.teaching-role { color: var(--text-muted); }
.teaching-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  margin-left: 1.5rem;
  opacity: 0.7;
}

/* ── Blog post list ─────────────────────────────────────── */

.post-item {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }

.post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  min-width: 100px;
  flex-shrink: 0;
}
.post-title {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}
.post-title:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Log entries ────────────────────────────────────────── */

.log-entry {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.log-entry:last-child { border-bottom: none; }

.log-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  margin-bottom: 0.6rem;
}

.log-entry ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.log-entry ul li { margin-bottom: 0.3rem; }

/* ── Blog post page ─────────────────────────────────────── */

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-back {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 1rem;
}
.post-back:hover { color: var(--accent); text-decoration: none; }

.post-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.post-meta {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.post-body {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.post-body p  { margin-bottom: 1.1rem; }
.post-body h2 { font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 0.5rem; }

.post-body code {
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--text);
}
.post-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.post-body li { margin-bottom: 0.35rem; }

/* ── Empty state ────────────────────────────────────────── */

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* ── Footer ─────────────────────────────────────────────── */

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  opacity: 0.7;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
  nav { padding: 0 1.25rem; }
  .nav-links { gap: 1rem; }
  .content { padding: 2rem 1.25rem 3.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-top { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .teaching-item { flex-direction: column; gap: 0.1rem; }
  .teaching-date { margin-left: 0; }
  .post-item { flex-direction: column; gap: 0.15rem; }
}
