/* The blog. Light, like the rest of the site. Each article has its own coffee ring. */
.ring { display: block; color: var(--ring); }

/* Index */
.blog { padding-top: clamp(32px, 6vw, 72px); }
.blog-head { max-width: 860px; }
.blog-head h1 { font-size: clamp(44px, 8vw, 88px); line-height: 1; letter-spacing: -.045em; font-weight: 700; }
.blog-head p { margin-top: 22px; max-width: 560px; font-size: 19px; line-height: 1.5; color: var(--body); }
.blog-jump { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 16px; }
.blog-jump a { padding-block: 6px; color: var(--muted); text-decoration: none; }
.blog-jump a:hover { color: var(--accent); }
.blog-lead { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; margin-top: clamp(40px, 6vw, 72px); padding: clamp(28px, 5vw, 64px); background: var(--surface); border-radius: 28px; text-decoration: none; color: inherit; }
.blog-lead .ring-lead { width: 100%; max-width: 340px; transition: transform .5s var(--ease); }
.blog-lead:hover .ring-lead { transform: rotate(-6deg); }
.blog-lead h2 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.06; letter-spacing: -.035em; font-weight: 700; }
.blog-lead p { margin-top: 16px; max-width: 560px; font-size: 18px; line-height: 1.5; color: var(--body); }
.blog-read { display: inline-block; margin-top: 20px; font-weight: 600; color: var(--accent); }
.blog-lead:hover .blog-read { text-decoration: underline; text-underline-offset: 3px; }
.blog-section { margin-top: clamp(56px, 8vw, 96px); font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; font-weight: 700; }
.blog-grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 44px 40px; }
.blog-grid a { display: block; text-decoration: none; color: inherit; }
.blog-grid .ring-small { width: 72px; margin-left: -8px; transition: transform .4s var(--ease); }
.blog-grid a:hover .ring-small { transform: rotate(-10deg); }
.blog-grid h3 { margin-top: 10px; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
.blog-grid a:hover h3 { color: var(--accent); }
.blog-grid p { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--body); }

/* Article */
.post { padding-top: clamp(24px, 4vw, 48px); }
.post-head { position: relative; max-width: 1040px; padding-bottom: clamp(28px, 4vw, 44px); }
.post-crumbs { font-size: 15px; }
.post-crumbs a { color: var(--muted); text-decoration: none; padding-block: 12px; }
.post-crumbs a:hover { color: var(--heading); }
.post-crumbs a + a::before { content: "/"; margin-inline: 8px; color: var(--muted); }
.post-head h1 { position: relative; z-index: 1; margin: 14px 0 0; max-width: 11.5em; font-size: clamp(38px, 6.4vw, 72px); line-height: 1.03; letter-spacing: -.04em; font-weight: 700; text-wrap: balance; }
.post-meta { position: relative; z-index: 1; margin-top: 20px; font-size: 16px; color: var(--muted); }
.ring-hero { position: absolute; top: -28px; right: -120px; width: clamp(180px, 26vw, 340px); opacity: .85; pointer-events: none; }

.post-layout { display: grid; grid-template-columns: 200px minmax(0, 700px); gap: 72px; align-items: start; padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.post-side { position: sticky; top: 28px; }
.ring-progress { display: none; width: 76px; margin: 0 0 16px -10px; }
.reading .ring-progress { display: block; }
.ring-progress-drop { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.2); transition: opacity .25s var(--ease), transform .45s var(--ease); }
.ring-progress.is-done .ring-progress-drop { opacity: 1; transform: none; }
.post-toc { font-size: 14px; line-height: 1.4; }
.post-toc p { font-weight: 600; color: var(--heading); }
.post-toc ul { list-style: none; margin: 12px 0 0; padding: 0; }
.post-toc li + li { margin-top: 10px; }
.post-toc a { color: var(--muted); text-decoration: none; }
.post-toc a:hover { color: var(--accent); }
.post-body { min-width: 0; }
.post-body > :first-child { margin-top: 0; }
.post-body p, .post-body li { color: var(--body); font-size: 18px; line-height: 1.68; overflow-wrap: anywhere; }
.post-body > p:first-of-type:not(.post-checked), .post-checked + p { font-size: 22px; line-height: 1.5; letter-spacing: -.012em; color: var(--text); }
.post-body > p, .post-body > ul, .post-body > ol, .post-body > blockquote, .post-body > pre, .post-body > .table-scroll { margin-top: 22px; }
.post-checked { padding: 14px 18px; border-radius: 12px; background: var(--surface); }
.post-body .post-checked { font-size: 14.5px; line-height: 1.55; }
.post-checked + p { margin-top: 28px; }
.post-body h2 { margin: 64px 0 0; font-size: clamp(27px, 3.4vw, 34px); line-height: 1.14; letter-spacing: -.028em; font-weight: 700; scroll-margin-top: 24px; }
.post-body h3 { margin: 36px 0 0; font-size: 20px; line-height: 1.3; letter-spacing: -.015em; font-weight: 650; }
.post-body h2 + p, .post-body h3 + p, .post-body h2 + ul { margin-top: 12px; }
.post-body ul, .post-body ol { padding-left: 1.25em; }
.post-body li + li { margin-top: 8px; }
.post-body li::marker { color: var(--ring); }
.post-body a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body strong { color: var(--heading); font-weight: 600; }
.post-body code { font: .85em "Geist Mono", ui-monospace, monospace; background: var(--surface); padding: .14em .36em; border-radius: 5px; font-variant-ligatures: none; }
.post-body > pre { padding: 18px 20px; border-radius: 14px; background: var(--surface); overflow-x: auto; }
.post-body > pre code { display: block; padding: 0; background: none; font-size: 14px; line-height: 1.65; white-space: pre; color: var(--text); }
.post-body > blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--ring); }

