/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.7;
  color: #24292f;
  background: #fff;
}

/* ── Layout ── */
main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
}

h1 { font-size: 2rem; margin-top: 0; padding-bottom: 0.4rem; border-bottom: 1px solid #d8dee4; }
h2 { font-size: 1.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid #d8dee4; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
}

/* ── Links ── */
a {
  color: #0969da;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Lists ── */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 2em;
}
li + li {
  margin-top: 0.3rem;
}

/* ── Blockquotes ── */
blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid #d0d7de;
  color: #57606a;
  background: #f6f8fa;
  border-radius: 0 6px 6px 0;
}
blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Horizontal rules ── */
hr {
  border: none;
  border-top: 1px solid #d8dee4;
  margin: 2.5rem 0;
}

/* ── Inline code ── */
code {
  padding: 0.15em 0.4em;
  font-size: 0.88em;
  background: #eff1f3;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ── Code blocks ── */
pre {
  margin: 1rem 0;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}
pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d7de;
  text-align: left;
}
th {
  background: #f6f8fa;
  font-weight: 600;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ── Bold & Italic ── */
strong { font-weight: 600; }
em { font-style: italic; }

/* ── Mermaid diagrams ── */
.mermaid {
  margin: 1.5rem 0;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  main { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
