/* blog-polish.css — the shared editorial layer linked into every blog post,
   riding over each post's own inline theme. Additive and defensive: nothing
   here assumes markup beyond the shared post anatomy (.blog-container,
   .blog-header, .blog-hero-image, callouts, .faq-section, .related-posts).
   Layout-changing rules only engage when js/blog-enhance.js has stamped the
   page (html.blog-enhanced / .blog-layout), so no-JS renders stay intact. */

/* ---- reading rhythm ---- */
.blog-container {
    text-rendering: optimizeLegibility;
    font-variant-ligatures: common-ligatures;
}
.blog-container p,
.blog-container li {
    letter-spacing: 0.001em;
}
.blog-container h2 {
    letter-spacing: -0.015em;
    text-wrap: balance;
    scroll-margin-top: 90px;
}
.blog-container h3 {
    letter-spacing: -0.008em;
    scroll-margin-top: 90px;
}
.blog-container ::selection {
    background: rgba(91, 110, 174, 0.16);
}

/* ---- links inside the article: quiet underline, clear hover ---- */
.blog-container article a:not(.btn):not([class*="button"]):not([class*="card"]),
article.blog-container a:not(.btn):not([class*="button"]):not([class*="card"]):not(.related-post-card):not(.article-card) {
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(91, 110, 174, 0.45);
    transition: text-decoration-color 120ms ease;
}
article.blog-container a:hover {
    text-decoration-color: currentColor;
}

