:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #e5e7eb;
  --text: #18181b;
  --muted: #52525b;
  --accent: #0f62fe;
  --accent-hover: #0043ce;
  --code-bg: #f3f4f6;
  --code-border: #e2e8f0;
  --tag-bg: #eef2ff;
  --tag-text: #1d4ed8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --code-bg: #161b22;
    --code-border: #30363d;
    --tag-bg: #1f2937;
    --tag-text: #93c5fd;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.72;
}

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

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

.wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 1.15rem;
  margin-bottom: 2rem;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

nav.site-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.94rem;
}

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

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--text);
  font-weight: 600;
}

.intro-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 2.2rem;
  font-size: 0.96rem;
}

.intro-box p {
  margin: 0;
}

h1, h2, h3 {
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.85rem;
  margin: 0 0 0.65rem;
}

h2 {
  font-size: 1.32rem;
  margin: 2.1rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.08rem;
  margin: 1.4rem 0 0.5rem;
}

.year-heading {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin: 2rem 0 0.85rem;
}

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

.post-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.post-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--muted);
  min-width: 6.2rem;
}

.post-title {
  font-weight: 600;
  font-size: 1.03rem;
  color: var(--text);
}

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

.post-summary {
  margin: 0.35rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
}

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  padding: 0.12rem 0.48rem;
  border-radius: 4px;
}

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

article.post-content ul,
article.post-content ol {
  margin: 0 0 1.1rem;
  padding-left: 1.45rem;
}

article.post-content li {
  margin-bottom: 0.35rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.87em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.1rem 0.32rem;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

pre code {
  border: none;
  padding: 0;
  background: transparent;
  font-size: 0.85rem;
}

blockquote {
  margin: 0 0 1.15rem;
  padding: 0.65rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 600;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

footer.site-footer {
  margin-top: 3.5rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}
