/* BaBaMagican Neon v0.8.0
   Consolidated mobile-first stylesheet. */

:root {
    --bm-neon: #00e5ff;
    --bm-neon-2: #00b8a9;
    --bm-bg: #03090b;
    --bm-bg-soft: #061012;
    --bm-panel: rgba(6, 16, 18, 0.9);
    --bm-panel-strong: rgba(8, 22, 25, 0.96);
    --bm-text: #edf9fa;
    --bm-muted: #9ab0b3;
    --bm-subtle: #80979a;
    --bm-border: color-mix(in srgb, var(--bm-neon) 26%, transparent);
    --bm-border-strong: color-mix(in srgb, var(--bm-neon) 52%, transparent);
    --bm-glow: 0 0 24px color-mix(in srgb, var(--bm-neon) 10%, transparent);
    --bm-radius: 6px;
    --bm-radius-sm: 4px;
    --bm-container: 1480px;
    --bm-reading: 780px;
    --bm-header-h: 66px;
    --bm-gap: 16px;
    --bm-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bm-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 1. Base --------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bm-header-h) + 20px);
    background: var(--bm-bg);
}

body {
    margin: 0;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 18% -10%, color-mix(in srgb, var(--bm-neon) 7%, transparent), transparent 34rem),
        linear-gradient(180deg, #03090b 0%, #020708 100%);
    color: var(--bm-text);
    font-family: var(--bm-font);
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    background-image:
        linear-gradient(color-mix(in srgb, var(--bm-neon-2) 5%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--bm-neon-2) 4%, transparent) 1px, transparent 1px),
        radial-gradient(circle at 76% 14%, color-mix(in srgb, var(--bm-neon) 6%, transparent), transparent 24rem);
    background-size: 36px 36px, 36px 36px, auto;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 80%);
}

body.bm-matrix-enabled::before {
    opacity: 1;
}

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

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
figure {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    line-height: 1.12;
    letter-spacing: -0.025em;
}

[hidden] {
    display: none;
}

::selection {
    background: color-mix(in srgb, var(--bm-neon) 30%, #082126);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--bm-neon);
    outline-offset: 3px;
    border-radius: 4px;
}

#main-content:focus {
    outline: 0;
}

.bm-skip {
    position: fixed;
    top: 8px;
    left: 12px;
    z-index: 9999;
    padding: 10px 14px;
    border: 1px solid var(--bm-border-strong);
    border-radius: var(--bm-radius-sm);
    background: #061518;
    color: var(--bm-text);
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.bm-skip:focus {
    transform: translateY(0);
}

.bm-copy-fallback {
    position: fixed;
    inset: auto auto 0 -9999px;
    opacity: 0;
}

.bm-site-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1 0 auto;
    min-width: 0;
}

.bm-container {
    width: min(calc(100% - 28px), var(--bm-container));
    margin-inline: auto;
    min-width: 0;
}

