:root {
  --primary: #6d4aff;
  --primary-soft: rgba(109, 74, 255, 0.09);
  --bg: #ffffff;
  --surface: #f8f7fc;
  --text: #29282d;
  --text-light: #68666f;
  --border: #e7e4ee;
  --code-bg: #201d2b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  line-height: 1.7;
}

a {
  color: var(--primary);
}

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

.nav,
.page,
.article {
  width: min(100% - 48px, 900px);
  margin: 0 auto;
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-light);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--primary);
}

.page {
  padding: 88px 0 96px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  max-width: 680px;
  margin-top: 12px;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.intro {
  max-width: 620px;
  margin-top: 24px;
  color: var(--text-light);
  font-size: 1.08rem;
}

.post-list {
  margin-top: 64px;
  border-top: 1px solid var(--border);
}

.post-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.post-meta,
.article-meta {
  color: var(--text-light);
  font-size: 0.86rem;
}

.post-card h2 {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--primary);
}

.post-card p {
  margin-top: 10px;
  color: var(--text-light);
}

.read-more {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.article {
  max-width: 740px;
  padding: 72px 0 104px;
}

.back-link {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--text-light);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.article-header {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.article h1 {
  margin: 14px 0 20px;
  font-size: clamp(2.25rem, 7vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.article-lead {
  margin-top: 28px;
  color: var(--text-light);
  font-size: 1.15rem;
}

.article-body {
  padding-top: 48px;
}

.article-body h2 {
  margin: 56px 0 16px;
  font-size: 1.65rem;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.article-body h3 {
  margin: 36px 0 12px;
  font-size: 1.15rem;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin-bottom: 24px;
}

.article-body ul,
.article-body ol {
  padding-left: 24px;
}

.article-body li + li {
  margin-top: 8px;
}

.article-body hr {
  height: 1px;
  margin: 48px 0;
  border: 0;
  background: var(--border);
}

.article-body blockquote {
  padding: 18px 22px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
  color: var(--text-light);
}

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

.article-body pre {
  overflow-x: auto;
  margin: 32px 0;
  padding: 24px;
  border-radius: 10px;
  background: var(--code-bg);
  color: #f4f1ff;
  font: 0.88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-body :not(pre) > code {
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: var(--primary-soft);
  color: #5637dc;
  font-size: 0.9em;
}

.article-body .mermaid {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  margin: 36px 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.article-body .mermaid svg {
  min-width: 580px;
  height: auto;
}

.callout {
  margin: 36px 0;
  padding: 22px 24px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
}

.callout p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.88rem;
}

.footer-inner {
  width: min(100% - 48px, 900px);
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner a {
  text-decoration: none;
}

@media (max-width: 640px) {
  .nav,
  .page,
  .article,
  .footer-inner {
    width: min(100% - 36px, 900px);
  }

  .nav {
    min-height: 64px;
  }

  .nav-links {
    gap: 16px;
  }

  .page {
    padding: 64px 0 72px;
  }

  .post-list {
    margin-top: 44px;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 28px 0;
  }

  .article {
    padding: 48px 0 72px;
  }

  .back-link {
    margin-bottom: 36px;
  }

  .article-header {
    padding-bottom: 36px;
  }

  .article-body {
    padding-top: 36px;
  }

  .article-body h2 {
    margin-top: 44px;
  }

  .article-body pre {
    margin-inline: -18px;
    padding: 20px 18px;
    border-radius: 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }
}
