/* Single post */
.read-progress {
  position: sticky;
  top: 64px;
  z-index: 40;
  height: 2px;
  background: transparent;
  overflow: hidden;
}
.read-progress i {
  display: block; height: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .1s linear;
}

.article__head {
  border-bottom: 1px solid var(--line);
  padding-block: 56px 48px;
}
.article__title { font-size: clamp(34px, 4.6vw, 60px); max-width: 22ch; }

.article__meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 20px;
  margin-bottom: 36px;
}
.article__by { display: flex; gap: 12px; align-items: center; }
.article__by .avatar { width: 40px; height: 40px; }
.article__tags { display: flex; gap: 6px; flex-wrap: wrap; }

.article__hero {
  margin: 0;
  aspect-ratio: 24 / 11;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background-color: var(--bg-soft);
  display: grid; place-items: center;
}
.article__hero[data-bg="dots"] { background-image: radial-gradient(var(--bg-grid) 1px, transparent 1px); background-size: 16px 16px; }

.article__body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  padding-block: 48px 64px;
  align-items: start;
}

/* TOC */
.toc {
  position: sticky;
  top: 92px;
  font-size: 13.5px;
}
.toc .lbl { display: block; margin-bottom: 14px; }
.toc ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  border-left: 1px solid var(--line);
}
.toc ol li a {
  display: block;
  padding: 6px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-3);
  line-height: 1.4;
  transition: color .15s ease, border-color .15s ease;
}
.toc ol li a:hover { color: var(--ink); }
.toc ol li a.active {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc__share { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.share-row { display: flex; gap: 6px; margin-top: 10px; }
.share-row a {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}
.share-row a:hover { background: var(--bg-soft); color: var(--ink); }

/* Prose */
.prose { max-width: 64ch; font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.prose .lead { font-size: 19px; color: var(--ink); line-height: 1.55; margin: 0 0 32px; }
.prose h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.018em;
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink);
  margin: 56px 0 14px;
  scroll-margin-top: 96px;
}
.prose h2::before {
  content: "";
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--ink);
  vertical-align: middle;
  margin-right: 12px;
  transform: translateY(-3px);
}
.prose p { margin: 0 0 16px; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 1px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.prose .kbd { background: var(--bg-elev); }

.callout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--accent-soft);
  border: 1px solid rgba(30,58,255,.15);
  border-radius: 10px;
}
.callout .lbl { color: var(--accent-ink); display: block; margin-bottom: 6px; }
.callout p { margin: 0; color: var(--accent-ink); }

.code {
  margin: 24px 0;
  background: #0e0f0c;
  color: #d8d8cf;
  border-radius: 12px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}
.code code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }

.bench { padding: 4px 22px 14px; margin: 24px 0; }
.bench-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.bench-row:last-child { border-bottom: 0; }
.bench-row.bench-head { color: var(--ink-4); font-size: 11px; letter-spacing: .04em; }
.bench-row > div:first-child { color: var(--ink-3); font-size: 13.5px; }

.article__cta {
  margin: 56px 0 24px;
  padding: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}

@media (max-width: 1080px) {
  .article__body { grid-template-columns: 1fr; gap: 32px; }
  .toc { position: static; }
}
