/* The blog and the pages written as articles (deploy/build-blog.mjs), and the homepage's "From the blog". Every rule is
   scoped to the blog's own elements (.post, .rail, .blog-head, .bcards…), so a page that loads this beside its own
   styles (the homepage, /compare) keeps its look. A reading column on the site's dark theme, the contents in a rail
   beside it that follows the reading, the crew cyan for links. */

/* ---- The article and its rail ---- */
.post-layout { padding: 0 0 96px; }
.post-layout.with-rail { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; }
@media (min-width: 1180px) {
  .post-layout.with-rail { grid-template-columns: minmax(0, 760px) 232px; column-gap: 64px; }
}
.post { max-width: 760px; margin: 0 auto; padding: 56px 0 0; min-width: 0; }
.post-layout.with-rail .post { margin: 0; }
.post .post-head h1 { margin: 14px 0 0; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; font-weight: 500; letter-spacing: -0.035em; text-wrap: balance; }
.post .post-head .lede { margin: 16px 0 0; color: var(--muted); font-size: 19px; line-height: 1.55; text-wrap: pretty; }
.post .post-head .meta { margin: 18px 0 0; color: var(--faint); font-size: 13.5px; }
.post .langs, .blog-head .langs { margin: 10px 0 0; font-size: 13.5px; color: var(--faint); }
.post .langs a, .blog-head .langs a { color: var(--muted); text-underline-offset: 3px; }
.post .langs a:hover, .blog-head .langs a:hover { color: var(--text); }
.post .crumbs a { color: var(--faint); text-decoration: none; }
.post .crumbs a:hover { color: var(--text); }
.post .post-head .hero { display: block; width: 100%; height: auto; margin-top: 28px; border-radius: 18px; border: 1px solid var(--line); }
.post .cta-row, .cta-box .cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.post .note, .cta-box .note { margin: 10px 0 0; color: var(--faint); font-size: 13px; }

.rail { display: none; }
@media (min-width: 1180px) {
  .rail { display: block; }
  .rail-in { position: sticky; top: 92px; padding-top: 64px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: none; }
  .rail-in::-webkit-scrollbar { display: none; }
  .post .toc-mobile { display: none; }
}
.rail .toc ol { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--line); }
.rail .toc li { margin: 0; }
.rail .toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--faint); font-size: 13.5px; line-height: 1.4; text-decoration: none; transition: color 0.15s, border-color 0.15s; }
.rail .toc a:hover { color: var(--text); }
.rail .toc a[aria-current] { color: var(--text); border-left-color: var(--accent); }
.rail .share { margin-top: 32px; }

