:root {
  --text: #1a1a1a;
  --text-light: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #fff;
  --bg-code: #f5f5f5;
  --border: #e5e5e5;
  --max-width: 740px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
}

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

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

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

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

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

/* Content */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Post listing */
.post-preview {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

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

.post-preview .post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.post-preview h2 {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.post-preview h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-preview h2 a:hover {
  color: var(--accent);
}

.post-preview p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.read-more {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.read-more:hover {
  color: var(--accent-hover);
}

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

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

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

.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

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

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

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

.post-content a:hover {
  text-decoration: underline;
}

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

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

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

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

.post-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  font-size: 0.88rem;
}

.post-content p code, .post-content li code {
  background: var(--bg-code);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

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

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

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

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

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

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

.post-footer a:hover {
  text-decoration: underline;
}

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

/* About page */
.content h1 {
  margin-bottom: 1.5rem;
}

.content > p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.content > hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.content > h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* Connect links */
.connect-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.connect-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.connect-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-code);
}

.connect-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e0e0e0;
    --text-light: #a0a0a0;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --bg: #121212;
    --bg-code: #1e1e1e;
    --border: #2a2a2a;
  }
}

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .content { padding: 1.5rem 1rem; }
  .post-header h1 { font-size: 1.6rem; }
  .site-header { padding: 1rem; }
}
