@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #fafaf9; --surface: #ffffff; --text: #1c1917; --text-secondary: #57534e;
  --accent: #b45309; --accent-light: #fef3c7; --border: #e7e5e4;
  --code-bg: #1e1e2e; --code-text: #cdd6f4; --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09; --surface: #1c1917; --text: #e7e5e4; --text-secondary: #a8a29e;
    --accent: #f59e0b; --accent-light: #451a0320; --border: #292524;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; }

/* Header */
.header { border-bottom: 1px solid var(--border); padding: 1.5rem 2rem; display: flex; justify-content: space-between; align-items: center; max-width: 960px; margin: 0 auto; }
.header-brand { font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); letter-spacing: 0.02em; text-decoration: none; }
.header-brand span { color: var(--accent); }
.header-actions { display: flex; gap: 0.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 1rem; font-size: 0.8rem; font-weight: 500; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; background: none; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.btn:hover { background: var(--accent); color: white; }

/* Hero */
.hero { max-width: var(--max-width); margin: 4rem auto 0; padding: 0 2rem; }
.hero h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 1rem; }
.byline { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.3rem; }
.byline a { color: var(--accent); text-decoration: none; }
.dateline { color: var(--text-secondary); font-size: 0.85rem; opacity: 0.7; }

/* Article */
article { max-width: var(--max-width); margin: 3rem auto; padding: 0 2rem 3rem; }
article h2 { font-size: 1.5rem; font-weight: 700; margin: 3rem 0 1rem; letter-spacing: -0.02em; padding-top: 1rem; border-top: 1px solid var(--border); }
article h2:first-child { border-top: none; padding-top: 0; }
article h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }
article p { margin-bottom: 1.1rem; }
article strong { font-weight: 600; }
article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
article ul, article ol { margin: 0.5rem 0 1.2rem 1.5rem; }
article li { margin-bottom: 0.4rem; }
article blockquote { border-left: 3px solid var(--accent); padding: 0.75rem 1.25rem; margin: 1.5rem 0; background: var(--accent-light); border-radius: 0 6px 6px 0; color: var(--text-secondary); font-style: italic; }
article code { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; background: var(--surface); border: 1px solid var(--border); padding: 0.15em 0.4em; border-radius: 4px; }
article pre { background: var(--code-bg); color: var(--code-text); padding: 1.25rem 1.5rem; border-radius: 8px; overflow-x: auto; margin: 1.2rem 0; font-size: 0.85rem; line-height: 1.6; }
article pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
article hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Nav */
.post-nav { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem 2rem; display: flex; justify-content: space-between; font-size: 0.9rem; }
.post-nav a { color: var(--accent); text-decoration: none; }

/* Footer */
.footer { border-top: 1px solid var(--border); max-width: var(--max-width); margin: 0 auto; padding: 2rem; color: var(--text-secondary); font-size: 0.8rem; text-align: center; }
.footer a { color: var(--accent); text-decoration: none; }

/* Index page */
.posts { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem 6rem; }
.post-card { display: block; padding: 1.5rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.post-card:hover .post-title { color: var(--accent); }
.post-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.3rem; transition: color 0.15s; }
.post-meta { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.5rem; }
.post-excerpt { color: var(--text-secondary); font-size: 0.95rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .hero, article, .posts, .post-nav { padding-left: 1.25rem; padding-right: 1.25rem; }
  .header { padding: 1rem 1.25rem; }
}
