/*
 * Gully Labs blog theme, on the 2026-11 Gully Labs kit: navy #0E1C38, blue #3754A0, light blue #6F8DDF, ground #F1F3F8, with
 * gullylabs.xyz's navy surface steps and Figtree. Layout grid for Ghost cards (.gh-canvas, .kg-width-wide, .kg-width-full) and the card spacing rules
 * adapted from Ghost's Source theme (MIT, Copyright (c) 2013-2026 Ghost Foundation; see LICENSE).
 *
 *  1. Tokens          7. Hairline grid + cards     13. Ghost cards (kg-*)
 *  2. Base            8. Banners                   14. Footer
 *  3. Utilities       9. Home                      15. Archive, author, error, empty
 *  4. Buttons, chips 10. Post head                 16. Toasts, pagination
 *  5. Header + menus 11. Content                   17. Ticker
 *  6. Mobile sheet   12. Code blocks               18. Reduced motion
 */

/* 1. Tokens ------------------------------------------------------------------------------------- */
:root {
    /* Only kit colours: navy #0e1c38, blue #3754a0, light blue #6f8ddf, ground #f1f3f8 and the kit greys #c9d2e8 #d6dce8.
       Surfaces and lines are those colours mixed, never a new hue. scripts/test-blog-theme.mjs enforces it. */
    --gl-bg: #0e1c38;            /* page background: the kit navy */
    --gl-bg-alt: color-mix(in srgb, #0e1c38 95%, #f1f3f8);
    --gl-bg-footer: color-mix(in srgb, #0e1c38 92%, #3754a0);
    --gl-surface: color-mix(in srgb, #0e1c38 95%, #f1f3f8);
    --gl-surface-deep: color-mix(in srgb, #0e1c38 90%, #3754a0);
    --gl-surface-hover: color-mix(in srgb, #0e1c38 89%, #f1f3f8);
    --gl-line: color-mix(in srgb, #0e1c38 80%, #6f8ddf);          /* 1 px lines */
    --gl-line-strong: color-mix(in srgb, #0e1c38 68%, #6f8ddf);
    --gl-line-hover: color-mix(in srgb, #0e1c38 52%, #6f8ddf);
    --gl-ink: #f1f3f8;           /* text: the kit ground */
    --gl-ink-2: #d6dce8;
    --gl-muted: #c9d2e8;         /* muted text (kit grey) */
    --gl-dim: #c9d2e8;
    --gl-accent: #6f8ddf;        /* the accent, kit light blue: buttons, links, active states */
    --gl-accent-hover: #c9d2e8;
    --gl-accent-line: rgba(111, 141, 223, .35);
    --gl-blue: #3754a0;          /* kit blue: secondary buttons */
    --gl-blue-hover: color-mix(in srgb, #3754a0 80%, #6f8ddf);
    --gl-gradient: linear-gradient(90deg, #6f8ddf 0%, #c9d2e8 100%);
    --gl-error: #f1f3f8;

    /* Figtree, as on gullylabs.xyz. Not Ghost's --gh-font variables: the old Code injection sets those to the old condensed font. */
    --gl-font-display: 'Figtree', system-ui, sans-serif;
    --gl-font-sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --gl-font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --gl-radius-btn: 999px;      /* the signature pill */
    --gl-radius-card: 16px;
    --gl-radius-toast: 22px;
    --gl-gutter: clamp(16px, 4.5vw, 64px);
    --gl-max: 1360px;
    --gl-header-h: 56px;

    /* Ghost's content grid (Source). */
    --container-width: 1200px;
    --content-width: 720px;
    --container-gap: var(--gl-gutter);

    /* Ghost prints the accent from its settings; this file loads after {{ghost_head}}, so the kit wins on Ghost cards. */
    --ghost-accent-color: #6f8ddf;

    color-scheme: dark;
}

/* 2. Base --------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
/* Ghost's Code injection still holds the old brand: old body colours, uppercase condensed headings with !important, and
   old yellow button rules in the site footer. This file loads after {{ghost_head}} so it wins every tie; the two font rules
   below answer the !important; the theme's buttons are .gk-btn so the footer rules match nothing, and gully.js removes
   the block the footer script adds. All of it is harmless once the injection is cleared. */
h1, h2, h3 { font-family: var(--gl-font-display) !important; text-transform: none; letter-spacing: normal; }
.gl-footer-head { font-family: var(--gl-font-mono) !important; text-transform: uppercase; letter-spacing: 1px; }
.gl-intro { display: none !important; }
html body {
    margin: 0;
    background: var(--gl-bg);
    color: var(--gl-ink);
    font-family: var(--gl-font-sans);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl { margin: 0; }
:focus-visible { outline: 2px solid var(--gl-accent); outline-offset: 2px; }
::selection { background: rgba(111, 141, 223, .3); color: var(--gl-ink); }
[hidden] { display: none !important; }

.gl-viewport { display: flex; flex-direction: column; min-height: 100vh; }
.gl-main { flex: 1 0 auto; outline: none; }

/* 3. Utilities ---------------------------------------------------------------------------------- */
.gl-page { width: min(100% - var(--gl-gutter) * 2, var(--gl-max)); margin-inline: auto; }
.gl-sr {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.gl-skip {
    position: absolute; left: 12px; top: -100px; z-index: 100;
    padding: 12px 18px; background: var(--gl-accent); color: var(--gl-bg); font-weight: 600;
    border-radius: var(--gl-radius-btn);
}
.gl-skip:focus { top: 12px; }
.gl-icon { width: 16px; height: 16px; flex: none; }
.gl-ext { margin-left: 4px; font-size: 13px; line-height: 1; color: var(--gl-dim); font-family: var(--gl-font-mono); }

.gl-kicker {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    font-family: var(--gl-font-mono); font-size: 12px; font-weight: 500; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--gl-accent);
}
.gl-kicker .gl-icon { width: 14px; height: 14px; }
.gl-kicker-num { display: inline-flex; align-items: center; gap: 10px; color: var(--gl-accent); }
.gl-kicker-num::after { content: ''; width: 28px; height: 1px; background: var(--gl-gradient); }
.gl-kicker-num + span { color: var(--gl-muted); }
.gl-kicker-sep { color: var(--gl-line-hover); }
.gl-kicker-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--gl-accent); }
.gl-kicker-link:hover { color: var(--gl-accent-hover); }

.gl-textlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--gl-accent); font-weight: 600; }
.gl-textlink:hover { color: var(--gl-accent-hover); }

.gl-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.gl-meta-item .gl-icon { width: 13px; height: 13px; color: var(--gl-dim); }

/* Brand kit images: exact intrinsic ratios, never cropped or recoloured. */
.gl-lockup { display: inline-flex; align-items: center; }
.gl-lockup-logotype { width: 143px; height: 26px; }
.gl-logo { width: 187px; height: 34px; }
.gl-mascot { width: auto; height: 448px; max-width: 100%; }

/* 4. Buttons, chips, inputs --------------------------------------------------------------------- */
/* The signature button: a pill with a left icon, the arrow slides right on hover, a shine sweeps across,
   scale .98 when pressed, focus ring. Primary = light blue fill, navy text; secondary = blue fill, white text;
   ghost = 1 px line. */
.gk-btn {
    position: relative; overflow: hidden; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: var(--gl-radius-btn);
    font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, transform .12s;
}
.gk-btn > .gl-icon { width: 16px; height: 16px; }
.gk-btn-arrow { display: inline-flex; transition: transform .2s ease-out; }
.gk-btn-arrow .gl-icon { width: 16px; height: 16px; }
.gk-btn:hover .gk-btn-arrow { transform: translateX(3px); }
.gk-btn:hover .gk-btn-arrow--back { transform: translateX(-3px); }
.gk-btn:active { transform: scale(.98); }
.gk-btn::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
    background: linear-gradient(100deg, transparent 0%, rgba(241, 243, 248, .35) 50%, transparent 100%);
    transform: skewX(-18deg); opacity: 0;
}
.gk-btn:hover::after { animation: gl-shine .7s ease-out; }
@keyframes gl-shine { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 0; } }
.gk-btn--primary { background: var(--gl-accent); color: var(--gl-bg); }
.gk-btn--primary:hover { background: var(--gl-accent-hover); }
.gk-btn--primary .gl-ext { color: rgba(14, 28, 56, .7); }
.gk-btn--secondary { background: var(--gl-blue); color: var(--gl-ink); }
.gk-btn--secondary:hover { background: var(--gl-blue-hover); }
.gk-btn--secondary::after { background: linear-gradient(100deg, transparent 0%, rgba(111, 141, 223, .45) 50%, transparent 100%); }
.gk-btn--ghost { border: 1px solid var(--gl-line-strong); color: var(--gl-ink); }
.gk-btn--ghost:hover { border-color: var(--gl-accent); color: var(--gl-accent); }
.gk-btn--ghost::after { background: linear-gradient(100deg, transparent 0%, rgba(111, 141, 223, .22) 50%, transparent 100%); }
.gk-btn--small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.gk-btn--block { width: 100%; }

.gl-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; min-width: 44px; padding: 0 10px; color: var(--gl-muted);
    border-radius: var(--gl-radius-btn); transition: color .15s, border-color .15s, background-color .15s;
}
.gl-iconbtn:hover { color: var(--gl-accent); }
.gl-iconbtn--box { border: 1px solid var(--gl-line-strong); padding: 0; width: 44px; }
.gl-iconbtn--box:hover { border-color: var(--gl-accent); }

.gl-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.gl-chip {
    position: relative; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
    border: 1px solid var(--gl-line-strong); border-radius: 999px;
    font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: .3px; color: var(--gl-ink-2);
    background: var(--gl-bg); transition: border-color .15s, color .15s;
}
/* 44px hit area around the 32px chip. */
.gl-chip::before { content: ''; position: absolute; inset: -6px -2px; }
.gl-chip .gl-icon { width: 12px; height: 12px; color: var(--gl-dim); }
.gl-chip:hover { border-color: var(--gl-accent); color: var(--gl-ink); }
.gl-chip.is-current { border-color: var(--gl-accent-line); background: rgba(111, 141, 223, .08); color: var(--gl-accent); }
.gl-chip.is-current .gl-icon { color: var(--gl-accent); }
.gl-chip-count { color: var(--gl-dim); }

.gl-badge {
    display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px;
    border: 1px solid var(--gl-accent-line); border-radius: 999px;
    font-family: var(--gl-font-mono); font-size: 11px; font-weight: 500; letter-spacing: .5px;
    text-transform: uppercase; color: var(--gl-accent); vertical-align: 1px;
}

.gl-input {
    min-height: 44px; width: 100%; padding: 0 16px; border-radius: var(--gl-radius-btn);
    border: 1px solid var(--gl-line-strong); background: var(--gl-bg); color: var(--gl-ink);
}
.gl-input::placeholder { color: var(--gl-dim); }
.gl-input:focus-visible { outline: 2px solid var(--gl-accent); outline-offset: 1px; border-color: var(--gl-accent-line); }

/* 5. Header + menus ----------------------------------------------------------------------------- */
.gl-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(14, 28, 56, .88); border-bottom: 1px solid var(--gl-line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.gl-bar { display: flex; align-items: center; gap: 24px; min-height: var(--gl-header-h); padding-block: 8px; flex-wrap: nowrap; }
.gl-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.gl-wordmark { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; }
.gl-brand-sep { color: var(--gl-line-hover); font-family: var(--gl-font-mono); font-size: 18px; }
.gl-brand-blog {
    display: inline-flex; align-items: center; min-height: 44px; padding-inline: 2px;
    font-family: var(--gl-font-mono); font-size: 13px; font-weight: 500; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--gl-muted); transition: color .15s;
}
.gl-brand-blog:hover { color: var(--gl-accent); }

.gl-nav { display: none; min-width: 0; }
.gl-nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.gl-nav-item { position: relative; }
.gl-nav-trigger, .gl-nav-link {
    position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px;
    border-radius: var(--gl-radius-btn); font-size: 14px; font-weight: 500; color: var(--gl-muted); white-space: nowrap;
    transition: color .15s;
}
.gl-nav-trigger .gl-icon, .gl-nav-link .gl-icon { width: 15px; height: 15px; color: var(--gl-dim); transition: color .15s; }
.gl-nav-trigger .gl-icon-chevron-down { width: 14px; height: 14px; transition: transform .2s; }
.gl-nav-trigger:hover, .gl-nav-link:hover, .gl-nav-trigger[aria-expanded="true"] { color: var(--gl-ink); }
.gl-nav-trigger:hover .gl-icon, .gl-nav-link:hover .gl-icon, .gl-nav-trigger[aria-expanded="true"] .gl-icon { color: var(--gl-accent); }
.gl-nav-trigger[aria-expanded="true"] .gl-icon-chevron-down { transform: rotate(180deg); }

.gl-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 340px; padding: 8px;
    background: var(--gl-surface); border: 1px solid var(--gl-line-strong); border-radius: var(--gl-radius-card);
    box-shadow: 0 18px 48px rgba(14, 28, 56, .6);
    animation: gl-fade .16s ease-out;
}
.gl-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* hover bridge */
.gl-menu--wide { width: min(860px, calc(100vw - 32px)); }
.gl-menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gl-menu--wide .gl-menu-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gl-entry-link {
    display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 12px;
    border-radius: 12px; text-align: left; transition: background-color .15s;
}
.gl-entry-icon {
    display: grid; place-items: center; flex: none; width: 36px; height: 36px;
    border: 1px solid var(--gl-line); border-radius: 10px; background: var(--gl-bg); color: var(--gl-dim);
    transition: color .15s, border-color .15s;
}
.gl-entry-icon .gl-icon { width: 17px; height: 17px; }
.gl-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gl-entry-label { display: inline-flex; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: var(--gl-ink); }
.gl-entry-desc { font-size: 13px; line-height: 1.35; color: var(--gl-muted); }
.gl-entry--menu .gl-entry-link:hover, .gl-entry--menu .gl-entry-link:focus-visible { background: var(--gl-surface-hover); }
.gl-entry-link:hover .gl-entry-icon, .gl-entry-link:focus-visible .gl-entry-icon { color: var(--gl-accent); border-color: var(--gl-accent-line); }
.gl-entry--menu .gl-entry-label { min-height: 20px; }

.gl-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
/* Visibility rules are scoped to .gl-actions so a bare .gk-btn rule elsewhere (e.g. Ghost code
   injection) cannot bring the Menu or Launch button back at the wrong width. */
.gl-actions .gl-launch { display: none; }

/* Sub-bar: the blog's own sections (Ghost navigation, each with a Lucide icon) and search. */
.gl-subbar { border-top: 1px solid var(--gl-line); display: none; }
.gl-subbar-inner { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.gl-blognav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.gl-blognav::-webkit-scrollbar { display: none; }
.gl-blognav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.gl-blognav-link {
    position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
    font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--gl-muted); white-space: nowrap; transition: color .15s;
}
.gl-blognav-link .gl-entry-icon { width: auto; height: auto; border: 0; background: none; }
.gl-blognav-link .gl-icon { width: 14px; height: 14px; }
.gl-blognav-link:hover { color: var(--gl-ink); }
.gl-blognav-link:hover .gl-entry-icon { color: var(--gl-accent); }
.gl-blognav-item.is-current .gl-blognav-link { color: var(--gl-ink); }
.gl-blognav-item.is-current .gl-entry-icon { color: var(--gl-accent); }
.gl-blognav-item.is-current .gl-blognav-link::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--gl-gradient);
}
.gl-subbar-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.gl-subbar-label { font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

.gl-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.gl-progress-bar { display: block; height: 100%; background: var(--gl-gradient); transform: scaleX(0); transform-origin: 0 50%; }

@media (min-width: 560px) {
    .gl-actions .gl-launch { display: inline-flex; }
}
@media (min-width: 768px) {
    .gl-subbar { display: block; }
}
@media (min-width: 1024px) {
    .gl-nav { display: block; }
    .gl-actions .gl-menu-button { display: none; }
}
/* 1024-1180: tighter so the one-line header (lockup 230 + nav + Launch app) never wraps. */
@media (max-width: 1180px) and (min-width: 1024px) {
    .gl-bar { gap: 12px; }
    .gl-nav-trigger, .gl-nav-link { padding: 0 8px; font-size: 13px; }
    .gl-brand-sep, .gl-brand-blog { display: none; }
}
/* Under 560: the logotype alone at 121x22, so the brand and the Menu button fit a 390 px phone with no overflow. */
@media (max-width: 559px) {
    .gl-bar { gap: 12px; }
    .gl-brand-sep, .gl-brand-blog { display: none; }
    .gl-lockup-logotype { width: 121px; height: 22px; }
}

/* 6. Mobile sheet ------------------------------------------------------------------------------- */
.gl-sheet {
    position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
    background: var(--gl-bg); color: var(--gl-ink); animation: gl-fade .18s ease-out;
}
.gl-sheet-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: var(--gl-header-h); border-bottom: 1px solid var(--gl-line);
    width: 100%; padding-inline: var(--gl-gutter); margin: 0;
}
.gl-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gl-gutter) 40px; width: 100%; margin: 0; }
.gl-acc { border-bottom: 1px solid var(--gl-line); }
.gl-acc-head { margin: 0; }
.gl-acc-trigger, .gl-acc-link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px;
    font-family: var(--gl-font-display); font-weight: 700; font-size: 22px; letter-spacing: -.01em;
    color: var(--gl-ink-2); text-align: left;
}
.gl-acc-link { border-bottom: 1px solid var(--gl-line); justify-content: flex-start; }
.gl-acc-title { display: inline-flex; align-items: center; gap: 12px; }
.gl-acc-title .gl-icon { width: 20px; height: 20px; color: var(--gl-dim); }
.gl-acc-trigger .gl-icon-chevron-down { width: 20px; height: 20px; color: var(--gl-dim); transition: transform .2s; }
.gl-acc-trigger[aria-expanded="true"] { color: var(--gl-ink); }
.gl-acc-trigger[aria-expanded="true"] .gl-acc-title .gl-icon { color: var(--gl-accent); }
.gl-acc-trigger[aria-expanded="true"] .gl-icon-chevron-down { transform: rotate(180deg); }
.gl-acc-panel { padding-bottom: 16px; animation: gl-fade .18s ease-out; }
.gl-sheet-blognav .gl-blognav-list { flex-direction: column; gap: 0; }
.gl-sheet-blognav .gl-blognav-link { font-size: 13px; padding: 0 12px; min-height: 48px; width: 100%; }
.gl-sheet-blognav .gl-blognav-item.is-current .gl-blognav-link::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto; }
.gl-sheet-launch { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.gl-sheet-launch .gl-kicker { color: var(--gl-dim); font-size: 11px; letter-spacing: 1px; }
.gl-sheet-social { display: flex; gap: 8px; list-style: none; margin: 24px 0 0; padding: 0; }

/* 7. Hairline grid + cards ---------------------------------------------------------------------- */
.gl-section { padding-block: clamp(32px, 5vw, 56px) 0; }
.gl-section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.gl-section-title {
    font-family: var(--gl-font-display); font-weight: 700; font-size: clamp(26px, 3vw, 36px);
    line-height: 1.1; letter-spacing: -.02em; color: var(--gl-ink);
}
.gl-topics { margin-bottom: 24px; }

.gl-grid {
    display: grid; grid-template-columns: 1fr; gap: 1px; padding: 1px;
}
.gl-grid > * { box-shadow: 0 0 0 1px var(--gl-line); }
@media (min-width: 700px) { .gl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .gl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.gl-card { position: relative; display: flex; flex-direction: column; background: var(--gl-bg); transition: background-color .2s; }
.gl-card:hover { background: var(--gl-bg-alt); }
.gl-card-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px 24px; flex: 1; }
.gl-card-chips { margin-bottom: 2px; }
.gl-card-title {
    font-family: var(--gl-font-display); font-weight: 700; font-size: 21px; line-height: 1.2;
    letter-spacing: -.015em; color: var(--gl-ink);
}
.gl-card-link { transition: color .15s; }
.gl-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.gl-card:hover .gl-card-link { color: var(--gl-accent); }
@supports selector(:has(a)) {
    .gl-card-link:focus-visible { outline: none; }
    .gl-card:has(.gl-card-link:focus-visible), .gl-hero:has(.gl-card-link:focus-visible) { outline: 2px solid var(--gl-accent); outline-offset: 2px; z-index: 3; }
}
.gl-card-excerpt {
    font-size: 15px; line-height: 1.55; color: var(--gl-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gl-card-excerpt:empty { display: none; }
.gl-card-meta {
    display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: auto; padding-top: 6px;
    font-family: var(--gl-font-mono); font-size: 12px; color: var(--gl-dim);
}

.gl-tile {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 220px; padding: 24px;
    background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(111, 141, 223, .2) 10px 11px), var(--gl-bg);
    transition: background-color .2s;
}
.gl-tile:hover { background-color: var(--gl-bg-alt); }
.gl-tile-title { display: inline-flex; align-items: baseline; font-family: var(--gl-font-display); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: -.02em; }
.gl-tile-sub { color: var(--gl-muted); font-size: 14px; }
.gl-tile-arrow { position: absolute; top: 24px; right: 24px; color: var(--gl-accent); transition: transform .2s; }
.gl-tile:hover .gl-tile-arrow { transform: translateX(3px); }
.gl-tile-arrow .gl-icon { width: 22px; height: 22px; }

/* 8. Banners ------------------------------------------------------------------------------------ */
.gl-banner {
    position: relative; overflow: hidden; aspect-ratio: 16 / 9; width: 100%;
    background: var(--gl-bg); isolation: isolate;
}
.gl-banner-fallback {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 75% 20%, rgba(111, 141, 223, .1), transparent 60%),
        radial-gradient(ellipse at 20% 90%, rgba(55, 84, 160, .08), transparent 60%),
        linear-gradient(var(--gl-line) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(90deg, var(--gl-line) 1px, transparent 1px) 0 0 / 40px 40px;
    opacity: .7;
}
.gl-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.gl-banner-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
    opacity: 0; transition: opacity .5s ease-out;
}
.gl-banner.is-drawn .gl-banner-canvas { opacity: 1; }
.gl-banner--card { border-bottom: 1px solid var(--gl-line); }
/* Shorter card banners in the grids (minimal pages): 2:1 from 700 px up. */
@media (min-width: 700px) { .gl-grid .gl-banner--card { aspect-ratio: 2 / 1; } }
.gl-banner--post { aspect-ratio: 16 / 9; border: 1px solid var(--gl-line); border-radius: var(--gl-radius-card); }
.gl-banner--tag { aspect-ratio: 16 / 9; border: 1px solid var(--gl-line); border-radius: var(--gl-radius-card); }
.gl-banner--hero { aspect-ratio: 16 / 9; }
.gl-banner--spark { aspect-ratio: auto; height: 64px; border-bottom: 1px solid var(--gl-line); }
.gl-banner--spark .gl-banner-fallback { opacity: .35; }
@media (min-width: 768px) {
    .gl-banner--post { aspect-ratio: 21 / 9; }
    .gl-banner--tag { aspect-ratio: 2 / 1; }
}

/* 9. Home --------------------------------------------------------------------------------------- */
.gl-masthead { display: grid; gap: 12px; padding-block: clamp(28px, 5vw, 56px) clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--gl-line); }
.gl-masthead-title {
    font-family: var(--gl-font-display); font-weight: 700;
    font-size: clamp(36px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.03em; color: var(--gl-ink);
    max-width: 16ch;
}
.gl-masthead-sub { max-width: 640px; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.5; color: var(--gl-muted); }
.gl-masthead-tagline {
    font-family: var(--gl-font-display); font-weight: 600; font-size: 15px; letter-spacing: .01em;
    background: var(--gl-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
    width: max-content; max-width: 100%;
}
@media (min-width: 1024px) {
    .gl-masthead { grid-template-columns: 1fr minmax(280px, 420px); align-items: end; column-gap: 48px; }
    .gl-masthead .gl-kicker { grid-column: 1 / -1; }
    .gl-masthead-tagline { grid-column: 1 / -1; }
    .gl-masthead-sub { padding-bottom: 6px; }
}

.gl-hero {
    position: relative; display: grid; grid-template-columns: 1fr;
    border: 1px solid var(--gl-line); border-radius: var(--gl-radius-card); overflow: hidden; background: var(--gl-surface);
}
.gl-hero-media { position: relative; border-bottom: 1px solid var(--gl-line); }
.gl-hero-body { position: relative; display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3vw, 40px); }
.gl-hero-title {
    font-family: var(--gl-font-display); font-weight: 700; font-size: clamp(26px, 2.8vw, 40px);
    line-height: 1.12; letter-spacing: -.02em; color: var(--gl-ink);
}
.gl-hero:hover .gl-card-link { color: var(--gl-accent); }
.gl-hero-excerpt { font-size: 16px; line-height: 1.6; color: var(--gl-muted); }
.gl-hero-excerpt:empty { display: none; }
.gl-hero-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gl-accent); }
.gl-hero .gl-card-meta { margin-top: 0; }
@media (min-width: 1024px) {
    .gl-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    .gl-hero-media { border-bottom: 0; border-right: 1px solid var(--gl-line); }
    .gl-hero-media .gl-banner { height: 100%; min-height: 100%; aspect-ratio: auto; }
    .gl-hero-media { min-height: 360px; }
}

