@import url('https://fonts.googleapis.com/css2?family=Inter Tight:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&display=swap');
:root {
    --bg: #ffffff; --bg-soft: #f6f6f6; --surface: #ffffff; --surface-2: #f2f2f2;
    --line: #e6e6e6; --line-soft: #efefef;
    --text: #0a0a0a; --muted: #585858; --faint: #8c8c8c;
    --ink: #0a0a0a;
    --accent: #D6241E; --accent-strong: #A81813; --accent-soft: #F5EAE9; --accent-line: #E6C9C7;
    --maxw: 760px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg); color: var(--text);
    font-family: 'Inter', sans-serif; font-size: 17px; line-height: 1.75;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; font-kerning: normal; -webkit-text-size-adjust: 100%;
    background-image: radial-gradient(1000px 480px at 50% -16%, var(--accent-soft), transparent 62%);
    overflow-x: hidden;
}
::selection { background: var(--accent-soft); color: var(--accent-strong); }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.serif { font-family: 'Inter Tight', sans-serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent-strong); }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); padding: 16px 0; position: sticky; top: 0; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(14px); z-index: 10; }
.topbar .row { display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 20px; height: 20px; color: var(--text); flex: 0 0 auto; }
.brand .mark rect.a { fill: var(--accent); }
.brand .dot { width: 9px; height: 9px; border-radius: 0; background: var(--accent); }
.topbar .back { font-size: 14px; color: var(--muted); font-weight: 500; }
.topbar .back:hover { color: var(--text); text-decoration: none; }

/* Article */
article { padding: 56px 0 92px; }
.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
article h1 { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: clamp(32px, 5.4vw, 50px); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 16px; color: var(--text); }
.art-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint); letter-spacing: .4px; margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
article h2 { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: 27px; letter-spacing: -0.02em; margin: 48px 0 14px; color: var(--text); }
article h3 { font-size: 19px; font-weight: 600; margin: 30px 0 10px; color: var(--text); }
article p { color: #3d3d3d; margin-bottom: 20px; }
article ul, article ol { color: #3d3d3d; margin: 0 0 22px 22px; }
article li { margin-bottom: 9px; }
article strong { color: var(--text); font-weight: 600; }
article blockquote { border-left: 3px solid var(--accent); padding: 6px 0 6px 20px; margin: 28px 0; font-family: 'Inter Tight', sans-serif; font-style: italic; font-size: 21px; color: var(--text); }
article code { font-family: 'IBM Plex Mono', monospace; font-size: 14px; background: var(--bg-soft); border: 1px solid var(--line); padding: 2px 6px; border-radius: 0; color: var(--accent-strong); }
.cta-box { margin-top: 52px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 0; padding: 32px; text-align: center; }
.cta-box h3 { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: 22px; margin-bottom: 10px; color: var(--text); }
.cta-box p { color: var(--muted); margin-bottom: 18px; }
.btn { display: inline-block; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 12px 24px; border-radius: 0; transition: transform .2s, box-shadow .2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10, 10, 10, 0.22); }

footer { border-top: 1px solid var(--line); padding: 26px 0; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--faint); }

/* Neutralize the posts' old dark inline colors (they were built for a dark bg) */
article p, article li { color: #3d3d3d !important; }
article h1, article h2, article h3 { color: var(--text) !important; }
.pt, .tier .name, .tier .price, .vh .nm, .cc.lbl, .pr-cap b { color: var(--text) !important; }
.tier li, .vcol li, .cc { color: #3d3d3d !important; }
.tier .price small, .tier .desc { color: var(--faint) !important; }

/* Entrance animation */
article > *, .post-card { animation: fadeUp .6s cubic-bezier(.16,1,.3,1) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) { body { font-size: 16px; } article h1 { font-size: 32px; } }
@media (prefers-reduced-motion: reduce) { article > *, .post-card { animation: none !important; } }

/* Keep-reading / related posts (end of article) */
.related { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 64px 0; }
.related .rwrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.related .rlabel { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent-strong); }
.related h2 { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -0.02em; margin: 12px 0 28px !important; color: var(--text) !important; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rel-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 0; padding: 22px; background: #fff; box-shadow: none; transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .25s; text-decoration: none; }
.rel-card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: none; text-decoration: none; }
.rel-card .rchip { align-self: flex-start; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 4px 10px; border-radius: 0; margin-bottom: 12px; }
.rel-card h3 { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); margin-bottom: 8px; }
.rel-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; flex: 1; margin-bottom: 14px; }
.rel-card .rmore { color: var(--accent-strong); font-weight: 600; font-size: 13px; }
@media (max-width: 820px) { .rel-grid { grid-template-columns: 1fr; } }

