/* ==========================================================================
   Blog (/blog, /blog/{slug})
   The public site's palette, made for reading: one accent, quiet surfaces,
   long-form type at 18px on a ~68-character line. Motion is limited to
   press feedback, the mobile menu and a few hover hints; the reading
   progress bar is driven by the scroll itself.
   ========================================================================== */

:root {
    --bg: #0D0F1A;
    --surface: #131726;
    --surface-2: #1A1F31;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #F1F2F6;
    --text-body: #CDD3E2;        /* long-form copy: softer than white, ~12:1 on --bg */
    --text-soft: #B1B9CF;        /* excerpts and subtitles */
    --text-muted: #939CB8;       /* meta: dates, labels (~7:1) */

    --accent: #00FF85;
    --accent-2: #00C9A7;
    --accent-ink: #06281A;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

    --page: 1160px;
    --nav-height: 68px;

    /* A topic's colour (the .topic-* classes below); the accent by default */
    --tint: #00FF85;
    --tint-soft: rgba(0, 255, 133, 0.22);
    --tint-faint: rgba(0, 255, 133, 0.07);
}

/* Topic colours: the artwork, the topic label */
.topic-payments  { --tint: #00FF85; --tint-soft: rgba(0, 255, 133, 0.22);  --tint-faint: rgba(0, 255, 133, 0.07); }
.topic-security  { --tint: #6CA5FF; --tint-soft: rgba(108, 165, 255, 0.24); --tint-faint: rgba(108, 165, 255, 0.08); }
.topic-p2p       { --tint: #2DD4BF; --tint-soft: rgba(45, 212, 191, 0.22);  --tint-faint: rgba(45, 212, 191, 0.07); }
.topic-referrals { --tint: #C084FC; --tint-soft: rgba(192, 132, 252, 0.24); --tint-faint: rgba(192, 132, 252, 0.08); }
.topic-news      { --tint: #FFB547; --tint-soft: rgba(255, 181, 71, 0.22);  --tint-faint: rgba(255, 181, 71, 0.07); }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Headings reached from "On this page" land clear of the fixed nav */
    scroll-padding-top: calc(var(--nav-height) + 2rem);
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(60rem 28rem at 8% -6rem, rgba(0, 255, 133, 0.07), transparent 70%),
        radial-gradient(48rem 26rem at 100% -4rem, rgba(58, 134, 255, 0.07), transparent 70%),
        var(--bg);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 300;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

/* ------------------------------------------------------------------ nav */

.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    background: rgba(13, 15, 26, 0.72);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background-color 200ms ease;
}

.site-nav.scrolled {
    background: rgba(13, 15, 26, 0.92);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: var(--page);
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #00FF99;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.brand img {
    height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 1.75rem;
    margin-left: auto;
    list-style: none;
}

.nav-links a {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0;
    color: #D9DCE6;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 200ms ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 250ms var(--ease-out);
}

.nav-links a.is-active {
    color: var(--text);
}

.nav-links a.is-active::after {
    transform: scaleX(1);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 1.25rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #3A86FF, #9D4EDD);
    box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}

.nav-cta:active {
    transform: scale(0.97);
}

.nav-toggle {
    display: none;
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--text);
    cursor: pointer;
}

.nav-toggle span {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 200ms var(--ease-out);
}

.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }

.site-nav.open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.site-nav.open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Reading progress: a 2px bar over the nav, moved by the scroll position
   where the browser can (nothing is shown elsewhere) */
.read-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 110;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: 0 50%;
}

@supports (animation-timeline: scroll()) {
    .read-progress {
        animation: read-progress linear both;
        animation-timeline: scroll(root);
    }
}

@keyframes read-progress {
    to { transform: scaleX(1); }
}

/* ------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-sm {
    min-height: 40px;
    padding: 0 0.95rem;
    font-size: 0.875rem;
}

.btn[hidden] {
    display: none;
}

/* ----------------------------------------------------------- index */

.blog-main {
    max-width: var(--page);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 4rem) 2rem 6rem;
}

.blog-hero {
    max-width: 46rem;
    margin-bottom: 2.5rem;
}