.bm-panel {
    min-width: 0;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    background: linear-gradient(145deg, rgba(8, 21, 24, 0.93), rgba(3, 10, 12, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018), var(--bm-glow);
}

/* 2. Shared controls ----------------------------------------------------- */
.bm-button,
.bm-icon-button,
.bm-menu-toggle,
.bm-copy-code,
.bm-archive-tool-status button {
    min-height: 44px;
}

.bm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 72%, transparent);
    border-radius: var(--bm-radius-sm);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bm-neon) 24%, #051416), color-mix(in srgb, var(--bm-neon) 10%, #031012));
    color: #eaffff;
    font-family: var(--bm-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    box-shadow: 0 0 18px color-mix(in srgb, var(--bm-neon) 12%, transparent);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.bm-button:hover {
    border-color: var(--bm-neon);
    transform: translateY(-1px);
    box-shadow: 0 0 22px color-mix(in srgb, var(--bm-neon) 19%, transparent);
}

.bm-button-outline {
    background: rgba(4, 13, 15, 0.65);
    border-color: var(--bm-border);
    color: #b9d4d7;
    box-shadow: none;
}

.bm-button-outline:hover {
    color: var(--bm-text);
    background: color-mix(in srgb, var(--bm-neon) 7%, #041013);
}

.bm-button-small {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 0.75rem;
}

.bm-text-link {
    display: inline-flex;
    align-items: center;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bm-text-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bm-kicker,
.bm-chip,
.bm-content-type,
.bm-terminal-line {
    font-family: var(--bm-mono);
    text-transform: uppercase;
    letter-spacing: 0.085em;
}

.bm-kicker {
    display: inline-flex;
    color: var(--bm-neon);
    font-size: 0.75rem;
    font-weight: 700;
}

.bm-kicker-fallback {
    color: var(--bm-muted);
}

.bm-chip,
.bm-content-type {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 8px;
    border: 1px solid var(--bm-border-strong);
    border-radius: 3px;
    color: var(--bm-neon);
    background: color-mix(in srgb, var(--bm-neon) 6%, #051113);
    font-size: 0.75rem;
    font-weight: 800;
}

.bm-content-type.is-project { color: #84f7c5; border-color: rgba(132, 247, 197, 0.45); }
.bm-content-type.is-update { color: #ffe18a; border-color: rgba(255, 225, 138, 0.45); }
.bm-content-type.is-note { color: #c7b8ff; border-color: rgba(199, 184, 255, 0.45); }

.bm-card-labels,
.bm-article-labels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bm-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-section-title {
    margin: 0;
    color: #dff8fa;
    font-family: var(--bm-mono);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.bm-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.bm-section-head h2 {
    margin: 4px 0 0;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
}

/* 3. Header -------------------------------------------------------------- */
.bm-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--bm-header-h);
    border-bottom: 1px solid color-mix(in srgb, var(--bm-neon) 20%, transparent);
    background: rgba(3, 10, 12, 0.86);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.bm-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-right: auto;
}

.bm-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.bm-brand-mark,
.bm-profile-brand-mark {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 2px solid var(--bm-neon);
    border-radius: 10px 4px 10px 4px;
    box-shadow: inset 0 0 15px color-mix(in srgb, var(--bm-neon) 14%, transparent), 0 0 16px color-mix(in srgb, var(--bm-neon) 13%, transparent);
    transform: rotate(45deg) scale(0.72);
}

.bm-brand-mark i,
.bm-profile-brand-mark i {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bm-neon);
    box-shadow: 0 0 8px var(--bm-neon);
}

.bm-brand-mark i:nth-child(1), .bm-profile-brand-mark i:nth-child(1) { top: 7px; left: 7px; }
.bm-brand-mark i:nth-child(2), .bm-profile-brand-mark i:nth-child(2) { right: 7px; top: 15px; }
.bm-brand-mark i:nth-child(3), .bm-profile-brand-mark i:nth-child(3) { left: 15px; bottom: 7px; }

.bm-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.08;
}

.bm-brand-copy strong {
    overflow: hidden;
    color: #e7fbfc;
    font-size: 0.92rem;
    letter-spacing: 0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-brand-copy small {
    display: none;
    margin-top: 4px;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-icon-button,
.bm-menu-toggle {
    width: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--bm-radius-sm);
    background: transparent;
    cursor: pointer;
}

.bm-icon-button {
    display: grid;
    place-items: center;
    color: #a8c5c7;
}

.bm-icon-button:hover,
.bm-menu-toggle:hover {
    border-color: var(--bm-border);
    background: color-mix(in srgb, var(--bm-neon) 5%, transparent);
    color: var(--bm-neon);
}

.bm-icon-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.bm-newsletter-button {
    display: none;
}

.bm-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.bm-menu-toggle span {
    width: 21px;
    height: 1.5px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

.bm-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.bm-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bm-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.bm-nav {
    display: none;
    position: absolute;
    top: var(--bm-header-h);
    left: 14px;
    right: 14px;
    padding: 10px;
    border: 1px solid var(--bm-border-strong);
    border-radius: var(--bm-radius);
    background: rgba(4, 14, 16, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38), var(--bm-glow);
}

.bm-nav.is-open {
    display: block;
}

.bm-nav .nav,
.bm-footer-nav .nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bm-nav .nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 9px 11px;
    border-radius: 4px;
    color: #bdd0d2;
    font-size: 0.88rem;
}

.bm-nav .nav a:hover,
.bm-nav .nav-current a {
    color: var(--bm-neon);
    background: color-mix(in srgb, var(--bm-neon) 6%, transparent);
}

/* 4. Homepage ------------------------------------------------------------ */
.bm-home {
    padding-block: 14px 26px;
}

.bm-home-grid,
.bm-main-column,
.bm-sidebar {
    display: grid;
    min-width: 0;
    gap: var(--bm-gap);
}

.bm-main-column {
    grid-template-columns: minmax(0, 1fr);
}

.bm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
}

.bm-hero-copy,
.bm-featured-wrap,
.bm-featured-copy {
    min-width: 0;
}

.bm-terminal-line {
    margin-bottom: 14px;
    color: var(--bm-neon-2);
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.025em;
}

.bm-hero h1 {
    max-width: 760px;
    margin-bottom: 14px;
    font-size: clamp(2.55rem, 12vw, 4.7rem);
    font-weight: 850;
    letter-spacing: -0.055em;
}

.bm-hero h1::first-line {
    color: #fff;
}

.bm-hero-lead {
    max-width: 620px;
    margin-bottom: 18px;
    color: #adc1c4;
    font-size: clamp(0.96rem, 2.8vw, 1.08rem);
}

.bm-hero-actions {
    display: grid;
    gap: 9px;
}

.bm-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    color: #81999c;
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3be397;
    box-shadow: 0 0 10px rgba(59, 227, 151, 0.55);
}

.bm-featured-card {
    position: relative;
    display: grid;
    min-width: 0;
    overflow: clip;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    background: rgba(3, 12, 14, 0.72);
}

.bm-featured-copy {
    padding: 18px;
}

.bm-featured-copy h2 {
    margin: 10px 0 10px;
    font-size: clamp(1.35rem, 6vw, 2.05rem);
}

.bm-featured-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.bm-featured-title-link:focus-visible {
    outline-offset: 5px;
}

.bm-featured-copy > p {
    margin-bottom: 12px;
    color: #9db3b6;
    font-size: 0.9rem;
}

.bm-featured-copy .bm-text-link {
    margin-top: 12px;
}

.bm-featured-media {
    position: relative;
    aspect-ratio: 16 / 9;
    min-width: 0;
    overflow: hidden;
    border-top: 1px solid var(--bm-border);
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--bm-neon) 13%, transparent), transparent 60%), #041013;
}

