/* Reconfigured — Ghost theme stylesheet
   An engineer's notebook: editorial serif body, monospace counter-voice. */

/* -----------------------------------------------------------------------
   1. Tokens
   ----------------------------------------------------------------------- */
:root {
    --bg:           #0c0c0a;
    --bg-inset:     #16140f;
    --fg:           #ece9df;
    --fg-soft:      #c9c5b8;
    --muted:        #8c8a82;
    --dim:          #5e5d57;
    --rule:         #2a2a26;
    --rule-strong:  #3d3d36;
    --inverse-bg:   #1a1a16;
    --inverse-fg:   #ece9df;
    --inverse-rule: #2a2a26;
    --accent:       #ece9df;
    --accent-dim:   #c9c5b8;

    --serif:  "Newsreader", "Source Serif Pro", Georgia, "Times New Roman", serif;
    --mono:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Ghost typography overrides — set in Admin → Design → Customize. */
    --gh-font-heading: var(--serif);
    --gh-font-body:    var(--serif);

    --measure:      640px;
    --measure-wide: 880px;
    --gutter:       clamp(1.25rem, 4vw, 3rem);
    --max:          1280px;

    --rule-w: 1px;
    --tr: 180ms cubic-bezier(.2,.6,.2,1);

    color-scheme: dark;
}

[data-accent="terminal"] {
    --accent:     #7dd49f;
    --accent-dim: #4ea872;
}
[data-accent="ember"] {
    --accent:     #e89178;
    --accent-dim: #b96852;
}

/* -----------------------------------------------------------------------
   2. Reset / base
   ----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--gh-font-body, var(--serif));
    font-size: 1.0625rem;
    line-height: 1.65;
    font-feature-settings: "kern", "liga", "onum";
    text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: var(--rule-strong);
    transition: color var(--tr), text-decoration-color var(--tr);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--fg); color: var(--bg);
    padding: .5rem .75rem; font-family: var(--mono); font-size: .75rem;
    z-index: 100;
}
.skip-link:focus { top: 0; }

/* -----------------------------------------------------------------------
   3. Layout
   ----------------------------------------------------------------------- */
.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.measure  { max-width: var(--measure);      margin-left: auto; margin-right: auto; }
.measure-wide { max-width: var(--measure-wide); margin-left: auto; margin-right: auto; }

.rule       { border: 0; border-top: var(--rule-w) solid var(--rule); margin: 2.5rem 0; }
.rule-strong{ border: 0; border-top: var(--rule-w) solid var(--rule-strong); margin: 2.5rem 0; }
.rule-tight { margin: 1.25rem 0; }

/* -----------------------------------------------------------------------
   4. Typography
   ----------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--gh-font-heading, var(--serif));
    font-weight: 500;
    letter-spacing: -0.012em;
    line-height: 1.1;
    margin: 0 0 0.5em;
    color: var(--fg);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 450; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 500; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5, h6 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1.1em; }

em, i, cite { font-style: italic; }
strong, b { font-weight: 600; }

blockquote {
    margin: 1.75rem 0;
    padding: .25rem 0 .25rem 1.25rem;
    border-left: 2px solid var(--fg);
    font-style: italic;
    color: var(--fg-soft);
}
blockquote p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: var(--rule-w) solid var(--rule); margin: 2.5rem 0; }

/* Mono tokens */
.mono, code, kbd, samp, pre {
    font-family: var(--mono);
    font-feature-settings: "calt" 0;
}

.cap {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
}
.cap-strong { color: var(--fg); }
.cap a { text-decoration: none; }
.cap a:hover { color: var(--accent); }

.muted { color: var(--muted); }
.dim   { color: var(--dim); }

.num {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-feature-settings: "tnum";
}

/* Inline code */
:not(pre) > code {
    font-size: 0.92em;
    padding: .1em .35em;
    background: var(--bg-inset);
    border: 1px solid var(--rule);
    border-radius: 3px;
}

/* Code blocks */
pre {
    background: var(--inverse-bg);
    color: var(--inverse-fg);
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.65;
    border-radius: 2px;
    position: relative;
}
pre code { background: transparent; border: 0; padding: 0; color: inherit; }

