:root {
  --bg:         #0a0a0a;
  --surface:    #111;
  --border:     #222;
  --text:       #ccc;
  --text-muted: #666;
  --accent:     #8be9fd;
  --link:       #8be9fd;
}

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

html { font-size: 16px; }

body {
  font-family: Charter, 'Bitstream Charter', Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

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

.site-nav {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* Home */
.intro {
  margin: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-links {
  margin: 1.5rem 0 2.5rem;
  font-size: 0.85rem;
}

.section-links span {
  color: var(--text-muted);
}

.section-links a {
  margin-right: 1rem;
}

.section-heading {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-item {
  padding: 0.4rem 0;
}

.post-item a {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  text-decoration: none;
  color: var(--text);
}

.post-item a:hover {
  color: var(--link);
}

.post-item .date {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  min-width: 6.5em;
}

.post-item .title {
  font-size: 0.9rem;
}

.post-item .section-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* List page */
.list-header {
  margin-bottom: 2rem;
}

.list-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.list-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.empty-notice {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-content {
  font-size: 0.9rem;
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2rem 0 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-content h1 { font-size: 1.3rem; }
.post-content h2 { font-size: 1.1rem; }
.post-content h3 { font-size: 1rem; }
.post-content h4 { font-size: 0.9rem; color: var(--text-muted); }

.post-content p { margin-bottom: 1.25rem; }

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

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

.post-content blockquote {
  border-left: 2px solid var(--border);
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

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

.post-content img {
  max-width: 100%;
  margin: 1rem 0;
  display: block;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
}

.post-content th {
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 700;
}

.post-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
}

/* Code */
.post-content code {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  background: var(--surface);
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

.post-content pre {
  background: var(--surface) !important;
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.highlight {
  margin: 1.5rem 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.highlight > pre,
.highlight > .chroma {
  margin: 0;
  border: none;
  padding: 1rem;
  background: var(--surface) !important;
}

.lntd pre {
  padding: 0;
  border: none;
  margin: 0;
}

/* Tags */
.post-tags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-tags a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-tags a:hover {
  color: var(--link);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.site-footer a:hover {
  color: var(--link);
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  color: var(--text-muted);
}

.social-links a:hover {
  color: var(--link);
}

.social-links svg {
  width: 16px;
  height: 16px;
}

/* Responsive */
@media (max-width: 640px) {
  .site-nav { gap: 0.75rem; }
  .post-header h1 { font-size: 1.25rem; }
  .post-item a { flex-wrap: wrap; gap: 0.25rem; }
}
