:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1a1a1a;
  --text-secondary: #55565c;
  --accent: #1d4ed8;
  --border: #e3e4e8;
  --code-bg: #f0f1f4;
  --max-width: 1600px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --bg-alt: #1b1c22;
    --text: #f0f0f2;
    --text-secondary: #a8a9b3;
    --accent: #7aa2ff;
    --border: #2b2c34;
    --code-bg: #1f2027;
  }
}

* {
  box-sizing: border-box;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(96%, var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
}

.site-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.site-main {
  width: min(96%, var(--max-width));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 260px;
  gap: 2.5rem;
  align-items: start;
}

.page-content {
  max-width: 780px;
  margin: 0 auto;
}

.page-sidebar {
  position: sticky;
  top: 2rem;
}

.page-sidebar-left {
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.page-sidebar-left p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.page-sidebar-left a {
  font-weight: 600;
}

.page-sidebar-right {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.page-sidebar h2 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

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

.posts-sidebar-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.posts-sidebar-list a {
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1.35;
  display: block;
}

.posts-sidebar-list a:hover {
  text-decoration: underline;
}

.posts-sidebar-list .post-date {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .page-sidebar,
  .page-sidebar-left,
  .page-sidebar-right {
    position: static;
    border: none;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 0;
  }
}

.site-main h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.site-main h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
}

.site-main h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

.site-main p,
.site-main li {
  color: var(--text);
  font-size: 1.02rem;
}

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

.hero {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

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

pre code {
  background: none;
  padding: 0;
}

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

.post-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  width: min(96%, var(--max-width));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.site-footer-inner p {
  margin: 0.3rem 0;
}

.site-footer-inner a {
  color: var(--accent);
}
