:root {
    --accent: #5f6fff;
    --accent-soft: #eef1ff;
    --bg: #fcfcfd;
    --surface: #ffffff;
    --surface-alt: #f5f7fb;
    --line: #d9dfeb;
    --text: #172033;
    --muted: #5c667a;
    --heading: #111827;
    --shadow: 0 18px 60px rgba(46, 62, 99, 0.08);
    --radius: 22px;
    --radius-sm: 14px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(95, 111, 255, 0.08), transparent 24%),
        radial-gradient(circle at top left, rgba(83, 201, 183, 0.08), transparent 20%),
        var(--bg);
    line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1rem; }
strong { color: var(--heading); }

.site-shell { min-height: 100vh; }
.site-main { padding-bottom: 4rem; }
.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}
.section-gap { margin-top: 4rem; }
.section-gap-tight { margin-top: 2rem; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.lede,
.hero-text,
.post-custom-excerpt {
    color: var(--muted);
    font-size: clamp(1.05rem, 0.96rem + 0.4vw, 1.18rem);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    background: rgba(252, 252, 253, 0.85);
    border-bottom: 1px solid rgba(217, 223, 235, 0.7);
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 84px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}
.brand-mark {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #69bf8f);
    box-shadow: var(--shadow);
}
.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.brand-text strong {
    font-size: 1rem;
    line-height: 1.1;
}
.brand-text small {
    font-size: 0.82rem;
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.site-nav ul,
.site-footer .gh-navigation ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.site-nav a,
.site-footer a { color: var(--muted); }
.site-nav a:hover,
.site-footer a:hover,
.text-link:hover { color: var(--accent); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
}
.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 14px;
    padding: 0.8rem;
}
.nav-toggle span:not(.u-hidden) {
    display: block;
    width: 1.2rem;
    height: 2px;
    margin: 0.16rem 0;
    background: var(--heading);
}
.u-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #69bf8f);
    box-shadow: 0 12px 30px rgba(47, 157, 115, 0.20);
}
.button-secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--heading);
}
.button-block { width: 100%; }
.text-link {
    color: var(--accent);
    font-weight: 700;
}

.hero,
.archive-hero {
    display: grid;
    gap: 2rem;
    padding-top: 2.5rem;
}
.hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
    align-items: stretch;
    padding-top: 3rem;
}
.hero h1,
.archive-hero h1,
.post-title,
.page-header h1 {
    margin: 0 0 1rem;
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: var(--heading);
}
.hero h1 { font-size: clamp(2.8rem, 2rem + 3.2vw, 5rem); }

.hero-site-title {
    margin: 0 0 1rem;
    line-height: 0.92;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-size: clamp(3.2rem, 2.2rem + 4.4vw, 5.8rem);
    max-width: none;
}