.gl-strip-list { display: grid; grid-template-columns: 1fr; gap: 1px; padding: 1px; list-style: none; margin: 0; }
.gl-strip-list > li { box-shadow: 0 0 0 1px var(--gl-line); background: var(--gl-bg); }
.gl-strip-item { display: flex; flex-direction: column; height: 100%; transition: background-color .2s; }
.gl-strip-item:hover { background: var(--gl-bg-alt); }
.gl-strip-text { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 20px; }
.gl-strip-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--gl-ink); }
.gl-strip-label .gl-icon { color: var(--gl-accent); }
.gl-strip-desc { font-size: 14px; color: var(--gl-muted); }
@media (min-width: 700px) { .gl-strip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .gl-strip-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 10. Post head --------------------------------------------------------------------------------- */
.gl-article-head { display: flex; flex-direction: column; gap: 18px; padding-block: clamp(28px, 5vw, 56px) 28px; max-width: 1040px; }
.gl-article-kicker { gap: 8px 12px; color: var(--gl-muted); }
.gl-article-kicker time { color: var(--gl-muted); }
.gl-article-title {
    font-family: var(--gl-font-display); font-weight: 700;
    font-size: clamp(32px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -.03em; color: var(--gl-ink);
    text-wrap: balance;
}
.gl-article-dek { max-width: 760px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--gl-muted); }
.gl-byline {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--gl-line);
}
.gl-byline-authors { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.gl-byline-author { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; color: var(--gl-ink-2); }
.gl-byline-author:hover { color: var(--gl-accent); }
.gl-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gl-line-strong); background: var(--gl-surface); }
.gl-avatar--empty { display: grid; place-items: center; color: var(--gl-dim); }
.gl-avatar--lg { width: 72px; height: 72px; }
.gl-avatar--lg.gl-avatar--empty .gl-icon { width: 28px; height: 28px; }
.gl-avatar--xl { width: 112px; height: 112px; flex: none; }
.gl-avatar--xl.gl-avatar--empty .gl-icon { width: 40px; height: 40px; }
.gl-share { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }

.gl-article-banner { margin-bottom: clamp(28px, 4vw, 48px); }
.gl-article-banner figcaption, .gh-content figcaption {
    display: flex; gap: 10px; margin-top: 12px; font-family: var(--gl-font-mono); font-size: 12.5px; line-height: 1.55; color: var(--gl-dim);
}
.gl-article-banner figcaption::before, .gh-content figcaption::before { content: ''; flex: none; width: 16px; height: 1px; margin-top: .8em; background: var(--gl-accent); }
.gh-content figcaption a, .gl-article-banner figcaption a { color: var(--gl-accent); text-decoration: underline; text-underline-offset: 3px; }

.gl-article-foot { display: grid; row-gap: 28px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--gl-line); }
.gl-article-foot > * { grid-column: main; }
.gl-article-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.gl-article-share .gl-kicker { color: var(--gl-muted); }
.gl-authorbox {
    display: flex; gap: 20px; align-items: flex-start; padding: 24px;
    border: 1px solid var(--gl-line); border-radius: var(--gl-radius-card); background: var(--gl-surface);
}
.gl-authorbox-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gl-authorbox .gl-kicker { color: var(--gl-dim); font-size: 11px; }
.gl-authorbox-name { font-family: var(--gl-font-display); font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.gl-authorbox-name a:hover { color: var(--gl-accent); }
.gl-authorbox-bio { color: var(--gl-muted); font-size: 15px; }
.gl-comments { margin-top: 48px; }
.gl-comments > * { grid-column: main; }
.gl-related .gl-kicker-num::after { width: 16px; }

/* 11. Content ----------------------------------------------------------------------------------- */
.gh-canvas, .kg-width-full.kg-content-wide {
    --main: min(var(--content-width, 720px), 100% - var(--container-gap) * 2);
    --wide: minmax(0, calc((var(--container-width, 1200px) - var(--content-width, 720px)) / 2));
    --full: minmax(var(--container-gap), 1fr);
    display: grid;
    grid-template-columns:
        [full-start] var(--full)
        [wide-start] var(--wide)
        [main-start] var(--main) [main-end]
        var(--wide) [wide-end]
        var(--full) [full-end];
}
.gh-canvas > * { grid-column: main; min-width: 0; }
.kg-width-wide, .kg-content-wide > div { grid-column: wide; }
.kg-width-full { grid-column: full; }

.gh-content { font-size: 17px; line-height: 1.75; color: var(--gl-ink-2); overflow-wrap: break-word; }
.gh-content > * + * { margin-top: 28px; }
.gh-content > .kg-width-full + .kg-width-full:not(.kg-width-full.kg-card-hascaption + .kg-width-full) { margin-top: 0; }
.gh-content > [id]:not(:first-child) { margin-top: 56px; }
.gh-content > [id] + p { margin-top: 12px; }
.gh-content > :is(hr, blockquote, iframe) { position: relative; margin-top: 48px; }
.gh-content > :is(hr, blockquote, iframe) + * { margin-top: 48px !important; }
.gh-content :not(.kg-card):not(table):not([id]) + :is(.kg-card, table) { margin-top: 48px; }
.gh-content :is(.kg-card, table) + :not(.kg-card):not(table):not([id]) { margin-top: 48px; }
.gh-content :not(.kg-card):not([id]) + .kg-card.kg-width-full { margin-top: 68px; }
.gh-content .kg-card.kg-width-full + :not(.kg-card):not([id]) { margin-top: 68px; }

.gh-content h1, .gh-content h2, .gh-content h3, .gh-content h4, .gh-content h5, .gh-content h6 {
    font-family: var(--gl-font-display); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--gl-ink);
}
.gh-content h1 { font-size: 36px; }
.gh-content h2 { font-size: 30px; }
.gh-content h3 { font-size: 24px; }
.gh-content h4 { font-size: 20px; }
.gh-content h5, .gh-content h6 { font-family: var(--gl-font-mono); font-weight: 500; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gl-accent); }
.gh-content strong { color: var(--gl-ink); font-weight: 600; }
.gh-content a:not([class]) { color: var(--gl-accent); text-decoration: underline; text-decoration-color: var(--gl-accent-line); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .15s, color .15s; }
.gh-content a:not([class]):hover { color: var(--gl-accent-hover); text-decoration-color: currentColor; }
.gh-content :is(ul, ol) { padding-left: 26px; }
.gh-content li + li, .gh-content li :is(ul, ol) { margin-top: 8px; }
.gh-content ul > li::marker { color: var(--gl-accent); }
.gh-content ol > li::marker { color: var(--gl-accent); font-family: var(--gl-font-mono); font-size: .85em; }
.gh-content hr { width: 100%; height: 1px; border: 0; background: var(--gl-line-strong); }
.gh-content blockquote:not([class]) {
    padding: 4px 0 4px 24px; border-left: 2px solid var(--gl-accent);
    font-size: 20px; line-height: 1.55; color: var(--gl-ink);
}
.gh-content blockquote.kg-blockquote-alt {
    padding: 8px 0; border: 0; text-align: center;
    font-family: var(--gl-font-display); font-weight: 700; font-size: 26px; line-height: 1.25; font-style: normal; color: var(--gl-ink);
}
.gh-content :not(pre) > code {
    padding: .12em .4em; border: 1px solid var(--gl-line); border-radius: 6px; background: var(--gl-surface);
    font-family: var(--gl-font-mono); font-size: .84em; color: var(--gl-accent-hover);
}
.gh-content .gl-table, .gh-content .kg-table-card { overflow-x: auto; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.gh-content th { font-family: var(--gl-font-mono); font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--gl-dim); text-align: left; }
.gh-content :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--gl-line); white-space: nowrap; }
.gh-content img, .gh-content video { border-radius: 12px; }
.kg-image { margin-inline: auto; }
.kg-width-full img, .kg-width-full video { border-radius: 0; }
.kg-embed-card { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* 12. Code blocks (Plex Mono on a surface, label + copy) ---------------------------------------- */
.gh-content pre {
    margin: 0; overflow-x: auto; padding: 14px 16px; background: var(--gl-surface);
    border: 1px solid var(--gl-line); border-radius: 12px;
    font-family: var(--gl-font-mono); font-size: 13.5px; line-height: 1.65; color: var(--gl-ink-2); tab-size: 4;
}
.gh-content pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.gh-content .gl-code { border: 1px solid var(--gl-line); border-radius: 12px; background: var(--gl-surface); overflow: hidden; }
.gh-content .gl-code pre { border: 0; border-radius: 0; }
.gl-code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 16px; padding-right: 4px; border-bottom: 1px solid var(--gl-line); }
.gl-code-lang { font-family: var(--gl-font-mono); font-size: 11px; letter-spacing: 1px; color: var(--gl-dim); }
.gl-code-copy { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--gl-radius-btn); font-family: var(--gl-font-mono); font-size: 11px; color: var(--gl-muted); transition: color .15s, background-color .15s; }
.gl-code-copy:hover { color: var(--gl-accent); background: var(--gl-surface-hover); }
/* Ghost's code card with a caption. */
.gh-content .kg-code-card figcaption { margin-top: 10px; }

