/* Masai Blog UI layer v6 - loaded after screen.css, and after code-injection overrides win only where
   they use !important. Selectors are prefixed with `body` so they out-rank injected rules. */

:root {
    --mb-accent: #C53030;
    --mb-accent-dark: #9b2323;
    --mb-ink: #14110f;
    --mb-ink-2: #3d3835;
    --mb-muted: #6f6762;
    --mb-line: #ece7e3;
    --mb-wash: #faf7f5;
    --mb-radius: 20px;
    --mb-font-head: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mb-font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { scroll-behavior: smooth; }
body { background: #fff; color: var(--mb-ink); -webkit-font-smoothing: antialiased; }
body :focus-visible { outline: 3px solid var(--mb-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
body .gh-head.outer {
    position: sticky !important;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 var(--mb-line) !important;
}
body .gh-head-menu a { font-family: var(--mb-font-head); font-weight: 500; font-size: 1.5rem; color: var(--mb-ink-2); transition: color .15s; }
body .gh-head-menu a:hover { color: var(--mb-accent); opacity: 1; }

/* ---------- Home hero ---------- */
.mb-hero { padding: clamp(48px, 8vw, 104px) max(4vmin, 20px) clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--mb-line); background:
    radial-gradient(900px 360px at 88% -10%, rgba(197,48,48,.10), transparent 70%),
    radial-gradient(520px 260px at 0% 0%, rgba(197,48,48,.04), transparent 70%); }
.mb-hero-inner { max-width: 1300px; margin: 0 auto; }
.mb-hero-inner > * { max-width: 760px; }
.mb-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 1.2rem/1 var(--mb-font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--mb-accent); background: rgba(197,48,48,.07); border: 1px solid rgba(197,48,48,.14); padding: 9px 14px; border-radius: 999px; }
.mb-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mb-accent); }
.mb-hero h1 { margin: 22px 0 18px; font: 600 clamp(3.6rem, 5.6vw, 5.8rem)/1.1 var(--mb-font-head); letter-spacing: -.03em; color: var(--mb-ink); }
.mb-hero h1 em { font-style: normal; color: var(--mb-accent); }
.mb-hero p { margin: 0 0 30px; font: 400 clamp(1.6rem, 1.5vw, 1.85rem)/1.7 var(--mb-font-body); color: var(--mb-muted); }
.mb-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; box-sizing: border-box; padding: 15px 20px; border: 1px solid var(--mb-line); border-radius: 999px; background: #fff; color: var(--mb-muted); font: 400 1.6rem var(--mb-font-body); cursor: pointer; box-shadow: 0 6px 24px -10px rgba(20,17,15,.18); transition: border-color .15s, box-shadow .15s; text-align: left; }
.mb-search:hover { border-color: var(--mb-accent); box-shadow: 0 10px 30px -10px rgba(197,48,48,.35); }
.mb-search svg { width: 18px; height: 18px; flex: none; }
.mb-search kbd { margin-left: auto; font: 600 1.1rem var(--mb-font-head); padding: 3px 8px; border: 1px solid var(--mb-line); border-radius: 6px; color: var(--mb-muted); }