/* ---- hero + inline images ---- */
.blog-hero-image img,
article.blog-container img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}
.blog-hero-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(26, 26, 26, 0.10);
}
.blog-hero-image img { border-radius: 0; }
article.blog-container figcaption {
    font-size: 0.8rem;
    color: var(--ink-muted, #6b6b6b);
    text-align: center;
    margin-top: 0.6rem;
}

/* hero parallax: JS moves the img; container clips. GPU-hinted, no layout. */
html.blog-enhanced .blog-hero-image { position: relative; }
html.blog-enhanced .blog-hero-image img {
    will-change: transform;
    transform: translateY(var(--hero-shift, 0px)) scale(1.06);
    transition: none;
}

/* ---- the lede: drop cap + slightly generous opening measure ---- */
article.blog-container p.blog-lede {
    font-size: 1.08em;
    line-height: 1.75;
}
article.blog-container p.blog-lede::first-letter {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 3.35em;
    float: left;
    line-height: 0.82;
    padding: 0.06em 0.12em 0 0;
    color: var(--riq, #5b6eae);
}

/* ---- numbered sections: JS stamps data-secnum on body h2s ---- */
article.blog-container h2[data-secnum] {
    position: relative;
    padding-top: 0.4rem;
}
article.blog-container h2[data-secnum]::before {
    content: attr(data-secnum);
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--ink-subtle, #999);
    margin-bottom: 0.45rem;
}
article.blog-container h2[data-secnum]::after {
    content: "";
    display: block;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--riq, #5b6eae), transparent);
    margin-top: 0.55rem;
    opacity: 0.55;
}

/* ---- heading anchors (JS adds .h-anchor links) ---- */
.h-anchor {
    margin-left: 0.4em;
    font-size: 0.72em;
    text-decoration: none !important;
    color: var(--ink-subtle, #999);
    opacity: 0;
    transition: opacity 120ms ease;
    vertical-align: baseline;
}
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; }

/* ---- icon lists: some posts use the markup without shipping the CSS ---- */
article.blog-container ul.icon-list {
    list-style: none;
    padding: 0;
}
article.blog-container ul.icon-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
article.blog-container ul.icon-list li > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
}
/* zero-specificity backstop: an inline SVG with no width attribute and no
   sizing rule of its own must never render at its natural viewBox size */
:where(article.blog-container) :where(svg:not([width]):not([height])) {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- tables: many older posts ship bare tables ---- */
article.blog-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin: 1.4rem 0;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 10px;
    overflow: hidden;
}
article.blog-container th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted, #6b6b6b);
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--rule, #d4d0c8);
    background: var(--ivory, #f5f2ed);
}
article.blog-container td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(212, 208, 200, 0.55);
    vertical-align: top;
}
article.blog-container tr:last-child td { border-bottom: none; }
article.blog-container table { display: table; }
@media (max-width: 640px) {
    article.blog-container table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ---- quotes, code, rules ---- */
article.blog-container blockquote {
    margin: 2.2rem 0;
    padding: 0.2rem 0 0.2rem 1.6rem;
    border-left: 3px solid var(--riq, #5b6eae);
    color: var(--ink-light, #3d3d3d);
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-size: 1.18em;
    line-height: 1.55;
}
article.blog-container code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85em;
    background: var(--ivory, #f5f2ed);
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 5px;
    padding: 0.08em 0.4em;
}
article.blog-container hr {
    border: none;
    border-top: 1px solid var(--rule, #d4d0c8);
    margin: 2.4rem auto;
    max-width: 240px;
}

/* ---- cards & callouts: consistent softness ---- */
article.blog-container .card,
article.blog-container [class*="callout"] {
    border-radius: 12px;
}
article.blog-container .card h3 { text-wrap: balance; }

/* ---- FAQ + related posts breathing room ---- */
.faq-section h3 { margin-top: 1.6rem; }
.related-posts { margin-top: 3rem; }

/* =====================================================================
   ENHANCED LAYOUT — everything below only engages once blog-enhance.js
   has run (html.blog-enhanced) so pages degrade perfectly without JS.
   ===================================================================== */

/* ---- reading progress bar ---- */
.blog-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    z-index: 240;
    background: transparent;
    pointer-events: none;
}
.blog-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-a, #5b6eae), var(--accent-b, #4a9080));
    transition: width 80ms linear;
}

/* ---- two-column editorial layout: rail + article ---- */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
}
.blog-rail { display: none; }
@media (min-width: 1200px) {
    .blog-layout {
        grid-template-columns: 232px minmax(0, 900px);
        gap: 56px;
        justify-content: center;
        padding-left: 24px;
        padding-right: 24px;
    }
    .blog-rail {
        display: block;
        padding-top: 4.4rem;
    }
    .blog-rail-inner {
        position: sticky;
        top: 72px;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding-bottom: 1rem;
    }
}

.blog-rail-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-subtle, #999);
    margin-bottom: 0.9rem;
}
.blog-rail-meta {
    font-size: 0.78rem;
    color: var(--ink-muted, #6b6b6b);
    margin-bottom: 1.2rem;
    line-height: 1.5;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule, #d4d0c8);
}

/* TOC */
.blog-toc { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.blog-toc li { margin: 0; }
.blog-toc a {
    display: block;
    padding: 0.34rem 0 0.34rem 0.85rem;
    border-left: 2px solid var(--rule, #d4d0c8);
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--ink-muted, #6b6b6b);
    text-decoration: none;
    transition: color 130ms ease, border-color 130ms ease, background 130ms ease;
}
.blog-toc a:hover { color: var(--ink, #1a1a1a); }
.blog-toc a.active {
    color: var(--ink, #1a1a1a);
    border-left-color: var(--accent-a, #5b6eae);
    background: linear-gradient(90deg, rgba(91,110,174,0.07), transparent 70%);
    font-weight: 600;
}

/* rail product card — quiet, editorial, topic-matched */
.rail-product {
    display: block;
    text-decoration: none;
    border: 1px solid var(--rule, #d4d0c8);
    border-top: 3px solid var(--accent-a, #5b6eae);
    border-radius: 10px;
    background: #fff;
    padding: 0.95rem 1rem 1rem;
    margin-bottom: 1rem;
    transition: transform 140ms ease, box-shadow 140ms ease;
}
.rail-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26,26,26,0.09);
}
.rail-product .rp-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink, #1a1a1a);
    margin-bottom: 0.25rem;
}
.rail-product .rp-line {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink-muted, #6b6b6b);
    margin-bottom: 0.5rem;
}
.rail-product .rp-go {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent-a, #5b6eae);
}
.blog-rail .rail-back {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--ink-muted, #6b6b6b);
    text-decoration: none;
}
.blog-rail .rail-back:hover { color: var(--ink, #1a1a1a); }

/* inline (mobile/tablet) TOC */
details.blog-toc-inline {
    margin: 0 0 2rem;
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 10px;
    background: var(--ivory, #f5f2ed);
    padding: 0.8rem 1.1rem;
}
details.blog-toc-inline summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--ink-light, #3d3d3d);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
details.blog-toc-inline summary::-webkit-details-marker { display: none; }
details.blog-toc-inline summary::after {
    content: "";
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--ink-muted, #6b6b6b);
    border-bottom: 1.5px solid var(--ink-muted, #6b6b6b);
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 150ms ease;
}
details.blog-toc-inline[open] summary::after { transform: rotate(-135deg); }
details.blog-toc-inline .blog-toc { margin: 0.75rem 0 0.25rem; }
@media (min-width: 1200px) {
    html.blog-enhanced details.blog-toc-inline { display: none; }
}

/* mid-article product aside — reads as an editorial note, not a banner */
.blog-note-product {
    margin: 2.6rem 0;
    padding: 1.15rem 1.35rem;
    border: 1px solid var(--rule, #d4d0c8);
    border-left: 3px solid var(--accent-a, #5b6eae);
    border-radius: 10px;
    background: linear-gradient(135deg, #fff, var(--ivory, #f5f2ed));
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ink-light, #3d3d3d);
}
.blog-note-product .np-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-a, #5b6eae);
    display: block;
    margin-bottom: 0.35rem;
}
.blog-note-product a {
    color: var(--accent-a, #5b6eae);
    font-weight: 600;
}

/* ---- product screenshot figures (Ahrefs-style teachable steps) ---- */
figure.blog-shot {
    margin: 2.2rem 0;
}
figure.blog-shot .shot-frame {
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 14px 38px rgba(26, 26, 26, 0.12);
}
figure.blog-shot .shot-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: var(--ivory, #f5f2ed);
    border-bottom: 1px solid var(--rule, #d4d0c8);
}
figure.blog-shot .shot-bar i {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--rule, #d4d0c8);
    display: inline-block;
}
figure.blog-shot .shot-bar span {
    margin-left: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--ink-subtle, #999);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
figure.blog-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0 !important;
}
figure.blog-shot figcaption {
    text-align: left !important;
    font-size: 0.84rem !important;
    line-height: 1.55;
    color: var(--ink-muted, #6b6b6b);
    margin-top: 0.7rem !important;
    padding-left: 2px;
}
figure.blog-shot figcaption strong {
    color: var(--ink-light, #3d3d3d);
}

/* stat callout strip (proof numbers) */
.blog-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--rule, #d4d0c8);
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 12px;
    overflow: hidden;
    margin: 2.2rem 0;
}
.blog-stats > div {
    background: #fff;
    padding: 1.1rem 1.2rem;
}
.blog-stats .stat-n {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: var(--accent-a, #5b6eae);
    line-height: 1.1;
}
.blog-stats .stat-l {
    font-size: 0.76rem;
    color: var(--ink-muted, #6b6b6b);
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* ---- scroll reveal ---- */
@media (prefers-reduced-motion: no-preference) {
    html.blog-enhanced .blog-reveal {
        opacity: 0;
        transform: translateY(14px);
        transition: opacity 500ms ease, transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
    }
    html.blog-enhanced .blog-reveal.in-view {
        opacity: 1;
        transform: none;
    }
}

/* ---- back to top ---- */
.blog-top-btn {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--rule, #d4d0c8);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    color: var(--ink-muted, #6b6b6b);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(26,26,26,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 230;
}
.blog-top-btn.show { opacity: 1; pointer-events: auto; transform: none; }
.blog-top-btn:hover { color: var(--ink, #1a1a1a); }

/* =====================================================================
   v3 EDITORIAL — the visible redesign layer. Modern CSS throughout:
   scroll-driven animations, :has(), @property conic borders, container
   queries, background-clip numerals, fluid type. All gated behind
   html.blog-enhanced so no-JS render stays intact.
   ===================================================================== */

/* ---- magazine opening: kicker + oversized headline + standfirst ---- */
.blog-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-a, #5b6eae);
    margin-bottom: 1.1rem;
}
.blog-kicker::before, .blog-kicker::after {
    content: "";
    display: inline-block;
    width: 26px;
    height: 1px;
    background: var(--accent-a, #5b6eae);
    vertical-align: middle;
    margin: 0 0.7rem;
    opacity: 0.5;
}
html.blog-enhanced .blog-header h1 {
    font-size: clamp(2.3rem, 1.2rem + 3.4vw, 3.4rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.022em;
    text-wrap: balance;
}
html.blog-enhanced .blog-subtitle {
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.28rem) !important;
    line-height: 1.6 !important;
}
html.blog-enhanced .blog-hero-image img { height: 420px; }
@media (max-width: 640px) {
    html.blog-enhanced .blog-hero-image img { height: 230px; }
}

/* ---- banded sections: the page visibly shifts as you read ---- */
.blog-sec { position: relative; }
.blog-sec[data-num]::before {
    content: attr(data-num);
    position: absolute;
    top: -0.5rem;
    right: -0.4rem;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(4.5rem, 3rem + 4vw, 7rem);
    line-height: 1;
    background: linear-gradient(175deg, var(--accent-a, #5b6eae) 10%, transparent 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.13;
    pointer-events: none;
    z-index: 0;
}
.blog-sec > * { position: relative; z-index: 1; }
@media (min-width: 720px) {
    .blog-sec-alt {
        background: linear-gradient(180deg, var(--ivory, #f5f2ed), rgba(245, 242, 237, 0.35));
        border-radius: 22px;
        padding: 1.8rem 2.2rem 1.4rem;
        margin: 2.6rem -2.2rem;
    }
}
@media (max-width: 719.9px) {
    .blog-sec-alt {
        background: var(--ivory, #f5f2ed);
        border-radius: 16px;
        padding: 1.2rem 1.1rem 0.9rem;
        margin: 2rem -1.1rem;
    }
}
html.blog-enhanced article.blog-container h2 {
    font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.9rem);
}

/* ---- pull quotes: plucked out, centred, oversized ---- */
article.blog-container blockquote.blog-pq {
    border-left: none;
    border-top: 1px solid var(--rule, #d4d0c8);
    border-bottom: 1px solid var(--rule, #d4d0c8);
    margin: 2.8rem auto;
    padding: 2.4rem 1rem 2rem;
    max-width: 36ch;
    text-align: center;
    font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
    line-height: 1.45;
    position: relative;
}
article.blog-container blockquote.blog-pq::before {
    content: "\201C";
    position: absolute;
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fraunces', Georgia, serif;
    font-style: normal;
    font-size: 3.2rem;
    line-height: 1;
    color: var(--accent-a, #5b6eae);
    opacity: 0.45;
}

/* ---- the quick answer becomes a proper TL;DR panel (GEO block) ---- */
html.blog-enhanced #quick-answer {
    border: 1px solid var(--rule, #d4d0c8) !important;
    border-top: 4px solid var(--accent-a, #5b6eae) !important;
    background: linear-gradient(180deg, #fff, var(--ivory, #f5f2ed)) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 34px rgba(26, 26, 26, 0.07);
}
html.blog-enhanced #quick-answer > h3 {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent-a, #5b6eae) !important;
}

/* ---- key takeaways inside the TL;DR panel ---- */
#quick-answer ul.qa-takeaways {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--rule, #d4d0c8);
}
#quick-answer ul.qa-takeaways li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    color: var(--ink-light, #3d3d3d);
}
#quick-answer ul.qa-takeaways li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--accent-a, #5b6eae), var(--accent-b, #4a9080));
}

/* ---- tables: accent-banded data panels ---- */
html.blog-enhanced article.blog-container th {
    border-bottom: 2px solid var(--accent-a, #5b6eae);
}
html.blog-enhanced article.blog-container tr:hover td {
    background: rgba(245, 242, 237, 0.6);
}

/* ---- CTA panels: deep gradient, unmissable ---- */
html.blog-enhanced article.blog-container .cta-section {
    background: linear-gradient(130deg, var(--accent-a, #5b6eae), var(--accent-b, #4a9080)) !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 44px rgba(26, 26, 26, 0.16);
}

/* ---- FAQ: carded ---- */
html.blog-enhanced .faq-section .faq-item {
    background: #fff;
    border: 1px solid var(--rule, #d4d0c8);
    border-radius: 12px;
    padding: 1.15rem 1.35rem;
    margin-bottom: 0.9rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
html.blog-enhanced .faq-section .faq-item:has(:hover) {
    border-color: var(--accent-a, #5b6eae);
    box-shadow: 0 8px 22px rgba(26, 26, 26, 0.06);
}
html.blog-enhanced .faq-section .faq-item h3 { margin-top: 0 !important; }

/* ---- figures breathe wider than the measure on big screens ---- */
@media (min-width: 1200px) {
    html.blog-enhanced figure.blog-shot { margin-left: -26px; margin-right: -26px; }
}

/* ---- rail product card: @property conic gradient border ---- */
@property --rp-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
html.blog-enhanced .rail-product {
    border-top: 1px solid var(--rule, #d4d0c8);
    position: relative;
}
html.blog-enhanced .rail-product::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 11px;
    padding: 2px;
    background: conic-gradient(from var(--rp-angle),
        var(--accent-a, #5b6eae), var(--accent-b, #4a9080),
        transparent 55%, var(--accent-a, #5b6eae));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
    html.blog-enhanced .rail-product::before { animation: rp-spin 7s linear infinite; }
}
@keyframes rp-spin { to { --rp-angle: 360deg; } }

/* ---- TOC marker via :has() ---- */
.blog-toc li:has(a.active) { position: relative; }

/* ---- rail is a container: card scales to its box ---- */
.blog-rail-inner { container-type: inline-size; }
@container (max-width: 220px) {
    .rail-product .rp-line { font-size: 0.74rem; }
}

/* ---- scroll-driven reveals: native CSS where supported ---- */
@supports (animation-timeline: view()) {
    html.blog-enhanced.blog-sda .blog-reveal {
        opacity: 1;
        transform: none;
        transition: none;
        animation: blog-rise both ease;
        animation-timeline: view();
        animation-range: entry 5% entry 38%;
    }
    @media (prefers-reduced-motion: reduce) {
        html.blog-enhanced.blog-sda .blog-reveal { animation: none; }
    }
}
@keyframes blog-rise {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}

/* ---- scroll-linked motion: elements drift as you read ---- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        /* screenshots gently counter-scroll inside their frames */
        html.blog-enhanced figure.blog-shot .shot-frame { overflow: hidden; }
        html.blog-enhanced figure.blog-shot .shot-frame img {
            animation: shot-drift both linear;
            animation-timeline: view();
            animation-range: cover 0% cover 100%;
            will-change: transform;
        }
        /* ghost numerals float upward past their sections */
        html.blog-enhanced .blog-sec[data-num]::before {
            animation: num-drift both linear;
            animation-timeline: view();
            animation-range: cover 0% cover 100%;
        }
        /* pull quotes settle into place */
        html.blog-enhanced blockquote.blog-pq {
            animation: pq-settle both ease;
            animation-timeline: view();
            animation-range: entry 0% entry 60%;
        }
        /* hero zooms out slightly as it leaves */
        html.blog-enhanced .blog-hero-image img {
            animation: hero-ease both linear;
            animation-timeline: view();
            animation-range: exit 0% exit 100%;
        }
    }
}
@keyframes shot-drift {
    from { transform: translateY(-10px) scale(1.03); }
    to { transform: translateY(10px) scale(1.03); }
}
@keyframes num-drift {
    from { translate: 0 3rem; }
    to { translate: 0 -3.5rem; }
}
@keyframes pq-settle {
    from { opacity: 0; scale: 0.94; }
    to { opacity: 1; scale: 1; }
}
@keyframes hero-ease {
    from { scale: 1.06; }
    to { scale: 1.14; }
}

/* ---- typography niceties where the engine allows ---- */
@supports (text-wrap: pretty) {
    article.blog-container p { text-wrap: pretty; }
}

/* ---- mobile: humane heading sizes and padding ---- */
@media (max-width: 640px) {
    .blog-container { padding-left: 1.1rem; padding-right: 1.1rem; }
    .blog-header h1 { font-size: clamp(1.6rem, 7.2vw, 2.2rem) !important; line-height: 1.2; }
    .blog-container h2 { font-size: clamp(1.3rem, 5.6vw, 1.6rem); }
    article.blog-container p.blog-lede::first-letter { font-size: 2.9em; }
}

/* ---- print: the article only ---- */
@media print {
    nav, header nav, .related-posts, .faq-section ~ div[class*="cta"], footer,
    .blog-progress, .blog-rail, .blog-top-btn, details.blog-toc-inline,
    .blog-note-product { display: none !important; }
    .blog-container { padding-top: 0; }
    .blog-hero-image { box-shadow: none; }
    html.blog-enhanced .blog-reveal { opacity: 1 !important; transform: none !important; }
}