/* -----------------------------------------------------------------------
   5. Header / nav
   ----------------------------------------------------------------------- */
.site-header {
    border-bottom: var(--rule-w) solid var(--rule);
    background: var(--bg);
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: saturate(140%) blur(8px);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    height: 64px;
}

.wordmark {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-decoration: none;
    color: var(--fg);
    display: inline-flex;
    align-items: baseline;
    gap: 0.5ch;
    white-space: nowrap;
}
.wordmark .bracket { color: var(--accent); font-weight: 500; }
.wordmark .ver     { color: var(--muted); margin-left: 0.5ch; }

.nav {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.75rem);
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
.nav a {
    text-decoration: none;
    color: var(--muted);
    display: inline-flex; align-items: baseline; gap: 0.4ch;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: color var(--tr), border-color var(--tr);
}
.nav a:hover { color: var(--fg); }
.nav a.is-active { color: var(--fg); border-bottom-color: var(--fg); }
.nav a .n { color: var(--dim); font-size: 0.62rem; letter-spacing: 0.04em; }
.nav .cta {
    color: var(--bg);
    background: var(--fg);
    padding: 0.45rem 0.75rem;
    border-radius: 2px;
}
.nav .cta:hover { background: var(--accent); color: var(--bg); }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fg-soft);
    border: 1px solid var(--rule-strong);
    border-radius: 2px;
    background: transparent;
}
.nav-toggle:hover { color: var(--fg); border-color: var(--fg); }
.nav-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 14px;
    height: 10px;
}
.nav-toggle-bars span {
    display: block;
    height: 1px;
    background: currentColor;
    transition: transform var(--tr), opacity var(--tr);
    transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 720px) {
    .site-header-inner { height: 56px; }
    .wordmark .ver { display: none; }

    .nav-toggle { display: inline-flex; }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem var(--gutter) 1rem;
        background: var(--bg);
        border-bottom: var(--rule-w) solid var(--rule);
        font-size: 0.72rem;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        display: none;
    }
    .nav.is-open { display: flex; }
    .nav .n { display: none; }
    .nav a {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--rule);
        border-top: 0;
    }
    .nav a.is-active { border-bottom-color: var(--fg); }
    .nav .cta {
        margin-top: 0.75rem;
        text-align: center;
        padding: 0.7rem 0.75rem;
        border-bottom: 0;
    }
}

/* -----------------------------------------------------------------------
   6. Hero / cover (home)
   ----------------------------------------------------------------------- */
.cover {
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 5rem);
    border-bottom: var(--rule-w) solid var(--rule);
}
.cover-meta {
    display: flex; gap: 1.25rem; align-items: baseline; justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: var(--rule-w) solid var(--rule);
    padding-bottom: 1rem;
}
.cover-headline {
    font-size: clamp(2.4rem, 7vw, 5.25rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 0 0 1.5rem;
    max-width: 14ch;
}
.cover-headline em { font-style: italic; color: var(--accent); }
.cover-tagline {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.45;
    max-width: 56ch;
    color: var(--fg-soft);
    margin: 0 0 2.5rem;
}
.cover-tagline em { font-style: italic; }

.cover-actions {
    display: flex; gap: 1rem; flex-wrap: wrap;
    align-items: center;
}
.btn {
    display: inline-flex; align-items: center; gap: 0.6ch;
    font-family: var(--mono); font-size: 0.74rem;
    text-transform: uppercase; letter-spacing: 0.14em;
    padding: 0.85rem 1.1rem;
    text-decoration: none;
    border: 1px solid var(--fg);
    color: var(--fg); background: transparent;
    transition: background var(--tr), color var(--tr);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }

/* -----------------------------------------------------------------------
   7. Featured banner
   ----------------------------------------------------------------------- */
.featured {
    border-bottom: var(--rule-w) solid var(--rule);
    padding: 2.5rem 0;
}
.featured-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: end;
}
@media (min-width: 880px) {
    .featured-inner { grid-template-columns: 1.3fr 1fr; gap: 3rem; }
}
.featured-eyebrow {
    display: flex; align-items: baseline; gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.featured-eyebrow .star { color: var(--accent); }
.featured-title {
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    line-height: 1.08;
    margin: 0 0 1rem;
}
.featured-title a { text-decoration: none; }
.featured-title a:hover { color: var(--accent); }
.featured-excerpt { color: var(--fg-soft); margin: 0; max-width: 56ch; }
.featured-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-inset);
}
.featured-image img { width: 100%; height: 100%; object-fit: cover; }

