/* ============================================================
   StackNova — article page styles (v1)
   Loaded on top of styles.css for /paths/.../article pages.
   ============================================================ */

/* ---------- ARTICLE HERO ---------- */
.article-hero {
  position: relative;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.article-hero::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 80% at 80% 0%, color-mix(in oklab, var(--accent) 12%, transparent) 0%, transparent 60%);
}
.article-hero .wrap { position: relative; z-index: 1; }

.crumbs {
  display: flex; width: fit-content; align-items: center; gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 36px;
}
.crumbs a { color: var(--ink-2); transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs .sep { color: var(--muted); opacity: 0.5; }
.crumbs .here { color: var(--ink); }

.article-eyebrow {
  display: flex; width: fit-content; align-items: center; gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  margin-bottom: 28px;
}
.article-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
.article-eyebrow .sep { color: var(--muted); opacity: 0.5; }

/* Author byline — sits directly under the eyebrow pill.
   Required on every article (see CLAUDE.md StackNova-v1 hard rules). */
.article-byline {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: -10px 0 32px 4px;
  display: flex; align-items: center; gap: 8px;
}
.article-byline a {
  color: var(--ink);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  padding-bottom: 1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.article-byline a:hover { color: var(--accent-ink); border-color: var(--accent); }

h1.article-title {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(56px, 8.4vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--ink);
  max-width: 18ch;
}
h1.article-title em { font-style: italic; color: var(--accent-ink); }

.article-sub {
  font-size: 22px;
  color: var(--ink-2);
  line-height: 1.45;
  max-width: 56ch;
  margin: 0 0 48px;
  text-wrap: pretty;
}

.article-meta {
  display: flex; align-items: center; gap: 36px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.article-meta .author { display: flex; align-items: center; gap: 12px; }
.article-meta .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), oklch(0.5 0.18 25));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-family: "Inter Tight", sans-serif;
  font-size: 13px; font-weight: 600;
}
.article-meta .name { font-size: 14.5px; color: var(--ink); font-weight: 500; line-height: 1.2; }
.article-meta .role {
  font-size: 11.5px; color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em; margin-top: 2px;
}
.article-meta .item {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted);
  display: inline-flex; flex-direction: column;
  gap: 2px;
}
.article-meta .item b {
  color: var(--ink); font-weight: 500;
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 18px;
  letter-spacing: -0.01em;
}

/* COVER CARD — terminal-style code window */
.cover-card {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cover-card .strip {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.cover-card .strip .lights { display: flex; gap: 6px; margin-right: 14px; }
.cover-card .strip .light {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-2);
}
.cover-card .strip .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em;
  margin-left: auto;
}
.cover-card .body {
  padding: 28px 32px;
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
}
.cover-card .line { display: block; }
.cover-card .prompt { color: var(--accent); margin-right: 10px; }
.cover-card .comment { color: var(--muted); }
.cover-card .key { color: var(--accent-ink); }

/* ---------- BODY (TOC + PROSE) ---------- */
.article-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  padding: 80px 0 100px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 88px;
  align-self: start;
}
.toc-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.toc ol {
  list-style: none; padding: 0; margin: 0;
  counter-reset: toc;
  display: flex; flex-direction: column; gap: 10px;
}
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13.5px; line-height: 1.4;
  transition: color .2s var(--ease);
  padding: 4px 0;
}
.toc a:hover, .toc a.active { color: var(--ink); }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.toc a.active::before { color: var(--accent); }

.prose {
  max-width: 68ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
  min-width: 0;
}
.prose > p, .prose > ul, .prose > ol, .prose > pre, .prose > blockquote {
  margin: 0 0 22px;
}
.prose > section { margin-bottom: 56px; }
.prose > section:last-child { margin-bottom: 0; }

.prose section h2 {
  position: relative;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 24px;
  padding-top: 32px;
}
.prose section h2 em { font-style: italic; color: var(--accent-ink); }
.prose section h2::before {
  content: attr(data-n);
  position: absolute; top: 0; left: 0;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--accent);
}
.prose h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 26px; line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
  color: var(--ink);
}
.prose p { color: var(--ink-2); text-wrap: pretty; margin: 0 0 22px; }
.prose p strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-size: 100% 1px;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: color .2s var(--ease), background-size .2s var(--ease);
}
.prose a:hover { color: var(--accent-ink); background-size: 100% 2px; }

