/* AIronClaw brand override — applied AFTER Source's screen.css.
 *
 * The body is wrapped in .ac-site (see default.hbs) so this stylesheet
 * mirrors frontend/src/app/globals.css's .ac-site scope verbatim for the
 * pieces a blog needs (palette tokens, container, nav, buttons, eyebrow,
 * footer, responsive nav). Marketing-only sections (HERO art, GATEWAY,
 * PRICING, FAQ, SECURITY, SCROLLY) are deliberately omitted.
 *
 * Source-side knobs to set in Ghost admin → Settings → Design:
 *   - Brand → Accent color           : #bae95c
 *   - Site → Site background color   : #f5efe6 (default of this theme)
 *   - Site → Title font              : Modern sans-serif
 *   - Site → Body font               : Modern sans-serif
 *   - Site → Header style            : Off (the AIronClaw navbar replaces it)
 */

/* ── BRAND TOKENS ─────────────────────────────────────────────────────────── */

:root {
    --ac-bg: #f5efe6;
    --ac-bg-2: #efe8dc;
    --ac-ink: #1d1d1b;
    --ac-ink-2: #2a2a27;
    --ac-mute: #8a8a82;
    --ac-line: #e4ddd0;
    --ac-line-dark: #2d2d2a;
    --ac-card-dark: #1f1f1c;
    --ac-card-dark-2: #272723;
    --ac-accent: #bae95c;
    --ac-accent-3: #96c338;
    --ac-accent-soft: #d9efae;
    --ac-accent-ink: #4f7a1e;
    --ac-danger: #d7563a;
    --ac-amber: #e7a93b;
    --ac-white: #ffffff;
}

/* ── SOURCE OVERRIDES (variables Source uses) ─────────────────────────────── */

:root {
    --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --color-darker-gray: var(--ac-ink);
    --color-dark-gray: var(--ac-ink-2);
    --color-mid-gray: var(--ac-mute);
    --color-light-gray: var(--ac-line);
    --color-lighter-gray: rgba(0, 0, 0, 0.04);
    --color-secondary-text: rgba(0, 0, 0, 0.62);
    --color-border: rgba(0, 0, 0, 0.08);
    --color-dark-border: rgba(0, 0, 0, 0.55);
}

/* ── BASE (.ac-site) ──────────────────────────────────────────────────────── */

.ac-site {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--ac-bg);
    color: var(--ac-ink);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "cv11";
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100vh;
}
.ac-site *,
.ac-site *::before,
.ac-site *::after {
    box-sizing: border-box;
}
.ac-site .mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
}
.ac-site .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ── NAVBAR (.ac-top) ─────────────────────────────────────────────────────── */

.ac-site nav.ac-top {
    background: var(--ac-white);
    border-bottom: 1px solid var(--ac-line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.ac-site .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;
}
.ac-site .ac-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 20px;
    text-decoration: none;
    color: var(--ac-ink);
}
.ac-site .ac-logo .mark {
    width: 28px;
    height: 28px;
    display: block;
    flex: none;
}
.ac-site .ac-logo .ai { color: var(--ac-ink); }
.ac-site .ac-logo .fw { color: var(--ac-accent-ink); }

.ac-site .nav-links {
    display: flex;
    gap: 34px;
    font-weight: 600;
    font-size: 14.5px;
    flex-wrap: wrap;
    row-gap: 6px;
}
.ac-site .nav-links a {
    color: var(--ac-ink);
    text-decoration: none;
    opacity: 0.85;
}
.ac-site .nav-links a:hover { opacity: 1; }
.ac-site .nav-links a.active {
    color: var(--ac-accent-ink);
    opacity: 1;
}
.ac-site .nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--ac-line);
    border-radius: 10px;
    padding: 9px 10px;
    cursor: pointer;
    gap: 4px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 42px;
    height: 40px;
}
.ac-site .nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ac-ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.ac-site .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.ac-site .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ac-site .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ── BUTTONS (.btn / .btn-primary / .btn-ghost) ───────────────────────────── */