/* -----------------------------------------------------------------------
   8. Section heading
   ----------------------------------------------------------------------- */
.section {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    border-bottom: var(--rule-w) solid var(--rule);
}
.section:last-child { border-bottom: 0; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: var(--rule-w) solid var(--rule);
}
.section-head h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    margin: 0;
}
.section-head .more {
    font-family: var(--mono);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-decoration: none;
    color: var(--muted);
    white-space: nowrap;
}
.section-head .more:hover { color: var(--fg); }

/* -----------------------------------------------------------------------
   9. Post list / cards
   ----------------------------------------------------------------------- */
.post-list { list-style: none; padding: 0; margin: 0; }

.post-card {
    display: grid;
    grid-template-columns: 6ch 1fr;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 1.75rem 0;
    border-bottom: var(--rule-w) solid var(--rule);
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child  { border-bottom: 0; }

.post-card .index {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--dim);
    padding-top: 0.4rem;
    font-feature-settings: "tnum";
}
.post-card .body { min-width: 0; }
.post-card .meta {
    display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.post-card h3 {
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    line-height: 1.2;
    margin: 0 0 0.5rem;
    font-weight: 450;
}
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-card .excerpt { color: var(--fg-soft); margin: 0; max-width: 60ch; }

.tag-pill {
    font-family: var(--mono);
    font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted); text-decoration: none;
    padding: 0.15rem 0;
}
.tag-pill::before { content: "#"; color: var(--dim); }
.tag-pill:hover { color: var(--fg); }

/* Card grid (used on podcast index / feature row) */
.card-grid {
    display: grid; gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .card-grid.three { grid-template-columns: 1fr 1fr 1fr; } }

.episode-card {
    border-top: var(--rule-w) solid var(--rule);
    padding: 1.5rem 0 1.75rem;
    display: flex; flex-direction: column;
    min-width: 0;
}
.episode-card .ep-num {
    font-family: var(--mono);
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.episode-card h3 {
    font-size: 1.4rem; line-height: 1.18; margin: 0 0 0.6rem;
    font-weight: 450;
}
.episode-card h3 a { text-decoration: none; }
.episode-card h3 a:hover { color: var(--accent); }
.episode-card .excerpt { color: var(--fg-soft); margin: 0 0 1rem; }
.episode-card .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--muted); margin-top: auto; }

/* -----------------------------------------------------------------------
   10. Single post
   ----------------------------------------------------------------------- */
.post-header {
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.75rem, 3vw, 2.5rem);
    border-bottom: var(--rule-w) solid var(--rule);
}
.post-header .crumbs {
    display: flex; gap: 0.6rem; align-items: baseline;
    margin-bottom: 1.5rem;
}
.post-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.018em;
    font-weight: 450;
    margin: 0 0 1rem;
    max-width: 22ch;
}
.post-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--fg-soft);
    line-height: 1.5;
    margin: 0 0 2rem;
    max-width: 56ch;
    font-style: italic;
}
.post-byline {
    display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem;
    align-items: center;
    border-top: var(--rule-w) solid var(--rule);
    padding-top: 1rem;
}
.post-byline .author { display: inline-flex; gap: 0.6rem; align-items: center; }
.post-byline .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-inset);
    object-fit: cover;
}

.post-feature {
    margin: 0;
    padding: 0;
    border-bottom: var(--rule-w) solid var(--rule);
}
.post-feature img { width: 100%; max-height: 70vh; object-fit: cover; }
.post-feature figcaption {
    font-family: var(--mono);
    font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted);
    padding: 0.6rem 0;
}

