/* Boston Listener site v2 — shared design system (header, footer, buttons, cards, forms). */
:root {
    /* Boston Listener internal UI language (boston-listener-finance-ui), values from FabMind v3 */
    --bg: #f6f2e9;             /* paper */
    --surface: #fcfaf5;        /* tile */
    --surface-soft: #efe9dc;   /* paper 2 */
    --text: #24221d;           /* ink */
    --muted: #655f4e;          /* ink 2, darkened for 4.5:1 on paper */
    --border: #e2dacb;         /* rule */
    --edge: #cfc6b2;
    --brand: #24221d;
    --accent: #24221d;
    --accent-hover: #000000;
    --accent-soft: #efe9dc;
    --lime: #dcef7c;
    --lime-soft: #eef7c4;
    --lime-ink: #4f5c0e;
    --error: #c0442c;
    --success: #3d7a4c;
    --radius: 0;
    --max: 1120px;
    --font: "JetBrains Mono", "IBM Plex Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.lead { font-size: 1.1875rem; color: var(--muted); max-width: 40rem; }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); margin-top: 0.75rem; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 0.75rem 1rem; z-index: 2000; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 0.625rem; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.0625rem; }
.brand:hover { color: var(--text); }
.brand .logo-image { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.site-nav { display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-list > li { position: relative; }
.site-nav .nav-link {
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0.5rem 0.75rem; border-radius: 8px;
    color: var(--text); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}
.site-nav .nav-link:hover { background: var(--surface-soft); color: var(--text); }
.site-nav .nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-caret { width: 10px; height: 10px; transition: transform 0.15s; }
.has-sub:hover .nav-caret, .has-sub:focus-within .nav-caret { transform: rotate(180deg); }
.sub-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 200px;
    margin: 0; padding: 0.375rem; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(31, 41, 51, 0.08);
}
.sub-menu::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { display: block; }
.sub-menu a { display: block; padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9375rem; }
.sub-menu a:hover { background: var(--surface-soft); }
.nav-cta { margin-left: 0.5rem; }
.menu-toggle {
    display: none; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.875rem; min-height: 44px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer;
}
.menu-toggle:hover { background: var(--surface-soft); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; position: relative; transition: transform 0.15s; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        padding: 0.5rem 1.5rem 1.25rem; max-height: calc(100vh - 68px); overflow-y: auto;
    }
    .site-nav.open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav .nav-link { padding: 0.75rem 0.5rem; font-size: 1.0625rem; min-height: 44px; }
    .nav-caret { display: none; }
    .sub-menu { display: block; position: static; border: 0; box-shadow: none; background: transparent; padding: 0 0 0.25rem 1rem; }
    .sub-menu::before { display: none; }
    .sub-menu a { padding: 0.625rem 0.5rem; color: var(--muted); }
    .nav-cta { margin: 0.75rem 0 0; }
    .nav-cta .btn { width: 100%; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 44px; padding: 0.625rem 1.25rem;
    border-radius: 999px; border: 1px solid transparent;
    font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-hover); }
.btn-text { padding-left: 0; padding-right: 0; min-height: 0; color: var(--accent); border-radius: 4px; }
.btn-text:hover { color: var(--accent-hover); text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-soft); color: var(--muted); border-color: var(--border); cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.arrow { transition: transform 0.15s; }
a:hover .arrow, .btn:hover .arrow { transform: translateX(3px); }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.75rem; display: flex; flex-direction: column; gap: 0.625rem;
}
.card p { color: var(--muted); }
.card .card-foot { margin-top: auto; padding-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.card-link { position: relative; transition: border-color 0.15s, box-shadow 0.15s; }
.card-link:hover { border-color: #c9d9e6; box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06); }
.product-card .product-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--surface-soft); margin-bottom: 0.5rem; }
.product-tag { font-size: 0.875rem; color: var(--accent); font-weight: 600; }
.stat { font-size: 2rem; font-weight: 650; color: var(--text); letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.9375rem; }
.fact-list { display: grid; gap: 1rem; margin: 0; }
.fact-list dt { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fact-list dd { margin: 0.125rem 0 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.125rem; }
.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.9375rem; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 0.625rem 0.875rem;
    font: inherit; font-size: 1rem; color: var(--text);
    background: var(--surface); border: 1px solid #c8c0b5; border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #a39a8e; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.25); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18); }
.field.valid input, .field.valid textarea { border-color: var(--success); }
.field-hint { font-size: 0.875rem; color: var(--muted); }
.field .field-error { font-size: 0.875rem; color: var(--error); font-weight: 500; }
.field .field-error::before { content: "! "; font-weight: 700; }
.field-error:empty { display: none; }
.card .form-status, .form-status { font-size: 0.9375rem; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid transparent; }
.form-status:empty { display: none; }
.form .form-status.is-pending { background: var(--surface-soft); color: var(--text); }
.form .form-status.is-success { background: #e9f6ee; color: var(--success); border-color: #bfe3cd; }
.form .form-status.is-error { background: #fdecea; color: var(--error); border-color: #f5c2bd; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3.5rem 0 2rem; font-size: 0.9375rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr 1fr; }
.footer-grid h2 { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.875rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-motto { color: var(--muted); margin-top: 0.75rem; max-width: 22rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Dense card lists collapse to divided rows on phones */
@media (max-width: 560px) {
    .card-grid.compact { gap: 0; }
    .card-grid.compact .card { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 1.25rem 0; background: transparent; }
}

/* ---------- Page patterns (step 2) ---------- */
.page-head { padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.page-head .lead { margin-top: 1.25rem; }
.page-head .btn-row { margin-top: 1.75rem; }
.product-head { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; }
.product-head .product-mark { width: 120px; height: 120px; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 10px; }
@media (max-width: 640px) { .product-head { grid-template-columns: 1fr; gap: 1.25rem; } .product-head .product-mark { width: 88px; height: 88px; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery a:hover { border-color: #c9d9e6; }
.gallery img { width: 100%; height: auto; }
.gallery figcaption { font-size: 0.9375rem; color: var(--muted); margin-top: 0.5rem; }
.prose > * { max-width: 46rem; }
.prose > .feature-list { max-width: none; }
.prose h2 { margin: 3rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 2rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { color: #3e4c59; margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li strong, .prose p strong { color: var(--text); }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin: 0 0 2.5rem; }
.callout h2 { margin: 0 0 0.75rem; font-size: 1.375rem; }
.callout p:last-child { margin-bottom: 0; }
.steps { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 0 3rem; margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 650; display: grid; place-items: center; font-size: 0.9375rem; }
.steps h3 { margin: 0.125rem 0 0.25rem; font-size: 1.0625rem; }
.steps p { margin: 0; }
.feature-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0; }
.feature-list strong { display: block; margin-bottom: 0.125rem; }
.check-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.375rem; }
.check-list li { padding-left: 1.5rem; position: relative; color: var(--muted); }
.check-list li::before { content: ""; position: absolute; left: 0.125rem; top: 0.55em; width: 0.6rem; height: 0.35rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0.5rem 0; }
.tier { border: 1px solid var(--border); border-radius: 10px; padding: 0.875rem 1rem; background: var(--bg); }
.tier .price { font-size: 1.5rem; font-weight: 650; color: var(--text); }
.tier p { font-size: 0.9375rem; }
@media (max-width: 440px) { .tiers { grid-template-columns: 1fr; } }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #8a4b00; background: #fff4e0; border: 1px solid #f3d9a8; border-radius: 999px; padding: 0.125rem 0.625rem; }
.tech-list { display: grid; gap: 1.25rem; }
.tech-list .card { padding: clamp(1.5rem, 4vw, 2.25rem); }
.tech-list .card h2 { font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.tech-list .card p { max-width: 46rem; }

/* Tutorial */
.tutorial-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 3rem; align-items: start; }
.toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 0.9375rem; }
.toc summary { font-weight: 650; cursor: pointer; padding: 0.5rem 0; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ul { list-style: none; margin: 0.25rem 0 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.875rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.tutorial-content { min-width: 0; }
.tutorial-content .step-container { scroll-margin-top: 88px; }
.tutorial-content .section-title { font-size: clamp(1.5rem, 3vw, 1.875rem); margin: 0 0 1rem; scroll-margin-top: 88px; }
.tutorial-content .section-divider { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.tutorial-content h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
.tutorial-content h4 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.tutorial-content p, .tutorial-content li { color: #3e4c59; }
.tutorial-content p, .tutorial-content ul, .tutorial-content ol { margin: 0 0 0.875rem; }
.tutorial-content ul, .tutorial-content ol { padding-left: 1.25rem; }
.tutorial-content li { margin-bottom: 0.375rem; }
.tutorial-content strong { color: var(--text); }
.tutorial-content .subsection-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1rem 0; }
.tutorial-content .subsection-box > h3:first-child { margin-top: 0; }
.tutorial-content .indented-content { padding-left: 1rem; border-left: 2px solid var(--border); margin: 0.75rem 0; }
.tutorial-content .tip-box { background: var(--accent-soft); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.75rem 0; color: var(--text); }
.tutorial-content img { border: 1px solid var(--border); border-radius: 8px; height: auto; }
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; }
@media (max-width: 1000px) {
    .tutorial-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1.25rem 0.75rem; }
    .toc summary::after { content: " +"; color: var(--muted); }
    .toc[open] summary::after { content: " \2212"; }
    .tutorial-content .subsection-box { padding: 1rem; }
}

/* Blog (Jekyll) */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.post-date { font-size: 0.875rem; color: var(--muted); }
.post-list h2 { font-size: 1.375rem; margin: 0.25rem 0 0.5rem; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); text-decoration: underline; }
.post-content { margin-top: 2rem; }
.subscribe { margin-top: 3rem; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; align-items: flex-start; }
.subscribe-form .field { flex: 1 1 240px; }
.subscribe-note { font-size: 0.9375rem; color: var(--muted); margin-top: 0.75rem; }

.prose ul.feature-list, .prose ul.check-list, .prose ul.post-list, .prose ol.steps { padding-left: 0; }
.prose .feature-list li, .prose .post-list li { margin: 0; }

/* ================= Boston Listener internal UI layer =================
   Warm paper, monospace, fine rules, square corners, a little pale lime. */
body { font-size: 0.9375rem; line-height: 1.7; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.15; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); letter-spacing: -0.03em; }
h3 { font-size: 1.0625rem; }
a { color: var(--text); text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 0; box-shadow: 0 0 0 5px var(--lime); }
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: var(--surface-soft); border-color: var(--edge); }
.eyebrow, .footer-grid h2, .fact-list dt { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; color: var(--muted); }
.eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.625rem; background: var(--lime); border: 1px solid var(--text); vertical-align: 0; }
.lead { font-size: 1rem; }

.site-header { background: rgba(246, 242, 233, 0.94); border-bottom-color: var(--edge); }
.brand { font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; }
.brand .logo-image { border-radius: 0; border: 1px solid var(--edge); }
.site-nav .nav-link { border-radius: 0; font-size: 0.8125rem; font-weight: 400; }
.site-nav .nav-link:hover { background: var(--surface-soft); }
.site-nav .nav-link.active { color: var(--text); background: var(--lime); }
.sub-menu, .sub-menu a, .menu-toggle { border-radius: 0; box-shadow: none; }
.sub-menu { border-color: var(--edge); }
.menu-icon, .menu-icon::before, .menu-icon::after { border-radius: 0; height: 1.5px; }
@media (max-width: 900px) { .site-nav .nav-link { font-size: 0.9375rem; } .sub-menu a { font-size: 0.875rem; } }

.btn { border-radius: 0; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.01em; }
.btn-primary { background: var(--text); color: var(--lime); }
.btn-primary:hover { background: #000; color: var(--lime); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--text); }
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn-text { color: var(--text); text-decoration: underline; border-radius: 0; font-weight: 500; }

/* Card groups become a ruled ledger: shared hairlines, no gaps, numbered cells */
.card-grid { gap: 0; counter-reset: cell; padding-right: calc(1px + var(--pad-r, 0px)); }
.container.card-grid { --pad-r: 1.5rem; }
.card-grid > .card, .card-grid > article { border: 1px solid var(--edge); margin: 0 -1px -1px 0; border-radius: 0; background: var(--surface); padding: 2rem 1.75rem 1.75rem; }
.card-grid > .card::before { counter-increment: cell; content: counter(cell, decimal-leading-zero); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.card { border-radius: 0; border-color: var(--edge); }
.card-link:hover { border-color: var(--edge); box-shadow: none; background: #fffef9; }
.product-card .product-logo { border-radius: 0; background: var(--bg); border: 1px solid var(--border); padding: 6px; }
.product-tag { color: var(--muted); font-weight: 500; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
@media (max-width: 560px) { .card-grid.compact .card { border-top: 0; padding: 1.5rem 1.25rem; background: var(--surface); } }

.field input, .field select, .field textarea, .card .form-status, .form-status { border-radius: 0; }
.field input, .field select, .field textarea { border-color: var(--edge); background: var(--surface); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--lime); }

.site-footer { background: var(--bg); border-top-color: var(--edge); font-size: 0.8125rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { border-top-color: var(--edge); }

.product-head .product-mark, .gallery a, .feature-list li, .tier, .tutorial-content .subsection-box,
.tutorial-content .tip-box, .tutorial-content img, .toc { border-radius: 0; }
.product-head .product-mark { border-color: var(--edge); }
.gallery a { border-color: var(--edge); padding: 0.75rem; background: var(--surface); }
.gallery a:hover { border-color: var(--text); }
.gallery figcaption { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }
.prose p, .prose ul, .prose ol, .tutorial-content p, .tutorial-content li { color: #3c3830; }
.callout { border-radius: 0; background: var(--surface-soft); border-left: 3px solid var(--lime); box-shadow: inset 1px 0 0 var(--text); }
.feature-list { gap: 0; border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.feature-list li { border: 0; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); padding: 1.25rem; }
.steps li::before { border-radius: 0; background: transparent; border: 1px solid var(--text); color: var(--text); font-weight: 500; font-size: 0.8125rem; }
.check-list li::before { border-color: var(--lime-ink); }
.badge { border-radius: 0; color: var(--lime-ink); background: var(--lime-soft); border-color: var(--lime-ink); font-weight: 500; }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--text); background: var(--lime-soft); }
.tutorial-content .tip-box { background: var(--lime-soft); }

/* Status panel (Uzei pricing): ruled cells with a small state marker */
.status-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); margin: 1.25rem 0 1.5rem; max-width: 46rem; }
.status-panel > div { border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); background: var(--surface); padding: 1.25rem 1.5rem; }
.status-panel dt { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.status-panel dd { margin: 0.5rem 0 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.status-panel dd small { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 0.25rem; }
.state { display: inline-flex; align-items: center; gap: 0.5rem; }
.state::before { content: ""; width: 8px; height: 8px; background: var(--lime); border: 1px solid var(--lime-ink); }
/* Key features: fill every row (7 cells -> 3+3+1 spanning, 2+2+2+1 spanning) */
.feature-list { grid-template-columns: 1fr; }
@media (min-width: 600px) {
    .feature-list { grid-template-columns: repeat(2, 1fr); }
    .feature-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
    .feature-list { grid-template-columns: repeat(3, 1fr); }
    .feature-list li:last-child:nth-child(odd) { grid-column: auto; }
    .feature-list li:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
    .feature-list li:last-child:nth-child(3n+2) { grid-column: span 2; }
}

/* Screenshots as specimens pinned on paper: tile sheet, hairline frame, margin, numbered caption */
.gallery { gap: 2rem; counter-reset: fig; }
.gallery figure { background: var(--surface); border: 1px solid var(--edge); padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 2.5vw, 1.75rem) 1rem; }
.gallery a { padding: 8px; border: 1px solid var(--edge); background: var(--bg); }
.gallery a:hover { border-color: var(--text); }
.gallery figcaption { counter-increment: fig; margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; }
.gallery figcaption::before { content: "Fig. " counter(fig, decimal-leading-zero); color: var(--text); }
.gallery figcaption::after { content: "Screenshot"; }

/* Reading comparison (?body=sans): paragraphs in sans-serif and one step darker grey;
   headings, labels, nav and buttons stay monospace. */
html.body-sans { --muted: #57513f; }
html.body-sans body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1rem; }
html.body-sans :is(h1, h2, h3, h4, .eyebrow, .btn, .btn-text, .brand, .nav-link, .sub-menu a, .menu-toggle, .product-tag,
    .footer-grid h2, .footer-bottom, dt, .badge, figcaption, .card::before, .steps li::before, .toc, .post-date, label) { font-family: var(--font); }
html.body-sans .btn, html.body-sans .nav-link { font-size: 0.8125rem; }
html.body-sans .prose p, html.body-sans .prose li, html.body-sans .tutorial-content p, html.body-sans .tutorial-content li { color: #2f2b24; }

/* Hide blog subscribe and blog link in the sidebar */
li:has(> a[href="/blog/"]),
li:has(> a[href="/blog/#subscribe"]) {
    display: none !important;
}