:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1e2530;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-faint: #6e7681;
  --accent: #58a6ff;
  --accent-2: #7ee787;
  --danger: #f85149;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.22);

  --content-width: 780px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Base */
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Main wrapper */
.wrapper,
.container,
main {
  width: min(100% - 32px, var(--content-width));
  margin: 0 auto;
}

/* Header / nav */
.site-header,
header.site-header,
header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.site-header .wrapper,
header .wrapper,
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.site-title,
.logo,
header h1 a {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  text-decoration: none;
}

nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-left: 18px;
}

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

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

.post-list li,
.posts article,
.post-card {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}

.post-list h2,
.posts h2,
.post-card h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post-list h2 a,
.posts h2 a,
.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-list h2 a:hover,
.posts h2 a:hover,
.post-card h2 a:hover {
  color: var(--accent);
}

.post-meta,
.post-date,
.post-author,
.post-categories {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-excerpt {
  color: var(--text-muted);
  margin-top: 10px;
}

/* Single post */
.post,
article.post,
.post-content {
  width: min(100%, var(--content-width));
  margin: 0 auto 64px;
}

.post-header {
  margin-bottom: 36px;
}

.post-title,
article h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--text);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Article typography */
.post-content p,
article p {
  margin: 0 0 18px;
  max-width: 72ch;
}

.post-content h2,
article h2 {
  margin: 42px 0 14px;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--text);
}

.post-content h3,
article h3 {
  margin: 28px 0 10px;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.post-content ul,
.post-content ol,
article ul,
article ol {
  margin: 0 0 18px 22px;
}

.post-content li,
article li {
  margin-bottom: 8px;
}

.post-content strong,
article strong {
  color: #f0f6fc;
}

.post-content blockquote,
article blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(88, 166, 255, 0.08);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text);
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  color: #e6edf3;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.04);
}

/* Code blocks */
pre {
  overflow-x: auto;
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #e6edf3;
  display: block;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

th {
  background: var(--surface);
  color: var(--text);
}

td {
  background: rgba(255,255,255,0.01);
}

/* Small tag style */
.tag,
.category,
.post-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Footer */
.site-footer,
footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 56px;
  padding: 24px 0 40px;
}

/* Selection + focus */
::selection {
  background: rgba(88, 166, 255, 0.28);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Mobile */
@media (max-width: 640px) {
  .site-header .wrapper,
  header .wrapper,
  header nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav a {
    margin-left: 0;
    margin-right: 14px;
  }

  .post-title,
  article h1 {
    font-size: 2rem;
  }

  pre {
    padding: 14px 16px;
  }
}