/* 13. Ghost cards on the dark theme ------------------------------------------------------------- */
.kg-callout-card.kg-card { border-radius: 12px; }
.kg-callout-card-grey, .kg-callout-card-white { background: var(--gl-surface) !important; border: 1px solid var(--gl-line); }
.kg-callout-card-accent { background: rgba(111, 141, 223, .08) !important; border: 1px solid var(--gl-accent-line); }
.kg-callout-card-accent, .kg-callout-card-accent .kg-callout-text { color: var(--gl-ink) !important; }
.kg-callout-card-accent a { text-decoration: underline; }
.kg-callout-text { font-size: .95em; }
.kg-toggle-card.kg-card { border: 1px solid var(--gl-line); border-radius: 12px; background: var(--gl-surface); box-shadow: none; }
.kg-toggle-card .kg-toggle-heading-text { font-family: var(--gl-font-display); font-weight: 600; font-size: 19px; color: var(--gl-ink); }
.kg-toggle-card svg { color: var(--gl-accent); }
.kg-bookmark-card a.kg-bookmark-container,
.kg-bookmark-card a.kg-bookmark-container:hover {
    background: var(--gl-surface) !important; color: var(--gl-ink) !important;
    border: 1px solid var(--gl-line) !important; border-radius: 12px !important; box-shadow: none !important;
}
.kg-bookmark-card a.kg-bookmark-container:hover { border-color: var(--gl-accent-line) !important; }
.kg-bookmark-content { padding: 18px 20px !important; }
.kg-bookmark-title { font-weight: 600; color: var(--gl-ink); }
.kg-bookmark-description { color: var(--gl-muted) !important; }
.kg-bookmark-metadata { color: var(--gl-dim) !important; font-family: var(--gl-font-mono); font-size: 12px !important; }
.kg-bookmark-thumbnail img { border-radius: 0 12px 12px 0; }
.kg-button-card .kg-btn { border-radius: var(--gl-radius-btn) !important; font-weight: 600; min-height: 44px; }
.kg-button-card .kg-btn-accent { background: var(--gl-accent) !important; color: var(--gl-bg) !important; }
.kg-header-card h2.kg-header-card-header, .kg-header-card .kg-header-card-heading { font-family: var(--gl-font-display); letter-spacing: -.02em; }
.kg-product-card .kg-product-card-container { background: var(--gl-surface) !important; border: 1px solid var(--gl-line) !important; box-shadow: none !important; color: var(--gl-ink) !important; }
.kg-product-card-title { font-family: var(--gl-font-display); }
.kg-file-card .kg-file-card-container { background: var(--gl-surface) !important; border: 1px solid var(--gl-line) !important; color: var(--gl-ink) !important; border-radius: 12px !important; }
.kg-file-card-container:hover { border-color: var(--gl-accent-line) !important; }
.kg-file-card-icon { color: var(--gl-accent); }
.kg-audio-card { background: var(--gl-surface) !important; border: 1px solid var(--gl-line); box-shadow: none !important; }
.kg-cta-card { border-radius: 12px; }
.gh-content .kg-gallery-image img { border-radius: 0; }
/* No email opt-in on this blog: hide any sign-up card left in a post's content. */
.kg-signup-card { display: none !important; }