.table-scroll { overflow-x: auto; }
.post-body > .table-scroll { margin-top: 26px; }
.post-body > .table-scroll table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.post-body > .table-scroll th, .post-body > .table-scroll td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--body); }
.post-body > .table-scroll thead th { color: var(--heading); font-weight: 650; border-bottom: 2px solid var(--heading); }
.post-body > .table-scroll td:first-child { color: var(--heading); font-weight: 550; }

/* Demos are windows of the app, as on the home page. */
.post-demo { margin: 40px 0 0; }
.post-demo figcaption { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.post-demo .win { font-size: 15px; }
.post-demo .calc-demo { height: 560px; }
.post-demo[data-tile] .tile .win { height: 170px; }
.post-demo .page p, .post-demo .page li { font-size: inherit; line-height: inherit; color: inherit; }
.post-demo .sheet p { font-size: 9.5px; line-height: 1.55; color: inherit; }

.post-cta { position: relative; overflow: hidden; margin-top: clamp(64px, 8vw, 104px); padding: clamp(32px, 6vw, 72px); background: var(--heading); border-radius: 28px; color: #fff; }
.post-cta > div { position: relative; max-width: 620px; }
.post-cta h2 { color: #fff; font-size: clamp(32px, 5vw, 54px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; }
.post-cta p { margin-top: 16px; font-size: 18px; line-height: 1.5; color: #c9cacd; }
.post-cta .btn { margin-top: 26px; background: #fff; color: var(--heading); text-decoration: none; }
.post-cta .btn:hover { opacity: .9; }
.post-cta .post-cta-more { margin-top: 14px; font-size: 16px; }
.post-cta-more a { display: inline-block; padding-block: 8px; color: #fff; }
.post-cta :focus-visible { outline-color: #fff; }
.ring-cta { position: absolute; right: -70px; bottom: -90px; width: clamp(220px, 34vw, 420px); color: #c98a4e; }

.post-related { margin-top: clamp(56px, 7vw, 88px); }
.post-related h2 { font-size: 26px; letter-spacing: -.025em; font-weight: 700; }
.post-related ul { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px; }
.post-related a { display: block; text-decoration: none; color: var(--heading); }
.post-related .ring-small { width: 60px; margin-left: -6px; }
.post-related span { display: block; margin-top: 8px; font-size: 18px; line-height: 1.28; letter-spacing: -.012em; font-weight: 600; }
.post-related a:hover span { color: var(--accent); }

@media (max-width: 1020px) {
  .post-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
  .post-side { display: contents; }
  .post-toc { display: none; }
  .reading .ring-progress { position: fixed; right: 14px; bottom: 14px; z-index: 5; width: 46px; margin: 0; padding: 3px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 8px rgba(17, 18, 20, .12); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
  .reading .ring-progress.is-reading { opacity: 1; }
  .post-head h1 { max-width: none; }
  .ring-hero { display: none; }
}
@media (max-width: 720px) {
  .blog-lead { grid-template-columns: 1fr; }
  .blog-lead .ring-lead { max-width: 150px; }
  .post-body p, .post-body li { font-size: 17px; }
  .post-body > p:first-of-type:not(.post-checked), .post-checked + p { font-size: 20px; }
  .post-demo .calc-demo { height: 440px; }
  .ring-cta { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-lead .ring-lead, .blog-grid .ring-small { transition: none; }
}