.ac-site .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ac-site .btn:active { transform: translateY(1px); }
.ac-site .btn-primary {
    background: var(--ac-accent);
    color: #1a2608;
    border-color: #a4d449;
}
.ac-site .btn-primary:hover {
    background: var(--ac-accent-3);
    color: #0e1a02;
}
.ac-site .btn-ghost {
    background: var(--ac-white);
    color: var(--ac-ink);
    border-color: var(--ac-line);
}

/* ── NAV ACTIONS & SEARCH BUTTON (.nav-actions / .nav-search) ─────────────── */
/* Base styles apply to both themes; dark-theme color overrides live in the
   DARK LISTINGS THEME section. */

.ac-site .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ac-site .nav-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    color: var(--ac-mute);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    min-width: 220px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.ac-site .nav-search:hover {
    border-color: var(--ac-ink-2);
    color: var(--ac-ink-2);
}
.ac-site .nav-search svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.ac-site .nav-search > span {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ac-site .nav-search kbd {
    margin-left: auto;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--ac-line);
    border-radius: 4px;
    color: var(--ac-mute);
    background: transparent;
}

/* ── EYEBROW PILL (reused on category lists, post meta, tag chips) ────────── */

.ac-site .eyebrow,
.ac-site .gh-canvas .gh-post-tags a,
.ac-site .gh-tag-card-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ac-mute);
    background: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 700;
}
.ac-site .eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ac-accent);
    box-shadow: 0 0 0 4px rgba(157, 209, 74, 0.15);
}

/* ── FOOTER (.ac-footer) ──────────────────────────────────────────────────── */

.ac-site footer.ac-footer {
    padding: 40px 0 56px;
    color: #7a7a71;
    font-size: 13px;
    border-top: 1px solid var(--ac-line);
    margin-top: auto;
}
.ac-site .foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.ac-site .ac-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--ac-line);
}
.ac-site .ac-footer a:hover {
    color: var(--ac-ink);
    border-bottom-color: var(--ac-ink);
}

/* ── EDITORIAL POST LAYOUT — overlays on Source's gh-content ──────────────── */

.ac-site h1, .ac-site h2, .ac-site h3, .ac-site h4, .ac-site h5, .ac-site h6,
.ac-site .gh-content h1, .ac-site .gh-content h2, .ac-site .gh-content h3, .ac-site .gh-content h4,
.ac-site .gh-canvas h1, .ac-site .gh-canvas h2 {
    letter-spacing: -0.022em;
    font-weight: 800;
    color: var(--ac-ink);
}

.ac-site .gh-content {
    line-height: 1.75;
    color: var(--ac-ink);
}

/* In-body links: Source defaults links to var(--color-darker-gray) without
 * an underline, which on the cream brand background reads as plain prose
 * instead of as a link. Force an explicit dark-ink colour and a subtle
 * underline so links are scannable in a long technical post. */
.ac-site .gh-content a {
    color: var(--ac-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--ac-line);
}
.ac-site .gh-content a:hover {
    opacity: 1;
    text-decoration-color: var(--ac-accent-ink);
}