.hero-description {
    max-width: 34rem;
    font-size: clamp(1.15rem, 1rem + 0.55vw, 1.5rem);
}
.archive-hero h1,
.page-header h1 { font-size: clamp(2.2rem, 1.8rem + 2vw, 3.5rem); }
.post-title { font-size: clamp(2.2rem, 1.7rem + 2.5vw, 4rem); }
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1.4rem 0;
}
.hero-points,
.sidebar-list,
.check-list,
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hero-points {
    display: grid;
    gap: 0.75rem;
    color: var(--muted);
}
.hero-points li,
.sidebar-list li,
.check-list li {
    position: relative;
    padding-left: 1.5rem;
}
.hero-points li::before,
.sidebar-list li::before,
.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.68rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #69bf8f);
}
.card {
    background: color-mix(in srgb, var(--surface) 88%, white);
    border: 1px solid rgba(217, 223, 235, 0.85);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-panel {
    display: grid;
    gap: 1rem;
}
.hero-panel-card,
.post-card-body,
.feature-card,
.subscribe-panel,
.access-panel,
.tier-card,
.sticky-card {
    padding: 1.35rem;
}
.stack-card {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.96)),
        linear-gradient(135deg, rgba(95,111,255,0.12), rgba(83,201,183,0.13));
}
.stack-card-label,
.mini-kicker,
.project-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}
.hero-mini-grid,
.feature-grid,
.membership-grid,
.footer-grid {
    display: grid;
    gap: 1rem;
}
.hero-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-panel {
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.78);
}
.mini-panel strong { display: block; line-height: 1.2; }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-card h3,
.post-card h3,
.tier-card h2,
.subscribe-panel h2,
.access-panel h2,
.stack-card h2,
.section-heading h2,
.footer-heading,
.sticky-card h2 {
    margin: 0 0 0.7rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--heading);
}
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.feature-banner,
.subscribe-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem;
}
.card-featured {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.98)),
        linear-gradient(120deg, rgba(95,111,255,0.11), rgba(83,201,183,0.11));
}
.meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.92rem;
}
.meta-row-wrap { flex-wrap: wrap; }
.meta-row > *:not(:first-child)::before {
    content: "•";
    margin-right: 0.75rem;
    color: #a7b0c0;
}
.meta-row > a::before { display: none; }
.meta-row .tag-link::before,
.meta-row .project-badge::before { display: none; }

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}
.post-card {
    overflow: clip;
    display: flex;
    flex-direction: column;
}
.post-card-image {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(95,111,255,0.15), rgba(83,201,183,0.15));
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-card h3 {
    font-size: 1.35rem;
    margin-top: 0.5rem;
}
.post-card p { color: var(--muted); }
.tag-link,
.tag-pill {
    color: var(--accent);
    font-weight: 700;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.tag-pill {
    padding: 0.42rem 0.72rem;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
}

.post-header,
.page-header {
    padding-top: 2rem;
}
.post-hero-image {
    margin: 2rem 0 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: var(--surface);
}
.post-hero-image figcaption {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.sticky-card {
    position: sticky;
    top: 104px;
    align-self: start;
}
.post-content-area { min-width: 0; }
.post-content,
.page-content {
    font-size: 1.06rem;
}
.post-content > *:first-child,
.page-content > *:first-child { margin-top: 0; }
.gh-content :is(h2, h3, h4) {
    margin-top: 2rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--heading);
}
.gh-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--accent);
    background: var(--surface-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.gh-content pre,
.gh-content code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.gh-content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: #eef3fb;
    border: 1px solid #dce5f4;
}
.gh-content code {
    font-size: 0.94em;
    background: rgba(95,111,255,0.08);
    padding: 0.12em 0.32em;
    border-radius: 0.4em;
}
.gh-content pre code {
    background: none;
    padding: 0;
}
.gh-content hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}
.gh-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.gh-content th,
.gh-content td {
    border-bottom: 1px solid var(--line);
    padding: 0.8rem;
    text-align: left;
}
.gh-content .kg-card {
    margin: 1.7rem 0;
}
.access-panel { margin-top: 2rem; }
.post-footer { margin-top: 2rem; }
.narrow-page { max-width: 860px; }

.membership-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tier-card { display: flex; flex-direction: column; }
.tier-card .button { margin-top: auto; }
.check-list { display: grid; gap: 0.8rem; margin: 1rem 0 1.2rem; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}
.pagination-label { color: var(--muted); }

.site-footer {
    border-top: 1px solid rgba(217, 223, 235, 0.7);
    background: rgba(255,255,255,0.55);
    padding: 2rem 0 3rem;
}
.footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
.footer-heading {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}
.footer-copy { color: var(--muted); max-width: 42ch; }
.footer-links { display: grid; gap: 0.55rem; }

@media (max-width: 1024px) {
    .post-layout,
    .feature-grid,
    .membership-grid,
    .footer-grid,
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .post-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}