.prose code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--ink);
}
.prose pre {
  margin: 8px 0 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  position: relative;
}
.prose pre code {
  background: none; border: none; padding: 0; font-size: inherit; color: inherit;
}
.prose pre .prompt { color: var(--accent); margin-right: 10px; user-select: none; }
.prose pre .comment { color: var(--muted); }

.prose ul, .prose ol { padding-left: 0; list-style: none; margin: 8px 0 24px; }
.prose ul li, .prose ol li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px dashed var(--line);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}
.prose ul li:last-child, .prose ol li:last-child { border-bottom: none; }
.prose ul li::before {
  content: "";
  position: absolute; left: 0; top: 24px;
  width: 22px; height: 1px;
  background: var(--accent);
}
.prose ol { counter-reset: olc; }
.prose ol li { counter-increment: olc; }
.prose ol li::before {
  content: counter(olc, decimal-leading-zero);
  position: absolute; left: 0; top: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--accent);
}
.prose li strong { color: var(--ink); font-weight: 600; }

.prose blockquote {
  margin: 36px 0;
  padding: 8px 0 8px 28px;
  border-left: 2px solid var(--accent);
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.prose blockquote .attrib {
  display: block;
  margin-top: 14px;
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Lede / drop cap */
.prose .lede-p {
  font-size: 22px;
  color: var(--ink);
  line-height: 1.5;
}
.prose .lede-p::first-letter {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  font-size: 88px;
  line-height: 0.85;
  float: left;
  padding: 6px 14px 0 0;
  color: var(--accent-ink);
}

/* ---------- BENCHMARK CHART ---------- */
figure.bench {
  margin: 28px 0 24px;
  padding: 26px 28px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
figure.bench svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
figure.bench .bench-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  fill: var(--muted);
  text-transform: uppercase;
}
figure.bench .tool-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  fill: var(--muted);
}
figure.bench .tool-name.esb {
  fill: var(--ink);
  font-weight: 600;
}
figure.bench .bar { fill: var(--line-2); }
figure.bench .bar-esb {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--accent) 55%, transparent));
}
figure.bench .value {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 19px;
  fill: var(--ink-2);
  letter-spacing: -0.01em;
}
figure.bench .value.esb { fill: var(--ink); }
figure.bench .axis,
figure.bench .tick { stroke: var(--line); stroke-width: 1; }
figure.bench .axis-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  fill: var(--muted);
  letter-spacing: 0.04em;
}
figure.bench figcaption {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
figure.bench figcaption a { color: var(--ink-2); }
figure.bench figcaption a:hover { color: var(--accent-ink); }

/* ---------- REFERENCES ---------- */
.refs {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.refs h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.refs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.refs li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.refs li:last-child { border-bottom: none; }
.refs a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  color: var(--ink);
  font-size: 16px;
  background: none;
}
.refs a .url {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}
.refs a:hover { color: var(--accent-ink); }
.refs a:hover .url { color: var(--ink-2); }

/* ---------- RELATED ---------- */
section.related {
  padding: 80px 0 100px;
  border-top: 1px solid var(--line);
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 32px;
}
.related-card {
  display: block;
  padding: 26px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .2s var(--ease), box-shadow .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.related-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.related-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.related-card:hover::before { transform: scaleX(1); }
.related-card .tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.related-card h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 26px; line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 8px;
  color: var(--ink);
}
.related-card p {
  color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px;
}
.related-card .open {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.related-card .open .ar { color: var(--accent); transition: transform .25s var(--ease); }
.related-card:hover .open .ar { transform: translateX(4px); }

@media (max-width: 1100px) {
  .article-body { grid-template-columns: 1fr; gap: 40px; }
  .toc { position: relative; top: 0; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  h1.article-title { font-size: 56px; }
  .article-meta { gap: 20px; }
  .related-grid { grid-template-columns: 1fr; }
}