.bm-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bm-featured-media-fallback,
.bm-card-placeholder {
    display: grid;
    place-items: center;
}

.bm-server-art {
    position: relative;
    display: grid;
    place-items: center;
    width: 108px;
    height: 92px;
    border: 1px solid var(--bm-border-strong);
    border-radius: 10px;
    box-shadow: inset 0 0 24px color-mix(in srgb, var(--bm-neon) 10%, transparent), 0 0 25px color-mix(in srgb, var(--bm-neon) 10%, transparent);
}

.bm-server-art i {
    position: absolute;
    left: 14px;
    right: 14px;
    height: 1px;
    background: var(--bm-border-strong);
}

.bm-server-art i:nth-child(1) { top: 24px; }
.bm-server-art i:nth-child(2) { top: 45px; }
.bm-server-art i:nth-child(3) { top: 66px; }
.bm-server-art b {
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 2rem;
    text-shadow: 0 0 12px var(--bm-neon);
}

.bm-jump,
.bm-topics,
.bm-latest,
.bm-widget {
    padding: 16px;
}

.bm-section-inline-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 10px;
}

.bm-section-inline-title strong {
    color: #dff9fb;
    font-family: var(--bm-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bm-section-inline-title span {
    color: var(--bm-subtle);
    font-size: 0.8rem;
}

.bm-tag-row {
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.bm-tag-row::-webkit-scrollbar {
    display: none;
}

.bm-tag-pill,
.bm-tag-more {
    flex: 0 0 auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid var(--bm-border);
    border-radius: 4px;
    color: #9db3b6;
    background: rgba(4, 14, 16, 0.62);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
    scroll-snap-align: start;
}

.bm-tag-pill:hover,
.bm-tag-more:hover {
    border-color: var(--bm-border-strong);
    color: var(--bm-neon);
}

.bm-tag-more {
    color: var(--bm-neon);
}

.bm-topic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 13px;
}

.bm-topic-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 18%, transparent);
    border-radius: var(--bm-radius-sm);
    background: rgba(3, 12, 14, 0.56);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.bm-topic-card:hover {
    border-color: var(--bm-border-strong);
    background: color-mix(in srgb, var(--bm-neon) 5%, #041012);
    transform: translateY(-1px);
}

.bm-topic-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--bm-border-strong);
    border-radius: 50%;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 1.2rem;
    box-shadow: inset 0 0 15px color-mix(in srgb, var(--bm-neon) 9%, transparent);
}

.bm-topic-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.bm-topic-copy strong {
    color: #e8f9fa;
    font-size: 0.92rem;
}

.bm-topic-copy small {
    margin-top: 3px;
    color: var(--bm-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.bm-topic-copy b {
    margin-top: 7px;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

/* 5. Post cards ---------------------------------------------------------- */
.bm-post-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.bm-post-card {
    position: relative;
    display: grid;
    min-width: 0;
    overflow: clip;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 18%, transparent);
    border-radius: var(--bm-radius);
    background: rgba(3, 12, 14, 0.65);
    transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.bm-post-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bm-neon) 62%, transparent), transparent);
    opacity: 0;
    transition: opacity 170ms ease;
}

.bm-post-card:hover {
    transform: translateY(-2px);
    border-color: var(--bm-border-strong);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), 0 0 18px color-mix(in srgb, var(--bm-neon) 7%, transparent);
}

