/* TB Terminal: main styles */

:root {
	--void: #0a0f14;
	--panel: #0f1821;
	--panel-2: #142130;
	--line: #1d2b38;
	--line-2: #2a3d4f;
	--text: #d5e1e9;
	--bright: #eef5f9;
	--muted: #8398a8;
	--cyan: #1bb0ce;
	--amber: #f2b33d;
	--up: #4cd28a;
	--red: #ff6b6b;
	--accent: var(--cyan);
	--accent-ink: #04131a;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	--wrap: 1180px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 8px;
	--header-h: 64px;
}

body.tb-cat-personal-blog { --accent: var(--amber); --accent-ink: #1a1203; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--void);
	color: var(--text);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--bright); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* WordPress wrappers: let the header's own sticky work and keep main flush */
.wp-block-template-part:has(.tb-header) { display: contents; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.tb-main { margin: 0; min-height: 60vh; }
.tb-main > * { margin-block-start: 0; }

.tb-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.tb-wrap--list { max-width: 980px; padding-block: 56px 80px; }

.tb-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; font-family: var(--mono); }
.tb-skip:focus { left: 8px; }

/* ------------------------------------------------------------ header */
.tb-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(10, 15, 20, 0.82);
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	border-bottom: 1px solid var(--line);
}
.admin-bar .tb-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tb-header { top: 46px; } }

.tb-header__in { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.tb-logo { font-family: var(--mono); font-weight: 600; font-size: 1rem; color: var(--bright); text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.tb-logo:hover { color: var(--bright); }
.tb-logo__user { color: var(--up); }
.tb-logo__at, .tb-logo__path { color: var(--muted); }
.tb-logo__host { color: var(--cyan); }
.tb-logo .tb-caret { margin-left: 6px; }

.tb-caret { display: inline-block; width: 0.6em; height: 1.1em; background: var(--accent); vertical-align: text-bottom; animation: tb-blink 1.1s steps(1) infinite; }
@keyframes tb-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tb-caret { animation: none; } }

.tb-nav { display: flex; gap: 4px; margin-left: auto; font-family: var(--mono); font-size: 0.9rem; }
.tb-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; transition: color .15s, background .15s; }
.tb-nav a span { opacity: .55; }
.tb-nav a:hover { color: var(--bright); background: var(--panel); }
.tb-nav a[aria-current="page"] { color: var(--bright); }
.tb-nav a[aria-current="page"] span { color: var(--accent); opacity: 1; }

.tb-search-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--panel); color: var(--muted);
	border: 1px solid var(--line); border-radius: 6px;
	padding: 6px 8px 6px 10px; font: 500 0.85rem var(--mono); cursor: pointer;
	transition: border-color .15s, color .15s;
}
.tb-search-btn:hover { color: var(--bright); border-color: var(--line-2); }
kbd { font: 500 0.72rem var(--mono); color: var(--muted); background: var(--void); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; }

.tb-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px var(--accent); opacity: 0; }
.single-post .tb-progress { opacity: 1; }

@media (max-width: 760px) {
	.tb-header__in { flex-wrap: wrap; gap: 0 12px; padding-block: 10px 0; }
	.tb-nav { order: 3; width: 100%; margin: 4px -10px 0; overflow-x: auto; }
	.tb-search-btn { margin-left: auto; }
	.tb-search-btn__label, .tb-search-btn kbd { display: none; }
	:root { --header-h: 96px; }
}

