/* Shared top bar for the blog episodes.
   The episodes are standalone documents with their own inline dark theme — they
   don't load the site's styles.css, so they had no way back to the site except
   the footer. This is a small bar in the episodes' own palette rather than the
   main site header, which would drag the whole commercial stylesheet (and its
   clashing :root tokens) into every episode. */
.sitebar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border, #2a313c);
}
.sitebar__inner {
  max-width: var(--maxw, 860px); margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 24px;
}
.sitebar__logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; color: var(--ink, #e6edf3); text-decoration: none;
}
.sitebar__logo:hover { text-decoration: none; }
.sitebar__mark {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, var(--accent, #6c8cff), var(--accent2, #a371f7));
}
.sitebar__sub {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted, #9aa7b4); font-weight: 700;
}
.sitebar__links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.sitebar__links a { color: var(--muted, #9aa7b4); font-size: 14px; font-weight: 600; text-decoration: none; }
.sitebar__links a:hover { color: var(--ink, #e6edf3); text-decoration: none; }
.sitebar__eps { display: inline-flex; align-items: center; gap: 6px; }
.sitebar__eps span { font-size: 12px; color: var(--muted, #9aa7b4); text-transform: uppercase; letter-spacing: 1px; }
.sitebar__eps a {
  min-width: 24px; text-align: center; padding: 2px 0; border-radius: 6px;
  border: 1px solid var(--border, #2a313c);
}
.sitebar__eps a[aria-current="page"] {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent, #6c8cff), var(--accent2, #a371f7));
}
/* Keep the in-page anchors clear of the sticky bar. */
:target, h2[id], h3[id] { scroll-margin-top: 64px; }
/* On a phone the full set wraps to three rows and eats a third of the screen.
   Keep the three site links — that's what the bar is for — and drop the episode
   chips, which the article's own prev/next links already cover. */
@media (max-width: 640px) {
  .sitebar__inner { flex-wrap: nowrap; gap: 12px; padding: 8px 16px; }
  .sitebar__links { gap: 12px; }
  .sitebar__links a { font-size: 13px; white-space: nowrap; }
  .sitebar__logo { font-size: 14px; flex: 0 0 auto; }
  .sitebar__sub, .sitebar__eps { display: none; }
}