.ac-site .gh-content :not(pre) > code {
    background-color: rgba(31, 31, 28, 0.08);
    border-radius: 4px;
    padding: 0.12em 0.35em;
    font-size: 0.92em;
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* Code blocks: dark surface that matches the marketing site's code-block
 * aesthetic. Source's screen.css ships a light `.gh-content pre` rule
 * (background: var(--color-lighter-gray)); the !important and the
 * compound selector below win the cascade unambiguously regardless of
 * Source's load order or future hash-busted redeploys. */
.ac-site .gh-content pre,
.ac-site .gh-content pre[class*="language-"] {
    background-color: var(--ac-card-dark) !important;
    color: #f4eee2 !important;
    border-radius: 12px;
    padding: 18px 22px;
    border: 1px solid var(--ac-line-dark);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    overflow-x: auto;
    line-height: 1.55;
    font-size: 14.5px;
}
.ac-site .gh-content pre code {
    color: inherit;
    background: transparent;
    font-family: inherit;
}

/* ── PRISM.JS TOKEN COLORS — AIronClaw palette ────────────────────────────── */
/* Mapped to a 4-color palette that reads well on --ac-card-dark and stays in
 * brand: lime accent for keywords/operators, warm cream for strings, muted
 * cream for comments, amber for numbers/constants. */

.ac-site .gh-content pre code[class*="language-"],
.ac-site .gh-content pre[class*="language-"] {
    color: #f4eee2;
    text-shadow: none;
    background: transparent;
}

.ac-site .gh-content .token.comment,
.ac-site .gh-content .token.prolog,
.ac-site .gh-content .token.cdata {
    color: #8a8a82;
    font-style: italic;
}
.ac-site .gh-content .token.doctype,
.ac-site .gh-content .token.punctuation,
.ac-site .gh-content .token.entity {
    color: #c9c4b7;
}
.ac-site .gh-content .token.attr-name,
.ac-site .gh-content .token.class-name,
.ac-site .gh-content .token.boolean,
.ac-site .gh-content .token.constant,
.ac-site .gh-content .token.number,
.ac-site .gh-content .token.atrule {
    color: #e7a93b;
}
.ac-site .gh-content .token.keyword,
.ac-site .gh-content .token.operator,
.ac-site .gh-content .token.selector,
.ac-site .gh-content .token.important,
.ac-site .gh-content .token.builtin,
.ac-site .gh-content .token.tag {
    color: #bae95c;
}
.ac-site .gh-content .token.string,
.ac-site .gh-content .token.char,
.ac-site .gh-content .token.attr-value,
.ac-site .gh-content .token.regex,
.ac-site .gh-content .token.variable,
.ac-site .gh-content .token.url,
.ac-site .gh-content .token.symbol {
    color: #d9efae;
}
.ac-site .gh-content .token.function,
.ac-site .gh-content .token.property {
    color: #fbf6ea;
}
.ac-site .gh-content .token.deleted {
    color: #d7563a;
    background: rgba(215, 86, 58, 0.08);
}
.ac-site .gh-content .token.inserted {
    color: #bae95c;
    background: rgba(186, 233, 92, 0.08);
}
.ac-site .gh-content .token.bold { font-weight: 700; }
.ac-site .gh-content .token.italic { font-style: italic; }

/* Mermaid diagrams rendered to inline SVG by the publish CLI:
 * keep them on a transparent backdrop within the editorial flow. */
.ac-site .gh-content .mermaid-svg {
    margin: 1.5em 0;
    text-align: center;
}
.ac-site .gh-content .mermaid-svg svg {
    max-width: 100%;
    height: auto;
}

.ac-site .gh-content blockquote:not(.kg-blockquote-alt) {
    border-left: 3px solid var(--ac-accent);
    padding-left: 18px;
    color: var(--ac-ink-2);
    font-style: normal;
    margin: 1.5em 0;
}

/* Ghost button card (e.g. CTA inside a post) — match the .btn-primary look. */
.ac-site .kg-button-card a {
    background: var(--ac-accent);
    color: #1a2608;
    border-radius: 10px;
    border: 1px solid #a4d449;
    font-weight: 700;
    letter-spacing: 0;
}
.ac-site .kg-button-card a:hover {
    background: var(--ac-accent-3);
    color: #0e1a02;
}

/* Source's primary button class — keep buttons rounded to match site. */
.ac-site .gh-button {
    border-radius: 10px;
    background-color: var(--ac-accent);
    color: #1a2608;
}
.ac-site .gh-button:hover {
    background-color: var(--ac-accent-3);
    color: #0e1a02;
    opacity: 1;
}

/* Card lists on the homepage (Source's post-card grid). Soften and warm. */
.ac-site .gh-card,
.ac-site .gh-card-link {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--ac-line);
    border-radius: 16px;
}
.ac-site .gh-card-link:hover {
    background: rgba(255, 255, 255, 0.75);
    opacity: 1;
}