@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; }
    .site-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        background: rgba(255,255,255,0.97);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 1rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }
    .site-nav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .site-nav ul,
    .nav-actions { flex-direction: column; align-items: stretch; }
    .nav-actions { margin-left: 0; }
    .feature-grid,
    .membership-grid,
    .post-grid,
    .footer-grid,
    .hero-mini-grid {
        grid-template-columns: 1fr;
    }
    .feature-banner,
    .subscribe-panel,
    .section-heading {
        flex-direction: column;
        align-items: start;
    }
}


/* Ghost editor width support */
.gh-content .kg-width-wide,
.page-content .kg-width-wide,
.post-content .kg-width-wide {
    width: min(100vw - 2rem, calc(var(--container) + 120px));
    max-width: calc(var(--container) + 120px);
    margin-left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full,
.page-content .kg-width-full,
.post-content .kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full img,
.gh-content .kg-width-wide img {
    width: 100%;
}

.gh-content .kg-image-card,
.gh-content .kg-gallery-card,
.gh-content .kg-embed-card,
.gh-content .kg-bookmark-card {
    overflow: hidden;
}

.gh-content .kg-bookmark-card .kg-bookmark-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.gh-content .kg-bookmark-content {
    padding: 1rem 1.1rem;
}

.gh-content .kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 820px) {
    .gh-content .kg-width-wide,
    .page-content .kg-width-wide,
    .post-content .kg-width-wide,
    .gh-content .kg-width-full,
    .page-content .kg-width-full,
    .post-content .kg-width-full {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        transform: none;
    }

    .gh-content .kg-bookmark-card .kg-bookmark-container {
        grid-template-columns: 1fr;
    }
}

/* --- Ghostkernel v2 overrides --- */
:root {
    --bg: #f7f4ee;
    --surface: #fffdf9;
    --surface-alt: #eef7f2;
    --line: #ddd3c6;
    --text: #243044;
    --muted: #667085;
    --heading: #162033;
    --shadow: 0 20px 48px rgba(39, 50, 74, 0.08);
    --accent: #2f9d73;
    --games: #6d67d8;
    --electronics: #2f9d8f;
    --printing: #d88735;
    --experiments: #c79a28;
}

body {
    background:
        linear-gradient(rgba(255,255,255,0.28) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.28) 1px, transparent 1px),
        radial-gradient(circle at top left, rgba(47,157,115,0.10), transparent 24%),
        radial-gradient(circle at top right, rgba(93,182,128,0.08), transparent 22%),
        var(--bg);
    background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

.card {
    background: rgba(255, 253, 249, 0.92);
    border-color: rgba(221, 211, 198, 0.95);
    box-shadow: var(--shadow);
}

.hero-v2 {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: start;
    padding-top: 3.25rem;
}

.hero-v2 .hero-text { max-width: 36rem; }

.hero-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
}
.hero-strip a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(47, 157, 115, 0.08);
    color: var(--heading);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    line-height: 1;
}
.hero-strip a:hover {
    background: rgba(47, 157, 115, 0.14);
}

.hero-module-body {
    margin-top: 1.5rem;
}
.hero-module-body > *:first-child {
    margin-top: 0;
}
.hero-module-body > *:last-child {
    margin-bottom: 0;
}
.hero-module-body p a,
.hero-module-body li a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    margin: 0 0.55rem 0.6rem 0;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(47, 157, 115, 0.08);
    color: var(--heading);
    font-weight: 700;
    font-size: 0.92rem;
    border: 1px solid rgba(47, 157, 115, 0.12);
}
.hero-module-body p,
.hero-module-body ul,
.hero-module-body ol {
    margin: 0.85rem 0 0;
}
.hero-module-body ul,
.hero-module-body ol {
    padding-left: 0;
    list-style: none;
}