.post-body {
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2.5rem, 5vw, 4rem);
}
.post-body > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.post-body h2 {
    margin-top: 2.5em; margin-bottom: 0.5em;
    font-size: 1.55rem;
    padding-top: 0.6em;
    border-top: var(--rule-w) solid var(--rule);
}
.post-body h3 { margin-top: 2em; font-size: 1.2rem; }
.post-body figure { margin: 2rem auto; }
.post-body figcaption {
    font-family: var(--mono);
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.5rem;
    text-align: center;
}
.post-body ul, .post-body ol { padding-left: 1.25rem; }
.post-body li { margin-bottom: 0.4em; }
.post-body table {
    width: 100%; border-collapse: collapse; font-size: 0.95rem;
    margin: 1.5rem auto;
}
.post-body th, .post-body td {
    border-bottom: var(--rule-w) solid var(--rule);
    padding: 0.6rem 0.5rem;
    text-align: left;
}
.post-body th { font-weight: 600; }

/* Wider Ghost cards break the measure intentionally */
.post-body .kg-width-wide   { max-width: var(--measure-wide); }
.post-body .kg-width-full   { max-width: 100%; }
.post-body .kg-bookmark-card,
.post-body .kg-callout-card,
.post-body .kg-toggle-card {
    border: 1px solid var(--rule);
    background: var(--bg-inset);
    padding: 1rem 1.25rem;
    border-radius: 2px;
}
.post-body .kg-callout-card { padding-left: 1.25rem; border-left: 3px solid var(--fg); }
.post-body .kg-bookmark-container { display: flex; gap: 1rem; align-items: stretch; text-decoration: none; color: inherit; }
.post-body .kg-bookmark-content { flex: 1; min-width: 0; padding: 0.75rem 1rem; }
.post-body .kg-bookmark-title { font-weight: 600; margin-bottom: .25rem; }
.post-body .kg-bookmark-description { color: var(--muted); font-size: 0.95rem; }
.post-body .kg-bookmark-thumbnail img { height: 100%; width: 160px; object-fit: cover; }

/* Audio (podcast) card */
.post-body .kg-audio-card,
.post-audio {
    border: 1px solid var(--rule);
    background: var(--bg-inset);
    padding: 1rem;
    border-radius: 2px;
}

/* Embeds, video, and gallery — break out of the text measure and stay responsive. */
.post-body .kg-embed-card,
.post-body .kg-video-card,
.post-body .kg-gallery-card,
.post-body .kg-image-card {
    max-width: var(--measure-wide);
    margin: 2rem auto;
}
.post-body .kg-width-wide.kg-embed-card,
.post-body .kg-width-wide.kg-video-card { max-width: var(--measure-wide); }
.post-body .kg-width-full.kg-embed-card,
.post-body .kg-width-full.kg-video-card { max-width: 100%; }

.post-body .kg-embed-card { display: block; }
.post-body .kg-embed-card > iframe,
.post-body .kg-embed-card > .fluid-width-video-wrapper iframe {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 0;
    background: var(--inverse-bg);
}
/* Twitter / Instagram / generic non-iframe embeds: don't force aspect-ratio. */
.post-body .kg-embed-card > blockquote,
.post-body .kg-embed-card > .twitter-tweet,
.post-body .kg-embed-card > .instagram-media {
    margin: 0 auto;
    max-width: 100%;
}

/* Native HTML5 video card */
.post-body .kg-video-container video,
.post-body video {
    width: 100%;
    height: auto;
    display: block;
    background: var(--inverse-bg);
}

/* Bare iframes (markdown-pasted) */
.post-body iframe {
    max-width: 100%;
    border: 0;
}

/* -----------------------------------------------------------------------
   11. Subscribe / member CTA
   ----------------------------------------------------------------------- */
.subscribe {
    border-top: var(--rule-w) solid var(--rule);
    border-bottom: var(--rule-w) solid var(--rule);
    background: var(--bg-inset);
    padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.subscribe-inner {
    display: grid; gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 880px) {
    .subscribe-inner { grid-template-columns: 1.2fr 1fr; align-items: center; gap: 3rem; }
}
.subscribe h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin: 0 0 0.6rem;
    max-width: 22ch;
}
.subscribe p { color: var(--fg-soft); margin: 0 0 0.5rem; max-width: 52ch; }
.subscribe .actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* -----------------------------------------------------------------------
   11b. Upscale CTA — services pitch at the end of #upscale-tagged posts
   ----------------------------------------------------------------------- */
