/* Shared foundation for the personal site. Homepage spacing and badges follow Figma 163:654. */
:root { --tf-text: #37362f; --tf-secondary: #63635e; --tf-link: #21201c; --tf-border: rgb(0 0 0 / .2); --tf-width: 692px; }
.tf-home { box-sizing: border-box; width: 100%; max-width: var(--tf-width); margin: 0 auto; padding: 64px 24px; font-family: var(--font-sans); font-size: 16px; line-height: 1.65; color: var(--tf-secondary); }
.tf-home *, .tf-home *::before, .tf-home *::after { box-sizing: border-box; }
.tf-home :is(h1,h2,h3,p) { margin: 0; font-size: 16px; letter-spacing: 0; line-height: 24px; }
.tf-home :is(h1,h2) { font-weight: 500; color: var(--tf-text); }
.tf-home h3 { font-weight: 400; color: var(--tf-link); }
.tf-home a { color: inherit; }
.tf-home h1 a, .tf-home h3 a { text-decoration: none; }
.tf-home a:hover { text-decoration: underline; }
.tf-home .tf-identity h1 a:hover { text-decoration: none; }
.tf-home a:focus-visible, .tf-home button:focus-visible, .tf-home input:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.tf-identity p { line-height: 20px; }
.tf-section { margin-top: 128px; }
.tf-section > p { margin-top: 8px; line-height: 26.4px; }
.tf-project { margin-top: 24px; }
.tf-project:first-of-type { margin-top: 8px; }
.tf-project h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tf-writing { display: grid; gap: 16px; margin-top: 16px; }
.tf-post { display: flex; align-items: flex-start; gap: 22px; padding: 12px; margin: -12px; border-radius: 6px; text-decoration: none; }
.tf-post:hover { background: #fafafa; text-decoration: none !important; }
.tf-post img { width: 150px; height: 90px; flex-shrink: 0; object-fit: cover; border-radius: 8px; }
.tf-post div { min-width: 0; }
.tf-more { display: inline-block; margin-top: 32px; padding: 6px 14px; border: 1px solid var(--tf-border); border-radius: 99px; font-size: 12.5px; font-weight: 500; line-height: 17.5px; color: var(--tf-link) !important; text-decoration: none; }
.tf-subscribe { margin-top: 24px; }
.tf-subscribe-field { display: flex; align-items: center; min-height: 48px; border: 1px solid var(--tf-border); border-radius: 99px; padding: 7px 9px 7px 14px; gap: 8px; }
.tf-subscribe input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--tf-text); font: inherit; line-height: 24px; padding: 0; }
.tf-subscribe input::placeholder { color: #8d8d86; }
.tf-subscribe button { border: 0; border-radius: 99px; background: var(--tf-link); color: #fff; padding: 6px 14px; font-family: inherit; font-size: 12.5px; font-weight: 500; line-height: 17.5px; cursor: pointer; }
.tf-subscribe-success, .tf-submit-loading { display: none; }
.tf-subscribe.success .tf-subscribe-success, .tf-subscribe.loading .tf-submit-loading { display: block; }
.tf-subscribe.loading .tf-submit-idle, .tf-subscribe.success .tf-subscribe-field { display: none; }
.tf-subscribe :is(.tf-subscribe-success,.tf-subscribe-error) { margin-top: 12px; }
.tf-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root { --tf-text: #ededeb; --tf-secondary: #a3a39b; --tf-link: #ededeb; --tf-border: rgb(255 255 255 / .2); } .tf-post:hover { background: #171717; } .tf-subscribe button { color: #0a0a0a; } }
@media (max-width: 600px) { .tf-home { padding: 40px 24px; } .tf-section { margin-top: 88px; } .tf-post { gap: 14px; } .tf-post img { width: 100px; height: 72px; } }
@media (prefers-reduced-motion: reduce) { .tf-home * { scroll-behavior: auto; } }

.tf-coming-soon { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 8px; background: rgb(0 0 0 / .05); color: rgb(0 0 0 / .4); font-size: 12px; font-weight: 400; line-height: 16px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tf-coming-soon { background: rgb(255 255 255 / .05); color: rgb(255 255 255 / .4); } }
.tf-home .tf-more, .tf-home .tf-subscribe button { transition: background-color 180ms ease; text-decoration: none; }
.tf-home .tf-more:hover { background-color: color-mix(in srgb, var(--tf-link) 6%, transparent); text-decoration: none; }
.tf-home .tf-subscribe button:hover { background-color: color-mix(in srgb, var(--tf-link) 88%, var(--paper)); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .tf-home .tf-more, .tf-home .tf-subscribe button { transition: none; } }

.tf-subscribe-error:empty { display: none; }

/* Article view — Figma 133:2482. Ghost cards and content remain dynamic. */
@font-face { font-family: Newsreader; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/newsreader-medium.ttf') format('truetype'); }
body.post-template { color: var(--tf-link); }
body.post-template .gh-article { padding-top: 72px; }
body.post-template .gh-article-header { display: flex; flex-direction: column; gap: 25px; padding: 0 42px; text-align: left; }
body.post-template .gh-article-title { margin: 0; font-family: Newsreader, Georgia, serif; font-size: 40px; font-weight: 500; line-height: 44px; letter-spacing: -1.6px; color: var(--ink); }
body.post-template .gh-article-excerpt { margin: -25px 0 0; padding-top: 4px; font-size: 16px; line-height: 1.4; color: var(--tf-secondary); }
body.post-template .gh-meta-share { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin: 0; }
body.post-template .gh-article-meta { margin: 0; gap: 8px; font-size: 16px; }
body.post-template .gh-article-author-image { padding-right: 8px; }
body.post-template .gh-article-author-image :is(img,svg) { width: 50px; height: 50px; border-radius: 50%; }
body.post-template .gh-article-author-name { font-size: 16px; line-height: 20px; font-weight: 600; letter-spacing: -.135px; }
body.post-template .gh-article-meta-content { margin-top: 4px; font-size: 16px; font-weight: 400; line-height: 20px; color: var(--tf-secondary); }
body.post-template .gh-article-image { width: 100%; margin: 0; }
body.post-template .gh-article-image img { width: 100%; height: auto; border-radius: 8px; }
body.post-template .gh-content { --content-width: 596px; --wide-width: 100%; --content-font-size: 16px; margin-top: 40px; padding-inline: 42px; font-family: var(--font-sans); font-size: 16px; line-height: 27.2px; letter-spacing: -.16px; }
body.post-template .gh-content > * { grid-column: main; }
body.post-template .gh-content > * + * { margin-top: 31px; }
body.post-template .gh-content :is(h2,h3) { font-family: var(--font-sans); font-weight: 600; }
body.post-template .gh-content h2 { font-size: 20.8px; line-height: 24.96px; letter-spacing: -.624px; }
body.post-template .gh-content h3 { font-size: 18px; line-height: 24px; }
body.post-template .gh-content .kg-width-full { width: 100%; margin-inline: 0; }
body.post-template .gh-content :is(pre,table) { max-width: 100%; overflow-x: auto; }
body.post-template .gh-content iframe { max-width: 100%; }
body.post-template .gh-comments { margin: 48px 42px; }
body.post-template .gh-container { margin: 120px 0 0; padding: 0; }
body.post-template .gh-container-title { margin-bottom: 20px; color: var(--muted); font-size: 13.5px; line-height: 18.9px; font-weight: 400; letter-spacing: 0; }
body.post-template .gh-feed { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px; }
body.post-template .gh-card { display: block; }
body.post-template .gh-card-link { display: block; }
body.post-template .gh-container .gh-card-image { width: 100%; margin: 0 0 8px; aspect-ratio: 16 / 9; }
body.post-template .gh-card-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
body.post-template .gh-card-wrapper { padding: 0; }
body.post-template .gh-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: 0; color: var(--tf-text); }
body.post-template .gh-card-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: 8px; font-size: 16px; line-height: 1.4; color: var(--tf-secondary); }
body.post-template :is(.gh-card-top,.gh-card-meta) { display: none; }
body.post-template :is(.gh-button-share,.gh-toc-copy) { padding: 8px 16px; border: 1px solid var(--tf-border); background: transparent; color: var(--ink); font-size: 16px; font-weight: 500; line-height: 17.5px; transition: background-color 180ms ease; text-decoration: none; }
body.post-template :is(.gh-button-share,.gh-toc-copy):hover { background: color-mix(in srgb,var(--ink) 6%,transparent); border-color: var(--tf-border); text-decoration: none; opacity: 1; }
.tf-article-footer { margin-top: 64px; padding: 40px 24px; border-top: 1px solid var(--hairline); text-align: center; }
.tf-wordmark { display: inline-block; }
.tf-wordmark img { display: block; width: 151px; height: 27px; }
.tf-article-footer .tf-subscribe { max-width: 560px; margin: 24px auto 0; font-size: 16px; text-align: left; }
.tf-article-footer .gh-social-links { display: flex; justify-content: center; gap: 20px; margin-top: 32px; }
.tf-article-footer .gh-social-links svg { width: 20px; height: 20px; }
.tf-article-footer .tf-account { display: block; margin-top: 24px; }
.tf-article-footer button { transition: background-color 180ms ease; }
.tf-article-footer button:hover { background: color-mix(in srgb,var(--tf-link) 88%,var(--paper)); }
@media (prefers-color-scheme: dark) { .tf-wordmark img { filter: invert(1); } }
@media (min-width: 900px) {
    body.post-template .gh-shell { max-width: 1280px; margin-inline: auto; padding-inline: 8px; grid-template-columns: 244px minmax(0,679px); column-gap: 51px; }
    body.post-template .gh-side-nav { margin: 0; padding-inline: 12px; font-size: 16px; }
    body.post-template .gh-side-heading { font-size: 16px; }
    body.post-template .gh-side-link { color: var(--tf-secondary); }
    body.post-template .gh-side-all { color: var(--ink); }
    body.post-template .gh-side-link.is-active { background: transparent; font-weight: 500; color: var(--tf-text); }
}
@media (min-width: 1120px) {
    body.post-template .gh-shell.has-toc { grid-template-columns: 244px minmax(0,679px) 216px; }
    body.post-template .gh-shell.has-toc .gh-toc { font-size: 16px; }
    body.post-template .gh-toc a { padding-left: 28px; }
}
@media (max-width: 899px) {
    body.post-template .gh-shell-main { max-width: 692px; margin-inline: auto; }
    body.post-template .gh-article { padding-top: 40px; }
    body.post-template .gh-article-header { padding-inline: 24px; }
    body.post-template .gh-content { padding-inline: 24px; }
    body.post-template .gh-container { padding-inline: 24px; margin-top: 80px; }
    body.post-template .gh-feed { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
}
@media (max-width: 600px) {
    body.post-template .gh-article-title { font-size: 34px; line-height: 38px; letter-spacing: -1px; }
    body.post-template .gh-article-meta-content { font-size: 13px; }
    body.post-template .gh-meta-share { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { body.post-template :is(.gh-button-share,.gh-toc-copy), .tf-article-footer button { transition: none; } }
body.post-template .gh-article-header { margin: 0; }
body.post-template .gh-content { grid-template-columns: [full-start wide-start main-start] minmax(0,1fr) [main-end wide-end full-end]; }
body.post-template .gh-content > :is(h2,h3) { margin-top: 31px; }
body.post-template .gh-content > [id]:not(:first-child) { margin-top: 31px; }
body.post-template .gh-article-title.is-title { font-family: Newsreader, Georgia, serif !important; font-weight: 500; }

/* Archive uses collection posts and Ghost page_url. No second query or infinite-scroll feed. */
/* Archive owns its header on every pagination page. */
.tf-archive-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tf-archive-header .tf-more { margin-top: 0; }
.tf-archive-viewport { min-height: 100vh; min-height: 100dvh; }
.tf-archive-viewport > :is(.tf-archive,.gh-shell) { flex: 1 0 auto; }
.tf-archive-viewport > :is(.gh-footer,.tf-article-footer) { flex-shrink: 0; }
.tf-archive-header .tf-wordmark { flex-shrink: 0; }
.tf-archive-header .tf-wordmark:hover { text-decoration: none; }
.tf-archive .tf-writing { margin-top: 40px; gap: 32px; }
.tf-archive .tf-post h2 { color: var(--tf-text); }
.tf-archive time { display: block; margin-top: 8px; font-size: 13px; }
.tf-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; font-size: 13px; }
.tf-pagination .tf-more { margin-top: 0; }
.tf-article-footer :is(button,a):hover { text-decoration: none; }

/* Ask-your-agent row: text plus ChatGPT / Claude / Perplexity icon links. */
.tf-home .tf-ask-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; line-height: 24px; }
.tf-home .tf-ask-ai a { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--tf-secondary); transition: color 180ms ease; }
.tf-home .tf-ask-ai a:hover { color: var(--tf-text); }
.tf-home .tf-ask-ai svg { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .tf-home .tf-ask-ai a { transition: none; } }