.post .toc-mobile { margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.post .toc-mobile summary { cursor: pointer; list-style: none; padding: 14px 18px; font: 500 12px/16px "Geist Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.post .toc-mobile summary::-webkit-details-marker { display: none; }
.post .toc-mobile summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; margin-top: -4px; }
.post .toc-mobile[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.post .toc-mobile ol { margin: 0; padding: 0 18px 14px 36px; color: var(--muted); font-size: 15px; }
.post .toc-mobile li { margin: 6px 0; }
.post .toc-mobile a { color: var(--muted); text-decoration: none; }
.post .toc-mobile a[aria-current] { color: var(--text); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #13b5d1, #12b76a, #ff6b1a); transform-origin: 0 50%; transform: scaleX(0); }

.share .share-row { display: flex; gap: 8px; margin-top: 10px; }
.share a, .share button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.share a:hover, .share button:hover { color: var(--text); background: var(--hover); }
.share svg { width: 16px; height: 16px; }
.share button.done { color: var(--green); border-color: var(--green); }
.post .share-end { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ---- The words ---- */
.post .prose { margin-top: 32px; font-size: 17.5px; line-height: 1.72; color: #e6e6e6; }
.post .prose > * + * { margin-top: 1.05em; }
.post .prose p, .post .prose ul, .post .prose ol { margin-bottom: 0; }
.post .prose h2 { margin: 2.2em 0 0; font-size: 27px; line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; color: var(--text); scroll-margin-top: 84px; }
.post .prose h3 { margin: 1.8em 0 0; font-size: 20px; line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; color: var(--text); scroll-margin-top: 84px; }
.post .prose h4 { margin: 1.5em 0 0; font-size: 17.5px; font-weight: 600; color: var(--text); }
.post .prose a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post .prose a:hover { text-decoration-thickness: 2px; }
.post .prose strong { color: var(--text); font-weight: 600; }
.post .prose ul, .post .prose ol { padding-left: 1.3em; }
.post .prose li + li { margin-top: 0.4em; }
.post .prose li > ul, .post .prose li > ol { margin-top: 0.4em; }
.post .prose code { font: 0.88em/1 "Geist Mono", ui-monospace, monospace; padding: 0.15em 0.4em; border-radius: 6px; background: var(--panel-2); color: var(--text); }
.post .prose pre { overflow-x: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.post .prose pre code { padding: 0; background: none; font-size: 14px; line-height: 1.6; }
.post .prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post .prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.post .prose .callout { padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--panel); font-size: 16px; }
.post .prose .callout b { color: var(--text); margin-right: 4px; }
.post .prose .table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.post .prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.post .prose th, .post .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.post .prose thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: 13px; background: var(--panel-2); }
.post .prose td:first-child { color: var(--text); font-weight: 500; }
.post .prose figure { margin: 2em 0; }
.post .prose figure img { display: block; width: auto; max-width: 100%; max-height: 520px; height: auto; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.post .prose figure.diagram { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(120% 120% at 50% 0%, rgb(255 255 255 / 0.035), transparent 70%), var(--panel); }
.post .prose figure.diagram svg { display: block; width: 100%; height: auto; }
.post .prose figcaption { margin-top: 12px; color: var(--faint); font-size: 13.5px; line-height: 1.5; text-align: center; }
.post .prose figcaption a { color: var(--muted); }

.post .sources { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post .sources h2 { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); }
.post .sources ol { margin: 12px 0 0; padding-left: 20px; color: var(--faint); font-size: 13.5px; line-height: 1.6; }
.post .sources a { color: var(--muted); text-underline-offset: 3px; overflow-wrap: anywhere; }
.post .sources a:hover { color: var(--text); }

.cta-box { margin-top: 40px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(120% 140% at 0% 0%, rgb(19 181 209 / 0.12), transparent 60%), var(--panel); }
.cta-box h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; }
.cta-box p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.post .related { margin-top: 56px; }
.post .related h2 { margin: 0 0 14px; font-size: 18px; font-weight: 500; }

/* ---- The index ---- */
.blog-head { max-width: 760px; padding: 64px 0 0; }
.blog-head h1 { margin: 12px 0 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 500; letter-spacing: -0.04em; }
.blog-head .lede { margin: 16px 0 0; color: var(--muted); font-size: 19px; max-width: 620px; }
.pillar { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 40px; padding: 26px 28px; border: 1px solid var(--line-strong); border-radius: 18px; text-decoration: none; background: radial-gradient(100% 160% at 100% 0%, rgb(18 183 106 / 0.12), transparent 55%), radial-gradient(100% 160% at 0% 100%, rgb(19 181 209 / 0.12), transparent 55%), var(--panel); transition: border-color 0.15s; }
.pillar:hover { border-color: var(--accent); }
.pillar .cover { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.pillar .title { font-size: clamp(22px, 3vw, 30px); line-height: 1.2; font-weight: 500; letter-spacing: -0.025em; }
.pillar .desc { color: var(--muted); font-size: 16px; max-width: 640px; }
@media (min-width: 900px) {
  .pillar { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 32px; align-items: center; }
  .pillar .cover { grid-column: 2; grid-row: 1 / span 3; margin: 0; max-width: none; }
}
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 36px 0 0; }
.filters button { height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: 500 13.5px/1 "Geist", sans-serif; cursor: pointer; }
.filters button:hover { color: var(--text); background: var(--hover); }
.filters button.on { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); }

/* ---- Cards (the index, related articles, the homepage) ---- */
.bcards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bcards.grid { margin: 18px 0 96px; }
.bcard { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-decoration: none; color: var(--text); transition: border-color 0.15s, background 0.15s; }
.bcard:hover { border-color: var(--line-strong); background: #101010; }
.bcard[hidden] { display: none; }
.bcard .cover { display: block; width: calc(100% + 44px); height: auto; margin: -20px -22px 6px; border-radius: 16px 16px 0 0; border-bottom: 1px solid var(--line); aspect-ratio: 1200 / 630; object-fit: cover; }
.bcard .kind { font: 500 11.5px/16px "Geist Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.bcard .title { font-size: 18.5px; line-height: 1.3; font-weight: 500; letter-spacing: -0.015em; }
.bcard .desc { color: var(--muted); font-size: 14.5px; line-height: 1.5; flex: 1; }
.bcard .meta { color: var(--faint); font-size: 12.5px; }

/* The homepage's "From the blog" */
.home-blog .bcards { margin-top: 48px; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: left; }
.home-blog .more { margin: 32px 0 0; text-align: center; }
@media (max-width: 900px) { .home-blog .bcards { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; } }

/* The comparisons written as articles, listed on /compare */
.more-compare { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.more-compare li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.more-compare a { display: block; color: var(--text); font-weight: 500; text-decoration: none; }
.more-compare a:hover { color: var(--accent); }
.more-compare span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 720px) {
  .post { padding-top: 36px; }
  .post .prose { font-size: 17px; }
  .post .prose h2 { font-size: 24px; }
  .post .prose figure.diagram { padding: 10px; margin-left: -6px; margin-right: -6px; }
  .cta-box { padding: 22px; }
}
