:root {
  --background: hsl(0 0% 97%);
  --foreground: hsl(220 13% 13%);
  --card: hsl(0 0% 100%);
  --muted: hsl(220 13% 97%);
  --muted-foreground: hsl(220 9% 46%);
  --border: hsl(220 13% 91%);
  --primary: hsl(220 13% 13%);
  --primary-foreground: hsl(0 0% 100%);
  --accent: hsl(220 13% 13%);
  --radius: 0.75rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--foreground);
}

/* Top nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--foreground);
}

.nav-brand img {
  width: 24px;
  height: 24px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--foreground);
}

/* Article layout */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

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

.breadcrumb a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--foreground);
}

.article h1 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--foreground);
}

.article .lede {
  font-size: 1.15rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0 0 2.5rem;
}

.article h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  color: var(--foreground);
}

.article h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--foreground);
}

.article p {
  margin: 0 0 1.25rem;
  color: var(--foreground);
}

.article ul,
.article ol {
  padding-left: 1.5rem;
  margin: 0 0 1.5rem;
}

.article li {
  margin-bottom: 0.5rem;
}

.article strong {
  font-weight: 600;
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.article pre {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
}

.article pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

.article blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--foreground);
  background: var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted-foreground);
}

.callout {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

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

.cta-box {
  background: var(--foreground);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0;
  text-align: center;
}

.cta-box h3 {
  color: var(--primary-foreground);
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.cta-box p {
  color: hsla(0, 0%, 100%, 0.7);
  margin: 0 0 1.25rem;
}

.cta-button {
  display: inline-block;
  background: white;
  color: var(--foreground);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.15s ease;
}

.cta-button:hover {
  transform: translateY(-1px);
}

.related {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.related-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--foreground);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-card:hover {
  border-color: var(--muted-foreground);
  transform: translateY(-1px);
  text-decoration: none;
}

.related-card-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.related-card-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer a {
  color: var(--muted-foreground);
  text-decoration: none;
  margin-left: 1rem;
}

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

@media (max-width: 640px) {
  .article h1 {
    font-size: 2rem;
  }
  .article .lede {
    font-size: 1.05rem;
  }
  .footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .footer div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .footer a {
    margin-left: 0;
  }
  .nav-links {
    gap: 1rem;
    font-size: 0.8rem;
  }
}

/* Blog additions (shared with /docs/ layout) */
.post-meta {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin: 0 0 1.25rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
}

.tag {
  font-size: 0.75rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--muted-foreground);
}

.post-hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0 0 2rem;
}

/* Article content emitted by the blog renderer (mirrors .article rules so
   distribb HTML picks up the same typography). */
.post-body h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  color: var(--foreground);
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--foreground);
}

.post-body p {
  margin: 0 0 1.25rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin: 0 0 1.5rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.post-body pre {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--foreground);
  background: var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted-foreground);
}

.related-card .post-meta {
  margin: 0.5rem 0 0;
}
