/* Journal (blog) pages. Built on the site's tokens in /styles.css. */

.b-eyebrow, .b-meta, .b-toc p, .b-cover, .b-dates time, .b-chip, .b-draft, .b-byline-sub, .b-callout-title {
  font-family: 'Geist Mono', ui-monospace, monospace; letter-spacing: .04em;
}
.blog main { padding-top: clamp(7rem, 14vw, 9.5rem); }

/* Index */
.b-hero { display: grid; gap: 1.1rem; max-width: 46rem; margin-inline: auto; padding-bottom: clamp(2.5rem, 6vw, 4rem); text-align: center; justify-items: center; }
.b-eyebrow { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.b-eyebrow .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); }
.b-hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 600; line-height: .98; letter-spacing: -.055em; }
.b-lede { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.6; text-wrap: pretty; }
.b-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .6rem; padding: 0; list-style: none; }
.b-filters a { display: inline-flex; min-height: 2.2rem; align-items: center; padding-inline: .95rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .88rem; text-decoration: none; transition: color .2s, border-color .2s, background-color .2s; }
.b-filters a:hover { color: var(--foreground); border-color: color-mix(in srgb, var(--foreground) 25%, transparent); }
.b-filters a[aria-current] { border-color: var(--foreground); background: var(--foreground); color: var(--inverse); }

/* ASCII covers, in the language of the migration page streams. */
.b-cover {
  position: relative; display: grid; align-content: end; overflow: hidden; aspect-ratio: 16 / 9;
  padding: clamp(1rem, 2.5vw, 1.6rem); border-radius: 1.2rem; color: var(--faint);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.b-cover pre { margin: 0; font: inherit; font-size: clamp(.68rem, 1.1vw, .86rem); line-height: 1.75; white-space: pre; color: var(--muted); }
.b-cover-label { position: absolute; top: clamp(1rem, 2.5vw, 1.4rem); left: clamp(1rem, 2.5vw, 1.6rem); color: var(--accent); font-size: .72rem; text-transform: uppercase; }
.b-cover-image { padding: 0; }
.b-cover-image img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .b-cover pre { transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
  a:hover .b-cover pre, .b-card:hover .b-cover pre { transform: translateX(.6rem); }
  .b-cover-image img { transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
  .b-card:hover .b-cover-image img { transform: scale(1.03); }
}

.b-featured { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; padding: clamp(.8rem, 1.5vw, 1rem); border-radius: 1.75rem; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1.2rem 3rem var(--shadow); }
.b-featured-media { display: block; border-radius: 1.2rem; text-decoration: none; }
.b-featured-body { display: grid; gap: 1rem; padding: 1rem clamp(.5rem, 2vw, 1.5rem) 1rem 0; }
.b-featured h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; }
.b-featured h2 a { color: inherit; text-decoration: none; }
.b-featured h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .12em; }
.b-featured-body > p:not(.b-meta) { color: var(--muted); line-height: 1.6; }
.b-read { display: inline-flex; align-items: center; gap: .45rem; justify-self: start; color: var(--foreground); font-weight: 600; text-decoration: none; }
.b-read .icon { transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.b-read:hover .icon { transform: translateX(.25rem); }

.b-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .8rem; color: var(--faint); font-size: .74rem; text-transform: uppercase; }
.b-tag { color: var(--accent); }

.b-section { padding-top: clamp(4rem, 9vw, 6rem); }
.b-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.b-section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.04em; }
.b-section-head p { color: var(--faint); font-size: .9rem; }
.b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2rem); padding: 0; list-style: none; }
.b-card { display: grid; align-content: start; gap: .8rem; }
.b-card h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.b-card > p:not(.b-meta) { color: var(--muted); font-size: .95rem; line-height: 1.55; }
.b-card .b-cover { margin-bottom: .3rem; }