/* ------------------------------------------------------------ palette (Ctrl K) */
.tb-palette { position: fixed; inset: 0; z-index: 200; background: rgba(4, 8, 12, .72); backdrop-filter: blur(4px); display: grid; place-items: start center; padding: 12vh 16px 16px; }
.tb-palette[hidden] { display: none; }
.tb-palette__box { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(27,176,206,.08); overflow: hidden; animation: tb-pop .14s ease-out; }
@keyframes tb-pop { from { transform: translateY(-6px) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tb-palette__box { animation: none; } }
.tb-palette__form { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tb-palette__prompt { font: 600 .9rem var(--mono); color: var(--up); white-space: nowrap; }
.tb-palette__form input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--bright); font: 500 1rem var(--mono); outline: none; }
.tb-palette__form input::-webkit-search-cancel-button { display: none; }
.tb-palette__results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.tb-palette__results:empty { display: none; }
.tb-palette__results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .95rem; }
.tb-palette__results a[aria-selected="true"], .tb-palette__results a:hover { background: var(--panel-2); color: var(--bright); }
.tb-palette__results a[aria-selected="true"]::before { content: "> "; color: var(--accent); font-family: var(--mono); }
.tb-palette__hint { margin: 0; padding: 10px 16px; font: .8rem var(--mono); color: var(--muted); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ buttons, links */
.tb-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--accent); color: var(--accent-ink);
	border: 1px solid var(--accent); border-radius: 6px;
	padding: 11px 18px; font: 600 .92rem var(--mono); text-decoration: none; cursor: pointer;
	transition: box-shadow .2s, transform .2s;
}
.tb-btn:hover { color: var(--accent-ink); box-shadow: 0 0 0 4px rgba(27,176,206,.18), 0 0 24px rgba(27,176,206,.35); }
.tb-btn--ghost { background: transparent; color: var(--bright); border-color: var(--line-2); }
.tb-btn--ghost:hover { color: var(--bright); border-color: var(--accent); box-shadow: none; }

.tb-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0; font: 500 .88rem var(--mono); }
.tb-links a { color: var(--muted); text-decoration: none; }
.tb-links a::before { content: "./"; color: var(--line-2); transition: color .15s; }
.tb-links a:hover { color: var(--bright); }
.tb-links a:hover::before { color: var(--accent); }

/* ------------------------------------------------------------ hero */
.tb-hero {
	position: relative;
	padding-block: clamp(56px, 9vw, 112px) clamp(56px, 8vw, 96px);
	border-bottom: 1px solid var(--line);
	background:
		radial-gradient(900px 420px at 85% 30%, rgba(27,176,206,.10), transparent 70%),
		linear-gradient(var(--void), var(--void));
	overflow: hidden;
}
.tb-hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 48px 48px;
	opacity: .35;
	mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
}
.tb-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.tb-hello { margin: 0 0 6px; font: 500 1rem var(--mono); color: var(--up); }
.tb-name { margin: 0; font: 760 clamp(2.9rem, 7.4vw, 5.6rem)/0.95 var(--mono); letter-spacing: -0.045em; color: var(--bright); }
.tb-tagline { margin: 20px 0 0; font: 500 clamp(1.05rem, 1.6vw, 1.25rem)/1.4 var(--mono); color: var(--accent); }
.tb-intro { margin: 16px 0 0; max-width: 46ch; color: var(--text); font-size: 1.05rem; line-height: 1.65; }
.tb-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }

/* Terminal window (hero + 404) */
.tb-term {
	background: linear-gradient(180deg, #0d1620, #0b131b);
	border: 1px solid var(--line-2);
	border-radius: 12px;
	box-shadow: 0 0 0 1px rgba(27,176,206,.06), 0 24px 70px rgba(0,0,0,.55), 0 0 90px rgba(27,176,206,.10);
	overflow: hidden;
	font: 400 .9rem/1.65 var(--mono);
}
.tb-term__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.015); }
.tb-term__bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.tb-term__bar i:first-child { background: #e5534b; } .tb-term__bar i:nth-child(2) { background: #d9a43a; } .tb-term__bar i:nth-child(3) { background: #45b26b; }
.tb-term__bar span { margin-left: 10px; color: var(--muted); font-size: .8rem; }
.tb-term__body { padding: 18px 20px 20px; min-height: 360px; box-sizing: border-box; }
.tl { white-space: pre-wrap; word-break: break-word; }
.tl--cmd { color: var(--bright); }
.tl--cmd + .tl--cmd, .tl--out + .tl--cmd { margin-top: 10px; }
.tl__p { color: var(--up); }
.tl--out { color: var(--text); opacity: .86; }
.tl--hi { color: var(--amber); }
.tl--list::before { content: "- "; color: var(--muted); }
.tl--err { color: var(--red); }
.tl--post { display: flex; gap: 12px; }
.tl--post time { color: var(--muted); flex: none; }
.tl--post a { color: var(--cyan); text-decoration: none; }
.tl--post a:hover { text-decoration: underline; color: var(--bright); }
/* typing state (set by JS) */
[data-tb-typer].is-typing .tl { display: none; }
[data-tb-typer].is-typing .tl.is-shown { display: block; }
[data-tb-typer].is-typing .tl--post.is-shown { display: flex; }

@media (max-width: 900px) {
	.tb-hero__grid { grid-template-columns: 1fr; }
	.tb-term__body { min-height: 0; }
}

/* ------------------------------------------------------------ sections */
.tb-section { padding-block: clamp(56px, 8vw, 96px); border-bottom: 1px solid var(--line); }
.tb-h2 { display: flex; flex-direction: column; gap: 6px; margin: 0 0 32px; }
.tb-h2__prompt { font: 500 .88rem var(--mono); color: var(--muted); }
.tb-h2__prompt::first-letter { color: var(--up); }
.tb-h2__title { font: 700 clamp(1.7rem, 3.2vw, 2.3rem)/1.15 var(--mono); letter-spacing: -0.03em; color: var(--bright); }
.tb-section__lede { max-width: 60ch; color: var(--muted); margin: -16px 0 28px; }

/* Post rows: ls -l style */
.tb-rows { border-top: 1px solid var(--line); }
.tb-row {
	position: relative;
	display: grid; grid-template-columns: 7.2rem 8rem minmax(0, 1fr) 4.5rem; gap: 4px 20px; align-items: baseline;
	padding: 16px 12px 16px 16px; border-bottom: 1px solid var(--line);
	transition: background .15s;
}
.tb-row::before { content: ">"; position: absolute; left: 0; top: 16px; font-family: var(--mono); color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .15s, transform .15s; }
.tb-row:hover { background: var(--panel); }
.tb-row:hover::before, .tb-row:focus-within::before { opacity: 1; transform: none; }
.tb-row__date, .tb-row__rt { font: 500 .82rem var(--mono); color: var(--muted); }
.tb-row__rt { text-align: right; }
.tb-row__title { margin: 0; font: 600 1.06rem/1.4 var(--sans); letter-spacing: -0.01em; }
.tb-row__title a { color: var(--bright); text-decoration: none; }
.tb-row__title a::after { content: ""; position: absolute; inset: 0; }
.tb-row:hover .tb-row__title a { color: var(--cyan); }
.tb-row.tb-kind-personal-blog:hover .tb-row__title a { color: var(--amber); }
.tb-row--featured { padding-block: 26px; }
.tb-row--featured .tb-row__title { font: 700 clamp(1.3rem, 2.4vw, 1.65rem)/1.25 var(--mono); letter-spacing: -0.03em; }
.tb-row__excerpt { grid-column: 3 / 5; margin: 6px 0 0; color: var(--muted); font-size: .97rem; max-width: 70ch; }

.tb-tag { justify-self: start; font: 500 .76rem/1 var(--mono); color: var(--cyan); border: 1px solid rgba(27,176,206,.35); background: rgba(27,176,206,.07); border-radius: 4px; padding: 4px 7px; white-space: nowrap; }
.tb-kind-personal-blog .tb-tag, .tb-kind-personal-blog.tb-tag { color: var(--amber); border-color: rgba(242,179,61,.35); background: rgba(242,179,61,.07); }

@media (max-width: 680px) {
	.tb-row { grid-template-columns: auto auto 1fr; padding-inline: 4px; }
	.tb-row::before { display: none; }
	.tb-row__title { grid-column: 1 / -1; grid-row: 2; }
	.tb-row__rt { grid-column: 3; grid-row: 1; }
	.tb-row__excerpt { grid-column: 1 / -1; }
}

.tb-more { margin: 24px 0 0; font: 600 .92rem var(--mono); }
.tb-more a { text-decoration: none; }
.tb-more a::before { content: "cd ~/blog  "; color: var(--muted); }

/* About */
.tb-about__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.tb-prose p { margin: 0 0 1.1em; max-width: 64ch; font-size: 1.04rem; }
.tb-timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line-2); }
.tb-timeline li { position: relative; padding: 0 0 26px; display: flex; flex-direction: column; gap: 3px; }
.tb-timeline li:last-child { padding-bottom: 0; }
.tb-timeline li::before { content: ""; position: absolute; left: -27px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--void); border: 1px solid var(--accent); }
.tb-timeline li:last-child::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tb-timeline__when { font: 500 .8rem var(--mono); color: var(--accent); }
.tb-timeline strong { font: 650 1rem var(--mono); color: var(--bright); }
.tb-timeline__text { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .tb-about__grid { grid-template-columns: 1fr; } }