/* Post header on a single post page: tighten and centre. */
.ac-site .gh-canvas .gh-article-meta {
    color: var(--ac-mute);
}

/* Member subscription block above footer: match the warm cream theme. */
.ac-site .gh-footer-signup {
    background: var(--ac-bg-2);
    border-top: 1px solid var(--ac-line);
    border-bottom: 1px solid var(--ac-line);
    padding: 56px 0;
    text-align: center;
}
.ac-site .gh-footer-signup .gh-inner {
    max-width: 720px;
    margin: 0 auto;
}
.ac-site .gh-footer-signup-header {
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.022em;
    font-weight: 800;
    color: var(--ac-ink);
    margin: 0 0 12px;
}
.ac-site .gh-footer-signup-subhead {
    color: var(--ac-mute);
    font-size: 16px;
    margin: 0 0 24px;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .ac-site .container {
        padding: 0 20px;
    }
    .ac-site .nav-toggle {
        display: inline-flex;
    }
    .ac-site .nav-cta,
    .ac-site .nav-search {
        display: none;
    }
    .ac-site .nav-links {
        display: flex !important;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--ac-white);
        border-bottom: 1px solid var(--ac-line);
        box-shadow: 0 12px 24px rgba(29, 29, 27, 0.08);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease, padding 0.25s ease;
    }
    .ac-site .nav-links.is-open {
        max-height: 560px;
        padding: 8px 0;
    }
    .ac-site .nav-links a {
        padding: 14px 20px;
        border-top: 1px solid var(--ac-line);
        font-size: 15px;
        font-weight: 600;
        opacity: 1;
    }
    .ac-site .nav-links a:first-child {
        border-top: 0;
    }
    .ac-site nav.ac-top .btn {
        padding: 9px 14px;
        font-size: 13px;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   DARK LISTINGS THEME — applied via body class .ac-theme-dark on home / index
   / tag / author. Post and page templates stay on the default light palette
   above, for reading legibility.
   Layout adapted from the AIronClaw blog Ghost-mapping template.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── DARK TOKENS ──────────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark {
    --ac-bg: #1d1d1b;
    --ac-bg-2: #262624;
    --ac-ink: #ede7d8;
    --ac-ink-2: #d8d2c4;
    --ac-mute: #9f9c92;
    --ac-mute-2: #6e6b62;
    --ac-line: #3a3733;
    --ac-line-soft: #2a2826;
    --ac-cream: #ede7d8;
    --ac-cream-2: #d8d2c4;

    background: #1d1d1b;
    color: #ede7d8;
    line-height: 1.55;
}
.ac-site.ac-theme-dark ::selection {
    background: var(--ac-accent);
    color: #1d1d1b;
}

/* Serif (Fraunces) is loaded from Google Fonts in default.hbs and used only
   on dark listings for h1/h2/h3 display copy. */
.ac-site.ac-theme-dark .serif,
.ac-site.ac-theme-dark .hero h1,
.ac-site.ac-theme-dark .post-card h3,
.ac-site.ac-theme-dark .feat-card h3,
.ac-site.ac-theme-dark .newsletter h2,
.ac-site.ac-theme-dark .h-section,
.ac-site.ac-theme-dark .author-card .ac-author-name {
    font-family: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.ac-site.ac-theme-dark .h-section {
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 800;
    font-size: 32px;
    line-height: 1.1;
}
.ac-site.ac-theme-dark .h-section .accent { color: var(--ac-accent); }

.ac-site.ac-theme-dark .eyebrow {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ac-mute);
    background: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: inline-block;
}
.ac-site.ac-theme-dark .eyebrow .dash {
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--ac-accent);
    vertical-align: middle;
    margin-right: 10px;
}