.upscale-cta {
    border-top: var(--rule-w) solid var(--rule);
    border-bottom: var(--rule-w) solid var(--rule);
    background:
        linear-gradient(180deg, transparent 0, rgba(255,255,255,0.012) 100%),
        var(--bg-inset);
    padding: clamp(2.25rem, 5vw, 3.75rem) 0;
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    position: relative;
}
.upscale-cta::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    opacity: 0.85;
}
.upscale-cta .wrap > * {
    max-width: var(--measure);
    margin-left: auto;
    margin-right: auto;
}
.upscale-cap {
    color: var(--accent);
    margin: 0 0 0.85rem;
}
.upscale-heading {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.12;
    margin: 0 0 0.85rem;
    max-width: 22ch;
    font-weight: 450;
}
.upscale-body {
    color: var(--fg-soft);
    margin: 0 0 1.5rem;
    max-width: 56ch;
    font-size: 1.05rem;
}
.upscale-action { margin: 0; }

/* -----------------------------------------------------------------------
   12. Pagination
   ----------------------------------------------------------------------- */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0;
    border-top: var(--rule-w) solid var(--rule);
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.pagination a { text-decoration: none; color: var(--fg); }
.pagination a:hover { color: var(--accent); }
.pagination .page { color: var(--muted); font-feature-settings: "tnum"; }

/* -----------------------------------------------------------------------
   13. Tag / author headers
   ----------------------------------------------------------------------- */
.archive-header {
    padding: clamp(3rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
    border-bottom: var(--rule-w) solid var(--rule);
}
.archive-header .crumbs { margin-bottom: 1rem; }
.archive-header h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin: 0 0 0.75rem;
}
.archive-header p { max-width: 56ch; color: var(--fg-soft); margin: 0; }

/* -----------------------------------------------------------------------
   14. Footer
   ----------------------------------------------------------------------- */
.site-footer {
    border-top: var(--rule-w) solid var(--rule-strong);
    background: var(--bg);
    margin-top: 3rem;
}
.site-footer-top {
    padding-block: clamp(3rem, 6vw, 5rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.75rem;
}
@media (min-width: 540px) {
    .site-footer-top { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
}
@media (min-width: 760px) {
    .site-footer-top { grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 3rem; }
}
.site-footer h4 {
    font-family: var(--mono);
    font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    margin: 0 0 1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); }

.site-footer .colophon p { margin: 0 0 0.6rem; max-width: 38ch; color: var(--fg-soft); }
.site-footer .signal {
    display: inline-flex; align-items: center; gap: 0.5ch;
    font-family: var(--mono); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--muted);
}
.site-footer .signal .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.site-footer-bottom {
    border-top: var(--rule-w) solid var(--rule);
    padding-top: 1.25rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem 1.25rem; flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}
@media (max-width: 480px) {
    .site-footer-bottom { padding-top: 1.5rem; gap: 0.5rem 1rem; }
}

/* -----------------------------------------------------------------------
   14b. Ghost Portal
   The floating Portal trigger button is injected by Ghost in an iframe;
   its colour comes from Admin → Settings → Brand → Accent (the theme can't
   reach inside the iframe). Theme already exposes Subscribe in the nav
   and CTA blocks, so we hide the auto-injected floating trigger.
   ----------------------------------------------------------------------- */
#ghost-portal-root [data-testid="portal-trigger-button"],
#ghost-portal-root [class*="trigger"],
#ghost-portal-root iframe[title*="trigger" i] {
    display: none !important;
}

/* -----------------------------------------------------------------------
   15. Error
   ----------------------------------------------------------------------- */
.error-page {
    min-height: 60vh;
    display: grid; place-items: center;
    text-align: center;
    padding: 4rem var(--gutter);
}
.error-page .code {
    font-family: var(--mono);
    font-size: clamp(3rem, 9vw, 6rem);
    color: var(--accent);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}
.error-page h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
.error-page p { max-width: 44ch; margin: 0 auto 1.5rem; color: var(--fg-soft); }
