/* ─────────────────────────────────────────────────────────────────────────────
   pulsar_content — Markdown styles
   Designed for developer documentation. Precise, opinionated, technical.
───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ───────────────────────────────────────────────────────────────── */

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2128;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-subtle: #6e7681;
  --accent:      #7c6af7;
  --accent-dim:  rgba(124, 106, 247, 0.15);
  --accent-glow: rgba(124, 106, 247, 0.08);
  --green:       #3fb950;
  --red:         #f85149;
  --yellow:      #d29922;
  --inline-bg:   #1c2128;

  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Cascadia Code', monospace;

  --radius:     6px;
  --radius-lg:  10px;
}

/* ── App shell ────────────────────────────────────────────────────────────── */

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── App nav ──────────────────────────────────────────────────────────────── */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  height: 56px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.app-nav a:first-child {
  color: var(--accent);
  font-weight: 600;
  margin-right: 16px;
  padding-left: 0;
}

.app-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

/* ── App layout ───────────────────────────────────────────────────────────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
}

/* ── Doc page layout ──────────────────────────────────────────────────────── */

.doc-page {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.doc-sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 32px 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.doc-sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 20px 12px;
}

.doc-nav-list {
  list-style: none;
}

.doc-nav-link {
  display: block;
  padding: 7px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.doc-nav-link:hover {
  color: var(--text);
  background: var(--accent-glow);
}

.doc-nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 500;
}

/* ── Doc main ─────────────────────────────────────────────────────────────── */

.doc-main {
  padding: 48px 64px;
  max-width: 900px;
}

.doc-header {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.doc-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.doc-description {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Blog layout ──────────────────────────────────────────────────────────── */

.blog-post {
  max-width: 72ch;
  margin: 64px auto;
  padding: 0 24px;
}

.blog-header {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.blog-title {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.blog-date {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.blog-description {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.blog-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(124, 106, 247, 0.3);
}

/* ── Content body — Markdown rendered HTML ────────────────────────────────── */

.pulsar-content-body {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

/* Headings */

.pulsar-content-body h1,
.pulsar-content-body h2,
.pulsar-content-body h3,
.pulsar-content-body h4,
.pulsar-content-body h5,
.pulsar-content-body h6 {
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.pulsar-content-body h1 { font-size: 1.75rem; }
.pulsar-content-body h2 {
  font-size: 1.35rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.pulsar-content-body h3 { font-size: 1.15rem; }
.pulsar-content-body h4 { font-size: 1rem; }

/* Signature element: accent left-border on h2 marker */
.pulsar-content-body h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Paragraphs and lists */

.pulsar-content-body p {
  margin-bottom: 1.25em;
}

.pulsar-content-body ul,
.pulsar-content-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.pulsar-content-body li {
  margin-bottom: 0.4em;
}

.pulsar-content-body li::marker {
  color: var(--accent);
}

/* Inline code */

.pulsar-content-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--inline-bg);
  border: 1px solid var(--border);
  color: #a5d6ff;
}

/* Code blocks */

.pulsar-content-body pre {
  margin: 1.5em 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
  position: relative;
}

.pulsar-content-body pre::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pulsar-content-body pre code {
  display: block;
  padding: 20px 24px;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
}

/* Blockquote */

.pulsar-content-body blockquote {
  margin: 1.5em 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

.pulsar-content-body blockquote p {
  margin: 0;
}

/* Links */

.pulsar-content-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.pulsar-content-body a:hover {
  border-bottom-color: var(--accent);
}

/* Tables */

.pulsar-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.pulsar-content-body th {
  background: var(--surface);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.pulsar-content-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.pulsar-content-body tr:last-child td {
  border-bottom: none;
}

/* Horizontal rule */

.pulsar-content-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Strong and em */

.pulsar-content-body strong {
  font-weight: 600;
  color: var(--text);
}

.pulsar-content-body em {
  color: var(--text-muted);
}

/* ── Home page ────────────────────────────────────────────────────────────── */

.home {
  max-width: 640px;
  margin: 96px auto;
  padding: 0 24px;
  text-align: center;
}

.home h1 {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.home p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.home a {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.15s, transform 0.1s;
}

.home a:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── 404 ──────────────────────────────────────────────────────────────────── */

.not-found {
  max-width: 480px;
  margin: 128px auto;
  padding: 0 24px;
  text-align: center;
}

.not-found h1 {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 500;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.not-found a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .doc-page {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  .doc-main {
    padding: 32px 20px;
  }

  .blog-post {
    margin: 32px auto;
  }

  .home h1 {
    font-size: 2.25rem;
  }
}
