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

/* Variables */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #0066cc;
  --border: #e0e0e0;
  --surface: #f8f9fa;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --text-muted: #999;
    --accent: #6cb4ee;
    --border: #333;
    --surface: #252525;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.site-nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

/* Home hero */
.hero {
  padding: 3rem 0;
  text-align: center;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); font-size: 1.15rem; }

/* Section headings */
.section-heading {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Post list */
.post-list { list-style: none; }
.post-list li { margin-bottom: 1.5rem; }
.post-list .post-date { color: var(--text-muted); font-size: 0.9rem; }
.post-list a { text-decoration: none; color: var(--accent); font-size: 1.1rem; }
.post-list p { color: var(--text-muted); margin-top: 0.25rem; }

/* Portfolio grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.portfolio-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s;
}

.portfolio-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.portfolio-card h3 { margin-bottom: 0.5rem; }
.portfolio-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Post content */
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 2rem; }
.post-header time { color: var(--text-muted); font-size: 0.9rem; }
.post-content h2 { margin: 2rem 0 0.75rem; }
.post-content p { margin-bottom: 1rem; }
.post-content a { color: var(--accent); }
.post-content ul, .post-content ol { margin: 0 0 1rem 1.5rem; }
.post-content img { max-width: 100%; border-radius: 4px; }
.post-content code {
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--surface);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.post-content pre code { background: none; padding: 0; }

.portfolio-image {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

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

/* About page */
.about-content p { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
  .header-content { flex-direction: column; gap: 0.75rem; }
  .site-nav a { margin-left: 0; margin-right: 1rem; }
}