/* Article layout with sticky table-of-contents (bookmark) */
article h2 { scroll-margin-top: 88px; }
.article-layout { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 44px; align-items: start; }
.article-layout > article, .article-layout > article.wrap { max-width: 760px; width: 100%; margin: 0; padding: 52px 0 40px; }
.toc { position: sticky; top: 84px; align-self: start; padding-top: 62px; }
.toc-inner { border-left: 1px solid var(--line); padding-left: 20px; }
.toc-label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.45; color: var(--faint); text-decoration: none; padding: 8px 0 8px 20px; margin-left: -21px; border-left: 2px solid transparent; transition: color .2s, border-color .2s, background .2s; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--text); font-weight: 600; border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); }
@media (max-width: 900px) { .article-layout { display: block; padding: 0; } .article-layout > article { max-width: 760px; margin: 0 auto; padding: 52px 24px 40px; } .toc { display: none; } }

/* Keep-reading as blog-page-style rows (green hover) */
.rel-list { border-top: 1px solid var(--line); }
.rel-row { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: start; padding: 32px 6px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .16s ease; }
.rel-row:hover { background: #D6241E; text-decoration: none; }
.rel-row .rrt { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.rel-row .rauthor { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.rel-row .rav { width: 30px; height: 30px; border-radius: 50%; background: #0a0a0a; color: #D6241E; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; font-family: 'Inter Tight', sans-serif; }
.rel-row .rauthor span { font-size: 13px; color: var(--muted); }
.rel-row .rttl { font-family: 'Inter Tight', sans-serif; font-weight: 600; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.15; letter-spacing: -0.02em; color: var(--text) !important; margin: 0 !important; }
.rel-row .rexc { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 10px 0 12px !important; }
.rel-row .rtag { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 0; padding: 6px 12px; background: #fff; }
.rel-row:hover .rrt, .rel-row:hover .rauthor span, .rel-row:hover .rexc { color: #0b1f12; }
.rel-row:hover .rtag { border-color: #0a0a0a; color: #0a0a0a; background: transparent; }
@media (max-width: 720px) { .rel-row { grid-template-columns: 1fr; gap: 10px; padding: 26px 6px; } }

/* ===== Mobile reading experience (article pages) ===== */
@media (max-width: 640px) {
    article { padding: 34px 0 52px; overflow-wrap: break-word; word-break: break-word; }
    .article-layout { display: block; padding: 0; }
    .article-layout > article, .article-layout > article.wrap { max-width: 100%; margin: 0; padding: 34px 20px 52px; }
    .toc { display: none; }
    article h1 { font-size: clamp(27px, 8.4vw, 34px); line-height: 1.14; letter-spacing: -0.02em; margin-bottom: 14px; }
    article h2 { font-size: 21px; margin: 34px 0 12px; }
    article h3 { font-size: 17px; margin: 26px 0 9px; }
    article p, article li { font-size: 16px; line-height: 1.72; }
    article ul, article ol { margin: 0 0 20px 18px; }
    article blockquote { font-size: 18px; padding: 4px 0 4px 16px; margin: 22px 0; }
    article code { font-size: 13px; word-break: break-word; }
    /* 16px stops iOS Safari auto-zooming when the search box is focused */
    .psearch input, input[type="text"], input[type="search"] { font-size: 16px; }
    .art-meta { margin-bottom: 26px; padding-bottom: 20px; }
    .cta-box { padding: 26px 20px; margin-top: 40px; }
    .cta-box h3 { font-size: 20px; }

    /* Keep-reading rows: compact, meta inline */
    .related { padding: 44px 0; }
    .related .rwrap { padding: 0 20px; }
    .related .rlabel { font-size: 10.5px; }
    .related h2 { font-size: 22px !important; margin: 10px 0 18px !important; }
    .rel-list { border-top: 1px solid var(--line); }
    .rel-row { grid-template-columns: 1fr; gap: 10px; padding: 24px 2px; }
    .rel-row .rmeta { display: flex; align-items: center; gap: 12px; }
    .rel-row .rauthor { margin-top: 0; }
    .rel-row .rav { width: 28px; height: 28px; font-size: 10.5px; }
    .rel-row .rttl { font-size: 20px; }
    .rel-row .rexc { font-size: 14.5px; margin: 8px 0 12px !important; }
}
/* No sticky green flash on touch devices */
@media (hover: none) {
    .rel-row:hover { background: transparent; }
    .rel-row:active { background: #D6241E; }
}

/* Green highlight on inline article links (matches blog rows) */
article a { transition: background .16s, color .16s; }
article a:hover { background: #D6241E; color: #ffffff; text-decoration: none; }
.topbar .back:hover, .crumbs a:hover { background: #D6241E; color: #ffffff; text-decoration: none; padding: 2px 6px; margin: 0 -6px; }

/* ===== Inter Tight display serif for headings & titles ===== */
article h1, article h2, article h3,
.cta-box h3, .related h2, .rel-card h3, .rel-row .rttl {
    font-family: 'Inter Tight', Georgia, 'Times New Roman', serif;
    font-optical-sizing: auto;
}
article h1 { font-weight: 600; letter-spacing: -0.021em; }
article h2 { font-weight: 600; letter-spacing: -0.014em; }
article h3 { font-weight: 600; }
article blockquote { font-family: 'Inter Tight', Georgia, serif; font-optical-sizing: auto; font-style: italic; }
