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

:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --tag-bg: #1f6feb22;
  --tag-border: #1f6feb55;
  --green: #3fb950;
  --orange: #d29922;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 860px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

/* Navigation */
.site-nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

/* Main content */
.site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  flex: 1;
  width: 100%;
}

/* Hero section */
.hero {
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Section headings */
.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Card grid */
.card-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card h3 a {
  color: var(--text);
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Tags */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--accent);
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Expertise list */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.expertise-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.expertise-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.expertise-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Blog / post list */
.post-list {
  list-style: none;
}

.post-list-item {
  margin-bottom: 1rem;
}

/* Post page */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.post-tags {
  display: flex;
  gap: 0.4rem;
}

.post-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.post-content {
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content code {
  font-family: var(--mono);
  background: var(--bg-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.post-content strong {
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-footer a {
  font-weight: 500;
}

/* Projects page */
.project-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.project-lang {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.project-lang::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.project-lang.java::before { background: #b07219; }
.project-lang.python::before { background: #3572A5; }
.project-lang.jupyter::before { background: #DA5B0B; }
.project-lang.shell::before { background: #89e051; }
.project-lang.html::before { background: #e34c26; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-container p {
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .site-content { padding: 2rem 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  .expertise-grid { grid-template-columns: 1fr; }
}
