:root {
  --bg: #0b0e0f;
  --bg-elevated: #111517;
  --border: #1f2628;
  --text: #d8dee1;
  --text-dim: #8b969a;
  --accent: #7ee787;
  --accent-dim: #4f9e5c;
  --code-bg: #1a2226;
  --link: #7ee787;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-width: 760px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafaf8;
    --bg-elevated: #ffffff;
    --border: #e3e3df;
    --text: #1c2224;
    --text-dim: #5b6669;
    --accent: #1a7f37;
    --accent-dim: #0f5c26;
    --code-bg: #f1f2ee;
    --link: #1a7f37;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-title .prompt {
  color: var(--accent);
}

.site-title .cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--accent);
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav.site-nav {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

nav.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 1.25rem;
}

nav.site-nav a:first-child { margin-left: 0; }

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

.site-tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0.5rem 0 0;
}

/* main */
main {
  padding: 2.5rem 0 4rem;
  min-height: 50vh;
}

/* post list */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.post-icon {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.1rem;
}

.post-item-body { min-width: 0; flex: 1; }

.post-list li:first-child { padding-top: 0; }

.post-list a.title {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.08rem;
}

.post-list a.title:hover { color: var(--accent); }

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.post-summary {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* single post */
article.post h1.post-title {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.post-header-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.post-header-meta .tag {
  color: var(--accent-dim);
}

.post-content {
  font-size: 1.02rem;
}

.post-content h2,
.post-content h3 {
  margin-top: 2.2rem;
  letter-spacing: -0.01em;
}

.post-content p { margin: 1rem 0; }

.post-content a {
  color: var(--link);
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.post-content a:hover { text-decoration-color: var(--link); }

.post-content code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-content blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 1rem;
  border-left: 3px solid var(--accent-dim);
  color: var(--text-dim);
}

.post-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.post-content ul, .post-content ol {
  padding-left: 1.3rem;
}

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

/* tags */
.tag-list { list-style: none; padding: 0; }
.tag-list a {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* 404 */
.not-found {
  text-align: center;
  padding: 4rem 0;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