.hero-notes {
    padding: 1.25rem;
    display: grid;
    gap: 0.9rem;
}
.note-row {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(242, 238, 230, 0.72);
    border: 1px solid rgba(221, 211, 198, 0.85);
}
.note-label {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-heading-band { margin-bottom: 1rem; }
.recent-writing-card {
    padding: 0.6rem;
    overflow: hidden;
}
.recent-writing-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.recent-writing-item {
    padding: 1.2rem 1.15rem 1.25rem;
    min-height: 100%;
    border-right: 1px solid rgba(221, 211, 198, 0.75);
}
.recent-writing-item:last-child { border-right: 0; }
.recent-writing-item.is-first {
    background: linear-gradient(180deg, rgba(47, 157, 115, 0.09), transparent 78%);
    border-radius: 16px;
}
.recent-writing-meta,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.7rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
}
.recent-writing-item h3,
.post-card h3,
.project-card h3,
.featured-project-card h3 {
    margin: 0.55rem 0 0.65rem;
    font-size: 1.28rem;
    line-height: 1.15;
}
.recent-writing-item p,
.post-card p,
.project-card p { color: var(--muted); }

.featured-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}
.featured-project-card {
    overflow: hidden;
}
.featured-project-card .post-card-image {
    aspect-ratio: 16 / 9;
    background: rgba(242, 238, 230, 0.9);
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-project-card .post-card-body {
    padding: 1.15rem 1.15rem 1.2rem;
}
.project-card:not(.featured-project-card) .post-card-image { aspect-ratio: 4 / 3; }
.project-meta-top { justify-content: space-between; }
.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}
.project-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.post-type-pill,
.project-badge,
.status-badge,
.mini-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.post-type-pill,
.project-badge { background: rgba(93, 124, 255, 0.1); color: var(--accent); }
.status-badge { background: rgba(22, 32, 51, 0.07); color: var(--heading); }
.status-badge.is-prototype { background: rgba(215, 135, 53, 0.16); color: #9a5a17; }
.status-badge.is-development { background: rgba(93, 124, 255, 0.14); color: #3955cf; }
.status-badge.is-released { background: rgba(47, 157, 143, 0.16); color: #1b7469; }
.status-badge.is-archived { background: rgba(102, 112, 133, 0.14); color: #516071; }
.mini-tag { background: rgba(22, 32, 51, 0.05); color: var(--muted); }

.category-panels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.category-panel {
    padding: 1.15rem;
    min-height: 100%;
}
.category-panel h3 { margin: 0.6rem 0 0.45rem; }
.category-dot {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
}
.category-panel.games .category-dot { background: var(--games); }
.category-panel.electronics .category-dot { background: var(--electronics); }
.category-panel.printing .category-dot { background: var(--printing); }
.category-panel.experiments .category-dot { background: var(--experiments); }

.support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.support-card {
    padding: 1.4rem;
}
.support-card-alt {
    background: linear-gradient(180deg, rgba(47,157,143,0.08), rgba(255,253,249,0.92));
}

.post-grid,
.project-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.post-card,
.project-card { overflow: hidden; }
.post-card-body { padding: 1.05rem 1.05rem 1.15rem; }
.empty-card .post-card-body,
.empty-state { padding: 1.2rem; }
.placeholder-featured { padding: 1.25rem; }

.post-header,
.page-header {
    display: grid;
    gap: 1.5rem;
    align-items: start;
    padding-top: 2.5rem;
}
.post-header.has-image,
.page-header.has-image {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.95fr);
}
.post-top-meta { margin-bottom: 0.7rem; }
.post-hero-image,
.page-hero-image {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(221, 211, 198, 0.9);
    box-shadow: var(--shadow);
}
.post-hero-image img,
.page-hero-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.post-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.post-sidebar { padding: 1.15rem; align-self: start; }
.sticky-card { position: sticky; top: 110px; }
.post-content-area { min-width: 0; }
.gh-content {
    font-size: 1.05rem;
}
.gh-content > * { max-width: 42rem; }
.gh-content > :where(figure, .kg-card, .kg-gallery-card, .kg-embed-card) { max-width: 100%; }
.gh-content .kg-width-wide {
    max-width: min(100%, calc(42rem + 14rem));
}
.gh-content .kg-width-full {
    max-width: none;
    width: calc(100% + 2rem);
    margin-left: -1rem;
}
.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img {
    border-radius: 20px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.4rem;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(221, 211, 198, 0.95);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255,255,255,0.6);
}

.narrow-page { padding-top: 1rem; padding-bottom: 3rem; }
.page-content > * { max-width: 44rem; }

@media (max-width: 1024px) {
    .recent-writing-list,
    .featured-projects-grid,
    .category-panels,
    .support-grid,
    .post-grid,
    .project-library-grid,
    .post-header.has-image,
    .page-header.has-image,
    .post-layout,
    .hero-v2 {
        grid-template-columns: 1fr 1fr;
    }
    .recent-writing-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .recent-writing-item:nth-child(2) { border-right: 0; }
    .category-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}

@media (max-width: 760px) {
    .hero-v2,
    .recent-writing-list,
    .featured-projects-grid,
    .category-panels,
    .support-grid,
    .post-grid,
    .project-library-grid,
    .post-header.has-image,
    .page-header.has-image {
        grid-template-columns: 1fr;
    }
    .recent-writing-item { border-right: 0; border-bottom: 1px solid rgba(221, 211, 198, 0.75); }
    .recent-writing-item:last-child { border-bottom: 0; }
    .project-card-footer { align-items: flex-start; flex-direction: column; }
    .site-main { padding-bottom: 2.5rem; }
    .gh-content .kg-width-full {
        width: 100%;
        margin-left: 0;
    }
}


.hero-visual {
    padding: 1rem;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(47, 157, 115, 0.10), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.94), rgba(238,247,242,0.92));
}
.hero-visual-browser {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}
.hero-visual-browser span {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    background: rgba(127, 140, 170, 0.4);
}
.hero-visual-frame {
    position: relative;
    min-height: 30rem;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(221, 211, 198, 0.85);
    background: rgba(255,255,255,0.78);
}
.hero-visual-image {
    width: 100%;
    height: 100%;
    min-height: 30rem;
    object-fit: cover;
}
.hero-visual-placeholder {
    position: relative;
    min-height: 30rem;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        linear-gradient(rgba(255,255,255,0.28) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.28) 1px, transparent 1px),
        linear-gradient(135deg, rgba(47,157,115,0.12), rgba(255,255,255,0.72));
    background-size: 24px 24px, 24px 24px, auto;
}
.hero-visual-placeholder-grid {
    position: absolute;
    inset: 1.25rem;
    border-radius: 20px;
    border: 1px dashed rgba(47,157,115,0.28);
}
.hero-visual-placeholder-copy {
    position: relative;
    z-index: 1;
    max-width: 22rem;
    text-align: center;
    padding: 1.2rem;
    border-radius: 20px;
    background: rgba(255,253,249,0.86);
    border: 1px solid rgba(221,211,198,0.95);
}
.hero-visual-kicker {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hero-visual-placeholder strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--heading);
}
.page-builder-layout {
    padding-top: 0;
}
.page-builder-layout .page-content > *:first-child {
    margin-top: 0;
}
.page-builder-layout .page-content > .kg-width-full:first-child,
.page-builder-layout .page-content > .kg-width-wide:first-child {
    margin-top: 0;
}
.page-builder-layout .page-content > .kg-width-full:last-child {
    margin-bottom: 0;
}
.page-comments,
.post-comments {
    margin-top: 2rem;
}
.container-narrow {
    max-width: 44rem;
}