.mb-topics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; max-width: 980px; }
.mb-topic { font: 500 1.4rem/1 var(--mb-font-head); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--mb-line); background: #fff; color: var(--mb-ink-2); text-decoration: none; transition: all .15s; }
.mb-topic:hover { background: var(--mb-ink); color: #fff; border-color: var(--mb-ink); }
.mb-topic small { color: var(--mb-muted); font-size: 1.15rem; margin-left: 4px; }
.mb-topic:hover small { color: rgba(255,255,255,.7); }

/* ---------- Feed / cards ---------- */
body .site-main { padding-top: clamp(20px, 3vw, 40px); }
body .post-feed { grid-gap: clamp(24px, 3vw, 40px) clamp(20px, 2.4vw, 32px); }
body .post-card { border: 1px solid var(--mb-line); border-radius: var(--mb-radius); box-shadow: none; overflow: hidden; background: #fff; transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
body .post-card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 22px 44px -22px rgba(20,17,15,.28); }
body .post-card-image-link { border-radius: 0 !important; background: var(--mb-wash); }
body .post-card-large .post-card-image-link { border-radius: 0 !important; }
body .post-card-image { transition: transform .5s ease; }
body .post-card:hover .post-card-image { transform: scale(1.03); }
body .post-card-content { padding: 22px 24px 20px; }
body .post-card-primary-tag { display: inline-block; font: 600 1.15rem/1 var(--mb-font-head); letter-spacing: .07em; text-transform: uppercase; color: var(--mb-accent); background: rgba(197,48,48,.08); padding: 6px 10px; border-radius: 6px; margin-bottom: 12px; }
body .post-card-title { font-family: var(--mb-font-head); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; color: var(--mb-ink); }
body .post-card-excerpt { color: var(--mb-muted); line-height: 1.6; }
body .post-card-meta { margin-top: 14px; font: 500 1.25rem var(--mb-font-body); color: var(--mb-muted); }
body .post-card-meta-length::before { content: "·"; margin: 0 8px; }
body .post-card-large .post-card-title { font-size: clamp(2.8rem, 3.4vw, 4.2rem); }

/* ---------- Article ---------- */
.mb-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--mb-accent); z-index: 100; transition: width .1s linear; }
.mb-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 18px; padding: 0; list-style: none; font: 500 1.3rem var(--mb-font-body); color: var(--mb-muted); }
.mb-crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.mb-crumbs a { color: var(--mb-muted); text-decoration: none; }
.mb-crumbs a:hover { color: var(--mb-accent); }
body .article-title { font-family: var(--mb-font-head); font-weight: 600; letter-spacing: -.022em; line-height: 1.14; color: var(--mb-ink); }
body .article-excerpt { font: 400 2rem/1.55 var(--mb-font-body); color: var(--mb-muted); }
body .article-byline { border-top: 1px solid var(--mb-line); border-bottom: 1px solid var(--mb-line); padding: 16px 0; margin-top: 8px; }
body .gh-content { font-family: var(--mb-font-body); }
body .gh-content > p, body .gh-content > ul, body .gh-content > ol { font-size: 1.9rem; line-height: 1.75; color: #2a2623; }
body .gh-content > h2, body .gh-content > h3 { font-family: var(--mb-font-head); letter-spacing: -.02em; scroll-margin-top: 90px; }
body .gh-content > h2 { margin-top: 2.2em; padding-top: .2em; }
body .gh-content a:not([class]) { color: var(--mb-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
body .gh-content blockquote:not([class]) { border-left: 4px solid var(--mb-accent); background: var(--mb-wash); padding: 18px 24px; border-radius: 0 12px 12px 0; font-style: normal; }
body .gh-content table { display: block; overflow-x: auto; }
body .gh-content table th { background: var(--mb-wash); font-family: var(--mb-font-head); }

.mb-toc { max-width: 720px; margin: 0 auto 36px; padding: 20px 24px; border: 1px solid var(--mb-line); border-radius: 16px; background: var(--mb-wash); }
.mb-toc[hidden] { display: none; }
.mb-toc-title { margin: 0 0 10px; font: 500 1.2rem var(--mb-font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--mb-muted); }
.mb-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 8px; }
.mb-toc li { counter-increment: toc; font: 500 1.55rem/1.4 var(--mb-font-body); }
.mb-toc li::before { content: counter(toc, decimal-leading-zero); margin-right: 10px; font: 600 1.2rem var(--mb-font-head); color: var(--mb-accent); }
.mb-toc a { color: var(--mb-ink-2); text-decoration: none; }
.mb-toc a:hover { color: var(--mb-accent); }

.mb-share { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid var(--mb-line); font: 600 1.4rem var(--mb-font-head); }
.mb-share a, .mb-share button { font: 500 1.35rem var(--mb-font-head); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--mb-line); background: #fff; color: var(--mb-ink-2); text-decoration: none; cursor: pointer; }
.mb-share a:hover, .mb-share button:hover { background: var(--mb-ink); color: #fff; }

.mb-author { display: flex; gap: 18px; align-items: center; max-width: 720px; margin: 28px auto 0; padding: 22px; border: 1px solid var(--mb-line); border-radius: 16px; }
.mb-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.mb-author h3 { margin: 0 0 4px; font: 600 1.7rem var(--mb-font-head); }
.mb-author h3 a { color: inherit; text-decoration: none; }
.mb-author p { margin: 0; font: 400 1.45rem/1.55 var(--mb-font-body); color: var(--mb-muted); }

.mb-more-title { max-width: 1300px; margin: 0 auto 24px; font: 600 clamp(2.4rem, 3vw, 3.2rem) var(--mb-font-head); letter-spacing: -.02em; }

/* ---------- Footer ---------- */
body .site-footer.outer { background: #14110f; color: rgba(255,255,255,.68); padding-top: 64px; padding-bottom: 28px; }
.mb-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(20px, 2.4vw, 32px); max-width: 1300px; margin: 0 auto; align-items: start; }
.mb-foot > * { min-width: 0; }
.mb-foot-logo { display: block; height: 30px; width: auto; margin-left: -9px; }
.mb-foot-about { margin: 18px 0 0; max-width: 38ch; font: 400 1.5rem/1.65 var(--mb-font-body); color: rgba(255,255,255,.62); }
.mb-foot h4 { margin: 4px 0 18px; font: 500 1.15rem/1 var(--mb-font-head); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.95); }
.mb-foot ul, .mb-foot .nav { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.mb-foot li { margin: 0; padding: 0; }
.mb-foot a { color: rgba(255,255,255,.68); text-decoration: none; font: 400 1.5rem/1.3 var(--mb-font-body); transition: color .15s; }
.mb-foot a:hover { color: #fff; }
.mb-foot-bottom { max-width: 1300px; margin: 48px auto 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 24px; font: 400 1.3rem var(--mb-font-body); color: rgba(255,255,255,.5); }
.mb-foot-bottom a { font-size: 1.3rem; color: rgba(255,255,255,.7); }
@media (max-width: 820px) { .mb-foot { grid-template-columns: 1fr 1fr; gap: 36px 24px; } .mb-foot > :first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .mb-foot { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .mb-hero h1 { max-width: none; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } body .post-card, body .post-card-image { transition: none !important; transform: none !important; } }

/* ---------- Refinements: tags, quick answer, premium details ---------- */
body .post-card-primary-tag, body .post-card-primary-tag a, body .article-tag a { color: var(--mb-accent) !important; text-decoration: none; }
body .post-card-primary-tag { font-weight: 500; letter-spacing: .09em; background: rgba(197,48,48,.07); border: 1px solid rgba(197,48,48,.14); padding: 7px 11px; border-radius: 999px; }
body .article-tag { margin-bottom: 14px; }
body .post-card-featured { color: var(--mb-accent); font-weight: 500; }
.mb-answer-label { margin: 0 0 8px; font: 500 1.15rem/1 var(--mb-font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--mb-accent); }
body .article-excerpt { font-weight: 400; color: #4a433f; }
body .author-name { font-family: var(--mb-font-head); font-weight: 500; }
body .gh-head-menu a { font-weight: 500; }
body .post-card-excerpt { font-size: 1.55rem; }
body .gh-content > h2 { font-weight: 600; } body .gh-content > h3 { font-weight: 600; }
body .gh-content strong, body .gh-content b { font-weight: 600; }
.mb-hero h1, body .article-title, body .post-card-title { text-wrap: balance; }
.mb-hero p { text-wrap: pretty; }
.mb-topic { font-weight: 500; letter-spacing: -.005em; }
.mb-topic small { font-family: var(--mb-font-body); }
.mb-share a, .mb-share button { font-weight: 500; }
body .post-card:hover .post-card-title { color: var(--mb-accent); }



.mb-crumbs li { display: inline-flex; align-items: baseline; margin: 0; padding: 0; line-height: 1.5; }
.mb-crumbs li:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.mb-crumbs a { display: inline; line-height: 1.5; }
.mb-answer { margin: 28px 0 8px; padding: 4px 0 4px 20px; border-left: 3px solid var(--mb-accent); }
.mb-answer .mb-answer-label { margin: 0 0 10px; }
.mb-answer .article-excerpt { margin: 0; padding: 0; }
@media (max-width: 600px) { .mb-answer { padding-left: 16px; } .mb-hero p { font-size: 1.6rem; } }

/* ---------- Hero v2: centred, premium ---------- */
.mb-hero { position: relative; isolation: isolate; text-align: center; overflow: hidden;
    padding: clamp(56px, 9vw, 120px) max(4vmin, 20px) clamp(56px, 8vw, 104px);
    border-bottom: 1px solid var(--mb-line);
    background:
        radial-gradient(720px 320px at 50% -8%, rgba(197,48,48,.13), transparent 70%),
        radial-gradient(520px 260px at 8% 100%, rgba(197,48,48,.06), transparent 70%),
        radial-gradient(520px 260px at 92% 100%, rgba(197,48,48,.06), transparent 70%),
        #fff; }
.mb-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(20,17,15,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(20,17,15,.045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 35%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 60% 70% at 50% 35%, #000 20%, transparent 75%); }
.mb-hero-inner { display: flex; flex-direction: column; align-items: center; }
.mb-hero-inner > * { max-width: 100%; }
.mb-eyebrow { background: rgba(255,255,255,.8); box-shadow: 0 1px 2px rgba(20,17,15,.05); }
.mb-hero h1 { max-width: 17ch; margin: 26px auto 20px; font-size: clamp(3.8rem, 6.4vw, 7rem); line-height: 1.06; letter-spacing: -.035em; }
.mb-hero h1 em { color: var(--mb-accent); -webkit-text-fill-color: currentColor; }
.mb-hero p { max-width: 62ch; margin: 0 auto 36px; font-size: clamp(1.6rem, 1.4vw, 1.9rem); line-height: 1.7; color: #5d5651; text-wrap: balance; }
.mb-search { max-width: 600px; margin: 0 auto; padding: 17px 22px; font-size: 1.6rem; border-color: rgba(20,17,15,.1);
    box-shadow: 0 1px 2px rgba(20,17,15,.05), 0 18px 40px -18px rgba(20,17,15,.22); }
.mb-search:hover { border-color: rgba(197,48,48,.5); box-shadow: 0 1px 2px rgba(20,17,15,.05), 0 22px 44px -16px rgba(197,48,48,.32); }
.mb-search span { flex: 1; text-align: left; }
@media (max-width: 600px) { .mb-hero h1 { max-width: 12ch; } .mb-hero p { text-wrap: pretty; } }

/* selection: readable everywhere, on brand */
::selection { background: rgba(197,48,48,.2); color: inherit; -webkit-text-fill-color: currentColor; }
.mb-skip { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: var(--mb-ink); color: #fff; font: 500 1.4rem var(--mb-font-head); text-decoration: none; transition: top .15s; }
.mb-skip:focus { top: 12px; }
img { height: auto; }
body .post-card-image-link { aspect-ratio: 16 / 9; }
body .post-card-image-link .post-card-image { width: 100%; height: 100%; object-fit: cover; }
@media print { .gh-head, .site-footer, .mb-share, .mb-progress, .mb-toc { display: none !important; } }