.eyebrow {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-hero h1 {
    font-size: clamp(2.25rem, 1.5rem + 2.8vw, 3.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.blog-hero-sub {
    max-width: 38rem;
    margin-top: 1.1rem;
    color: var(--text-soft);
    font-size: 1.15rem;
    text-wrap: pretty;
}

.blog-hero .btn {
    margin-top: 2rem;
}

.topics {
    display: flex;
    gap: 0.5rem;
    margin: 0 -2rem 3.5rem;
    padding: 0 2rem 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.topics::-webkit-scrollbar {
    display: none;
}

.topic-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.topic-chip:active {
    transform: scale(0.97);
}

.topic-chip[aria-current="page"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

/* ---- artwork ---- */

.cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        radial-gradient(90% 120% at 100% 100%, var(--tint-soft), transparent 62%),
        radial-gradient(70% 90% at 0% 0%, var(--tint-faint), transparent 70%),
        var(--surface);
    container-type: inline-size;
    transition: border-color 200ms ease, transform 160ms var(--ease-out);
}

/* The site's grid, fading out from the glow */
.cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at 85% 100%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 90% at 85% 100%, #000 10%, transparent 75%);
}

.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The topic's icon again, large and faint, running off the corner */
.cover-echo {
    position: absolute;
    right: -6%;
    bottom: -24%;
    color: var(--tint);
    font-size: 160px;
    font-size: 54cqi;
    line-height: 1;
    opacity: 0.07;
    transform: rotate(-12deg);
}

.cover-mark {
    position: absolute;
    left: 8%;
    bottom: 12%;
    display: grid;
    place-items: center;
    width: 64px;
    width: clamp(48px, 20cqi, 104px);
    aspect-ratio: 1;
    border: 1px solid var(--tint-soft);
    border-radius: 24%;
    background: var(--tint-faint);
    box-shadow: 0 0 48px var(--tint-faint);
    color: var(--tint);
    font-size: 26px;
    font-size: clamp(20px, 8cqi, 42px);
    transition: transform 250ms var(--ease-out);
}

/* ---- feature (newest post) ---- */

.feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border);
}

.feature-title {
    margin: 0.7rem 0 1rem;
    font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.35rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.feature-excerpt {
    margin-bottom: 1.25rem;
    color: var(--text-soft);
    font-size: 1.075rem;
    text-wrap: pretty;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
    color: var(--accent);
    font-weight: 600;
}

.read-more i {
    font-size: 0.85em;
    transition: transform 200ms var(--ease-out);
}

/* ---- cards ---- */

.posts-heading {
    margin-bottom: 1.75rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3.25rem 2rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.card .cover {
    aspect-ratio: 16 / 9;
}

.card-topic {
    color: var(--tint);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-title {
    margin: 0.5rem 0 0.55rem;
    font-size: 1.2rem;
    line-height: 1.3;
    letter-spacing: -0.012em;
    text-wrap: balance;
}

/* The title's link covers its card (and the feature) */
.card-title a,
.feature-title a {
    color: inherit;
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.card-title a::after,
.feature-title a::after {
    content: '';
    position: absolute;
    inset: -0.5rem;
    z-index: 1;
    border-radius: 20px;
}

.card-title a:focus-visible,
.feature-title a:focus-visible {
    outline: none;
}

.card-title a:focus-visible::after,
.feature-title a:focus-visible::after {
    outline: 2px solid var(--accent);
}

.card-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    margin-bottom: 0.8rem;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* A press on a card answers on its artwork */
.card:active .cover,
.feature:active .cover {
    transform: scale(0.985);
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4.5rem;
}

.empty {
    color: var(--text-soft);
}

.empty a {
    color: var(--accent);
}

/* ---------------------------------------------------------- article */

.article {
    --article-width: 44rem;
    max-width: calc(var(--article-width) + 4rem);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 2.5rem) 2rem 6rem;
}

.article-head {
    margin-bottom: 2.75rem;
}

/* An admin's preview of a post that may not be public yet */
.preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(255, 181, 71, 0.35);
    border-radius: 12px;
    background: rgba(255, 181, 71, 0.08);
    color: #FFD08A;
    font-size: 0.925rem;
}

.preview-banner a {
    margin-left: auto;
    color: #FFB547;
    font-weight: 600;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 200ms ease;
}

.back-link i {
    font-size: 0.85em;
    transition: transform 200ms var(--ease-out);
}

.article-head .card-topic {
    display: block;
    width: fit-content;
    margin-bottom: 1rem;
    text-decoration: none;
}

.article-title {
    max-width: 52rem;
    font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.article-dek {
    max-width: 40rem;
    margin-top: 1.25rem;
    color: var(--text-soft);
    font-size: 1.2rem;
    line-height: 1.55;
    text-wrap: pretty;
}

.byline {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 2rem;
}

.byline-avatar {
    flex-shrink: 0;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
}

.byline-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.byline-name {
    font-weight: 600;
}

.article-cover {
    margin-bottom: 3.5rem;
}

.article-cover .cover {
    aspect-ratio: 21 / 9;
    border-radius: 20px;
}

.toc {
    display: none;
}

/* ---- the post's body ---- */

.prose {
    color: var(--text-body);
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.prose > :first-child {
    margin-top: 0;
}

.prose > p:first-child {
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.65;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
    margin: 0 0 1.35em;
}

.prose h2,
.prose h3,
.prose h4 {
    color: var(--text);
    font-weight: 700;
    text-wrap: balance;
}

.prose h2 {
    margin: 2.3em 0 0.7em;
    font-size: 1.6rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.prose h3 {
    margin: 1.9em 0 0.55em;
    font-size: 1.25rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.prose h4 {
    margin: 1.6em 0 0.5em;
    font-size: 1.05rem;
}

.prose strong {
    color: var(--text);
    font-weight: 600;
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(0, 255, 133, 0.45);
    text-underline-offset: 3px;
    transition: text-decoration-color 150ms ease;
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
}

.prose li {
    margin: 0.5em 0;
    padding-left: 0.3em;
}

.prose li::marker {
    color: var(--accent);
}

.prose ol > li::marker {
    color: var(--accent-2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.prose li > ul,
.prose li > ol {
    margin: 0.5em 0 0;
}

/* "> **Tip:** ..." reads as a callout */
.prose blockquote {
    padding: 1.1rem 1.35rem;
    border: 1px solid rgba(0, 255, 133, 0.18);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    background: rgba(0, 255, 133, 0.05);
    color: var(--text);
}

.prose blockquote > :last-child {
    margin-bottom: 0;
}

.prose blockquote strong:first-child {
    color: var(--accent);
}

.prose code {
    padding: 0.12em 0.4em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
}

.prose pre {
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font-size: 0.9rem;
    line-height: 1.6;
}

.prose pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
}

.prose hr {
    margin: 2.75em 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.75em 0;
    border-radius: 12px;
}

/* An image's caption: the italic line right under it */
.prose p:has(> img:only-child) + p:has(> em:only-child) {
    margin-top: -0.75em;
    color: var(--text-muted);
    font-size: 0.925rem;
    text-align: center;
}

.prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.prose th {
    color: var(--text);
    font-weight: 600;
}

.prose del {
    opacity: 0.7;
}

.prose input[type="checkbox"] {
    margin-right: 0.5em;
    accent-color: var(--accent);
}

/* ---- after the body ---- */

.article-foot {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.share-label {
    margin-bottom: 0.9rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cta-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    margin-top: 3rem;
    padding: 1.75rem;
    border: 1px solid rgba(0, 255, 133, 0.2);
    border-radius: 20px;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(0, 255, 133, 0.1), transparent 60%),
        var(--surface);
}

.cta-title {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.cta-text {
    margin-top: 0.3rem;
    color: var(--text-soft);
}

.related {
    margin-top: 5.5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

/* -------------------------------------------------------------- footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2.5rem;
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #00FF99;
    font-weight: 700;
    text-decoration: none;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-soft);
    font-size: 0.925rem;
    text-decoration: none;
    transition: color 200ms ease;
}

.footer-note {
    flex-basis: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* -------------------------------------------------------------- hover */

/* Only where there is a real pointer; on touch, hover sticks after a tap */
@media (hover: hover) and (pointer: fine) {
    .nav-links a:hover {
        color: var(--accent);
    }

    .nav-links a:hover::after {
        transform: scaleX(1);
    }

    .nav-cta:hover {
        box-shadow: 0 8px 25px rgba(58, 134, 255, 0.4);
    }

    .btn-primary:hover {
        box-shadow: 0 8px 28px rgba(0, 255, 133, 0.28);
    }

    .btn-ghost:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.26);
    }

    .topic-chip:not([aria-current="page"]):hover {
        border-color: rgba(255, 255, 255, 0.3);
        color: var(--text);
    }

    .card:hover .cover,
    .feature:hover .cover {
        border-color: var(--border-strong);
    }

    .card:hover .cover-mark,
    .feature:hover .cover-mark {
        transform: translateY(-3px);
    }

    .card:hover .card-title a,
    .feature:hover .feature-title a {
        text-decoration-line: underline;
        text-decoration-color: rgba(255, 255, 255, 0.35);
    }

    .feature:hover .read-more i {
        transform: translateX(3px);
    }

    .back-link:hover {
        color: var(--text);
    }

    .back-link:hover i {
        transform: translateX(-3px);
    }

    .prose a:hover {
        text-decoration-color: currentColor;
    }

    .toc a:hover {
        color: var(--text);
    }

    .footer-links a:hover {
        color: var(--accent);
    }
}

/* ---------------------------------------------------------- wide: contents */

@media (min-width: 1080px) {
    .article.has-toc {
        --article-width: 62rem;
    }

    .article.has-toc .article-layout {
        display: grid;
        grid-template-columns: 14rem minmax(0, 44rem);
        justify-content: space-between;
        gap: 4rem;
    }

    .toc {
        display: block;
        position: sticky;
        top: calc(var(--nav-height) + 2rem);
        align-self: start;
        font-size: 0.875rem;
    }

    .toc-title {
        margin-bottom: 0.85rem;
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .toc ol {
        border-left: 1px solid var(--border);
        list-style: none;
    }

    .toc a {
        display: block;
        margin-left: -1px;
        padding: 0.4rem 0 0.4rem 1rem;
        border-left: 1px solid transparent;
        color: var(--text-muted);
        line-height: 1.4;
        text-decoration: none;
        transition: color 150ms ease, border-color 150ms ease;
    }

    .toc a[aria-current="location"] {
        border-left-color: var(--accent);
        color: var(--text);
    }
}

/* ------------------------------------------------------------- tablet */

@media (max-width: 1000px) {
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------- phone */

@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .nav-inner {
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .brand {
        margin-right: auto;
        font-size: 1.1rem;
    }

    .brand img {
        height: 32px;
    }

    .nav-cta {
        padding: 0 1rem;
        font-size: 0.85rem;
    }

    .nav-toggle {
        display: block;
    }

    /* The links become a panel that drops from the bar; closing is quicker than opening */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0.5rem 1rem 1rem;
        border-bottom: 1px solid var(--border);
        background: var(--bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 150ms ease, transform 150ms var(--ease-out), visibility 0s linear 150ms;
    }

    .site-nav.open .nav-links {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s;
    }

    .nav-links a {
        display: block;
        padding: 0.85rem 0.5rem;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a.is-active {
        color: var(--accent);
    }

    .blog-main {
        padding: calc(var(--nav-height) + 2.5rem) 1.25rem 4.5rem;
    }

    .topics {
        margin: 0 -1.25rem 2.5rem;
        padding: 0 1.25rem 2px;
    }

    .feature {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
        margin-bottom: 3rem;
        padding-bottom: 3rem;
    }

    .read-more {
        margin-top: 1.25rem;
    }

    .post-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.75rem;
    }

    .article {
        padding: calc(var(--nav-height) + 1.25rem) 1.25rem 4.5rem;
    }

    .article-dek {
        font-size: 1.1rem;
    }

    .article-cover {
        margin: 0 -1.25rem 2.5rem;
    }

    .article-cover .cover {
        aspect-ratio: 16 / 9;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .prose {
        font-size: 1.0625rem;
    }

    .prose > p:first-child {
        font-size: 1.15rem;
    }

    .prose h2 {
        font-size: 1.4rem;
    }

    .cta-card {
        padding: 1.5rem;
    }

    .cta-card .btn {
        width: 100%;
    }

    .footer-inner {
        padding: 0 1.25rem;
    }
}

/* Very narrow phones: the mark alone carries the brand */
@media (max-width: 359px) {
    .brand span {
        display: none;
    }
}

/* ------------------------------------------------------- reduced motion */

/* Keep the fades and colour changes, drop everything that travels */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .nav-links,
    .site-nav.open .nav-links {
        transform: none;
        transition-property: opacity, visibility;
    }

    .btn:active,
    .nav-cta:active,
    .topic-chip:active,
    .card:active .cover,
    .feature:active .cover,
    .card:hover .cover-mark,
    .feature:hover .cover-mark,
    .feature:hover .read-more i,
    .back-link:hover i {
        transform: none;
    }
}