@media (max-width: 1024px) {
    .hero-visual-frame,
    .hero-visual-image,
    .hero-visual-placeholder {
        min-height: 24rem;
    }
}

@media (max-width: 760px) {
    .hero-visual-frame,
    .hero-visual-image,
    .hero-visual-placeholder {
        min-height: 18rem;
    }
}


/* --- Ghostkernel v5 tweaks --- */
.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.button-row-wrap .button {
    flex: 1 1 10rem;
}
.simple-placeholder {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(238,247,242,0.92));
}
.simple-placeholder .hero-visual-placeholder-copy {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.shop-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
    margin: 1.5rem 0;
}
.shop-panel {
    padding: 1.25rem;
}
.shop-panel h2 {
    margin: 0.5rem 0 0.6rem;
    font-size: 1.35rem;
}
@media (max-width: 760px) {
    .shop-panel-grid {
        grid-template-columns: 1fr;
    }
}


.hero-visual-placeholder-blank {
    background:
        linear-gradient(rgba(255,255,255,0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.35) 1px, transparent 1px),
        linear-gradient(135deg, rgba(47,157,115,0.08), rgba(255,255,255,0.88));
    background-size: 24px 24px, 24px 24px, auto;
}


/* --- Ghostkernel v10 page-driven homepage modules --- */
.hero-actions-dynamic {
    margin: 1.4rem 0;
}
.hero-actions-dynamic > *:first-child {
    margin-top: 0;
}
.hero-actions-dynamic > *:last-child {
    margin-bottom: 0;
}
.hero-actions-dynamic.gh-content {
    max-width: 42rem;
}
.hero-actions-dynamic .kg-button-card,
.module-card-body .kg-button-card {
    margin: 0;
}
.hero-actions-dynamic .kg-button-card + .kg-button-card,
.module-card-body .kg-button-card + .kg-button-card {
    margin-top: 0.8rem;
}
.hero-actions-dynamic .kg-button-card a,
.hero-actions-dynamic .kg-btn,
.module-card-body .kg-button-card a,
.module-card-body .kg-btn {
    width: auto;
    min-width: 12rem;
    border-radius: 999px;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}