/* Skills: systemd unit list */
.tb-units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tb-unit { padding: 22px 24px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tb-unit__name { margin: 0; display: flex; align-items: center; gap: 10px; font: 650 1.02rem var(--mono); color: var(--bright); }
.tb-unit__note { margin: 4px 0 0 18px; color: var(--muted); font-size: .93rem; }
.tb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px rgba(76,210,138,.7); }
.tb-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0 18px; }
.tb-chips li { font: 500 .8rem/1 var(--mono); color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; }
@media (max-width: 760px) { .tb-units { grid-template-columns: 1fr; } .tb-unit { padding-inline: 16px; } }

/* Homelab host list */
.tb-hostlist { font: 400 .92rem var(--mono); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.tb-host { display: grid; grid-template-columns: 12rem 11rem minmax(0, 1fr); gap: 16px; padding: 13px 18px; border-top: 1px solid var(--line); }
.tb-host--head { border-top: 0; color: var(--muted); font-size: .8rem; background: rgba(255,255,255,.015); }
.tb-host__name { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-weight: 600; }
.tb-host__role { color: var(--bright); }
.tb-host__runs { color: var(--muted); }
@media (max-width: 760px) {
	.tb-host { grid-template-columns: 1fr auto; gap: 2px 12px; }
	.tb-host--head { display: none; }
	.tb-host__runs { grid-column: 1 / -1; }
}

/* Contact */
.tb-contact { border-bottom: 0; }
.tb-contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.tb-contact .tb-section__lede { margin-top: -16px; }
@media (max-width: 860px) { .tb-contact__grid { grid-template-columns: 1fr; } }

.tb-form { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: clamp(18px, 3vw, 28px); }
.tb-field { display: grid; gap: 6px; }
.tb-field label { font: 500 .85rem var(--mono); color: var(--muted); }
.tb-field input, .tb-field textarea, .tb-comments input:not([type=submit]):not([type=checkbox]), .tb-comments textarea {
	width: 100%; box-sizing: border-box; background: var(--void); color: var(--bright);
	border: 1px solid var(--line-2); border-radius: 6px; padding: 11px 12px; font: 400 1rem var(--sans);
	transition: border-color .15s, box-shadow .15s;
}
.tb-field input:focus, .tb-field textarea:focus, .tb-comments input:focus, .tb-comments textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,176,206,.18); }
.tb-field--hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tb-form .tb-btn { justify-self: start; }
.tb-notice { margin: 0; padding: 12px 14px; border-radius: 6px; font: 500 .9rem var(--mono); }
.tb-notice--ok { color: var(--up); background: rgba(76,210,138,.08); border: 1px solid rgba(76,210,138,.3); }
.tb-notice--err { color: var(--red); background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.3); }

/* ------------------------------------------------------------ archives */
.tb-archive-head { margin-bottom: 36px; }
.tb-archive-head__prompt { margin: 0 0 8px; font: 500 .9rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.tb-archive-head__prompt::first-letter { color: var(--up); }
.tb-archive-head__title { margin: 0; font: 760 clamp(2rem, 5vw, 3.2rem)/1.05 var(--mono); letter-spacing: -0.04em; color: var(--bright); overflow-wrap: anywhere; }
.tb-archive-head__desc { color: var(--muted); max-width: 60ch; margin-top: 12px; }
.tb-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; font: 500 .85rem var(--mono); }
.tb-filters a { color: var(--muted); text-decoration: none; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 6px; transition: color .15s, border-color .15s; }
.tb-filters a span { color: var(--line-2); margin-left: 4px; }
.tb-filters a:hover { color: var(--bright); border-color: var(--muted); }
.tb-filters a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tb-filters a[aria-current="page"] span { color: var(--accent-ink); opacity: .6; }

.tb-pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 32px 0 0; font: 500 .9rem var(--mono); }
.tb-pagination a, .tb-pagination span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); text-decoration: none; }
.tb-pagination .current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tb-pagination a:hover { color: var(--bright); border-color: var(--muted); }
.tb-empty { padding: 24px 0; color: var(--muted); }
.tb-empty .tl { font-family: var(--mono); color: var(--red); }

.tb-subscribe { margin-top: 56px; padding: 22px 24px; border: 1px dashed var(--line-2); border-radius: var(--radius); display: grid; gap: 12px; }
.tb-subscribe__text { margin: 0; color: var(--muted); }
.tb-subscribe__text strong { color: var(--bright); font-family: var(--mono); }
.tb-subscribe .wp-block-jetpack-subscriptions { margin: 0; }