/* ── DARK NAVBAR ─────────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark nav.ac-top {
    background: rgba(29, 29, 27, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .ac-logo .ai { color: var(--ac-cream); }
.ac-site.ac-theme-dark .ac-logo .fw { color: var(--ac-accent); }
.ac-site.ac-theme-dark .nav-links a {
    color: var(--ac-cream-2);
    opacity: 1;
}
.ac-site.ac-theme-dark .nav-links a:hover { color: var(--ac-cream); }
.ac-site.ac-theme-dark .nav-links a.active { color: var(--ac-cream); }
.ac-site.ac-theme-dark .nav-links a.active::after {
    background: var(--ac-accent);
}
.ac-site.ac-theme-dark .nav-toggle span { background: var(--ac-cream); }

/* Dark-only nav-search overrides (base styles live above, in the BUTTONS
   section). The dark theme's --ac-mute / --ac-line tokens already shift the
   resting colors via the cascade — these rules just cover the hover state. */
.ac-site.ac-theme-dark .nav-search:hover {
    border-color: var(--ac-cream-2);
    color: var(--ac-cream-2);
}
.ac-site.ac-theme-dark .nav-search kbd {
    color: var(--ac-mute-2);
    border-color: var(--ac-line);
}
.ac-site.ac-theme-dark .btn-ghost {
    border: 1px solid var(--ac-line);
    color: var(--ac-cream-2);
    background: transparent;
}
.ac-site.ac-theme-dark .btn-ghost:hover {
    border-color: var(--ac-cream-2);
    color: var(--ac-cream);
}
.ac-site.ac-theme-dark .btn-primary {
    background: var(--ac-accent);
    color: #1d1d1b;
}
.ac-site.ac-theme-dark .btn-primary:hover {
    background: var(--ac-accent-3);
    color: #1d1d1b;
}

/* ── COMMON BLOCKS ───────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark a { color: inherit; }
.ac-site.ac-theme-dark img { display: block; max-width: 100%; }

.ac-site.ac-theme-dark .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}
.ac-site.ac-theme-dark .pill-accent {
    background: rgba(186, 233, 92, 0.12);
    color: var(--ac-accent);
    border: 1px solid rgba(186, 233, 92, 0.35);
}
.ac-site.ac-theme-dark .pill-line {
    border: 1px solid var(--ac-line);
    color: var(--ac-mute);
}

.ac-site.ac-theme-dark .avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3a3733, #262624);
    border: 1px solid var(--ac-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--ac-cream-2);
    flex-shrink: 0;
    overflow: hidden;
}
.ac-site.ac-theme-dark .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Section chrome */
.ac-site.ac-theme-dark .ac-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .ac-section.is-tight { padding: 32px 0; }
.ac-site.ac-theme-dark .section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 48px;
    gap: 24px;
    flex-wrap: wrap;
}
.ac-site.ac-theme-dark .section-head-l { max-width: 680px; }
.ac-site.ac-theme-dark .section-head .eyebrow {
    display: block;
    margin-bottom: 16px;
}
.ac-site.ac-theme-dark .section-head .h-section { margin-bottom: 12px; }
.ac-site.ac-theme-dark .section-head .lede {
    color: var(--ac-mute);
    max-width: 540px;
    font-size: 15px;
}
.ac-site.ac-theme-dark .section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ac-accent);
    white-space: nowrap;
}
.ac-site.ac-theme-dark .section-link svg { width: 14px; height: 14px; }

/* Placeholder cover (.ph) — used when a post has no feature_image */
.ac-site.ac-theme-dark .ph {
    position: relative;
    background: linear-gradient(135deg, #2a2826, #1d1d1b);
    border: 1px solid var(--ac-line-soft);
    overflow: hidden;
    display: block;
}
.ac-site.ac-theme-dark .ph::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, 0.025) 12px 13px);
}
.ac-site.ac-theme-dark .ph::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--gx, 40%) var(--gy, 40%), var(--gc, rgba(186, 233, 92, 0.12)), transparent 55%);
}
.ac-site.ac-theme-dark .ph .ph-tag {
    position: absolute;
    left: 16px;
    bottom: 16px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ac-mute);
    z-index: 1;
}
.ac-site.ac-theme-dark .ph img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── HERO (featured post) ────────────────────────────────────────────────── */