.bm-post-card:hover::before {
    opacity: 1;
}

.bm-post-card-copy {
    min-width: 0;
    padding: 15px;
    order: 2;
}

.bm-post-card h2,
.bm-post-card h3 {
    margin: 8px 0 8px;
    font-size: clamp(1.05rem, 4.7vw, 1.28rem);
}

.bm-post-card-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.bm-post-card-title-link:focus-visible {
    outline-offset: 5px;
}

.bm-post-card-excerpt {
    margin-bottom: 10px;
    color: var(--bm-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.bm-post-card-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--bm-border);
    background: #041013;
    order: 1;
}

.bm-post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.bm-post-card:hover .bm-post-card-media img {
    transform: scale(1.015);
}

.bm-card-placeholder {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, color-mix(in srgb, var(--bm-neon) 8%, transparent), transparent 60%);
}

.bm-card-placeholder svg {
    width: 48px;
    fill: none;
    stroke: color-mix(in srgb, var(--bm-neon) 66%, transparent);
    stroke-width: 1.2;
}

/* 6. Sidebar ------------------------------------------------------------- */
.bm-sidebar {
    align-content: start;
}

.bm-widget h2 {
    margin: 0 0 12px;
    color: #dff8fa;
    font-family: var(--bm-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.085em;
}

.bm-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bm-popular-tags a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 18%, transparent);
    border-radius: 4px;
    color: #9eb3b6;
    background: rgba(3, 12, 14, 0.58);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-popular-tags a:hover {
    border-color: var(--bm-border-strong);
    color: var(--bm-neon);
}

.bm-popular-tags b {
    color: var(--bm-neon);
    font-weight: 600;
}

.bm-quick-links {
    display: grid;
}

.bm-quick-links a {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(145, 183, 188, 0.11);
    color: #a7bec1;
    font-size: 0.82rem;
}

.bm-quick-links a:last-child {
    border-bottom: 0;
}

.bm-quick-links a:hover {
    color: var(--bm-neon);
}

.bm-profile {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 11px 12px;
    align-items: start;
}

.bm-profile h2 {
    grid-column: 1 / -1;
}

.bm-profile-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
}

.bm-profile-image {
    width: 58px;
    height: 58px;
    border: 1px solid var(--bm-border-strong);
    border-radius: 50%;
    object-fit: cover;
}

.bm-profile-brand-mark {
    width: 54px;
    height: 54px;
}

.bm-profile-copy {
    min-width: 0;
}

.bm-profile-copy > strong {
    display: block;
    margin-bottom: 4px;
    color: #e7f8fa;
}

.bm-profile p {
    margin-bottom: 8px;
    color: var(--bm-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* 7. Archive, tags, taxonomy -------------------------------------------- */
.bm-archive-page,
.bm-error-wrap {
    padding-block: 18px 34px;
}

.bm-archive-header {
    padding: 20px;
    margin-bottom: 16px;
}

.bm-archive-header h1 {
    margin: 5px 0 8px;
    font-size: clamp(2rem, 9vw, 3.6rem);
}

.bm-archive-header p {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--bm-muted);
}

.bm-archive-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.bm-author-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bm-author-header > img {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border: 1px solid var(--bm-border-strong);
    border-radius: 50%;
    object-fit: cover;
}

.bm-post-grid-archive {
    margin-top: 14px;
}

.bm-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    margin-top: 18px;
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.78rem;
}

.bm-pagination a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--bm-neon);
}

.bm-archive-tools {
    display: grid;
    gap: 12px;
    padding: 15px;
    margin-bottom: 12px;
}

.bm-archive-tools label {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--bm-muted);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-archive-tools input,
.bm-archive-tools select {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 24%, transparent);
    border-radius: 4px;
    background: #061113;
    color: var(--bm-text);
}

.bm-archive-tools input:focus,
.bm-archive-tools select:focus {
    border-color: var(--bm-border-strong);
}

.bm-archive-tool-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bm-archive-tool-status strong {
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.78rem;
}

.bm-archive-tool-status button {
    border: 0;
    padding: 7px 0;
    background: none;
    color: #9fb7ba;
    cursor: pointer;
    font-size: 0.78rem;
}

.bm-archive-tool-status button:hover {
    color: var(--bm-neon);
}

.bm-archive-list {
    overflow: clip;
}

.bm-archive-row {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(145, 183, 188, 0.12);
    color: #a8bdc0;
    font-size: 0.8rem;
}

.bm-archive-row:last-of-type {
    border-bottom: 0;
}

.bm-archive-row:hover {
    background: color-mix(in srgb, var(--bm-neon) 4%, transparent);
}