/* 404 */
.tb-404 .tb-term { max-width: 640px; margin-bottom: 40px; }
.tb-404 .tb-term__body { min-height: 0; }
.tb-404 > p { color: var(--muted); }
.tb-404 .tb-rows { margin-top: 40px; }

/* ------------------------------------------------------------ single post */
.tb-single__grid { display: grid; grid-template-columns: minmax(0, 760px) 1fr; gap: 64px; padding-block: 56px 96px; }
.tb-page { max-width: 820px; padding-block: 56px 96px; }
.tb-page--wide { max-width: var(--wrap); }
.tb-article { min-width: 0; }
.tb-crumb { margin: 0 0 14px; font: 500 .88rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.tb-crumb span { color: var(--up); }
.tb-crumb a { color: var(--muted); text-decoration: none; }
.tb-crumb a:hover { color: var(--accent); }
.tb-post-head__title { margin: 0; font: 740 clamp(1.9rem, 4.2vw, 2.9rem)/1.12 var(--mono); letter-spacing: -0.04em; color: var(--bright); text-wrap: balance; }
.tb-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 18px 0 0; font: 500 .85rem var(--mono); color: var(--muted); }
.tb-meta a { color: var(--muted); }
.tb-hero-img { margin: 32px 0 0 !important; }
.tb-hero-img img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

@media (max-width: 1180px) { .tb-single__grid { grid-template-columns: minmax(0, 1fr); max-width: 820px; } }

/* Table of contents */
.tb-toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; font: 400 .84rem/1.45 var(--mono); padding-left: 16px; border-left: 1px solid var(--line); }
.tb-toc[hidden] { display: none; }
.tb-toc__title { margin: 0 0 10px; color: var(--bright); font-weight: 600; }
.tb-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tb-toc a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; transition: color .15s; }
.tb-toc .is-h3 a { padding-left: 14px; font-size: .8rem; }
.tb-toc a:hover { color: var(--bright); }
.tb-toc a.is-active { color: var(--accent); }
.tb-toc a.is-active::before { content: "> "; }
@media (max-width: 1180px) { .tb-toc { display: none; } }

/* Post content */
.tb-content { margin-top: 36px; font-size: 1.07rem; line-height: 1.78; }
.tb-content > * { margin-block: 0 1.25em; }
.tb-content h2, .tb-content h3, .tb-content h4 { color: var(--bright); font-family: var(--mono); letter-spacing: -0.02em; margin: 2em 0 .6em; scroll-margin-top: calc(var(--header-h) + 24px); }
.tb-content h2 { font-size: 1.55rem; }
.tb-content h3 { font-size: 1.22rem; }
.tb-content h4 { font-size: 1.05rem; }
.tb-content h2::before { content: "## "; color: var(--accent); opacity: .7; }
.tb-content h3::before { content: "### "; color: var(--accent); opacity: .55; }
.tb-content strong { color: var(--bright); }
.tb-content ul, .tb-content ol { padding-left: 1.4em; }
.tb-content li { margin: .35em 0; }
.tb-content li::marker { color: var(--accent); font-family: var(--mono); }
.tb-content hr { border: 0; border-top: 1px dashed var(--line-2); margin: 2.5em 0; }
.tb-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.tb-content figure { margin-inline: 0; }
.tb-content figcaption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 8px; }
.tb-content blockquote, .tb-content .wp-block-quote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--text); }
.tb-content .wp-block-pullquote { border-color: var(--line-2); }
.tb-content table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tb-content .wp-block-table { overflow-x: auto; }
.tb-content th, .tb-content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.tb-content thead, .tb-content .wp-block-table thead { border-bottom: 0; }
.tb-content .wp-block-table tfoot { border-top: 0; }
.tb-content th { background: var(--panel); color: var(--bright); font-family: var(--mono); font-weight: 600; font-size: .85rem; }
.tb-content tr:nth-child(even) td { background: rgba(255,255,255,.012); }
.tb-content .wp-block-table figcaption { text-align: left; }
.tb-content .wp-block-image.alignwide, .tb-content .alignwide { margin-inline: 0; }