.ac-site.ac-theme-dark .hero {
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 64px;
    align-items: center;
}
.ac-site.ac-theme-dark .hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ac-site.ac-theme-dark .hero h1 {
    font-size: 56px;
    line-height: 1.05;
    margin-bottom: 24px;
}
.ac-site.ac-theme-dark .hero-excerpt {
    font-size: 18px;
    color: var(--ac-cream-2);
    max-width: 540px;
    margin-bottom: 32px;
    text-wrap: pretty;
}
.ac-site.ac-theme-dark .hero-author {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ac-site.ac-theme-dark .author-info .ac-author-name {
    font-size: 14px;
    font-weight: 600;
    font-family: "Manrope", system-ui, sans-serif;
    letter-spacing: -0.005em;
}
.ac-site.ac-theme-dark .author-info .ac-author-meta {
    font-size: 12px;
    color: var(--ac-mute);
    font-family: "JetBrains Mono", ui-monospace, monospace;
}
.ac-site.ac-theme-dark .hero-image {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2826, #1d1d1b);
    border: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .hero-image .label {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ac-cream-2);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    z-index: 2;
}
.ac-site.ac-theme-dark .hero-image .label .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--ac-accent);
    box-shadow: 0 0 10px var(--ac-accent);
}

/* ── TAGS STRIP ──────────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark .tags-strip {
    padding: 32px 0;
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .tags-strip-inner {
    display: flex;
    align-items: center;
    gap: 16px 24px;
    flex-wrap: wrap;
}
.ac-site.ac-theme-dark .tags-strip .label {
    color: var(--ac-mute);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.ac-site.ac-theme-dark .tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    font-size: 13px;
    color: var(--ac-cream-2);
    transition: border-color 0.15s, color 0.15s;
}
.ac-site.ac-theme-dark .tag-chip:hover {
    border-color: var(--ac-accent);
    color: var(--ac-accent);
}
.ac-site.ac-theme-dark .tag-chip .count {
    color: var(--ac-mute);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
}

/* ── POST GRID (3 columns) ───────────────────────────────────────────────── */

.ac-site.ac-theme-dark .post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
}
.ac-site.ac-theme-dark .post-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ac-site.ac-theme-dark .post-card.is-link {
    cursor: pointer;
    color: inherit;
}
.ac-site.ac-theme-dark .post-card .ph {
    aspect-ratio: 16 / 10;
    border-radius: 10px;
}
.ac-site.ac-theme-dark .post-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ac-site.ac-theme-dark .post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ac-mute);
}
.ac-site.ac-theme-dark .post-card-meta .tag { color: var(--ac-accent); }
.ac-site.ac-theme-dark .post-card-meta .sep { color: var(--ac-mute-2); }
.ac-site.ac-theme-dark .post-card h3 {
    font-size: 24px;
    line-height: 1.2;
    transition: color 0.15s;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.ac-site.ac-theme-dark .post-card:hover h3 { color: var(--ac-accent); }
.ac-site.ac-theme-dark .post-card-excerpt {
    color: var(--ac-mute);
    font-size: 14px;
    line-height: 1.5;
    text-wrap: pretty;
}
.ac-site.ac-theme-dark .post-card-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ac-mute-2);
}
.ac-site.ac-theme-dark .post-card-foot .avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

/* ── TWO-COL: tag-filtered feature list + most-read aside ────────────────── */

