/* Blog: index (featured, filters, list) and article pages. Generated by scripts/build-blog.mjs. */

/* Entrance for above-the-fold blocks: CSS only, so it never waits for JS */
.b-in { animation: b-rise 1s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms + 60ms); }
@keyframes b-rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }

.b-chip { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; background: var(--tonal); color: var(--ink-2); font-size: 12.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.b-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 14px; color: var(--ink-3); }

/* ---------- Index hero ---------- */
.b-hero { padding: 96px 0 24px; }
.b-hero h1 { margin: 0 0 20px; font-family: var(--font-display); font-weight: 600; font-size: clamp(3.4rem, 10vw, 8.5rem); line-height: .95; letter-spacing: -0.055em; }
.b-lede { max-width: 44rem; margin: 0; font-size: clamp(1.08rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* ---------- Featured ---------- */
.b-featured { margin-top: 72px; }
.b-label { margin: 0 0 24px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.035em; }
.b-feat { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 48px; align-items: center; padding: 20px 20px 20px 48px; border-radius: var(--radius-card); background: var(--bg-2); border: 1px solid var(--line); transition: border-color .3s; }
.b-feat:hover { border-color: var(--line-2); }
.b-feat h3 { margin: 18px 0 14px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.2vw, 2.8rem); line-height: 1.06; letter-spacing: -0.04em; text-wrap: balance; }
.b-feat h3 a { text-decoration: none; }
.b-feat h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.b-feat h3 a:focus-visible { outline: none; }
.b-feat:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }
.b-feat-desc { margin: 0 0 28px; color: var(--ink-2); line-height: 1.6; max-width: 34rem; }
.b-feat-art { border-radius: 20px; overflow: hidden; aspect-ratio: 2 / 1; }
.b-feat-art svg { width: 100%; height: 100%; transition: transform 1s var(--ease-out); }
.b-feat:hover .b-feat-art svg { transform: scale(1.03); }
.b-feat:hover .b-feat-btn { background: var(--tonal-hover); }

/* ---------- Toolbar: category filters with a sliding underline ---------- */
.b-latest { margin-top: 96px; }
.b-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.b-filters { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.b-filters::-webkit-scrollbar { display: none; }
.b-filters button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink-3); transition: color .2s; }
.b-filters button:hover { color: var(--ink); }
.b-filters button[aria-pressed="true"] { color: var(--ink); }
.b-count { font: 500 12px/1 var(--font-mono); color: var(--ink-3); }
.b-filter-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--flame-1), var(--flame-2)); transition: transform .5s var(--ease-out), width .5s var(--ease-out); }
html:not(.js) .b-filters { display: none; }
.b-rss { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--tonal); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color .2s; }
.b-rss:hover { background: var(--tonal-hover); }
.b-rss svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- List: two columns of horizontal cards ---------- */
.b-list { list-style: none; margin: 0; padding: 24px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.b-item[hidden] { display: none; }
.b-card { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) clamp(120px, 14vw, 184px); gap: 24px; align-items: stretch; padding: 14px 14px 14px 28px; border-radius: 24px; border: 1px solid var(--line); background: var(--bg); transition: border-color .3s, background-color .3s; }
.b-card:hover { border-color: var(--line-2); background: var(--bg-2); }
.b-card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.b-card-text { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; min-width: 0; }
.b-card h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.22; letter-spacing: -0.025em; text-wrap: balance; }
.b-card h3 a { text-decoration: none; }
.b-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.b-card h3 a:focus-visible { outline: none; }
.b-card-desc { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-card .b-meta { font-size: 13px; margin-top: auto; }
.b-read { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.b-read svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease-out); }
.b-card:hover .b-read svg { transform: translateX(4px); }
.b-card-art { border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; align-self: center; }
.b-card-art svg { width: 100%; height: 100%; transition: transform .9s var(--ease-out); }
.b-card:hover .b-card-art svg { transform: scale(1.06); }

/* ---------- Article ---------- */
.b-article { padding-top: 72px; }
.b-head { max-width: 1040px; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.b-crumb a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--tonal); font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: background-color .2s, color .2s; }
.b-crumb a::before { content: "\2190"; }
.b-crumb a:hover { background: var(--tonal-hover); color: var(--ink); }
.b-head h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 5.6vw, 4.6rem); letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance; }
.b-head .b-lede { max-width: 48rem; }
.b-cover { margin-top: 56px; }
.b-cover svg { width: 100%; height: auto; aspect-ratio: 2.4 / 1; border-radius: var(--radius-card); }

