/* Blog-specific styles keep the landing page's established design untouched. */
.article-library { border-top: 1px solid var(--line); padding-top: 2rem; }
.article-library-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 2rem; }
.article-library-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.025em; }
.article-library-heading p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.article-carousel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.carousel-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 1.1rem; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, opacity 150ms ease; }
.carousel-btn:hover:not(:disabled) { border-color: #8e8e8e; background: var(--surface); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-viewport { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-viewport::-webkit-scrollbar { display: none; }
.article-grid { display: flex; gap: 1.5rem; }
.post-card { flex: 0 0 calc((100% - 3rem) / 3); min-width: 0; }
.carousel-counter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.post-card-link { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color 150ms ease; }
.post-card-link:hover { border-color: #8e8e8e; }
.post-card-link:focus-visible { outline-offset: 5px; }
.post-card-cover { aspect-ratio: 16 / 11; min-height: 17rem; overflow: hidden; flex-shrink: 0; }
.post-card-cover:has(> .post-cover) { aspect-ratio: auto; }
.post-card-cover .post-cover { min-height: 17rem; height: auto; }
.post-card-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-cover { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; width: 100%; height: 100%; padding: 1.75rem; background: #f1f1f1; color: var(--ink); }
.cover-category { font-size: 0.875rem; }
.cover-title { max-width: 16ch; font-size: clamp(1.7rem, 2.5vw, 2.4rem); line-height: 1.13; letter-spacing: -0.045em; font-weight: 400; overflow-wrap: anywhere; }
.cover-caption { font-size: 0.75rem; color: #646464; }
.cover-dark { background: #242424; color: #fff; }
.cover-dark .cover-caption { color: #bfbfbf; }
.cover-mid { background: #dedede; }
.post-card-copy { display: flex; flex-direction: column; flex: 1; padding: 1.75rem; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin: 0 0 1.2rem; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.draft-label { padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.75rem; }
.post-card h3 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 400; line-height: 1.25; letter-spacing: -0.035em; }
.post-card h3, .post-card-meta, .post-summary, .post-card .cover-category { overflow-wrap: anywhere; }
.post-summary { margin: 0 0 1.75rem; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.post-read { margin-top: auto; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 0.3em; }

.article-main { --article-col: 46rem; width: min(calc(100% - var(--page-pad) * 2), var(--content)); margin-inline: auto; padding-block: 3rem 5rem; }
.article-heading { max-width: var(--article-col); margin-inline: auto; padding-bottom: 2.5rem; }
.article-back { display: inline-block; margin-bottom: 3rem; padding-block: 0.5rem; color: var(--muted); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 0.3em; }
.article-back:hover { color: var(--ink); }
.article-category { margin-bottom: 1.25rem; color: var(--muted); font-size: 0.9375rem; }
.article-heading h1 { max-width: none; margin-bottom: 1.5rem; font-size: clamp(2.5rem, 4.6vw, 4rem); font-weight: 400; line-height: 1.08; letter-spacing: -0.05em; text-wrap: balance; }
.article-deck { margin-bottom: 2rem; color: var(--muted); font-size: 1.1875rem; line-height: 1.6; }
.article-metadata { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; margin: 0; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.article-metadata div { min-width: 8rem; }
.article-metadata dt { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.875rem; }
.article-metadata dd { margin: 0; font-size: 0.9375rem; }
.article-draft-notice { margin: 0; padding: 1rem 1.25rem; border-left: 2px solid #777; background: var(--surface); color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.article-draft-notice strong { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 500; }
.article-cover { width: 100%; max-width: var(--article-col); margin: 0 auto 3.5rem; overflow: hidden; border-radius: 8px; }
.article-cover > img { display: block; width: 100%; height: auto; }
.article-cover .post-cover { min-height: 13rem; justify-content: flex-end; padding: clamp(1.75rem, 3.5vw, 2.75rem); }
.article-cover .cover-category { display: none; }
.article-cover .cover-title { max-width: 18ch; font-size: clamp(2.25rem, 4.2vw, 3.5rem); line-height: 1.05; }
.article-content { max-width: var(--article-col); margin-inline: auto; font-size: 1.0625rem; line-height: 1.75; }
.article-content h2 { margin-bottom: 1rem; font-size: clamp(1.5rem, 2.2vw, 1.875rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.03em; text-wrap: balance; }
.article-content h3 { margin-block: 2.25rem 0.75rem; font-size: 1.25rem; font-weight: 500; line-height: 1.35; letter-spacing: -0.02em; }
.article-content p { margin-bottom: 1.25rem; color: #333; }
.article-content ul, .article-content ol { padding-left: 1.3rem; }
.article-content li + li { margin-top: 0.5rem; }
.article-content li::marker { color: var(--muted); }
.article-section ul, .article-section ol { margin: 0 0 1.25rem; color: #333; }
.article-section li > ul, .article-section li > ol { margin: 0.5rem 0 0; }
.article-section ul ul { list-style-type: circle; }
.article-section ul ul ul { list-style-type: square; }
.article-content code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--surface); font-size: 0.9em; }
.article-content a:not(.button) { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; overflow-wrap: anywhere; transition: text-decoration-color 150ms ease; }
.article-content a:not(.button):hover { text-decoration-color: currentColor; }
.article-content blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 2px solid #777; color: var(--muted); }
.article-takeaways { margin-bottom: 3.5rem; padding: 1.75rem 2rem; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.article-takeaways h2 { margin-bottom: 1rem; color: var(--muted); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.article-takeaways ul { margin: 0; padding-left: 1.1rem; }
.article-takeaways li { color: var(--ink); font-size: 1rem; line-height: 1.6; }
.article-takeaways li + li { margin-top: 0.75rem; }
.article-takeaways .takeaway-note { font-size: 0.875rem; color: var(--muted); }
.article-section { margin-bottom: 3.5rem; }
.article-figure { margin: 2.25rem 0; }
.article-figure .figure-zoom { position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto; text-decoration: none; cursor: zoom-in; }
.article-figure .figure-zoom > img {
  display: block; width: auto; max-width: 100%; margin-inline: auto;
  max-height: min(720px, 130vh); height: auto;
  border: 1px solid var(--line); border-radius: 4px;
}
.figure-zoom-icon { position: absolute; top: 0.5rem; right: 0.5rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); opacity: 0; transition: opacity 150ms ease, transform 150ms ease; }
.figure-zoom:hover .figure-zoom-icon, .figure-zoom:focus-visible .figure-zoom-icon { opacity: 1; transform: scale(1.06); }
@media (hover: none) { .figure-zoom-icon { opacity: 0.9; } }
.figure-zoom:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.article-figure figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
html.has-lightbox { overflow: hidden; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(14, 14, 14, 0.96); color: #f2f2f2; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 3.5rem 1.5rem 1rem; overflow: auto; }
.lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; background: #fff; }
.lightbox.is-zoomable .lightbox-image { cursor: zoom-in; }
.lightbox.is-zoomed .lightbox-stage { align-items: flex-start; justify-content: flex-start; padding: 1rem; }
.lightbox.is-zoomed .lightbox-image { flex-shrink: 0; max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
.lightbox-caption { max-width: 46rem; margin: 0 auto; padding: 0.25rem 1.5rem 1.5rem; color: #cfcfcf; font-size: 0.875rem; line-height: 1.6; text-align: center; }
.lightbox-close { position: fixed; top: 0.75rem; right: 0.75rem; z-index: 1; width: 2.75rem; height: 2.75rem; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; background: rgba(0, 0, 0, 0.4); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgba(255, 255, 255, 0.15); }
.article-references { padding-top: 2rem; border-top: 1px solid var(--line); }
.article-references h2 { font-size: 1.25rem; }
.article-references p, .article-references li { font-size: 0.9375rem; line-height: 1.6; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article-nav-link { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color 0.15s ease, background 0.15s ease; }
.article-nav-link:hover { border-color: var(--line-strong); background: var(--surface); }
.article-nav-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.article-nav-label::before { content: "\2190"; font-size: 1rem; }
.article-nav-next { text-align: right; align-items: flex-end; }
.article-nav-next .article-nav-label { flex-direction: row-reverse; }
.article-nav-next .article-nav-label::before { content: none; }
.article-nav-next .article-nav-label::after { content: "\2192"; font-size: 1rem; }
.article-nav-title { font-size: 1.0625rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.article-nav-empty { border: none; }
.article-end { padding-top: 2rem; }
@media (max-width: 1050px) {
  .post-card { flex-basis: calc((100% - 1.5rem) / 2); }
}
@media (max-width: 700px) {
  .blog-index { padding-block: 2rem 3rem; }
  .blog-index .blog-intro { padding-bottom: 1.75rem; }
  .blog-index .blog-intro h1 { margin-bottom: 1rem; font-size: 2.25rem; line-height: 1.15; letter-spacing: 0; }
  .blog-index .blog-deck { margin-top: 1rem; font-size: 1rem; line-height: 1.6; }
  .blog-index .article-library { padding-top: 1.5rem; }
  .blog-index .article-library-heading { gap: 0.5rem; margin-bottom: 1.25rem; }
  .blog-index .article-library-heading p { line-height: 1.5; }
  .blog-index .article-carousel { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; gap: 1rem; }
  .blog-index .carousel-viewport { grid-area: 1 / 1 / 2 / 4; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .blog-index .carousel-prev { grid-area: 2 / 1; }
  .blog-index .carousel-next { grid-area: 2 / 3; }
  .blog-index .carousel-counter { grid-area: 2 / 2; position: static; width: auto; height: auto; clip: auto; overflow: visible; margin: 0; text-align: center; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .blog-index .article-grid { display: flex; gap: 1.5rem; }
  .blog-index .post-card { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  .blog-index .post-card-link { border-radius: 8px; }
  .blog-index .post-card-link:focus-visible { outline-offset: -3px; }
  .blog-index .post-card-cover { aspect-ratio: auto; min-height: 0; }
  .blog-index .post-card-cover:has(> img) { aspect-ratio: 16 / 9; }
  .blog-index .post-cover { min-height: 12rem; height: auto; gap: 1rem; padding: 1.25rem; }
  .blog-index .cover-category { font-size: 0.75rem; line-height: 1.4; overflow-wrap: anywhere; }
  .blog-index .cover-title { max-width: none; font-size: 1.75rem; line-height: 1.2; letter-spacing: 0; }
  .blog-index .post-card-copy { padding: 1.25rem; }
  .blog-index .post-card-meta { margin-bottom: 0.75rem; font-size: 0.8125rem; overflow-wrap: anywhere; }
  .blog-index .post-card h3 { margin-bottom: 0.75rem; font-size: 1.25rem; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; }
  .blog-index .post-summary { margin-bottom: 1.25rem; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: anywhere; }
  .article-main { padding-top: 1.5rem; }
  .article-back { margin-bottom: 2rem; }
  .article-heading h1 { font-size: clamp(2.4rem, 8vw, 3.5rem); }
  .article-deck { font-size: 1.0625rem; }
  .article-metadata { gap: 1.25rem 2rem; }
  .article-cover { margin-bottom: 2.5rem; }
  .article-cover .post-cover { min-height: 10rem; }
  .article-cover .cover-title { font-size: 2rem; }
  .article-content { font-size: 1rem; line-height: 1.7; }
  .article-takeaways { padding: 1.25rem 1.25rem 1.25rem 1.5rem; }
  .article-takeaways li { font-size: 0.9375rem; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-next { text-align: left; align-items: flex-start; }
  .article-nav-next .article-nav-label { flex-direction: row; }
  .article-nav-next .article-nav-label::before { content: "\2192"; }
  .article-nav-next .article-nav-label::after { content: none; }
}