.ac-site.ac-theme-dark .two-col {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 64px;
}
.ac-site.ac-theme-dark .col-feat-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.ac-site.ac-theme-dark .feat-card {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    gap: 24px;
    align-items: center;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .feat-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.ac-site.ac-theme-dark .feat-card .ph {
    aspect-ratio: 5 / 4;
    border-radius: 8px;
}
.ac-site.ac-theme-dark .feat-card .post-card-meta { margin-bottom: 8px; }
.ac-site.ac-theme-dark .feat-card h3 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 10px;
}
.ac-site.ac-theme-dark .feat-card h3 a {
    transition: color 0.15s;
}
.ac-site.ac-theme-dark .feat-card h3 a:hover { color: var(--ac-accent); }
.ac-site.ac-theme-dark .feat-card .post-card-excerpt { font-size: 14px; }

/* Compact "Most Read" list */
.ac-site.ac-theme-dark .compact-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .compact-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--ac-line-soft);
    transition: padding 0.15s;
}
.ac-site.ac-theme-dark .compact-row:hover { padding-left: 8px; }
.ac-site.ac-theme-dark .compact-row .num {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 13px;
    color: var(--ac-mute-2);
    font-variant-numeric: tabular-nums;
}
.ac-site.ac-theme-dark .compact-row h4 {
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    line-height: 1.35;
    margin-bottom: 4px;
    transition: color 0.15s;
}
.ac-site.ac-theme-dark .compact-row:hover h4 { color: var(--ac-accent); }
.ac-site.ac-theme-dark .compact-row .meta {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ac-mute);
}

/* ── NEWSLETTER CTA ──────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark .newsletter {
    padding: 80px 0;
    border-bottom: 1px solid var(--ac-line-soft);
    background: radial-gradient(ellipse at center top, rgba(186, 233, 92, 0.07), transparent 60%);
    position: relative;
    overflow: hidden;
}
.ac-site.ac-theme-dark .newsletter::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
    pointer-events: none;
}
.ac-site.ac-theme-dark .newsletter-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
}
.ac-site.ac-theme-dark .newsletter h2 {
    font-size: 42px;
    line-height: 1.1;
    margin-bottom: 18px;
}
.ac-site.ac-theme-dark .newsletter h2 .accent { color: var(--ac-accent); }
.ac-site.ac-theme-dark .newsletter p {
    color: var(--ac-mute);
    font-size: 16px;
    max-width: 480px;
    text-wrap: pretty;
}
.ac-site.ac-theme-dark .newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ac-site.ac-theme-dark .newsletter-input {
    display: flex;
    gap: 8px;
}
.ac-site.ac-theme-dark .newsletter-input input {
    flex: 1;
    height: 52px;
    padding: 0 18px;
    background: var(--ac-bg-2);
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    color: var(--ac-cream);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.ac-site.ac-theme-dark .newsletter-input input::placeholder { color: var(--ac-mute-2); }
.ac-site.ac-theme-dark .newsletter-input input:focus { border-color: var(--ac-accent); }
.ac-site.ac-theme-dark .newsletter-input .btn {
    height: 52px;
    padding: 0 24px;
    font-size: 14px;
    border-radius: 999px;
}
.ac-site.ac-theme-dark .newsletter-trust {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ac-mute);
}
.ac-site.ac-theme-dark .newsletter-trust .ok { color: var(--ac-accent); }

/* ── AUTHOR SPOTLIGHT ────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark .author-spot {
    padding: 80px 0;
    border-bottom: 1px solid var(--ac-line-soft);
}
.ac-site.ac-theme-dark .author-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 40px;
    align-items: center;
    padding: 32px;
    border: 1px solid var(--ac-line-soft);
    border-radius: 16px;
    background: var(--ac-bg-2);
}
.ac-site.ac-theme-dark .author-card .avatar {
    width: 96px;
    height: 96px;
    font-size: 32px;
}
.ac-site.ac-theme-dark .author-card .ac-author-name {
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.ac-site.ac-theme-dark .author-card .role {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ac-accent);
    margin-bottom: 14px;
}
.ac-site.ac-theme-dark .author-card .bio {
    color: var(--ac-cream-2);
    max-width: 520px;
    font-size: 15px;
    text-wrap: pretty;
}
.ac-site.ac-theme-dark .author-card .stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: right;
    border-left: 1px solid var(--ac-line-soft);
    padding-left: 32px;
}
.ac-site.ac-theme-dark .author-card .stat-num {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--ac-cream);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.ac-site.ac-theme-dark .author-card .stat-lbl {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ac-mute);
    margin-top: 2px;
}

/* ── PAGINATION ──────────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark .ac-pagination {
    padding: 48px 0 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ac-site.ac-theme-dark .ac-pagination a,
.ac-site.ac-theme-dark .ac-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 13px;
    color: var(--ac-cream-2);
    border: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}
.ac-site.ac-theme-dark .ac-pagination a:hover {
    border-color: var(--ac-line);
    color: var(--ac-cream);
}
.ac-site.ac-theme-dark .ac-pagination .is-active {
    background: var(--ac-accent);
    color: #1d1d1b;
    font-weight: 600;
}
.ac-site.ac-theme-dark .ac-pagination .ellip {
    color: var(--ac-mute-2);
    border: 0;
}
.ac-site.ac-theme-dark .ac-pagination .nav-btn {
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--ac-line);
}
.ac-site.ac-theme-dark .ac-pagination .nav-btn[aria-disabled="true"] {
    opacity: 0.35;
    pointer-events: none;
}

/* ── FOOTER ON DARK ──────────────────────────────────────────────────────── */