.b-body { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 72px; justify-content: center; margin-top: 72px; }
.b-aside { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
.b-aside dl { margin: 0; display: grid; gap: 22px; }
.b-aside dt { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.b-aside dd { margin: 0; font-size: 14.5px; color: var(--ink); }
.b-tags { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.b-tags li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); }

.b-prose { font-size: 18px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; min-width: 0; }
.b-prose > * { margin: 0 0 1.15em; }
.b-prose > :first-child { margin-top: 0; }
.b-prose h2 { margin: 2.1em 0 .6em; font-family: var(--font-display); font-weight: 600; font-size: 1.85rem; line-height: 1.2; letter-spacing: -0.03em; color: var(--ink); }
.b-prose h3 { margin: 1.7em 0 .5em; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.b-prose strong { color: var(--ink); }
.b-prose a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--flame-2) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.b-prose a:hover { text-decoration-color: var(--ink); }
.b-prose ul, .b-prose ol { padding-left: 1.4em; }
.b-prose li { margin: .4em 0; }
.b-prose li::marker { color: var(--ink-3); }
.b-prose blockquote { margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid; border-image: linear-gradient(var(--flame-1), var(--flame-2)) 1; color: var(--ink); font-size: 1.1em; }
.b-prose code { font-family: var(--font-mono); font-size: .85em; padding: .14em .4em; border-radius: 6px; background: var(--tonal); overflow-wrap: anywhere; }
.b-prose pre { padding: 20px 22px; border-radius: 18px; background: var(--term-bg); color: var(--term-fg); border: 1px solid var(--term-line); overflow-x: auto; font-size: 14.5px; line-height: 1.6; }
.b-prose pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; color: inherit; }
.b-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.b-prose th, .b-prose td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.b-prose th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.b-prose img { max-width: 100%; height: auto; border-radius: 16px; }

/* ---------- Call to action ---------- */
.b-cta-wrap { max-width: 1012px; margin-top: 96px; }
.b-cta { padding: 48px; border-radius: var(--radius-card); border: 1px solid var(--line);
  background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--flame-2) 14%, transparent), transparent 65%), radial-gradient(60% 100% at 0% 100%, color-mix(in srgb, var(--flame-1) 10%, transparent), transparent 60%), var(--bg-2); }
.b-cta h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.04em; line-height: 1.1; }
.b-cta p { margin: 0 0 24px; color: var(--ink-2); line-height: 1.6; max-width: 40rem; }
.b-cta-cmd { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-radius: 999px; background: var(--term-bg); border: 1px solid var(--term-line); margin-bottom: 20px; max-width: 34rem; }
.b-cta-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 400 14.5px/1.5 var(--font-mono); color: var(--term-fg); }
.b-cta-cmd code::before { content: "$ "; color: var(--term-mute); }
.b-copy { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--term-line); background: var(--term-bar); color: var(--term-fg); font: 500 13px/1 var(--font-sans); cursor: pointer; }
.b-copy:hover { border-color: var(--term-mute); }
.b-copy.is-copied { color: var(--term-ok); }
.b-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.b-cta-oss { margin: 22px 0 0 !important; font-size: 14.5px; color: var(--ink-3) !important; }
.b-cta-oss a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- Keep reading ---------- */
.b-more { margin-top: 120px; }
.b-more-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.b-more-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.045em; line-height: 1; }
.b-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.b-tile { position: relative; display: flex; flex-direction: column; gap: 14px; }
.b-tile-art { border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; }
.b-tile-art svg { width: 100%; height: 100%; transition: transform .9s var(--ease-out); }
.b-tile:hover .b-tile-art svg { transform: scale(1.05); }
.b-tile h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; letter-spacing: -0.025em; }
.b-tile h3 a { text-decoration: none; }
.b-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.b-tile h3 a:focus-visible { outline: none; }
.b-tile:focus-within { outline: 3px solid var(--focus); outline-offset: 6px; border-radius: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .b-list { grid-template-columns: minmax(0, 1fr); }
  .b-body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .b-aside { position: static; border-bottom: 1px solid var(--line-2); padding-bottom: 24px; }
  .b-aside dl { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 900px) {
  .b-feat { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 28px; gap: 24px; }
  .b-feat-text { order: 2; padding: 0 14px; }
  .b-feat-art { order: 1; }
  .b-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .b-hero { padding-top: 56px; }
  .b-featured { margin-top: 48px; }
  .b-latest { margin-top: 64px; }
  .b-toolbar { flex-direction: column; align-items: stretch; }
  .b-rss { align-self: flex-start; margin-bottom: 12px; order: -1; }
  .b-card { grid-template-columns: minmax(0, 1fr) 96px; padding: 12px 12px 12px 18px; gap: 14px; }
  .b-card-desc { display: none; }
  .b-article { padding-top: 40px; }
  .b-cover { margin-top: 36px; }
  .b-cover svg { aspect-ratio: 1.6 / 1; border-radius: 20px; }
  .b-body { margin-top: 40px; }
  .b-prose { font-size: 16.5px; }
  .b-prose pre { margin-left: -20px; margin-right: -20px; border-radius: 0; border-left: 0; border-right: 0; }
  .b-cta { padding: 28px 20px; }
  .b-cta-actions .dl-btn { width: 100%; justify-content: center; }
  .b-more-head { flex-direction: column; align-items: flex-start; }
}