.bm-archive-row > time,
.bm-archive-row > span:nth-child(2),
.bm-archive-row > em {
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
    font-style: normal;
}

.bm-archive-title-wrap {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.bm-archive-title-wrap strong {
    min-width: 0;
    color: #e5f5f7;
}

.bm-archive-empty {
    padding: 22px;
    margin: 0;
    color: var(--bm-muted);
    text-align: center;
}

.bm-tags-main-topics {
    margin-bottom: 24px;
}

.bm-tags-secondary-head {
    align-items: center;
}

.bm-all-tags-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.bm-all-tag-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 15px;
    transition: border-color 160ms ease, transform 160ms ease;
}

.bm-all-tag-card:hover {
    border-color: var(--bm-border-strong);
    transform: translateY(-1px);
}

.bm-all-tag-card > strong {
    margin: 5px 0;
    color: #e9f9fa;
    font-size: 1rem;
}

.bm-all-tag-card small {
    color: var(--bm-muted);
    font-size: 0.78rem;
}

.bm-all-tag-card b {
    margin-top: 10px;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

/* 8. Article ------------------------------------------------------------- */
.bm-reading-progress-top {
    position: fixed;
    top: var(--bm-header-h);
    left: 0;
    z-index: 999;
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.bm-reading-progress-top span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--bm-neon);
    box-shadow: 0 0 10px var(--bm-neon);
}

.bm-article-header {
    padding-top: 28px;
}

.bm-article-title-wrap {
    max-width: 1000px;
}

.bm-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    margin-bottom: 13px;
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-breadcrumb a:hover {
    color: var(--bm-neon);
}

.bm-article-labels {
    margin-bottom: 10px;
}

.bm-article-header h1 {
    max-width: 1040px;
    margin-bottom: 14px;
    font-size: clamp(2.2rem, 10vw, 4.8rem);
    letter-spacing: -0.05em;
}

.bm-article-deck {
    max-width: 850px;
    margin-bottom: 16px;
    color: #a7bdc0;
    font-size: clamp(1rem, 3vw, 1.14rem);
}

.bm-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-author-mini {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #c3d8da;
}

.bm-author-mini img,
.bm-author-fallback {
    width: 32px;
    height: 32px;
    border: 1px solid var(--bm-border-strong);
    border-radius: 50%;
    object-fit: cover;
}

.bm-author-fallback {
    background: radial-gradient(circle, color-mix(in srgb, var(--bm-neon) 24%, transparent), transparent 68%);
}

.bm-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.bm-article-tags a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid var(--bm-border);
    border-radius: 4px;
    color: #a9c1c4;
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-article-tags a:hover {
    color: var(--bm-neon);
    border-color: var(--bm-border-strong);
}

.bm-feature-image {
    margin-top: 22px;
    margin-bottom: 22px;
}

.bm-feature-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    background: #041013;
}

.bm-feature-image figcaption {
    margin-top: 7px;
    color: var(--bm-subtle);
    font-size: 0.78rem;
    text-align: center;
}

.bm-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.bm-article-aside {
    min-width: 0;
}

.bm-toc-panel,
.bm-progress-panel {
    padding: 13px;
}