/* 14. Footer ------------------------------------------------------------------------------------ */
.gl-footer { margin-top: clamp(48px, 7vw, 88px); border-top: 1px solid var(--gl-line); background: var(--gl-bg-footer); }
.gl-footer-main { display: grid; gap: 40px; padding-block: 48px 40px; }
.gl-footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.gl-footer-logo { display: inline-flex; border-radius: 8px; }
.gl-footer-logo .gl-logo { margin: 6px 0; }
.gl-footer-tagline {
    font-family: var(--gl-font-display); font-weight: 600; font-size: 16px;
    background: var(--gl-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gl-footer-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 24px; }
.gl-footer-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gl-footer-head { font-family: var(--gl-font-mono); font-size: 11px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; color: var(--gl-dim); }
.gl-footer-list { list-style: none; margin: 0; padding: 0; }
.gl-entry--footer .gl-entry-link { align-items: center; gap: 8px; padding: 0; min-height: 44px; border-radius: 6px; font-size: 14px; color: var(--gl-ink-2); }
.gl-entry--footer .gl-entry-icon { width: auto; height: auto; border: 0; background: none; }
.gl-entry--footer .gl-entry-icon .gl-icon { width: 14px; height: 14px; }
.gl-entry--footer .gl-entry-label { font-size: 14px; font-weight: 500; color: inherit; }
.gl-entry--footer .gl-entry-link:hover { color: var(--gl-accent); }
.gl-footer-legal {
    display: flex; flex-direction: column; gap: 16px; padding-block: 24px 56px; border-top: 1px solid var(--gl-line);
    font-family: var(--gl-font-mono); font-size: 12px; line-height: 1.6; color: var(--gl-dim);
}
.gl-footer-legal-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.gl-powered { display: inline-flex; flex: none; border-radius: 8px; }
.gl-powered img { width: auto; height: 30px; }
@media (max-width: 599px) { .gl-powered img { height: 26px; } }
.gl-footer-copy { flex: none; }
.gl-footer-legal-links { display: inline-flex; flex-wrap: wrap; gap: 0 16px; }
.gl-footer-legal-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gl-dim); }
.gl-footer-legal-links a:hover { color: var(--gl-accent); }
.gl-footer-secondary .gl-blognav-list { flex-wrap: wrap; }
.gl-footer-secondary .gl-blognav-link { font-size: 11px; padding: 0 8px 0 0; color: var(--gl-dim); }
.gl-footer-secondary:empty, .gl-footer-secondary .gl-blognav-list:empty { display: none; }
/* One column on phones, two on tablets, three from 1024, five from 1280: no column is more than seven rows. */
@media (min-width: 700px) {
    .gl-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gl-entry--footer .gl-entry-link { min-height: 32px; }
}
@media (min-width: 1024px) {
    .gl-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
    .gl-footer-legal { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
}
@media (min-width: 1280px) { .gl-footer-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* 15. Archive, author, error, empty ------------------------------------------------------------- */
.gl-archive-head { display: grid; gap: 24px; padding-block: clamp(28px, 5vw, 56px) 8px; }
.gl-archive-copy { display: flex; flex-direction: column; gap: 14px; }
.gl-archive-title {
    font-family: var(--gl-font-display); font-weight: 700;
    font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: -.03em;
}
.gl-archive-sub { max-width: 640px; font-size: 17px; color: var(--gl-muted); }
.gl-archive-count { font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gl-dim); }
.gl-archive-head--author { grid-template-columns: auto 1fr; align-items: center; }
.gl-author-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; list-style: none; margin: 0; padding: 0; font-family: var(--gl-font-mono); font-size: 12px; color: var(--gl-dim); }
.gl-author-links .gl-textlink { font-family: var(--gl-font-mono); font-size: 12px; }
@media (min-width: 1024px) {
    .gl-archive-head--banner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: end; gap: 48px; }
}
@media (max-width: 599px) {
    .gl-archive-head--author { grid-template-columns: 1fr; }
}