.b-cta { padding-block: clamp(4rem, 9vw, 6rem) 1.5rem; }
.b-cta-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: 1.75rem; background: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--subtle); box-shadow: inset 0 0 0 1px var(--line); }
.b-cta-card h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -.04em; }
.b-cta-card p { max-width: 34rem; margin-top: .5rem; color: var(--muted); line-height: 1.55; }

/* Article */
.b-article-head { display: grid; gap: 1.1rem; max-width: 46rem; margin-inline: auto; }
.b-draft { justify-self: start; padding: .4rem .75rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: .72rem; text-transform: uppercase; }
.b-back a { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; text-decoration: none; }
.b-back a:hover { color: var(--foreground); }
.b-article-head h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); font-weight: 600; line-height: 1.02; letter-spacing: -.05em; text-wrap: balance; }
.b-byline { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; font-size: .95rem; }
.b-byline > span:last-child { display: grid; gap: .1rem; }
.b-avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--subtle); box-shadow: inset 0 0 0 1px var(--line); }
.b-byline-sub { color: var(--faint); font-size: .74rem; text-transform: uppercase; }
.b-article-cover { max-width: 58rem; margin-block: clamp(2rem, 5vw, 3rem); }
.b-article-cover .b-cover { aspect-ratio: 21 / 9; }

.b-layout { display: grid; grid-template-columns: 12rem minmax(0, 40rem); justify-content: center; gap: clamp(2rem, 5vw, 4rem); }
.b-toc { position: sticky; top: 6.5rem; align-self: start; display: grid; gap: .8rem; }
.b-toc p { color: var(--faint); font-size: .72rem; text-transform: uppercase; }
.b-toc ol { display: grid; gap: .55rem; margin: 0; padding: 0 0 0 1rem; border-left: 1px solid var(--line); list-style: none; }
.b-toc a { color: var(--muted); font-size: .88rem; line-height: 1.35; text-decoration: none; }
.b-toc a:hover { color: var(--foreground); }

.b-prose { font-size: 1.06rem; line-height: 1.75; }
.b-prose > * + * { margin-top: 1.25rem; }
.b-prose p, .b-prose li { color: color-mix(in srgb, var(--foreground) 82%, var(--muted)); text-wrap: pretty; }
.b-prose h2 { margin-top: 3rem; font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.15; letter-spacing: -.035em; scroll-margin-top: 6rem; }
.b-prose h2 + * { margin-top: 1rem; }
.b-prose ul:not([role]) { padding-left: 1.2rem; }
.b-prose ul:not([role]) li + li { margin-top: .6rem; }
.b-prose ul:not([role]) li::marker { color: var(--accent); }
.b-prose strong { color: var(--foreground); }
.b-note { color: var(--faint) !important; font-size: .88rem; }

.b-dates { display: grid; gap: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.b-dates li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding-block: .9rem; border-bottom: 1px solid var(--line); }
.b-dates time { color: var(--faint); font-size: .82rem; line-height: 1.9; }
.b-dates li:first-child time { color: var(--accent); }

.b-table-wrap { overflow-x: auto; border-radius: 1rem; box-shadow: inset 0 0 0 1px var(--line); }
.b-table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
.b-table th, .b-table td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.b-table thead th { color: var(--faint); font: 500 .7rem/1.4 'Geist Mono', ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; background: var(--subtle); }
.b-table tbody tr:last-child > * { border-bottom: 0; }
.b-table tbody th { font-weight: 600; white-space: nowrap; }
.b-table td { color: var(--muted); }
.b-chip { display: inline-block; padding: .15rem .5rem; border-radius: 999px; background: var(--subtle); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: .7rem; white-space: nowrap; }
.b-chip-yes { color: var(--foreground); }