.bm-toc-title {
    display: none;
    margin-bottom: 8px;
    color: #e3f8f9;
    font-family: var(--bm-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.bm-toc-mobile-toggle {
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d4e9eb;
    text-align: left;
    cursor: pointer;
}

.bm-toc-mobile-toggle span {
    font-family: var(--bm-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.bm-toc-mobile-toggle b {
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

.bm-toc-mobile-toggle i {
    font-style: normal;
    transition: transform 160ms ease;
}

.bm-toc-panel.is-open .bm-toc-mobile-toggle i {
    transform: rotate(180deg);
}

.bm-toc {
    display: none;
    padding-top: 7px;
}

.bm-toc-panel.is-open .bm-toc {
    display: grid;
}

.bm-toc a {
    padding: 6px 0 6px 10px;
    border-left: 1px solid rgba(143, 180, 184, 0.18);
    color: var(--bm-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.bm-toc a.is-sub {
    padding-left: 22px;
    font-size: 0.75rem;
}

.bm-toc a:hover,
.bm-toc a.is-active {
    border-left-color: var(--bm-neon);
    color: var(--bm-neon);
}

.bm-progress-panel {
    display: none;
}

.bm-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--bm-muted);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-reading-progress {
    height: 3px;
    margin-top: 9px;
    overflow: hidden;
    background: #0c1d20;
}

.bm-reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--bm-neon);
    box-shadow: 0 0 8px var(--bm-neon);
}

.bm-article-body,
.bm-page-body {
    min-width: 0;
    max-width: var(--bm-reading);
}

.bm-page-body {
    margin-top: 24px;
    margin-bottom: 42px;
}

/* 9. Ghost content ------------------------------------------------------- */
.gh-content {
    color: #c9d9db;
    font-size: 1rem;
    line-height: 1.78;
}

.gh-content > * {
    max-width: 100%;
}

.gh-content p,
.gh-content ul,
.gh-content ol,
.gh-content blockquote,
.gh-content pre,
.gh-content table,
.gh-content .kg-card {
    margin-bottom: 1.25em;
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
    color: #f0fbfc;
    scroll-margin-top: calc(var(--bm-header-h) + 24px);
}

.gh-content h2 {
    position: relative;
    margin: 2em 0 0.75em;
    padding-top: 0.55em;
    font-size: clamp(1.55rem, 6vw, 2.1rem);
}

.gh-content h2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 54px;
    height: 1px;
    background: linear-gradient(90deg, var(--bm-neon), transparent);
    box-shadow: 0 0 7px color-mix(in srgb, var(--bm-neon) 45%, transparent);
}

.gh-content h3 {
    margin: 1.65em 0 0.65em;
    font-size: clamp(1.25rem, 5vw, 1.55rem);
}

.gh-content h4 {
    margin: 1.4em 0 0.55em;
    font-size: 1.08rem;
}

.gh-content a:not(.kg-btn) {
    color: var(--bm-neon);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--bm-neon) 42%, transparent);
    text-underline-offset: 3px;
}

.gh-content a:hover {
    text-decoration-color: var(--bm-neon);
}

.gh-content strong {
    color: #eefafb;
}

.gh-content ul,
.gh-content ol {
    padding-left: 1.35em;
}

.gh-content li + li {
    margin-top: 0.35em;
}

.gh-content blockquote {
    margin-inline: 0;
    padding: 13px 15px;
    border-left: 2px solid var(--bm-neon);
    background: color-mix(in srgb, var(--bm-neon) 4%, #061012);
    color: #b9cdcf;
}

.gh-content code:not(pre code) {
    padding: 0.15em 0.38em;
    border: 1px solid rgba(121, 171, 176, 0.16);
    border-radius: 3px;
    background: #071416;
    color: #a9eff4;
    font-family: var(--bm-mono);
    font-size: 0.88em;
}

.bm-code-shell {
    margin: 1.35em 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--bm-neon) 23%, transparent);
    border-radius: var(--bm-radius);
    background: #020708;
}

.bm-code-shell.is-terminal {
    border-color: color-mix(in srgb, var(--bm-neon-2) 34%, transparent);
}

.bm-code-toolbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px 7px 12px;
    border-bottom: 1px solid rgba(126, 177, 181, 0.15);
    background: #071113;
}

.bm-code-toolbar-left,
.bm-terminal-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.bm-code-label {
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.bm-terminal-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #44666a;
}