/* The theme draws the one empty state. An old Ghost admin code injection prepends its own "first posts" intro
   (section.gl-intro): never shown here, and assets/js/gully.js removes it and its stylesheet. */
.gl-intro { display: none !important; }

.gl-empty, .gl-error-box {
    display: grid; gap: 32px; padding-block: clamp(28px, 5vw, 56px) 0; align-items: center;
}
.gl-mascot-box { display: flex; justify-content: center; }
.gl-empty .gl-mascot-box { order: -1; }
.gl-empty .gl-mascot, .gl-error-box .gl-mascot { width: auto; height: 319px; }
.gl-empty-copy, .gl-error-copy { display: flex; flex-direction: column; gap: 16px; }
.gl-empty-title, .gl-error-title {
    font-family: var(--gl-font-display); font-weight: 700;
    font-size: clamp(34px, 4.8vw, 60px); line-height: 1.04; letter-spacing: -.03em;
}
.gl-empty-sub, .gl-error-sub { max-width: 560px; font-size: 17px; color: var(--gl-muted); }
.gl-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.gl-error-details { margin-top: 16px; font-family: var(--gl-font-mono); font-size: 12px; color: var(--gl-dim); }
.gl-error-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
@media (min-width: 1024px) {
    .gl-empty, .gl-error-box { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; }
    .gl-empty .gl-mascot-box { order: 0; }
    .gl-empty .gl-mascot, .gl-error-box .gl-mascot { width: auto; height: 448px; }
    .gl-error-box--plain { grid-template-columns: 1fr; }
}