.b-steps { display: grid; gap: 0; padding: 0; list-style: none; counter-reset: step; }
.b-steps li { position: relative; display: grid; gap: .35rem; padding: 1.2rem 0 1.2rem 3.2rem; border-top: 1px solid var(--line); counter-increment: step; }
.b-steps li::before { position: absolute; top: 1.35rem; left: 0; color: var(--accent); content: counter(step, decimal-leading-zero); font: 500 .82rem/1 'Geist Mono', ui-monospace, monospace; }
.b-steps h3 { font-size: 1.12rem; letter-spacing: -.02em; }
.b-steps p { font-size: 1rem; line-height: 1.65; }

.b-callout-title { color: var(--accent); font-size: .74rem; text-transform: uppercase; }
.b-callout p + p { margin-top: .5rem; }

@media (max-width: 52rem) {
  .b-featured { grid-template-columns: 1fr; }
  .b-featured-body { padding: .5rem .6rem 1rem; }
  .b-grid { grid-template-columns: 1fr; }
  .b-layout { grid-template-columns: minmax(0, 1fr); }
  .b-toc { position: static; }
  .b-dates li { grid-template-columns: 1fr; gap: .2rem; }
}

/* Topic filters are buttons; posts outside the chosen topic fold away. */
.b-filters button { display: inline-flex; min-height: 2.2rem; align-items: center; padding-inline: .95rem; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.b-filters button:hover { color: var(--foreground); border-color: color-mix(in srgb, var(--foreground) 25%, transparent); }
.b-filters button[aria-pressed="true"] { border-color: var(--foreground); background: var(--foreground); color: var(--inverse); }
[data-topic].is-hidden { display: none; }
.b-section:not(:has([data-topic]:not(.is-hidden))), .b-featured-wrap:not(:has([data-topic]:not(.is-hidden))) { display: none; }
.b-card-link { display: block; border-radius: 1.2rem; text-decoration: none; }
.b-card h3 a { color: inherit; text-decoration: none; }
.b-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .15em; }

/* Markdoc output: numbered steps, callouts and tables in the article body. */
.b-prose ol { display: grid; gap: 0; padding: 0; list-style: none; counter-reset: step; }
.b-prose ol > li { position: relative; padding: 1.2rem 0 1.2rem 3.2rem; border-top: 1px solid var(--line); counter-increment: step; font-size: 1rem; line-height: 1.65; }
.b-prose ol > li::before { position: absolute; top: 1.45rem; left: 0; color: var(--accent); content: counter(step, decimal-leading-zero); font: 500 .82rem/1 'Geist Mono', ui-monospace, monospace; }
.b-prose ol > li > strong:first-child { display: block; margin-bottom: .3rem; font-size: 1.12rem; letter-spacing: -.02em; }
/* Callout (a > quote in the article): a quiet note card. A warm glow in one corner and a small
   mono label carry the emphasis, with no coloured side edge. */
.b-prose .b-callout {
  position: relative; margin-block: 2.2rem; padding: clamp(1.4rem, 3vw, 1.9rem);
  border-radius: 1.4rem;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%), var(--subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.b-prose .b-callout p { color: var(--foreground); font-size: clamp(1.08rem, 1.6vw, 1.22rem); line-height: 1.55; letter-spacing: -.01em; }
.b-prose .b-callout p > strong:first-child {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
  color: var(--accent); font: 500 .74rem/1.4 'Geist Mono', ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase;
}
.b-prose .b-callout p > strong:first-child::before { width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent); content: ""; }
.b-prose .b-table th, .b-prose .b-table td { font-size: .92rem; }
.b-prose .b-table tbody td:first-child { color: var(--foreground); font-weight: 600; white-space: nowrap; }
.b-prose .b-table tbody td:nth-child(2) { color: var(--foreground); font: 500 .74rem/1.6 'Geist Mono', ui-monospace, monospace; white-space: nowrap; }
.b-prose img { width: 100%; height: auto; border-radius: 1rem; }
.b-prose code { padding: .1rem .35rem; border-radius: .35rem; background: var(--subtle); font: .88em 'Geist Mono', ui-monospace, monospace; }
