/* Blog pages (/blog and /blog/{slug}), server-rendered by blog.mjs. Loaded after site.css, which owns the tokens,
   .wrap, .btn, .cover, .nav, .label, .pill and .footer. Only what the blog adds lives here: the sticky header (the
   landing page keeps its own copy), the post card grid, the article column and the FAQ list. No JavaScript: the
   contents rail is anchors and the questions are <details>. */

/* header, repeated from the landing page so a post needs neither landing.css nor any script */
.hdr { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(14, 20, 36, .82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid rgba(255, 255, 255, .08) }
.hdr .nav { padding-block: 12px }
.hdr .nav a.link:hover { color: #fff }
.ctarow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.btn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .25) }

/* index hero */
.blog-hero { padding-block: clamp(44px, 7vw, 86px) clamp(36px, 5vw, 64px) }
.blog-hero .label { color: var(--citron) }
.blog-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 5vw, 56px); line-height: 1.04; letter-spacing: -.045em; margin-top: 14px; max-width: 24ch }
.blog-hero .lead { margin-top: 16px; font-size: clamp(16px, 1.6vw, 19px); color: rgba(243, 245, 250, .84); max-width: 58ch }

.blog-index { padding-block: clamp(32px, 5vw, 56px) }
.batch-h { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -.03em; margin: 34px 0 14px }
.batch-h:first-child { margin-top: 0 }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px }

.pcard { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-decoration: none; color: inherit }
.pcard:hover { border-color: var(--iris); box-shadow: 0 18px 40px -28px rgba(27, 36, 64, .55) }
.pc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px }
.pc-h { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.22; letter-spacing: -.028em }
.pc-d { font-size: 14.5px; line-height: 1.55; flex: 1 }
.pc-go { font-size: 13.5px; font-weight: 600; color: var(--accent) }

/* article */
.post { padding-block: 26px clamp(40px, 6vw, 72px) }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 7px; flex-wrap: wrap }
.crumbs a { color: var(--muted); text-decoration: none }
.crumbs a:hover { color: var(--ink) }
.post h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.06; letter-spacing: -.043em; margin-top: 18px; max-width: 26ch }
.post > .lead { margin-top: 16px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; color: var(--muted); max-width: 62ch }
.postmeta { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--line) }

.draftbar { margin-top: 18px; border: 1px solid var(--warn); border-left-width: 4px; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; font-weight: 600 }

.postgrid { display: grid; grid-template-columns: 220px minmax(0, 44rem); gap: clamp(28px, 5vw, 64px); align-items: start; margin-top: 30px }
@media (max-width: 980px) { .postgrid { grid-template-columns: minmax(0, 1fr) } }

.toc { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 18px; font-size: 13.5px }
@media (max-width: 980px) { .toc { position: static; top: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px } }
.toc .label { margin-bottom: 10px }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px }
.toc a { color: var(--muted); text-decoration: none }
.toc a:hover { color: var(--ink) }
.toc li.sub { padding-left: 11px; font-size: 12.5px }
.toc li.sub a { color: var(--off) }

.postbody { font-size: 16.5px; line-height: 1.72; min-width: 0 }
.postbody > * + * { margin-top: 18px }
.postbody h2 { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.18; letter-spacing: -.035em; margin-top: 44px; scroll-margin-top: 82px }
.postbody h3 { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -.03em; scroll-margin-top: 82px }
.postbody a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px }
.postbody ul, .postbody ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px }
.postbody li { padding-left: 2px }
.postbody li::marker { color: var(--iris) }
.postbody code { font-family: var(--mono); font-size: .88em; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere }
.postbody p.tip { border: 1px solid var(--line); border-left: 4px solid var(--iris); background: var(--soft); border-radius: 10px; padding: 14px 16px; font-size: 15.5px; line-height: 1.6 }

.tablewrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); margin-top: 26px }
/* A wide table scrolls inside the frame. The two gradients are painted against the scroll box (background-attachment:
   local), so each one shows only while there is more table in that direction: a scroll cue that needs no JavaScript
   and disappears once the table fits. */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--panel), rgba(255, 255, 255, 0)) 0 0 / 28px 100% no-repeat local,
    linear-gradient(to left, var(--panel), rgba(255, 255, 255, 0)) 100% 0 / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(16, 22, 40, .14), rgba(16, 22, 40, 0)) 0 0 / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(16, 22, 40, .14), rgba(16, 22, 40, 0)) 100% 0 / 14px 100% no-repeat scroll }
.tablewrap table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 14px; line-height: 1.5 }
.tablewrap thead { background: var(--head) }
.tablewrap th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line) }
.tablewrap td { padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 9rem }
.tablewrap tbody tr:last-child td { border-bottom: 0 }
.tablewrap td:first-child { font-weight: 600; color: var(--ink) }
.tablewrap .tnote { border-top: 1px solid var(--line); background: var(--head); padding: 10px 14px; font-size: 12.5px; line-height: 1.6; color: var(--muted) }

.entry { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 18px }
.entry-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--night); color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 500 }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .entry-n { background: #E9ECF4; color: #0E1424 } }
:root[data-theme="dark"] .entry-n { background: #E9ECF4; color: #0E1424 }
.entry-b { min-width: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15.5px }
.entry-tag { color: var(--accent); font-size: 11px }
.entry-link a { font-weight: 600; font-size: 14px; text-decoration: none }

.faqs { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 12px }
.faqs h2 { margin-top: 24px }
.faqs details { border-bottom: 1px solid var(--line); padding-block: 15px }
.faqs summary { cursor: pointer; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 14px }
.faqs summary::-webkit-details-marker { display: none }
.faqs summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1 }
.faqs details[open] summary::after { content: "−" }
.faqs details p { color: var(--muted); margin-top: 9px; font-size: 15.5px; max-width: 70ch }

.srcs { margin-top: 44px }
.srcs h2 { font-size: 19px; margin-top: 0; scroll-margin-top: 82px }
.srcs ul { list-style: none; padding: 0; margin-top: 12px; display: flex; flex-direction: column; gap: 9px; font-size: 14px }
.srcs li { overflow-wrap: anywhere }

.inlinecta { margin-top: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between }
.inlinecta p { font-size: 15.5px; line-height: 1.55 }
.inlinecta p + p { margin-top: 5px }

/* section.keep, not .keep: site.css already uses .keep on the nav links that survive the mobile breakdown
   (.nav a.link:not(.keep) { display: none }), and a bare .keep here put a 76px top margin on "Log in". */
section.keep { margin-top: clamp(44px, 6vw, 76px) }
section.keep h2 { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.035em; margin-bottom: 16px }

.closing { padding-block: clamp(48px, 7vw, 80px); display: flex; flex-direction: column; gap: 16px; align-items: flex-start }
.closing h2 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.04em; max-width: 24ch }
.closing .lead { color: rgba(243, 245, 250, .82); max-width: 54ch; font-size: 16.5px }

.notfound { padding-block: clamp(60px, 10vw, 120px); display: flex; flex-direction: column; gap: 16px; align-items: flex-start }
.notfound h1 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.04em }