/* 16. Toasts, pagination ------------------------------------------------------------------------ */
/* Bottom-right stack: night surface, 22 px corners, Lucide icon, a progress bar that is the toast's life. */
.gl-toasts {
    position: fixed; right: 16px; bottom: 16px; z-index: 90;
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
    width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
.gl-toast {
    position: relative; overflow: hidden; pointer-events: auto; cursor: pointer;
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px 16px;
    border: 1px solid var(--gl-line-strong); border-radius: var(--gl-radius-toast);
    background: var(--gl-surface); color: var(--gl-ink); font-size: 14px; font-weight: 500;
    box-shadow: 0 12px 32px rgba(14, 28, 56, .55);
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.gl-toast.is-on { opacity: 1; transform: none; }
.gl-toast.is-leaving { opacity: 0; transform: translateX(12px); }
.gl-toast .gl-icon { width: 20px; height: 20px; color: var(--gl-accent); }
.gl-toast--error .gl-icon { color: var(--gl-error); }
.gl-toast--error { border-color: rgba(241, 243, 248, .4); }
.gl-toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--gl-gradient); transform-origin: 0 50%; }
.gl-toast.is-on .gl-toast-bar { animation: gl-toast-life 3.2s linear forwards; }
.gl-toast:hover .gl-toast-bar { animation-play-state: paused; }
@keyframes gl-toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.gl-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 40px; }
.gl-pagination-count { font-family: var(--gl-font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gl-dim); text-align: center; }
.gl-pagination-spacer { min-width: 44px; }

