:root {
  --bg: #0a0a0a;
  --bg-alt: #111;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #58a6ff;
  --border: #222;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --max-width: 680px;
  --space: 1.5rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex; 
  gap: 1.5rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

section {
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

p {
  margin-bottom: 1rem;
}

.meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.role {
  margin-left: 1rem;
  margin-bottom: 1rem;
}

.role h4 {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Hero */
.hero {
  padding: 3rem 0 2rem;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Experience */
.experience-item {
  margin-bottom: 1.25rem;
}

/* Skills */
.skill-group {
  margin-bottom: 1rem;
}

.skill-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* Experience list */
.experience-item ul {
  margin: 0.25rem 0 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.experience-item li {
  margin-bottom: 0.2rem;
}

/* Certifications */
.cert-item {
  margin-bottom: 0.5rem;
}

.cert-item p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Publications */
.publication-item {
  margin-bottom: 0.5rem;
}

.publication-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Education */
.education-item {
  margin-bottom: 0.75rem;
}

.education-item h3 {
  margin-bottom: 0.1rem;
}

.education-item .meta {
  margin-bottom: 0;
}

/* Contact */
.contact-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Footer */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* 404 */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

/* Post list on homepage */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list time {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Blog post */
.post-header {
  margin-bottom: 2rem;
}

.post-header time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-content h2 {
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-size: 1.5rem;
  margin-top: 2rem;
}

.post-content h3 {
  margin-top: 1.5rem;
}

.post-content pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.post-content code {
  font-size: 0.875em;
}

.post-content :not(pre) > code {
  background: var(--bg-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1rem 1.5rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Syntax highlighting overrides for dark theme */
pre[class*="language-"] {
  background: var(--bg-alt) !important;
}

/* Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .contact-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}
