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

:root {
  --bg: #1a1a1a;
  --bg-card: #242424;
  --border: #333;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #5b9bd5;
  --accent-hover: #7ab3e0;
  --font: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, monospace;
  --max-width: 860px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Nav */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
}
.site-title:hover { color: var(--accent-hover); text-decoration: none; }

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
nav ul a:hover, nav ul a.active { color: var(--text); text-decoration: none; }

/* Main */
main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-logo {
  display: block;
  max-width: 320px;
  width: 100%;
  margin: 1.5rem auto;
  border-radius: 12px;
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s;
}
.button:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

.button-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.button-secondary:hover { background: var(--border); color: var(--text); }

.intro {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

/* Page / Article */
.page h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.page h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.page h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.page p { margin-bottom: 1rem; }
.page ul, .page ol { margin: 0 0 1rem 1.5rem; }
.page li { margin-bottom: 0.3rem; }

.page pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

.page code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.page pre code { background: none; padding: 0; font-size: inherit; }

/* Section index */
.section-index {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.section-index li {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.section-index li:first-child { border-top: 1px solid var(--border); }

.section-index a { font-weight: 500; }

.section-index span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Callouts (GitHub-style alerts) */
.markdown-alert {
  border-left: 4px solid;
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
}

.markdown-alert p { margin-bottom: 0; }
.markdown-alert p + p { margin-top: 0.5rem; }

.markdown-alert-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem !important;
  text-transform: capitalize;
}

.markdown-alert-note   { border-color: #4a9eff; }
.markdown-alert-tip    { border-color: #3fb950; }
.markdown-alert-important { border-color: #a371f7; }
.markdown-alert-warning   { border-color: #d29922; }
.markdown-alert-caution   { border-color: #f85149; }

.markdown-alert-note    .markdown-alert-title { color: #4a9eff; }
.markdown-alert-tip     .markdown-alert-title { color: #3fb950; }
.markdown-alert-important .markdown-alert-title { color: #a371f7; }
.markdown-alert-warning   .markdown-alert-title { color: #d29922; }
.markdown-alert-caution   .markdown-alert-title { color: #f85149; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }
