/* ============================================================
   Aikraft — Blog article (long-read) page
   Extends styles.css. Editorial deep-dive: TOC, figures, code,
   comparison tables, takeaways, author bio.
   ============================================================ */

/* reading progress */
.read-bar {
  position: fixed; left: 0; top: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 60; transition: width .08s linear;
}

/* breadcrumb */
.ba-top { padding: 18px 0 0; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.crumbs a:hover { color: var(--text-2); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text-2); max-width: 38ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* hero */
.ba-hero { padding: 26px 0 0; }
.ba-hero .container { max-width: 820px; }
.kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cat-tag {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 12px; border-radius: 7px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
}
.kicker .rt { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.ba-title {
  font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em;
  margin: 0; text-wrap: balance; max-width: 19ch;
}
.ba-deck { font-size: 18px; line-height: 1.55; color: var(--text-2); margin: 18px 0 0; max-width: 62ch; }

.ba-byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0 0; }
.ba-byline .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #000));
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; font-weight: 600;
}
.ba-byline .who { font-size: 14px; font-weight: 500; }
.ba-byline .who small { display: block; color: var(--text-3); font-weight: 400; font-size: 11.5px; font-family: var(--font-mono); }
.ba-byline .dot-sep { color: var(--text-mute); }
.ba-byline .date { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.ba-byline .actions { margin-left: auto; display: flex; gap: 8px; }
.ba-byline .iconbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px;
  background: var(--bg-elev); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2);
}
.ba-byline .iconbtn:hover { border-color: var(--border-strong); color: var(--text); }
.ba-byline .iconbtn.primary { background: var(--accent); color: #fff; border-color: transparent; }

/* versus cover (comparison hero) */
.versus {
  margin: 28px 0 0; padding: 32px;
  border: 1px solid var(--border); border-radius: 16px;
  background:
    radial-gradient(circle at 18% 50%, rgba(217,119,87,.10) 0%, transparent 42%),
    radial-gradient(circle at 82% 50%, rgba(16,163,127,.10) 0%, transparent 42%),
    var(--bg-elev);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.vs-side .logo { box-shadow: var(--shadow-md); }
.vs-side .nm { font-size: 16px; font-weight: 600; }
.vs-side .meta { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.vs-side .score { font-family: var(--font-mono); font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.vs-side.win .score { color: var(--accent); }
.vs-side .score .u { font-size: 13px; color: var(--text-3); }
.vs-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vs-mid .vs { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); letter-spacing: .1em; }
.vs-mid .of { font-size: 11px; color: var(--text-mute); font-family: var(--font-mono); white-space: nowrap; }
.vs-bolt { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--text-2); font-weight: 600; font-family: var(--font-mono); }

/* body grid: TOC + article */
.ba-body { padding: 40px 0 56px; }
.ba-grid {
  max-width: 1060px; margin: 0 auto;
  display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 48px; align-items: start;
}

/* TOC */
.toc { position: sticky; top: 80px; }
.toc .toc-ttl {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc a {
  display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-3); line-height: 1.35;
  border-left: 2px solid transparent;
}
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); flex-shrink: 0; }
.toc a:hover { color: var(--text-2); background: var(--bg-hover); }
.toc a.active { color: var(--accent); background: var(--accent-soft); }
.toc a.active::before { color: var(--accent); }
.toc .toc-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.toc .toc-foot .iconbtn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.toc .toc-foot .iconbtn:hover { color: var(--accent); }