.hero-actions-dynamic .kg-button-card,
.module-card-body .kg-button-card {
    justify-content: flex-start;
}
.hero-actions-empty {
    color: var(--muted);
    font-size: 0.95rem;
}
.hero-visual {
    padding: 0;
    min-height: 30rem;
    background: rgba(255,255,255,0.88);
}
.hero-visual-image,
.hero-visual-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 30rem;
    border-radius: var(--radius);
}
.hero-visual-placeholder {
    background: rgba(255,255,255,0.72);
    border: 2px dashed rgba(47,157,115,0.18);
}
.module-card-body {
    margin-top: 1rem;
}
.module-card-body > *:first-child {
    margin-top: 0;
}
.module-card-body > *:last-child {
    margin-bottom: 0;
}
.module-card-body .kg-button-card,
.module-card-body .kg-btn {
    width: 100%;
}
.module-card-body .kg-button-card a,
.module-card-body .kg-btn {
    min-width: 0;
    width: 100%;
}
.module-card-body p,
.module-card-body .kg-callout-card,
.module-card-body .kg-card {
    margin-top: 1rem;
}

.library-module-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
}
.library-module-body > * {
    margin: 0;
}
.library-module-body .kg-callout-card,
.library-module-body .kg-card:not(.kg-button-card),
.library-module-body .kg-html-card > * {
    height: 100%;
    padding: 1.7rem;
    border-radius: var(--radius);
    border: 1px solid rgba(217, 223, 235, 0.85);
    background: color-mix(in srgb, var(--surface) 88%, white);
    box-shadow: var(--shadow);
}
.library-module-body .kg-callout-card a,
.library-module-body .kg-html-card a {
    text-decoration: none;
}
.library-module-body .kg-callout-text,
.library-module-body .kg-callout-card {
    display: block;
}
.library-module-body .kg-callout-card {
    color: var(--text);
}
.library-module-body .kg-callout-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-bottom: 1.1rem;
    font-size: 0;
    border-radius: 999px;
    background: var(--accent);
}
.library-module-body .kg-callout-text strong,
.library-module-body .kg-html-card h3 {
    display: block;
    margin: 0 0 0.7rem;
    font-size: 1.28rem;
    line-height: 1.15;
    color: var(--heading);
}
.library-module-body .kg-callout-text,
.library-module-body .kg-html-card p {
    color: var(--text);
    font-size: 1rem;
}
.library-module-empty {
    grid-template-columns: 1fr;
}
.library-placeholder-card {
    padding: 1.7rem;
}
@media (max-width: 760px) {
    .library-module-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .hero-visual,
    .hero-visual-image,
    .hero-visual-placeholder {
        min-height: 24rem;
    }
}
@media (max-width: 760px) {
    .hero-visual,
    .hero-visual-image,
    .hero-visual-placeholder {
        min-height: 18rem;
    }
}