.bm-terminal-dots i:nth-child(1) { background: #ff6c68; }
.bm-terminal-dots i:nth-child(2) { background: #ffd166; }
.bm-terminal-dots i:nth-child(3) { background: #43d49e; }

.bm-copy-code {
    padding: 7px 10px;
    border: 1px solid rgba(124, 176, 181, 0.2);
    border-radius: 4px;
    background: #081619;
    color: #a9c1c4;
    cursor: pointer;
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-copy-code:hover,
.bm-copy-code.is-copied {
    border-color: var(--bm-border-strong);
    color: var(--bm-neon);
}

.bm-code-shell pre {
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    padding: 16px;
    background: transparent;
    color: #c8e2e4;
    font-family: var(--bm-mono);
    font-size: 0.82rem;
    line-height: 1.65;
    tab-size: 4;
}

.bm-table-scroll {
    max-width: 100%;
    margin: 1.3em 0;
    overflow-x: auto;
    border: 1px solid rgba(124, 176, 181, 0.16);
    border-radius: var(--bm-radius-sm);
}

.bm-table-scroll table {
    width: max(100%, 600px);
    margin: 0;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.bm-table-scroll th,
.bm-table-scroll td {
    padding: 9px 11px;
    border-bottom: 1px solid rgba(124, 176, 181, 0.13);
    text-align: left;
}

.bm-table-scroll th {
    color: #e4f7f8;
    background: #081719;
}

.bm-table-scroll tr:last-child td {
    border-bottom: 0;
}

.gh-content figure,
.gh-content .kg-image-card,
.gh-content .kg-gallery-card,
.gh-content .kg-bookmark-card,
.gh-content .kg-callout-card,
.gh-content .kg-button-card {
    max-width: 100%;
}

.gh-content .kg-image,
.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img {
    border-radius: var(--bm-radius-sm);
}

.gh-content figcaption,
.gh-content .kg-card figcaption {
    margin-top: 6px;
    color: var(--bm-subtle);
    font-size: 0.78rem;
    text-align: center;
}

.gh-content .kg-callout-card {
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    background: color-mix(in srgb, var(--bm-neon) 5%, #061012);
    color: #c8d9db;
}

.gh-content .kg-callout-card.bm-callout-warning {
    border-color: rgba(255, 180, 74, 0.46);
    background: rgba(78, 49, 10, 0.2);
}

.gh-content .kg-callout-card.bm-callout-success {
    border-color: rgba(67, 212, 158, 0.42);
    background: rgba(15, 74, 53, 0.18);
}

.gh-content .kg-bookmark-container {
    overflow: hidden;
    border: 1px solid rgba(124, 176, 181, 0.2);
    border-radius: var(--bm-radius);
    background: #061113;
}

.gh-content .kg-bookmark-title {
    color: #e9f8f9;
}

.gh-content .kg-bookmark-description,
.gh-content .kg-bookmark-metadata {
    color: var(--bm-muted);
}

.gh-content .kg-btn {
    min-height: 44px;
    border: 1px solid var(--bm-border-strong);
    border-radius: var(--bm-radius-sm);
    background: color-mix(in srgb, var(--bm-neon) 12%, #061012);
    color: #edffff;
}

/* 10. Article footer / related ------------------------------------------ */
.bm-related {
    margin-top: 38px;
}

.bm-related-grid {
    margin-top: 12px;
}

.bm-post-neighbors {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 28px;
}

.bm-post-neighbors a {
    display: flex;
    min-height: 94px;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    transition: border-color 160ms ease;
}

.bm-post-neighbors a:hover {
    border-color: var(--bm-border-strong);
}

.bm-post-neighbors span {
    margin-bottom: 5px;
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-post-neighbors strong {
    color: #e7f7f8;
    font-size: 0.93rem;
}

.bm-article-footer {
    margin-top: 16px;
    margin-bottom: 34px;
}

.bm-post-end {
    display: grid;
    gap: 13px;
    padding: 16px;
}

.bm-post-end > div > strong {
    color: var(--bm-neon);
    font-family: var(--bm-mono);
    font-size: 0.78rem;
}

.bm-post-end p {
    margin: 6px 0 0;
    color: var(--bm-muted);
    font-size: 0.84rem;
}

.bm-post-end-actions {
    display: grid;
    gap: 8px;
}

/* 11. Error & footer ----------------------------------------------------- */
.bm-error {
    max-width: 760px;
    margin: 8vh auto;
    padding: 24px;
    text-align: center;
}

.bm-error h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 9vw, 4rem);
}

.bm-error p:not(.bm-terminal-line) {
    color: var(--bm-muted);
}

.bm-footer {
    flex: 0 0 auto;
    border-top: 1px solid color-mix(in srgb, var(--bm-neon) 17%, transparent);
    background: rgba(2, 8, 9, 0.9);
}

.bm-footer-inner {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-block: 16px;
    text-align: center;
}

.bm-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.bm-brand-mark-small {
    width: 28px;
    height: 28px;
}

.bm-footer-brand > span:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.bm-footer-brand strong {
    font-size: 0.82rem;
}

.bm-footer-brand small,
.bm-footer p {
    color: var(--bm-subtle);
    font-family: var(--bm-mono);
    font-size: 0.75rem;
}

.bm-footer p {
    margin: 0;
}

.bm-footer-nav .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 14px;
}

.bm-footer-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    color: #91a9ac;
    font-size: 0.78rem;
}

.bm-footer-nav a:hover {
    color: var(--bm-neon);
}

/* 12. Responsive: small tablet ------------------------------------------ */
@media (min-width: 620px) {
    :root {
        --bm-gap: 18px;
    }

    .bm-container {
        width: min(calc(100% - 40px), var(--bm-container));
    }

    .bm-brand-copy small {
        display: block;
    }

    .bm-newsletter-button {
        display: inline-flex;
    }

    .bm-hero-actions,
    .bm-post-end-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .bm-topic-grid,
    .bm-post-grid,
    .bm-all-tags-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bm-archive-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bm-archive-tool-status {
        grid-column: 1 / -1;
    }

    .bm-post-neighbors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bm-post-neighbors .is-next {
        text-align: right;
    }

    .bm-post-end {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}

/* 13. Responsive: article desktop --------------------------------------- */
@media (min-width: 821px) {
    :root {
        --bm-header-h: 72px;
    }

    .bm-article-header {
        padding-top: 38px;
    }

    .bm-article-layout {
        grid-template-columns: 220px minmax(0, var(--bm-reading));
        justify-content: center;
        gap: 26px;
    }

    .bm-article-aside {
        position: sticky;
        top: calc(var(--bm-header-h) + 22px);
        display: grid;
        gap: 10px;
    }

    .bm-toc-title {
        display: block;
    }

    .bm-toc-mobile-toggle {
        display: none;
    }

    .bm-toc,
    .bm-toc-panel.is-open .bm-toc {
        display: grid;
    }

    .bm-progress-panel {
        display: block;
    }

    .bm-page-body {
        margin-inline: auto;
    }

    .bm-archive-row {
        grid-template-columns: 105px 180px minmax(0, 1fr) 70px;
        align-items: center;
        gap: 12px;
    }

    .bm-archive-row > em {
        text-align: right;
    }

    .gh-content .kg-width-wide {
        width: min(1050px, calc(100vw - 48px));
        max-width: none;
        margin-left: 50%;
        transform: translateX(-50%);
    }

    .gh-content .kg-width-full {
        width: min(1260px, calc(100vw - 32px));
        max-width: none;
        margin-left: 50%;
        transform: translateX(-50%);
    }
}

/* 14. Responsive: main desktop ------------------------------------------ */
@media (min-width: 980px) {
    :root {
        --bm-header-h: 78px;
    }

    .bm-menu-toggle {
        display: none;
    }

    .bm-nav {
        position: static;
        display: block;
        margin-left: auto;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .bm-nav .nav {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .bm-nav .nav a {
        position: relative;
        min-height: 44px;
        padding-inline: 11px;
        background: transparent;
        font-size: 0.8rem;
    }

    .bm-nav .nav-current a::after {
        content: "";
        position: absolute;
        left: 11px;
        right: 11px;
        bottom: 4px;
        height: 1px;
        background: var(--bm-neon);
        box-shadow: 0 0 7px var(--bm-neon);
    }

    .bm-header-actions {
        margin-left: 4px;
    }

    .bm-home {
        padding-block: 20px 34px;
    }

    .bm-home-grid {
        grid-template-columns: minmax(0, 1fr) 245px;
        align-items: start;
    }

    .bm-sidebar {
        position: sticky;
        top: calc(var(--bm-header-h) + 18px);
    }

    .bm-hero {
        grid-template-columns: minmax(0, 1.03fr) minmax(390px, 0.97fr);
        align-items: stretch;
        gap: 20px;
        padding: 24px;
    }

    .bm-hero-copy {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 4px 0;
    }

    .bm-hero h1 {
        font-size: clamp(3.7rem, 5.4vw, 5.7rem);
    }

    .bm-featured-card {
        height: 100%;
        grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    }

    .bm-featured-media {
        height: 100%;
        aspect-ratio: auto;
        border-top: 0;
        border-left: 1px solid var(--bm-border);
    }

    .bm-featured-copy {
        display: flex;
        min-height: 280px;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    .bm-featured-copy .bm-text-link {
        margin-top: auto;
        padding-top: 14px;
    }

    .bm-post-card {
        grid-template-columns: minmax(0, 1fr) 188px;
    }

    .bm-post-card-copy {
        order: 1;
    }

    .bm-post-card-media {
        height: 100%;
        min-height: 170px;
        aspect-ratio: auto;
        border-bottom: 0;
        border-left: 1px solid var(--bm-border);
        order: 2;
    }

    .bm-archive-tools {
        grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(180px, 0.8fr)) auto;
        align-items: end;
    }

    .bm-archive-tool-status {
        grid-column: auto;
        min-width: 160px;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
    }

    .bm-footer-inner {
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        justify-items: stretch;
        text-align: left;
    }

    .bm-footer p {
        text-align: center;
    }

    .bm-footer-nav .nav {
        justify-content: flex-end;
    }
}

/* 15. Wide desktop ------------------------------------------------------- */
@media (min-width: 1240px) {
    .bm-home-grid {
        grid-template-columns: minmax(0, 1fr) 270px;
    }

    .bm-topic-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bm-all-tags-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bm-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bm-related-grid .bm-post-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .bm-related-grid .bm-post-card-media {
        height: auto;
        aspect-ratio: 16 / 9;
        border-left: 0;
        border-top: 1px solid var(--bm-border);
        order: 1;
    }

    .bm-related-grid .bm-post-card-copy {
        order: 2;
    }
}

/* 16. Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        transition-duration: 0.001ms;
        animation-duration: 0.001ms;
        animation-iteration-count: 1;
    }

    .bm-topic-card:hover,
    .bm-post-card:hover,
    .bm-button:hover,
    .bm-all-tag-card:hover {
        transform: none;
    }

    .bm-post-card:hover .bm-post-card-media img {
        transform: none;
    }
}