.ac-site.ac-theme-dark footer.ac-footer {
    background: #171715;
    border-top: 1px solid var(--ac-line-soft);
    color: var(--ac-mute);
}
.ac-site.ac-theme-dark .ac-footer .foot { color: var(--ac-mute); }
.ac-site.ac-theme-dark .ac-footer a { color: var(--ac-cream-2); }
.ac-site.ac-theme-dark .ac-footer a:hover { color: var(--ac-accent); }

/* The Source-style member signup band above the footer reads as a discordant
   light slab on dark listings — hide it on dark; the on-page newsletter CTA
   handles signups on home.hbs. */
.ac-site.ac-theme-dark .gh-footer-signup { display: none; }

/* ── RESPONSIVE (dark listings) ──────────────────────────────────────────── */

@media (max-width: 980px) {
    .ac-site.ac-theme-dark .hero-grid,
    .ac-site.ac-theme-dark .two-col,
    .ac-site.ac-theme-dark .newsletter-inner {
        grid-template-columns: 1fr;
    }
    .ac-site.ac-theme-dark .post-grid { grid-template-columns: 1fr 1fr; }
    /* Dark-mode mobile dropdown panel (.nav-links.is-open) — base CSS uses a
       white slab which clashes on dark; recolor to the dark surface. */
    .ac-site.ac-theme-dark .nav-links {
        background: var(--ac-bg-2);
        border-bottom-color: var(--ac-line-soft);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    }
    .ac-site.ac-theme-dark .nav-links a {
        border-top-color: var(--ac-line-soft);
        color: var(--ac-cream-2);
    }
    .ac-site.ac-theme-dark .author-card { grid-template-columns: auto 1fr; }
    .ac-site.ac-theme-dark .author-card .stats {
        grid-column: 1 / -1;
        flex-direction: row;
        border-left: 0;
        border-top: 1px solid var(--ac-line-soft);
        padding: 20px 0 0;
        justify-content: space-around;
        text-align: center;
    }
    .ac-site.ac-theme-dark .hero h1 { font-size: 42px; }
}
@media (max-width: 640px) {
    .ac-site.ac-theme-dark .post-grid { grid-template-columns: 1fr; }
    .ac-site.ac-theme-dark .feat-card { grid-template-columns: 1fr; }
    .ac-site.ac-theme-dark .hero h1 { font-size: 34px; }
    .ac-site.ac-theme-dark .h-section { font-size: 26px; }
    .ac-site.ac-theme-dark .ac-section { padding: 56px 0; }
    .ac-site.ac-theme-dark .author-card .stats { padding-top: 16px; }
}
