/* Public journal and long-form reading, scoped to the blog. */
.blog-page { --blog-top: calc(var(--safe-top) + var(--chrome-h) * var(--chrome-scale)); }
body.blog-page main.section { padding-top: calc(var(--blog-top) + 36px); }
body.blog-page main .wrap.blog-index { width: min(1120px, calc(100% - 48px)); max-width: none; }
.blog-intro { margin-bottom: 44px; }
.blog-intro h1 { margin-block: 18px; }
.blog-list { display: grid; gap: 36px; }
.blog-card { border-block-start: 1px solid var(--line); padding-top: 28px; min-width: 0; }
.blog-page main .blog-card > a { display: grid; gap: 32px; color: inherit; text-decoration: none; }
.blog-card.has-image > a { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
.blog-card-media { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 9; background: #0b1017; }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.blog-card-copy { min-width: 0; padding-block: 12px; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #9aaebc; font-size: 12px; line-height: 1.6; letter-spacing: .025em; }
.blog-page main .blog-card h2 { margin: 18px 0 14px; font-size: clamp(24px, 2.5vw, 34px); line-height: 1.3; font-weight: 400; text-wrap: balance; }
.blog-card-summary { margin: 0; font-size: 15px; line-height: 1.8; }
.blog-card-read { display: inline-flex; align-items: center; gap: 16px; margin-top: 24px; color: #b7dceb; font-size: 13px; }
.blog-card > a:hover .blog-card-read { text-decoration: underline; text-underline-offset: 5px; }
.blog-card > a:hover img { transform: scale(1.025); }
body.blog-article-page main .wrap.blog-index { width: min(860px, calc(100% - 48px)); }
.blog-reader-tools { display: flex; align-items: center; gap: 26px; position: sticky; top: var(--blog-top); z-index: 10; min-height: 54px; margin-bottom: 32px; border-bottom: 1px solid var(--line); background: #080c11; padding: 0 16px; font-size: 12px; }
.blog-reader-tools > a, .blog-contents > summary { display: inline-flex; align-items: center; min-height: 48px; }
.blog-reader-tools .blog-top { margin-left: auto; }
.blog-progress { position: absolute; inset: auto 0 -1px; height: 2px; overflow: hidden; pointer-events: none; }
.blog-progress span { display: block; width: 100%; height: 100%; background: #9fd2ea; transform-origin: left; transform: scaleX(0); }
.blog-contents > summary { gap: 12px; cursor: pointer; list-style: none; color: #cce4ef; }
.blog-contents > summary::-webkit-details-marker { display: none; }
.blog-contents > summary span { font-size: 18px; font-weight: 300; }
.blog-contents[open] > summary span { transform: rotate(45deg); }
.blog-contents:not([open]) .blog-toc { display: none; }
.blog-toc { position: absolute; left: 0; top: 100%; width: min(640px, 100%); max-height: min(60dvh, calc(100dvh - var(--blog-top) - 80px)); overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px; border: 1px solid #2a3b47; background: #0b1118; box-shadow: 0 16px 40px #0008; scrollbar-width: thin; scrollbar-color: #526d80 transparent; }
.blog-toc ol { list-style: none; margin: 0; padding: 0; }
.blog-toc > ol > li + li { border-top: 1px solid var(--line); }
.blog-toc li ol { padding-left: 18px; padding-bottom: 10px; }
.blog-page main .blog-toc a { display: block; padding: 10px 4px; color: #d5dee3; line-height: 1.5; text-decoration: none; }
.blog-page main .blog-toc li li a { color: #9fb4c1; padding-block: 7px; }
.blog-page main .blog-toc a:hover, .blog-page main .blog-toc a[aria-current="location"] { color: #9fd2ea; background: #15222e; }
.blog-article, .blog-body { min-width: 0; }
.blog-article-head { padding: 8px 0 20px; }
.blog-article-head h1 { margin: 22px 0 18px; max-width: 25ch; font-size: clamp(30px, 3.5vw, 46px); font-weight: 300; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.blog-page main .blog-dek { margin: 0 0 14px; color: #9fb4c1; font-size: clamp(16px, 1.7vw, 19px); line-height: 1.65; }
.blog-body { font-size: 17px; line-height: 1.85; overflow-wrap: anywhere; }
.blog-body > p, .blog-body > ul, .blog-body > blockquote { max-width: 74ch; }
.blog-body p { margin-block: 0 1.4em; }
.blog-body li { margin-block: .4em; }
.blog-page main .blog-body h2 { margin: 2.6em 0 .8em; padding-top: .6em; border-top: 1px solid var(--line); font-size: clamp(25px, 2.6vw, 32px); line-height: 1.35; font-weight: 400; }
.blog-page main .blog-body h3 { margin: 2em 0 .75em; font-size: clamp(20px, 2vw, 24px); line-height: 1.4; font-weight: 400; }
.blog-page main [id] { scroll-margin-top: calc(var(--blog-top) + 76px); }
.blog-body blockquote { margin: 28px 0; padding-left: 20px; border-left: 2px solid #9fd2ea; }
.blog-body figure { margin: 28px 0; }
.blog-body img { width: 100%; height: auto; border-radius: 12px; }
.blog-body .blog-cover { margin: 8px 0 40px; }
.blog-cover a { display: block; }
.blog-body figcaption { margin-top: 12px; font-size: 13px; line-height: 1.7; }
.blog-body figcaption:empty { display: none; }
.blog-body code { font-size: .9em; background: #14202a; border-radius: 4px; padding: .1em .3em; }
.blog-body a { text-decoration: underline; text-underline-offset: 4px; }
.blog-table { max-width: 100%; overflow-x: auto; margin: 28px 0; border: 1px solid var(--line); border-radius: 8px; scrollbar-width: thin; scrollbar-color: #526d80 transparent; }
.blog-body table { min-width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.blog-body th, .blog-body td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; min-width: 90px; }
.blog-body th { background: #111c25; color: #dae7ee; font-weight: 600; }
.blog-body td { color: #bdcdd7; }
.blog-body tr:last-child td { border-bottom: 0; }
.blog-body .katex { font-size: 1.05em; position: relative; }
.blog-body p .katex, .blog-body li .katex { display: inline-block; vertical-align: middle; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: .15em; }
.blog-body .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: 8px; scrollbar-width: thin; }
.blog-body .katex-display > .katex { white-space: nowrap; }
.blog-eq { display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.blog-eq-math { flex: 1; min-width: 0; overflow-x: auto; }
.blog-eq .katex-display { margin: 0; }
.blog-eq-no { flex: none; font-size: 13px; color: #9fb4c1; }
.blog-back { display: flex; justify-content: space-between; gap: 20px; padding-top: 28px; margin-top: 56px; border-top: 1px solid var(--line); font-size: 13px; }
.blog-skip { position: fixed; left: 16px; top: 12px; padding: 12px 18px; background: #d2e9f5; color: #05070b; z-index: 200; transform: translateY(-160%); }
.blog-skip:focus { transform: none; }
.blog-page :is(summary, .blog-table):focus-visible { outline: 2px solid #9fd2ea; outline-offset: 4px; }
@media (max-width: 680px) {
  body.blog-page main .wrap.blog-index, body.blog-article-page main .wrap.blog-index { width: calc(100% - 40px); }
  body.blog-page main.section { padding-top: calc(var(--blog-top) + 22px); }
  .blog-intro { margin-bottom: 28px; }
  .blog-card.has-image > a { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .blog-card-media { aspect-ratio: 16 / 9; }
  .blog-card-copy { padding: 0; }
  .blog-page main .blog-card h2 { font-size: 27px; }
  .blog-reader-tools { gap: 18px; margin-bottom: 24px; padding-inline: 0; font-size: 11px; }
  .blog-contents > summary { gap: 7px; }
  .blog-article-head { padding-top: 0; }
  .blog-body { font-size: 16px; line-height: 1.85; }
  .blog-body ul { padding-left: 22px; }
  .blog-meta { gap: 4px 14px; font-size: 11px; }
  .blog-body th, .blog-body td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-card-media img { transition: none; }
  .blog-card > a:hover img { transform: none; }
}
@media print {
  .blog-reader-tools, .blog-skip, .blog-page .masthead, .blog-page footer, .blog-page canvas, .blog-page .blog-back { display: none; }
  body.blog-page, .blog-page main.section { background: white; color: black; padding: 0; }
  body.blog-article-page main .wrap.blog-index { width: 100%; }
  .blog-page main p, .blog-page main li, .blog-page main td, .blog-page main th { color: black; }
  .blog-table { overflow: visible; }
  .blog-page h2, .blog-page h3 { break-after: avoid; }
}
