:root {
  --accent: #ee4c2c;
  --accent-hover: #c9371e;
  --accent-soft: #fef2f0;
  --text: #333;
  --text-muted: #767676;
  --heading: #111;
  --bg: #fff;
  --bg-code: #f6f6f6;
  --border: #e0e0e0;
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff6f56;
    --accent-hover: #ff8e7a;
    --accent-soft: #3d1a10;
    --text: #ccc;
    --text-muted: #888;
    --heading: #e0e0e0;
    --bg: #1a1a1a;
    --bg-code: #242424;
    --border: #333;
  }
}

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

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

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

a.site-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

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

.site-header nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
}

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

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }

p { margin-bottom: 1rem; }

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

article img { max-width: min(700px, 100%); height: auto; margin: 1.5rem 0; display: block; }

ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.2rem; }

blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
}

blockquote p:last-child { margin-bottom: 0; }

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

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--bg-code);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

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

pre code { background: transparent; padding: 0; border-radius: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9em;
}

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

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

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.3rem;
}

.site-intro {
  text-align: center;
  padding: 3rem 2rem;
  margin-bottom: 2.5rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}

.site-intro h1 { font-size: 2.2rem; margin-bottom: 0.5rem; color: var(--accent); }

.site-intro p {
  color: var(--heading);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

.section-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--heading);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-soft);
}

.post-entry {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

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

.post-entry h3 { font-size: 1.1rem; margin: 0 0 0.15rem; }

.post-entry h3 a { color: var(--heading); text-decoration: none; }
.post-entry h3 a:hover { color: var(--accent); text-decoration: none; }

.post-entry .meta { margin-bottom: 0.5rem; }

.post-entry .summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.post-entry .read-more { font-size: 0.85rem; font-weight: 500; }

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

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

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

.post-list .date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-list a { color: var(--heading); font-weight: 500; text-decoration: none; }
.post-list a:hover { color: var(--accent); }

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

.topic-list li { padding: 0.4rem 0; }

.topic-list a { color: var(--heading); font-weight: 500; text-decoration: none; }
.topic-list a:hover { color: var(--accent); }

.topic-list .count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

.home-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.home-main {
  flex: 1;
  min-width: 0;
}

.home-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
}

.home-sidebar .section-heading {
  font-size: 1.1rem;
  margin-top: 0;
}

@media (max-width: 768px) {
  .home-layout {
    flex-direction: column;
  }
  .home-sidebar {
    width: 100%;
    position: static;
  }
}

@media (max-width: 600px) {
  .site-header { padding: 1rem; }
  .site-intro h1 { font-size: 1.6rem; }
  h1 { font-size: 1.5rem; }
}
