:root {
  color-scheme: light dark;
  --bg: #f8f5ef;
  --text: #1f2933;
  --muted: #667085;
  --link: #4f46e5;
  --card: #ffffff;
  --border: #e4ddd1;
  --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --text: #e8e6e3;
    --muted: #9ca3af;
    --link: #a5b4fc;
    --card: #1a1d27;
    --border: #2d3348;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

.site-header,
.site-main,
.site-footer {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.site-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
}

.site-main {
  padding: 48px 0 64px;
}

.site-footer {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.hero {
  margin-bottom: 40px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.nav-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

@media (min-width: 560px) {
  .nav-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.nav-card {
  display: block;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.nav-card:hover {
  text-decoration: none;
  border-color: var(--link);
}

.nav-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.nav-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-list h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}

.post-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  line-height: 1.2;
}

.page-description {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.post-content {
  font-size: 1.05rem;
}

.post-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.post-content h2:first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-top: 0;
  margin-bottom: 1rem;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.post-content blockquote {
  margin: 1rem 0;
  padding: 12px 16px;
  border-left: 3px solid var(--link);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

.post-content code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.post-content :not(pre) > code {
  padding: 0.15em 0.35em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.page-nav span {
  color: var(--muted);
}