@keyframes gl-fade { from { opacity: 0; } to { opacity: 1; } }

/* 17. Ticker (the live element on every page) --------------------------------------------------- */
.gl-ticker { border-bottom: 1px solid var(--gl-line); background: var(--gl-surface); }
.gl-ticker-inner { display: flex; align-items: center; gap: 16px; min-height: 40px; }
.gl-ticker-live {
    display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px;
    font-family: var(--gl-font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gl-muted);
}
.gl-ticker-live:hover { color: var(--gl-accent); }
.gl-ticker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gl-line-hover); }
.gl-ticker.is-live .gl-ticker-dot { background: var(--gl-accent); box-shadow: 0 0 0 0 rgba(111, 141, 223, .6); animation: gl-pulse 1.8s ease-out infinite; }
.gl-ticker.is-stale .gl-ticker-dot { background: var(--gl-line-hover); animation: none; box-shadow: none; }
@keyframes gl-pulse { 0% { box-shadow: 0 0 0 0 rgba(111, 141, 223, .6); } 100% { box-shadow: 0 0 0 9px rgba(111, 141, 223, 0); } }
.gl-ticker-track { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; }
.gl-ticker-track::before, .gl-ticker-track::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 24px; z-index: 1; pointer-events: none;
}
.gl-ticker-track::before { left: 0; background: linear-gradient(90deg, var(--gl-surface), transparent); }
.gl-ticker-track::after { right: 0; background: linear-gradient(270deg, var(--gl-surface), transparent); }
.gl-ticker-list { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0 14px; flex: none; }
.gl-ticker-item { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; min-height: 40px; }
.gl-ticker-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gl-muted); }
.gl-ticker-label .gl-icon { width: 13px; height: 13px; color: var(--gl-accent); }
.gl-ticker-value { font-family: var(--gl-font-mono); font-size: 13px; font-weight: 500; color: var(--gl-ink); font-variant-numeric: tabular-nums; }
.gl-ticker-track.is-scrolling .gl-ticker-list { animation: gl-marquee 36s linear infinite; }
.gl-ticker-track.is-scrolling:hover .gl-ticker-list { animation-play-state: paused; }
@keyframes gl-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.gl-ticker-spark { flex: none; width: 120px; height: 28px; opacity: 0; transition: opacity .6s; }
.gl-ticker-spark.is-drawn { opacity: 1; }
.gl-ticker-spark .gl-spark-line { stroke-dasharray: 400; stroke-dashoffset: 400; }
.gl-ticker-spark.is-drawn .gl-spark-line { animation: gl-draw 1.6s ease-out forwards; }
@keyframes gl-draw { to { stroke-dashoffset: 0; } }
.gl-ticker-updated { flex: none; font-family: var(--gl-font-mono); font-size: 11px; color: var(--gl-dim); }
/* Header live pill (gullylabs.xyz style): static dot, last read time; shown from 1280, the Docs pill from 1440. */
.gl-actions .gl-livepill, .gl-actions .gl-docs { display: none; }
.gl-livepill {
    align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--gl-line-strong);
    border-radius: var(--gl-radius-btn); background: var(--gl-surface); font-size: 13px; font-weight: 600;
    color: var(--gl-ink); white-space: nowrap; transition: border-color .15s;
}
.gl-livepill:hover { border-color: var(--gl-accent-line); }
.gl-livepill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gl-line-hover); }
.gl-livepill.is-live .gl-livepill-dot { background: var(--gl-accent); }
.gl-livepill-time { font-family: var(--gl-font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--gl-muted); }
.gl-livepill-time:empty { display: none; }
@media (min-width: 1280px) { .gl-actions .gl-livepill { display: inline-flex; } }
@media (min-width: 1440px) { .gl-actions .gl-docs { display: inline-flex; } }

@media (max-width: 767px) {
    .gl-ticker-spark, .gl-ticker-updated { display: none; }
    .gl-ticker-livetext { display: none; }
}

/* 18. Reduced motion (keep fades and colour changes, drop movement) ----------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-delay: 0s !important;
        animation-duration: .2s !important;
        animation-iteration-count: 1 !important;
        transition-property: opacity, color, background-color, border-color, outline-color, text-decoration-color, visibility !important;
        transition-duration: .15s !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
    .gl-ticker-track { flex-wrap: wrap; }
    .gl-ticker-list { flex-wrap: wrap; animation: none !important; }
    .gl-toast-bar { animation: none !important; transform: scaleX(1); }
    .gk-btn::after { display: none; }
}
