/* Base Theme */
:root {
  --bg: #ffffff;
  --fg: #1f1f1f;
  --muted: #666;
  --accent: #f3f4f6;
  --primary: #007acc;
  --code-bg: #f5f7f9;
  --border: #ddd;
  --radius: 8px;
  --font-main: 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e0e0e0;
    --muted: #999;
    --accent: #1f1f1f;
    --primary: #4ea3ff;
    --code-bg: #1e1e1e;
    --border: #333;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-main);
  line-height: 1.75;
  max-width: 900px;
  margin-inline: auto;
}

h1, h2, h3 {
  color: var(--fg);
  margin-top: 2.2rem;
}

p, li {
  color: var(--fg);
  font-size: 1.05rem;
}

nav {
  text-align: center;
  margin-bottom: 2rem;
}

nav a {
  color: var(--primary);
  margin: 0 1rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

section {
  background-color: var(--accent);
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

pre, code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

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

code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

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

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

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

footer {
  text-align: center;
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

body[data-theme='dark'] {
  --bg: #121212;
  --fg: #e0e0e0;
  --muted: #999;
  --accent: #1f1f1f;
  --primary: #4ea3ff;
  --code-bg: #1e1e1e;
  --border: #333;
}

body[data-theme='light'] {
  --bg: #ffffff;
  --fg: #1f1f1f;
  --muted: #666;
  --accent: #f3f4f6;
  --primary: #007acc;
  --code-bg: #f5f7f9;
  --border: #ddd;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 1000;
  transition: background 0.3s;
}
.theme-toggle:hover {
  background: var(--primary);
  color: white;
}