/* --- Ghostkernel v12 hero fixes --- */
.hero-module-placeholder {
    margin-top: 1.4rem;
    padding: 1.15rem 1.25rem;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(217,223,235,0.92);
    box-shadow: none;
}
.hero-module-placeholder h3 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
    line-height: 1.3;
}
.hero-module-placeholder p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}
.hero-visual {
    background: rgba(255,255,255,0.88);
}
.hero-visual-placeholder,
.hero-visual-placeholder-blank {
    background: rgba(255,255,255,0.72);
    border: 2px dashed rgba(47,157,115,0.18);
}


/* --- Ghostkernel v13 hero image setting --- */
.hero-visual-placeholder.simple-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.hero-visual-placeholder.simple-placeholder .hero-visual-placeholder-copy {
  max-width: 28rem;
  text-align: left;
}
.hero-visual-placeholder.simple-placeholder h3 {
  margin: 0.35rem 0 0.65rem;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
}
.hero-visual-placeholder.simple-placeholder p:last-child {
  margin-bottom: 0;
}


/* --- Ghostkernel v14 modular + hero layout polish --- */
.hero-v2 {
    align-items: start;
    gap: 2rem;
}
.hero-copy {
    display: flex;
    flex-direction: column;
}
.hero-copy .hero-text {
    max-width: 44rem;
}
.hero-module-body,
.hero-actions-dynamic,
.hero-module-placeholder {
    margin-top: auto;
}
.hero-module-body {
    padding-top: 1.25rem;
}
.hero-actions-dynamic.gh-content {
    max-width: 100%;
}
.hero-actions-dynamic .kg-button-card {
    margin-bottom: 0.75rem;
}
.hero-actions-dynamic .kg-button-card:last-of-type {
    margin-bottom: 0;
}
.hero-actions-dynamic p,
.hero-actions-dynamic ul,
.hero-actions-dynamic ol {
    margin-top: 1rem;
}
.hero-visual {
    display: flex;
    align-self: start;
    justify-self: end;
    width: min(100%, clamp(22rem, 34vw, 34rem));
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.hero-visual-image,
.hero-visual-placeholder,
.hero-visual-placeholder-blank {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.hero-visual-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}
.hero-visual-placeholder,
.hero-visual-placeholder-blank {
    aspect-ratio: 1 / 1;
}
.hero-module-placeholder,
.library-placeholder-card,
.module-card.module-placeholder,
.support-card.module-card {
    background: rgba(255,253,249,0.92);
}
.placeholder-note {
    color: var(--muted);
    font-size: 0.96rem;
}
.source-page-list {
    margin: 0.8rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
}
.source-page-list li + li {
    margin-top: 0.35rem;
}
@media (max-width: 1280px) {
    .hero-visual {
        width: min(100%, clamp(20rem, 36vw, 30rem));
    }
}
@media (max-width: 768px) {
    .hero-v2 {
        grid-template-columns: 1fr;
    }
    .hero-copy {
        min-height: auto;
    }
    .hero-module-body,
    .hero-actions-dynamic,
    .hero-module-placeholder {
        margin-top: 1.35rem;
    }
    .hero-visual {
        width: 100%;
        max-width: none;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }
    .hero-visual,
    .hero-visual-image,
    .hero-visual-placeholder,
    .hero-visual-placeholder-blank {
        height: auto;
    }
}
@media (max-width: 760px) {
    .hero-visual {
        aspect-ratio: 1 / 1;
    }
}


/* --- Ghostkernel v18 hero breakpoint fix --- */
@media (min-width: 769px) {
    .hero.hero-v2 {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
        align-items: stretch;
    }
}


/* --- Ghostkernel v19 archive + hero refinements --- */
@media (min-width: 769px) {
    .hero.hero-v2 {
        grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
        align-items: start;
    }
}
.hero-copy .hero-text {
    max-width: 40rem;
}
.hero-visual {
    min-height: clamp(26rem, 40vw, 36rem);
}
.hero-visual-image,
.hero-visual-placeholder,
.hero-visual-placeholder-blank {
    aspect-ratio: 1 / 1;
}
.project-archive-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}
.project-card-large {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.05fr);
    min-height: 100%;
}
.project-card-large-image {
    min-height: 100%;
    background: linear-gradient(135deg, rgba(47,157,115,0.10), rgba(109,103,216,0.10));
}
.project-card-large-image,
.project-card-large-image img {
    width: 100%;
    height: 100%;
}
.project-card-large-image img {
    object-fit: cover;
}
.project-card-large-body {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.project-card-large-body h3 {
    font-size: clamp(1.5rem, 1.2rem + 0.7vw, 2rem);
    margin: 0;
}
.project-card-large-body p {
    margin: 0;
    color: var(--muted);
}
.project-targets {
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
    background: rgba(47,157,115,0.07);
    border: 1px solid rgba(47,157,115,0.12);
}
.project-card-large-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}
.devlog-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.devlog-card {
    min-height: 100%;
}
.devlog-card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.devlog-card-body h3 {
    margin: 0;
    font-size: 1.35rem;
}
.devlog-card-body p {
    margin: 0;
    color: var(--muted);
}
.post-type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(47,157,115,0.09);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
}
@media (max-width: 1100px) {
    .project-card-large {
        grid-template-columns: 1fr;
    }
    .project-card-large-image {
        aspect-ratio: 16 / 10;
    }
    .devlog-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 820px) {
    .project-archive-grid,
    .devlog-archive-grid {
        grid-template-columns: 1fr;
    }
}


