:root {
  /* Dark theme */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --text-primary: #c9d1d9;
  --text-secondary: #e6edf3;
  --text-muted: #8b949e;
  --link-color: #58a6ff;
  --border-color: #30363d;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --text-primary: #24292f;
    --text-secondary: #1f2328;
    --text-muted: #656d76;
    --link-color: #0969da;
    --border-color: #d0d7de;
  }
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 2rem;
  margin: 0 auto;
  max-width: 80ch;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
  margin-top: 1.5em;
  margin-bottom: 1em;
  font-weight: 600;
  color: var(--text-secondary);
}

h1 { font-size: 2em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.4em; }
h4 { font-size: 1.2em; }
h5 { font-size: 1em; }
h6 { font-size: 0.9em; }

p {
  margin: 1em 0;
}

ul, ol {
  padding-left: 2em;
  margin: 1em 0;
}

li {
  margin-bottom: 0.3em;
}

code {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.95em;
}

pre {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1em;
  border-radius: 6px;
  overflow: auto;
  font-family: monospace;
  font-size: 0.95em;
  line-height: 1.6;
}

blockquote {
  border-left: 4px solid var(--border-color);
  padding-left: 1em;
  color: var(--text-muted);
  margin: 1em 0;
}

table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}

th, td {
  border: 1px solid var(--border-color);
  padding: 0.6em 1em;
}

th {
  background-color: var(--bg-secondary);
  font-weight: 600;
}

img {
  max-width: 100%;
  display: block;
  margin: 1em 0;
}

@media (max-width: 768px) {
  body {
    font-size: 1.15em;
    padding: 1.25rem;
    max-width: none;
    margin: 0;
  }
  h1 { font-size: 2.2em; }
  h2 { font-size: 1.8em; }
  h3 { font-size: 1.5em; }
  h4 { font-size: 1.3em; }
  pre, code {
    font-size: 1em;
  }
  table {
    display: block;
    overflow-x: auto;
    width: 100%;
  }
  th, td {
    white-space: nowrap;
  }
}
