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

:root {
  --ink: #1a1a2e;
  --ink-light: #555;
  --bg: #fafaf8;
  --accent: #2d5a7b;
  --border: #e0ddd8;
  --content-width: 640px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- Typography --- */
h1 { font-size: 1.8rem; line-height: 1.2; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin-top: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.25rem; }

p { margin-bottom: 1.25rem; }

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

/* --- Header --- */
header nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { color: var(--ink-light); font-size: 0.9rem; }
.nav-links a:hover { color: var(--ink); }

/* --- Home --- */
.hero {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-text { flex: 1; }

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.intro {
  font-size: 1.15rem;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .hero { flex-direction: column-reverse; align-items: center; text-align: center; }
  .avatar { width: 100px; height: 100px; }
}

.recent { margin-top: 2.5rem; }
.recent ul { list-style: none; padding: 0; }
.recent li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
}
.recent time, .post-list time {
  color: var(--ink-light);
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* --- Post list --- */
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
}

/* --- Prose --- */
.prose { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.3rem; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--ink-light);
  font-style: italic;
}
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose code {
  background: #eee;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}
.prose pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.prose pre code { background: none; padding: 0; color: inherit; }

/* --- Article header --- */
article header time {
  display: block;
  color: var(--ink-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* --- Footer --- */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--ink-light);
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  body { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .recent li, .post-list li { flex-direction: column; gap: 0; }
  .recent time, .post-list time { margin-left: 0; }
}