/* --- Ghostkernel v22 hero corrections --- */
.hero.hero-v2 {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 460px);
    align-items: start;
    column-gap: clamp(1.5rem, 2vw, 2.5rem);
}
.hero-copy {
    min-width: 0;
}
.hero.hero-v2 .hero-copy h1,
.hero-site-title {
    max-width: min(100%, 12ch);
    font-size: clamp(2.8rem, 2rem + 2.35vw, 4.6rem);
    line-height: 0.94;
    letter-spacing: -0.04em;
    text-transform: none;
    color: var(--accent);
    margin-right: 0;
    overflow-wrap: anywhere;
}
.hero-copy .hero-text {
    max-width: 34rem;
    font-size: clamp(1.05rem, 0.95rem + 0.28vw, 1.2rem);
    margin-bottom: 1.5rem;
}
.hero-visual {
    width: min(100%, 460px) !important;
    max-width: 460px;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    justify-self: end;
    align-self: start;
    overflow: hidden;
}
.hero-visual-image,
.hero-visual-placeholder,
.hero-visual-placeholder-blank {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
}
.hero-visual-image {
    object-fit: cover;
    object-position: center;
}
@media (max-width: 768px) {
    .hero.hero-v2 {
        grid-template-columns: 1fr;
    }
    .hero.hero-v2 .hero-copy h1,
    .hero-site-title {
        font-size: clamp(2.35rem, 1.9rem + 3.1vw, 3.25rem);
        max-width: 100%;
    }
    .hero-visual {
        width: 100% !important;
        max-width: none;
        justify-self: stretch;
    }
}