/* prose */
.prose { max-width: 720px; font-size: 17px; line-height: 1.72; color: var(--text); }
.prose > p { margin: 0 0 20px; color: var(--text-2); }
.prose > p.lead { font-size: 19px; color: var(--text); line-height: 1.6; }
.prose h2 {
  font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 40px 0 14px;
  scroll-margin-top: 90px;
}
.prose h2 .hnum { font-family: var(--font-mono); font-size: 15px; color: var(--accent); margin-right: 12px; font-weight: 500; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.prose a.inline { color: var(--accent); border-bottom: 1px solid var(--accent-border); }
.prose a.inline:hover { border-bottom-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol.steps { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.prose ul li { position: relative; padding-left: 22px; color: var(--text-2); }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.prose ol.steps { counter-reset: st; }
.prose ol.steps li { position: relative; padding-left: 34px; color: var(--text-2); }
.prose ol.steps li::before {
  counter-increment: st; content: counter(st); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.prose li b { color: var(--text); font-weight: 600; }

/* figure / image placeholder */
.figure { margin: 28px 0; }
.figure .ph {
  aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-elev-2); position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(45deg, transparent 0px, transparent 20px, rgba(255,255,255,0.022) 20px, rgba(255,255,255,0.022) 21px);
}
.figure .ph::after {
  content: attr(data-label); position: absolute; left: 16px; bottom: 14px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase;
}
.figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--text-3); font-family: var(--font-mono); }

/* code block */
.codeblock {
  margin: 24px 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border-strong); background: #0b0d11;
}
.codeblock .cb-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02);
}
.codeblock .cb-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.codeblock .cb-head .dot.r { background: #ff5f56; } .codeblock .cb-head .dot.y { background: #ffbd2e; } .codeblock .cb-head .dot.g { background: #27c93f; }
.codeblock .cb-head .fn { margin-left: 8px; font-family: var(--font-mono); font-size: 11.5px; color: #8b92a0; }
.codeblock .cb-head .lang { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: #5b6270; text-transform: uppercase; letter-spacing: .04em; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.codeblock code { font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: #c4cad4; }
.codeblock .cm { color: #5b6270; } .codeblock .add { color: #27c93f; } .codeblock .del { color: #ff7a85; } .codeblock .kw { color: #c792ea; } .codeblock .st { color: #ecc48d; } .codeblock .fn2 { color: #82aaff; }

/* comparison table */
.ctable-wrap { margin: 24px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.ctable { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ctable th, table.ctable td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.ctable tbody tr:last-child td { border-bottom: none; }
table.ctable thead th { background: var(--bg-elev-2); color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
table.ctable td.num, table.ctable th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.ctable td.task { color: var(--text); font-weight: 500; }
table.ctable td.win { color: var(--green); font-weight: 600; }
table.ctable tbody tr:hover { background: var(--bg-hover); }
table.ctable tfoot td { background: var(--bg-elev); font-weight: 600; border-top: 1px solid var(--border-strong); }

/* callout */
.callout {
  margin: 26px 0; padding: 16px 18px; border-radius: 12px; display: flex; gap: 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--accent);
}
.callout.warn { border-left-color: var(--amber); }
.callout .ico { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.callout.warn .ico { color: var(--amber); }
.callout .ct { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.callout .ct b { color: var(--text); }

/* pull quote */
.pullquote {
  margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
  font-size: 22px; line-height: 1.45; font-weight: 500; letter-spacing: -.01em; color: var(--text);
}
.pullquote .src { display: block; margin-top: 12px; font-size: 13px; font-weight: 400; color: var(--text-3); font-family: var(--font-mono); }

/* takeaways */
.takeaways {
  margin: 32px 0; padding: 22px 24px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--bg-elev);
  border: 1px solid var(--accent-border);
}
.takeaways .tk-ttl { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.takeaways ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.takeaways ul li { position: relative; padding-left: 28px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.takeaways ul li::before { content: "✓"; position: absolute; left: 0; top: 0; width: auto; height: auto; background: none; border-radius: 0; color: var(--accent); font-weight: 700; }
.takeaways ul li b { color: var(--text); }

/* author bio */
.author-bio {
  max-width: 720px; margin: 40px 0 0; padding: 22px 24px; border-radius: 14px;
  background: var(--bg-elev); border: 1px solid var(--border);
  display: flex; gap: 16px; align-items: flex-start;
}
.author-bio .avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #000));
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; font-weight: 600;
}
.author-bio .ab-name { font-size: 15px; font-weight: 600; }
.author-bio .ab-role { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); margin-top: 1px; }
.author-bio .ab-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 10px 0 0; }
.author-bio .ab-links { display: flex; gap: 8px; margin-top: 12px; }
.author-bio .ab-links a { font-size: 12px; color: var(--accent); font-family: var(--font-mono); }
.author-bio .ab-follow { margin-left: auto; }

/* tag list */
.ba-tags { max-width: 720px; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ba-tags .t {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); font-family: var(--font-mono);
}
.ba-tags .t:hover { border-color: var(--border-strong); color: var(--text); }

/* related */
.ba-related { padding: 48px 0; border-top: 1px solid var(--border); }
.rel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.rel-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.rel-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rel-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: border .15s, transform .15s; }
.rel-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.rel-card .cov {
  aspect-ratio: 16 / 9; background: var(--bg-elev-2); position: relative;
  background-image: repeating-linear-gradient(45deg, transparent 0px, transparent 18px, rgba(255,255,255,0.025) 18px, rgba(255,255,255,0.025) 19px);
}
.rel-card .cov::after { content: attr(data-label); position: absolute; left: 12px; bottom: 10px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.rel-card .rc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rel-card .rc-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.rel-card h3 { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0; letter-spacing: -.01em; }
.rel-card .rc-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: auto; }

/* responsive */
@media (max-width: 1024px) {
  .ba-grid { grid-template-columns: 1fr; gap: 0; max-width: 720px; }
  .toc { display: none; }
  .ba-title { font-size: 32px; }
  .rel-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ba-title { font-size: 26px; }
  .ba-deck { font-size: 16px; }
  .versus { padding: 20px; gap: 10px; }
  .vs-side .score { font-size: 26px; }
  .prose { font-size: 16px; }
  .author-bio { flex-wrap: wrap; }
  .author-bio .ab-follow { margin-left: 0; }
}
