/* The blog (scripts/blog/pages.ts), after Splat Studio's blog: flat ink, hairlines, editorial type.
   Uses the tokens and site.css only; brand blue stays on the primary action and focus. The pages
   scroll the document itself (the app's body does not scroll), so headings, find and back work. */
body.blog { height: auto; min-height: 100%; overflow: visible; background: var(--ink-0); color: var(--fg); font-family: var(--display); }
:root:has(body.blog) { background: var(--ink-0); scroll-padding-top: 80px; }
:root[data-theme='light'] .only-dark,
:root:not([data-theme='light']) .only-light { display: none; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 40; padding: 10px 14px; border-radius: 10px; background: var(--selected-bg); color: var(--selected-fg); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: calc(12px + var(--safe-t)); }
.blog .site-nav .nav-link[aria-current] { color: var(--fg); }
.blog .site-nav > a { display: inline-flex; }

/* Entrance: one quiet rise, staggered by `--i` (reduced motion is handled in base.css). */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.rise, .post-card { animation: rise 900ms var(--ease-reveal) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* ── Listing ── */
.blog-head { padding: clamp(48px, 8vw, 110px) 0 clamp(32px, 5vw, 56px); max-width: 760px; }
.blog-head h1, .post-head h1 { margin: 0; font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.045em; font-weight: 650; text-wrap: balance; }
.lede { margin: 20px 0 0; max-width: 620px; color: var(--fg-2); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; text-wrap: pretty; }

.post-card { display: flex; flex-direction: column; gap: 18px; color: var(--fg); text-decoration: none; border-radius: 22px; }
.post-card-img { display: block; overflow: hidden; border-radius: 20px; aspect-ratio: 16 / 10; background: var(--ink-2); border: 1px solid var(--line); }
.post-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1100ms var(--ease-reveal); }
.post-card:hover img { transform: scale(1.04); }
.post-card .body { display: flex; flex-direction: column; gap: 10px; }
.post-card .meta, .post-meta { color: var(--fg-3); font-size: 13px; }
.post-card h2, .post-card h3 { margin: 0; font-size: 21px; line-height: 1.22; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
.post-card p { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.post-card .more { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 14px; font-weight: 600; transition: color 180ms ease, gap 220ms var(--ease); }
.post-card .more svg { width: 16px; height: 16px; }
.post-card:hover .more { color: var(--fg); gap: 10px; }
.post-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; }

.post-card.feature { border-radius: 0; display: grid; grid-template-columns: 1.45fr 1fr; align-items: center; gap: clamp(24px, 4vw, 56px); padding-bottom: clamp(48px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.post-card.feature h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 650; }
.post-card.feature p { font-size: 17px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(36px, 4vw, 48px) 28px; padding-top: clamp(40px, 5vw, 64px); }

.blog-faq { margin-top: clamp(80px, 10vw, 130px); padding-top: 34px; border-top: 1px solid var(--line); }
.blog-faq h2, .blog-open h2, .post-cta h2 { margin: 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 650; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(28px, 5vw, 72px); margin-top: 36px; }
.faq-grid h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.faq-grid p { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.6; }
.faq-grid a { color: var(--fg); text-underline-offset: 3px; }

.blog-open { margin-top: clamp(80px, 10vw, 130px); padding: clamp(40px, 6vw, 72px) 24px; text-align: center; border-radius: 28px; background: var(--ink-1); border: 1px solid var(--line); }
.blog-open > p { margin: 14px auto 0; max-width: 460px; color: var(--fg-2); font-size: 17px; line-height: 1.55; }
.blog-open .post-try { justify-content: center; margin: 28px 0 0; }

/* ── Article ── */
.post { max-width: 880px; }
.post-crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: clamp(32px, 5vw, 64px) 0 20px; font-size: 13.5px; }
.post-crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--fg-3); }
.post-crumbs a { color: var(--fg-2); text-decoration: none; transition: color 180ms ease; }
.post-crumbs a:hover { color: var(--fg); }
.post-head h1 { font-size: clamp(36px, 5.2vw, 64px); line-height: 1.02; }
.post-meta { margin: 18px 0 0; }
.post-hero { margin: clamp(28px, 4vw, 44px) 0 0; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: var(--ink-2); animation-delay: 120ms; }
.post-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-try { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 clamp(36px, 5vw, 52px); }

.prose { max-width: 68ch; font-family: var(--font); font-size: 18px; line-height: 1.7; color: var(--fg); }
.prose > * { margin: 0 0 1.1em; }
.prose h2 { margin: 2.1em 0 0.6em; font-family: var(--display); font-size: clamp(25px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; }
.prose h3 { margin: 1.7em 0 0.5em; font-family: var(--display); font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; }
.prose p, .prose li { color: color-mix(in srgb, var(--fg) 86%, var(--fg-2)); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--fg-3); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color 180ms ease; }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font-family: var(--mono); font-size: 0.86em; padding: 2px 6px; border-radius: 6px; background: var(--ink-2); border: 1px solid var(--line); }
.prose pre { overflow-x: auto; padding: 16px 18px; border-radius: 14px; background: var(--ink-1); border: 1px solid var(--line); font-size: 14px; line-height: 1.55; }
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--line-2); color: var(--fg-2); }
.prose kbd { font-family: var(--mono); font-size: 0.8em; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--ink-1); }
/* Wide tables scroll inside themselves on a phone instead of widening the page. */
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 120px; }
.prose th { color: var(--fg-2); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; border-bottom-color: var(--line-2); }

.post-cta { margin-top: clamp(64px, 8vw, 96px); padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-cta > p:not(.kicker) { margin: 14px 0 0; max-width: 560px; color: var(--fg-2); font-size: 16.5px; line-height: 1.55; }
.post-cta .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.post-related { margin-top: clamp(64px, 8vw, 96px); }
.post-related h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 650; }
.post-related .post-grid { padding-top: 28px; }
.blog .site-footer { margin-top: clamp(80px, 10vw, 140px); }

@media (max-width: 980px) {
  .post-card.feature { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .prose { font-size: 17px; }
  .post-try .b, .blog-open .b { flex: 1 1 auto; }
  .post-hero, .post-card-img { border-radius: 16px; }
}