/* Inline code */
.tb-content :not(pre) > code, .tb-content kbd {
	font: 500 .88em var(--mono); color: #9fe3f1; background: var(--panel-2);
	border: 1px solid var(--line); border-radius: 4px; padding: .1em .38em;
}
.tb-content kbd { color: var(--bright); border-bottom-width: 2px; }

/* Code blocks */
.tb-content pre, .tb-content .wp-block-code, .tb-content .wp-block-preformatted {
	position: relative;
	background: #070b10; color: #cfdde7;
	border: 1px solid var(--line-2); border-radius: var(--radius);
	padding: 0; margin-inline: 0; overflow: hidden;
	font: 400 .875rem/1.65 var(--mono);
}
.tb-content pre > code, .tb-content .tb-pre-scroll {
	display: block; padding: 16px 18px; overflow-x: auto; background: transparent; border: 0; white-space: pre; color: inherit; font: inherit;
}
.tb-content .wp-block-preformatted { padding: 16px 18px; white-space: pre-wrap; }
.tb-codebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); background: var(--panel); font: 500 .75rem var(--mono); color: var(--muted); }
.tb-copy { background: transparent; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 9px; font: 500 .75rem var(--mono); cursor: pointer; transition: color .15s, border-color .15s; }
.tb-copy:hover { color: var(--bright); border-color: var(--muted); }
.tb-copy.is-done { color: var(--up); border-color: rgba(76,210,138,.5); }

/* highlight.js tokens, tuned to the palette */
.hljs-comment, .hljs-quote { color: #5f7486; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal { color: #1bb0ce; }
.hljs-string, .hljs-attr + .hljs-string, .hljs-regexp, .hljs-addition { color: #9be28f; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #f2b33d; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable, .hljs-template-variable { color: #8fc8ff; }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-name { color: #e9d27a; }
.hljs-type, .hljs-class .hljs-title, .hljs-params { color: #cfdde7; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-deletion { color: var(--red); }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }

/* Tags, post nav, comments */
.tb-post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 40px 0 0; font: 500 .85rem var(--mono); }
.tb-post-tags a { color: var(--muted); text-decoration: none; }
.tb-post-tags a:hover { color: var(--accent); }

.tb-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.tb-post-nav a { display: grid; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--bright); text-decoration: none; font-weight: 600; line-height: 1.4; transition: border-color .15s, background .15s; }
.tb-post-nav a:hover { border-color: var(--accent); background: var(--panel); color: var(--bright); }
.tb-post-nav span { font: 500 .78rem var(--mono); color: var(--muted); }
.tb-post-nav__prev span::before { content: "cd ../  "; color: var(--accent); }
.tb-post-nav__next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .tb-post-nav { grid-template-columns: 1fr; } .tb-post-nav__next { grid-column: 1; } }

.tb-comments { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.tb-comments h2, .tb-comments h3, .tb-comments .comment-reply-title { font: 650 1.3rem var(--mono); color: var(--bright); }
.tb-comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.tb-comment__meta { gap: 6px 14px; font: 500 .85rem var(--mono); color: var(--muted); }
.tb-comment__meta .wp-block-comment-author-name { color: var(--bright); font-weight: 600; }
.tb-comment__meta a { color: inherit; text-decoration: none; }
.tb-comments .wp-block-comment-reply-link a { font: 500 .82rem var(--mono); }
.tb-comments .comment-form { display: grid; gap: 14px; }
.tb-comments .comment-form p { margin: 0; display: grid; gap: 6px; }
.tb-comments .comment-form label { font: 500 .85rem var(--mono); color: var(--muted); }
.tb-comments .comment-form-cookies-consent { display: flex !important; align-items: center; gap: 8px !important; }
.tb-comments input[type=submit] { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 11px 18px; font: 600 .92rem var(--mono); cursor: pointer; justify-self: start; }
.tb-comments .logged-in-as, .tb-comments .comment-notes { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------ footer */
.tb-footer { border-top: 1px solid var(--line); padding-block: 40px 28px; background: #080c10; }
.tb-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; }
.tb-footer__exit { margin: 0; font: 650 1.1rem var(--mono); color: var(--bright); }
.tb-footer__exit span { color: var(--up); }
.tb-footer__line { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.tb-footer__render { margin-top: 24px; margin-bottom: 0; font: 400 .75rem var(--mono); color: #4a5d6d; }

/* Elementor content that survives on old pages shouldn't paint a white box */
.elementor-section, .elementor-widget-wrap { background-color: transparent; }
