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

:root {
  --bg: #fff;
  --text: #111;
  --text-secondary: #555;
  --border: #e0e0e0;
  --link: #0055ff;
  --link-hover: #0033cc;
  --code-bg: #f5f5f5;
  --max-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --text: #e0e0e0;
    --text-secondary: #999;
    --border: #333;
    --link: #6ea8fe;
    --link-hover: #9ec5fe;
    --code-bg: #1a1a1a;
  }
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

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

header {
  margin-bottom: 3rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

header h1 a {
  color: var(--text);
}

header h1 a:hover {
  text-decoration: none;
}

nav {
  margin-top: 0.5rem;
}

nav a {
  margin-right: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.bio {
  margin-bottom: 3rem;
}

.bio p {
  color: var(--text-secondary);
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 1.25rem;
}

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

.post-list time {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

article {
  margin-bottom: 3rem;
}

article h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

article .meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

article p {
  margin-bottom: 1.25rem;
}

article h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

article h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

article ul,
article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.25rem;
}

article code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

article pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

article pre code {
  background: none;
  padding: 0;
}

article blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* 404 */
.not-found {
  text-align: center;
  padding-top: 4rem;
}

.not-found h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.not-found p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
