:root {
  --bg: #ffffff;
  --bg-code: #f6f8fa;
  --text: #1f2328;
  --text-muted: #656d76;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --sidebar-bg: #f6f8fa;
  --table-stripe: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-code: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --sidebar-bg: #161b22;
    --table-stripe: #161b22;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 2rem;
}

.sidebar .logo img {
  width: 36px;
  height: 36px;
}

.sidebar .logo span {
  font-size: 1.25rem;
  font-weight: 600;
}

.sidebar nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  margin: 0.15rem 0;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--text);
  background: var(--bg);
}

.sidebar nav a.active {
  font-weight: 600;
  color: var(--accent);
}

.sidebar .github-link {
  display: block;
  margin-top: 1.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
}

.sidebar .github-link:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

/* Main content */
.main {
  margin-left: 260px;
  flex: 1;
  max-width: 860px;
  padding: 2.5rem 3rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

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

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

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
}

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

tr:nth-child(even) {
  background: var(--table-stripe);
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.3rem;
}

.endpoint {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
}

.endpoint dt {
  font-weight: 600;
  margin-top: 0.75rem;
  color: var(--accent);
}

.endpoint dd {
  margin-left: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 2rem 1.25rem;
    padding-top: 3.5rem;
  }
}
