/* ============================================================
   Madhukar Cloud — main stylesheet
   Design tokens + components. No frameworks. Mobile-first.
   ============================================================ */

:root {
	--bg: #ffffff;
	--fg: #0B1220;
	--muted: #5b6776;
	--surface: #ffffff;
	--surface-2: #f7f9fc;
	--border: #e6ebf1;
	--brand: #22A6F2;
	--brand-2: #2E5BFF;
	--brand-fg: #ffffff;
	--code-bg: #0B1220;
	--code-fg: #e6edf5;
	--ok: #16a34a;
	--warn: #d97706;
	--danger: #dc2626;
	--shadow-sm: 0 1px 2px rgba(11,18,32,.04), 0 8px 24px -12px rgba(11,18,32,.10);
	--shadow-md: 0 1px 3px rgba(11,18,32,.06), 0 12px 40px -16px rgba(11,18,32,.18);
	--radius-sm: 8px;
	--radius: 12px;
	--radius-lg: 16px;
	--radius-xl: 20px;
	--container: 1200px;
	--container-narrow: 760px;
	--container-wide: 1100px;
	--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--font-serif: "Source Serif 4", Georgia, serif;
}

html.dark {
	--bg: #0B1220;
	--fg: #e6edf5;
	--muted: #94a3b8;
	--surface: #111a2c;
	--surface-2: #0f1729;
	--border: rgba(255,255,255,.08);
	--code-bg: #060a14;
	--code-fg: #e6edf5;
	--shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.6);
	--shadow-md: 0 1px 3px rgba(0,0,0,.5), 0 16px 40px -18px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	min-width: 0;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.small { font-size: 13px; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden;
}
.skip-link {
	position: absolute; left: -9999px; top: 8px; z-index: 99999;
	background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* ----- Header ----- */
.site-header {
	position: sticky; top: 0; z-index: 60;
	background: color-mix(in srgb, var(--bg) 70%, transparent);
	backdrop-filter: saturate(140%) blur(14px);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled {
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	border-bottom-color: var(--border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
	display: grid; place-items: center; width: 32px; height: 32px;
	border-radius: 8px; color: #fff; font-size: 12px; font-weight: 700;
	background: linear-gradient(135deg, var(--brand), var(--brand-2));
	font-family: var(--font-mono);
}
.brand-name { color: var(--fg); }
.custom-logo-link img, .custom-logo { max-height: 36px; width: auto; }

.primary-nav .menu {
	display: none; gap: 4px; list-style: none; margin: 0; padding: 0;
}
.primary-nav .menu a {
	display: inline-flex; align-items: center; padding: 8px 12px;
	font-size: 14px; font-weight: 500; color: var(--muted); border-radius: 8px;
}
.primary-nav .menu a:hover, .primary-nav .menu .current-menu-item > a { color: var(--fg); }
@media (min-width: 1180px) { .primary-nav .menu { display: flex; } }

.header-tools { display: flex; align-items: center; gap: 4px; }
.icon-btn {
	display: grid; place-items: center; width: 36px; height: 36px;
	background: transparent; border: 0; color: var(--muted);
	border-radius: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.js-menu-toggle { display: grid; }
@media (min-width: 1180px) { .js-menu-toggle { display: none; } }

html:not(.dark) .icon-sun { display: none; }
html.dark .icon-moon { display: none; }

/* ----- Mobile nav (premium slide-in panel) ----- */
.mobile-nav-backdrop[hidden],
.mobile-nav[hidden] { display: none !important; }

.mobile-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9990;
	background: rgba(8,12,22,.72);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	opacity: 0;
	transition: opacity .22s ease;
}
.mobile-nav-backdrop.is-open { opacity: 1; }

.mobile-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 9991;
	width: min(92vw, 420px);
	max-width: 100vw;
	height: 100dvh;
	min-height: 100vh;
	background: var(--bg);
	border-left: 1px solid var(--border);
	box-shadow: -24px 0 60px rgba(0,0,0,.55);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	transform: translate3d(102%,0,0);
	transition: transform .28s cubic-bezier(.22,.8,.36,1), visibility .28s ease;
	visibility: hidden;
	will-change: transform;
}
.mobile-nav.is-open { transform: translate3d(0,0,0); visibility: visible; }
.mobile-nav.is-closing { transform: translate3d(102%,0,0); visibility: visible; }

.mobile-nav__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--border);
	position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.mobile-nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 700; }
.mobile-nav__brand .brand-mark {
	display: inline-grid; place-items: center; width: 30px; height: 30px;
	border-radius: 8px; background: var(--surface-2); color: var(--fg);
	font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.mobile-nav__brand .brand-name { font-size: 15px; }

.mobile-nav__tagline {
	margin: 18px 22px 6px;
	font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
	color: var(--muted);
}

.mobile-nav__nav { padding: 8px 12px 4px; }
.mobile-nav .menu, .mobile-nav .mobile-menu {
	list-style: none; margin: 0; padding: 0;
	display: flex; flex-direction: column; gap: 2px;
}
.mobile-nav .mobile-menu li {
	opacity: 0; transform: translateX(14px);
	animation: mc-item-in .35s cubic-bezier(.22,.8,.36,1) forwards;
	animation-delay: calc(60ms + var(--i, 0) * 40ms);
}
@keyframes mc-item-in { to { opacity: 1; transform: translateX(0); } }

.mobile-nav .mobile-menu a {
	display: flex; align-items: center; gap: 14px;
	padding: 14px 16px; border-radius: 12px;
	font-size: 20px; font-weight: 600; letter-spacing: -.01em;
	color: var(--fg); text-decoration: none;
	transition: background .18s ease, color .18s ease, transform .18s ease;
}
.mobile-nav .mobile-menu a:hover,
.mobile-nav .mobile-menu a:focus-visible,
.mobile-nav .current-menu-item > a {
	background: var(--surface-2);
	transform: translateX(2px);
	outline: none;
}
.mobile-nav .mobile-menu .mm-num {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px; font-weight: 600; letter-spacing: .06em;
	color: var(--muted); min-width: 22px;
}
.mobile-nav .mobile-menu .mm-label { flex: 1; }
.mobile-nav .mobile-menu .mm-arrow {
	color: var(--muted); font-size: 18px;
	opacity: 0; transform: translateX(-6px); transition: opacity .18s, transform .18s, color .18s;
}
.mobile-nav .mobile-menu a:hover .mm-arrow,
.mobile-nav .mobile-menu a:focus-visible .mm-arrow {
	opacity: 1; transform: translateX(0); color: var(--fg);
}

.mobile-nav .menu:not(.mobile-menu) a {
	display: block; padding: 14px 16px; border-radius: 12px;
	font-size: 18px; font-weight: 600; color: var(--fg); text-decoration: none;
}
.mobile-nav .menu:not(.mobile-menu) a:hover { background: var(--surface-2); }

.mobile-nav__foot {
	margin-top: auto;
	padding: 18px 20px 22px;
	border-top: 1px solid var(--border);
	display: flex; flex-direction: column; gap: 10px;
}
.mc-pill {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 11px 14px; border-radius: 10px;
	background: var(--surface-2); color: var(--fg);
	border: 1px solid var(--border);
	font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
	transition: background .15s, border-color .15s, filter .15s;
}
.mc-pill:hover { border-color: var(--fg); }
.mc-pill--accent { background: linear-gradient(180deg, #ff2e2e, #c40000); color: #fff; border-color: transparent; }
.mc-pill--accent:hover { filter: brightness(1.05); }

.mobile-nav__socials { display: flex; gap: 6px; margin-top: 4px; }
.mobile-nav__socials a {
	display: inline-grid; place-items: center;
	width: 38px; height: 38px; border-radius: 10px;
	color: var(--muted); border: 1px solid var(--border);
	transition: background .15s, color .15s, border-color .15s;
}
.mobile-nav__socials a:hover { color: var(--fg); background: var(--surface-2); border-color: var(--fg); }

html.mc-menu-open,
body.mc-menu-open { overflow: hidden; touch-action: none; }
@media (min-width: 1180px) {
	.mobile-nav, .mobile-nav-backdrop { display: none !important; }
}

@media (max-width: 480px) {
	.mobile-nav { width: 94vw; }
	.mobile-nav__head { padding: 16px; }
	.mobile-nav__tagline { margin: 16px 18px 6px; }
	.mobile-nav__nav { padding-inline: 10px; }
	.mobile-nav .mobile-menu a { font-size: 18px; padding: 13px 14px; }
	.mobile-nav__foot { padding: 16px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.mobile-nav, .mobile-nav-backdrop, .mobile-nav .mobile-menu li { animation: none !important; transition: none !important; }
}

/* ----- Search overlay ----- */
.search-overlay { position: fixed; inset: 0; z-index: 100; }
.search-overlay__backdrop { position: absolute; inset: 0; background: rgba(11,18,32,.45); backdrop-filter: blur(4px); }
.search-overlay__panel {
	position: relative; max-width: 640px; margin: 12vh auto 0; padding: 0 16px;
}
.search-form {
	display: flex; align-items: center; gap: 10px;
	background: var(--surface); color: var(--fg);
	border: 1px solid var(--border); border-radius: 16px;
	padding: 0 12px 0 16px; box-shadow: var(--shadow-md);
}
.search-form svg { color: var(--muted); }
.search-form input {
	flex: 1; height: 56px; background: transparent; border: 0; outline: 0;
	font-size: 16px; color: var(--fg); font-family: var(--font-sans);
}
.search-overlay__hint { text-align: right; margin-top: 8px; color: rgba(255,255,255,.7); font-size: 12px; }
.search-overlay__hint kbd {
	background: rgba(255,255,255,.15); color: #fff; padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono);
}

/* ----- Buttons ----- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
	border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
	text-decoration: none;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { color: var(--bg); opacity: .92; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }

/* ----- Hero ----- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero__bg {
	position: absolute; inset: 0;
	background: radial-gradient(ellipse at 50% -20%, color-mix(in oklab, var(--brand) 22%, transparent), transparent 60%);
}
.hero__grid {
	position: absolute; inset: 0;
	background-image:
		linear-gradient(to right, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px),
		linear-gradient(to bottom, color-mix(in oklab, var(--fg) 6%, transparent) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
	        mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.hero__inner { position: relative; padding: 80px 20px; text-align: center; }
.hero__eyebrow {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12px; font-weight: 500; color: var(--muted);
	border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 60%, transparent);
	padding: 4px 10px; border-radius: 999px; margin-bottom: 18px;
	backdrop-filter: blur(6px);
}
.hero__eyebrow svg { color: var(--brand); }
.hero__title {
	font-size: clamp(32px, 5vw, 56px);
	line-height: 1.05; letter-spacing: -.025em; font-weight: 800; margin: 0 auto;
	max-width: 18ch;
}
.hero__title::after { content: ''; }
.hero__subtitle { max-width: 640px; margin: 18px auto 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 18px); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
@media (min-width: 768px) { .hero__inner { padding: 110px 20px; } }

/* ----- Sections ----- */
.section-title { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 24px; }

/* ----- Layouts ----- */
.content-with-sidebar {
	display: grid; gap: 36px; padding: 40px 20px;
	grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
	.content-with-sidebar { grid-template-columns: minmax(0,1fr) 320px; padding: 56px 20px; }
}
body.no-sidebar .content-with-sidebar { grid-template-columns: 1fr; }
.content-area { min-width: 0; }

/* ----- Post grid / cards ----- */
.post-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--fg) 18%, transparent); }
.card__media { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card__cover-fallback {
	width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--brand), var(--brand-2));
	position: relative;
}
.card__cover-fallback::after {
	content: ''; position: absolute; inset: 0; opacity: .35;
	background-image:
		linear-gradient(to right, rgba(255,255,255,.18) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255,255,255,.18) 1px, transparent 1px);
	background-size: 32px 32px;
}
.card__cat {
	position: absolute; top: 12px; left: 12px;
	background: color-mix(in srgb, var(--bg) 90%, transparent);
	color: var(--fg); font-size: 11px; font-weight: 500;
	padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(8px);
}
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.card__title { font-size: 18px; line-height: 1.35; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.card__title a { color: var(--fg); }
.card__title a:hover { color: var(--brand); }
.card__excerpt { color: var(--muted); font-size: 14px; margin: 0; }
.card__meta { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.reading-time { display: inline-flex; align-items: center; gap: 6px; }
.card .arrow { transition: transform .15s; }
.card:hover .arrow { transform: translate(2px,-2px); }

.cat-badge {
	display: inline-block; background: var(--surface-2); color: var(--fg);
	border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 500; margin-bottom: 16px;
}

/* ----- Article ----- */
.article-header { padding: 56px 0 24px; border-bottom: 1px solid var(--border); }
.article-title {
	font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -.02em;
	font-weight: 800; margin: 12px 0 0;
}
.article-deck { color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); margin: 16px 0 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: 20px 24px; align-items: center; margin-top: 24px; color: var(--muted); font-size: 14px; }
.byline { display: inline-flex; align-items: center; gap: 10px; }
.author-name { color: var(--fg); font-weight: 500; }
.avatar-round { border-radius: 999px; }
.post-meta { display: inline-flex; align-items: center; gap: 8px; }
.post-meta .dot { opacity: .6; }

.reading-progress { position: sticky; top: 64px; z-index: 50; height: 2px; background: transparent; }
.reading-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .15s; }

.article-cover {
	margin: 32px auto 0; aspect-ratio: 16/7; overflow: hidden; border-radius: var(--radius-xl);
	border: 1px solid var(--border); background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-layout {
	display: grid; gap: 40px; padding: 32px 20px;
	grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
	.article-layout { grid-template-columns: minmax(0,1fr) 280px; padding: 48px 20px 80px; }
}
.article-body { min-width: 0; max-width: 760px; }
.article-sidebar { display: none; }
@media (min-width: 1024px) { .article-sidebar { display: block; } }
.sticky-sidebar { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }

/* ----- Prose ----- */
.prose, .single-page .prose {
	font-family: var(--font-serif);
	font-size: 18px; line-height: 1.8; color: var(--fg);
}
.prose p { margin: 1.25em 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-sans); letter-spacing: -.02em; scroll-margin-top: 90px; }
.prose h2 { font-size: 1.7em; font-weight: 700; margin: 2.4em 0 .8em; }
.prose h3 { font-size: 1.3em; font-weight: 600; margin: 2em 0 .6em; }
.prose h4 { font-size: 1.1em; font-weight: 600; margin: 1.6em 0 .4em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .5em 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose blockquote {
	margin: 1.6em 0; padding: .2em 1.2em;
	border-left: 3px solid var(--brand); color: var(--muted); font-style: italic;
	background: color-mix(in srgb, var(--brand) 6%, transparent);
	border-radius: 0 var(--radius) var(--radius) 0;
}
.prose code {
	font-family: var(--font-mono); font-size: .9em;
	background: var(--surface-2); padding: .15em .4em; border-radius: 6px;
	border: 1px solid var(--border);
}
.prose pre {
	background: var(--code-bg); color: var(--code-fg);
	padding: 18px 20px; border-radius: var(--radius);
	overflow-x: auto; font-family: var(--font-mono); font-size: 14px; line-height: 1.65;
	margin: 1.5em 0; box-shadow: var(--shadow-sm); position: relative;
}
.prose pre code { background: transparent; padding: 0; border: 0; color: inherit; }
.copy-btn {
	position: absolute; top: 10px; right: 10px;
	display: inline-flex; align-items: center; gap: 6px;
	background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); border: 0;
	padding: 4px 10px; font-size: 12px; border-radius: 6px; cursor: pointer;
	font-family: var(--font-sans);
}
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-family: var(--font-sans); font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }

/* Gutenberg / WP block support */
.alignwide { width: 100vw; max-width: 1100px; margin-left: 50%; transform: translateX(-50%); }
.alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.wp-block-image figcaption, .wp-element-caption { color: var(--muted); font-size: 13px; text-align: center; margin-top: 6px; font-family: var(--font-sans); }
.wp-block-pullquote { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.6em 0; }
.wp-block-button__link { background: var(--fg) !important; color: var(--bg) !important; border-radius: 10px !important; padding: 10px 18px !important; font-weight: 600; }
.wp-block-separator { border: 0; border-top: 1px solid var(--border); }
.wp-block-quote { border-left: 3px solid var(--brand); padding-left: 1.2em; }
.wp-block-code { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius); padding: 18px 20px; font-family: var(--font-mono); }

/* Special callout blocks (Gutenberg group with "is-style-…") */
.is-style-pro-tip, .is-style-architecture-note, .is-style-troubleshooting,
.is-style-cost-tip, .is-style-security-warning {
	border-radius: 12px; padding: 16px 18px; margin: 1.6em 0;
	font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
	border-left: 4px solid var(--brand);
	background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.is-style-pro-tip::before { content: 'Pro Tip'; }
.is-style-architecture-note::before { content: 'Architecture Note'; }
.is-style-troubleshooting { border-left-color: #f59e0b; background: color-mix(in srgb, #f59e0b 8%, transparent); }
.is-style-troubleshooting::before { content: 'Troubleshooting'; color: #92400e; }
.is-style-cost-tip { border-left-color: #16a34a; background: color-mix(in srgb, #16a34a 8%, transparent); }
.is-style-cost-tip::before { content: 'Cost Optimization'; color: #14532d; }
.is-style-security-warning { border-left-color: #dc2626; background: color-mix(in srgb, #dc2626 8%, transparent); }
.is-style-security-warning::before { content: 'Security Warning'; color: #7f1d1d; }
.is-style-pro-tip::before, .is-style-architecture-note::before, .is-style-troubleshooting::before,
.is-style-cost-tip::before, .is-style-security-warning::before {
	display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; margin-bottom: 6px; color: var(--brand);
}
html.dark .is-style-troubleshooting::before { color: #fbbf24; }
html.dark .is-style-cost-tip::before { color: #4ade80; }
html.dark .is-style-security-warning::before { color: #fca5a5; }

/* Tag list, share, author */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.tag {
	display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
	background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12px;
}
.tag:hover { color: var(--fg); }

.share-row {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 12px; margin-top: 28px; padding: 14px 16px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.share-row__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px; border-radius: 8px;
	background: var(--bg); border: 1px solid var(--border); color: var(--fg);
	font-size: 12px; font-weight: 500; cursor: pointer;
}
.share-btn:hover { background: var(--surface-2); }

.author-box {
	display: grid; grid-template-columns: auto 1fr; gap: 18px;
	margin-top: 32px; padding: 24px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.author-box__name { font-weight: 600; }
.author-box__body p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.author-box__note { font-size: 12px; color: var(--muted); margin-top: 12px !important; }
.author-box__note .prompt { color: var(--brand); font-weight: 600; }

.related { margin-top: 56px; }

/* Comments */
.comments-area { margin-top: 56px; }
.comments-title { font-size: 22px; font-weight: 700; margin: 0 0 20px; letter-spacing: -.01em; }
.comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.comment-list .children { list-style: none; padding-left: 24px; margin-top: 16px; border-left: 1px solid var(--border); }
.comment-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-avatar img { border-radius: 999px; }
.comment-author { font-size: 14px; }
.comment-date { font-size: 12px; color: var(--muted); }
.comment-content { font-size: 15px; line-height: 1.65; }
.comment-actions { margin-top: 8px; font-size: 13px; color: var(--muted); }
.comment-actions a { color: var(--brand); }
.comment-form { margin-top: 24px; display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
	background: var(--bg); color: var(--fg); font-family: inherit; font-size: 14px;
}
.comment-form textarea { min-height: 120px; }
.comment-form label { font-size: 13px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 4px; }
.comment-reply-title { font-size: 18px; font-weight: 700; margin: 0; }

/* ----- Pagination ----- */
.navigation.pagination, .nav-links {
	display: flex; justify-content: center; gap: 6px; margin: 40px 0 0;
}
.page-numbers, .nav-links a, .nav-links .nav-previous a, .nav-links .nav-next a {
	display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
	padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
	background: var(--surface); color: var(--fg); font-size: 14px; font-weight: 500;
}
.page-numbers.current { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.page-numbers:hover { background: var(--surface-2); }

/* ----- Sidebar widgets ----- */
.primary-sidebar .widget, .article-sidebar .widget, .toc, .ad-wrap, .footer-widgets .widget {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 18px;
}
.widget + .widget { margin-top: 16px; }
.widget-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.widget li:last-child { border-bottom: 0; }

/* TOC */
.toc { display: none; }
.toc.has-items { display: block; }
.toc__title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.4; border-left: 2px solid transparent; }
.toc a:hover, .toc a.is-active { color: var(--fg); border-left-color: var(--brand); background: var(--surface-2); }
.toc .lvl-3 { padding-left: 18px; font-size: 13px; }

/* Ad slot */
.ad-slot {
	display: flex; align-items: center; justify-content: center;
	min-height: 96px; border: 1px dashed var(--border); border-radius: var(--radius);
	background: var(--surface-2); color: var(--muted); font-size: 11px;
	text-transform: uppercase; letter-spacing: .12em; padding: 16px; margin: 0;
}
.ad-wrap { padding: 0; border: 0; background: transparent; }
.ad-wrap--mid { margin: 28px 0; }
.ad-footer-wrap { padding: 24px 20px 0; }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--fg); }
.breadcrumbs .bc-sep { opacity: .6; }

/* Archive hero */
.archive-hero { padding: 56px 0 24px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.archive-hero::before {
	content: ''; position: absolute; inset: 0;
	background: radial-gradient(ellipse at 30% -10%, color-mix(in oklab, var(--brand) 14%, transparent), transparent 60%);
	pointer-events: none;
}
.archive-hero > .container { position: relative; }
.archive-title { font-size: clamp(30px, 4vw, 44px); margin: 6px 0 0; letter-spacing: -.02em; font-weight: 800; }
.archive-desc { color: var(--muted); margin: 14px 0 0; font-size: clamp(15px, 1.4vw, 17px); max-width: 60ch; }

/* Empty / 404 */
.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.not-found { padding: 80px 20px; text-align: center; }
.error-code { font-family: var(--font-mono); font-size: 96px; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; letter-spacing: -.04em; }
.cta-row { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.search-inline { max-width: 480px; margin: 28px auto 0; }
.search-form-inline { display: flex; gap: 8px; }
.search-form-inline input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--fg); }
.search-form-inline button { padding: 10px 16px; border: 0; background: var(--fg); color: var(--bg); border-radius: 8px; font-weight: 600; cursor: pointer; }

/* Page header */
.page-header { padding: 56px 0 16px; }
.page-title { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em; margin: 4px 0 0; font-weight: 800; }

/* Footer */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); background: var(--surface-2); }
.footer-grid { padding: 56px 20px; display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-about p { color: var(--muted); font-size: 14px; max-width: 38ch; margin-top: 12px; }
.social-nav .menu { list-style: none; padding: 0; margin: 16px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.social-nav .menu a {
	display: grid; place-items: center; width: 36px; height: 36px;
	border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted);
	font-size: 12px;
}
.social-nav .menu a:hover { color: var(--fg); }
.footer-cats ul, .footer-links .menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-cats a, .footer-links .menu a { color: var(--muted); font-size: 14px; }
.footer-cats a:hover, .footer-links .menu a:hover { color: var(--fg); }
.footer-bottom {
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
	padding: 18px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted);
}

/* Misc */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--fg) 18%, transparent); border-radius: 8px; }

/* Print */
@media print {
	.site-header, .site-footer, .article-sidebar, .ad-slot, .share-row, .related, .comments-area { display: none !important; }
	.prose { color: #000; }
}

/* ============================================================
   v1.4.0 — Readability, Code, Diagrams, Cards polish
   ============================================================ */

/* --- Prose readability (Medium/Hashnode feel) --- */
.article-body { max-width: 720px; }
.prose, .single-page .prose {
	font-size: 17.5px;
	line-height: 1.75;
	color: var(--fg);
}
@media (min-width: 1024px) { .prose, .single-page .prose { font-size: 18px; line-height: 1.78; } }
.prose p { margin: 1.15em 0; }
.prose p, .prose li { letter-spacing: -.003em; }
.prose h2 { font-size: 1.55em; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.22em; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 1.06em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 1em 0; }
.prose li { margin: .35em 0; }
.prose blockquote { font-size: .98em; }

/* --- Premium code blocks (terminal style) --- */
.prose pre {
	background: linear-gradient(180deg, #0a1424 0%, #06101e 100%);
	color: #e6edf5;
	border: 1px solid rgba(255,255,255,.06);
	padding: 44px 18px 18px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.7;
	box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -22px rgba(0,0,0,.55);
}
html:not(.dark) .prose pre { box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 14px 32px -20px rgba(11,18,32,.35); }
.prose pre::before {
	content: '';
	position: absolute; top: 0; left: 0; right: 0; height: 32px;
	background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
	border-bottom: 1px solid rgba(255,255,255,.05);
	border-radius: 14px 14px 0 0;
	pointer-events: none;
}
.prose pre::after {
	content: '';
	position: absolute; top: 11px; left: 14px;
	width: 10px; height: 10px; border-radius: 50%;
	background: #ff5f57;
	box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
}
.prose pre .code-lang {
	position: absolute; top: 8px; left: 60px;
	font-family: var(--font-mono); font-size: 10.5px;
	letter-spacing: .14em; text-transform: uppercase;
	color: rgba(230,237,245,.55);
}
.copy-btn {
	top: 6px; right: 8px;
	background: rgba(255,255,255,.06);
	color: rgba(230,237,245,.85);
	font-size: 11px; font-weight: 600;
	padding: 4px 10px; border-radius: 6px;
	letter-spacing: .04em;
}
.copy-btn:hover { background: rgba(255,255,255,.14); }
.copy-btn.is-copied { background: rgba(34,166,242,.2); color: #7cd1ff; }

/* Prism tokens (lightweight, brand-aligned) */
.prose pre code .token.comment,
.prose pre code .token.prolog,
.prose pre code .token.doctype,
.prose pre code .token.cdata { color: #6b7d96; font-style: italic; }
.prose pre code .token.punctuation { color: #c9d4e1; }
.prose pre code .token.property,
.prose pre code .token.tag,
.prose pre code .token.boolean,
.prose pre code .token.number,
.prose pre code .token.constant,
.prose pre code .token.symbol,
.prose pre code .token.deleted { color: #f59e7b; }
.prose pre code .token.selector,
.prose pre code .token.attr-name,
.prose pre code .token.string,
.prose pre code .token.char,
.prose pre code .token.builtin,
.prose pre code .token.inserted { color: #a5e3a3; }
.prose pre code .token.operator,
.prose pre code .token.entity,
.prose pre code .token.url,
.prose pre code .token.variable { color: #e6edf5; }
.prose pre code .token.atrule,
.prose pre code .token.attr-value,
.prose pre code .token.function,
.prose pre code .token.class-name { color: #7cd1ff; }
.prose pre code .token.keyword { color: #c4a8ff; font-weight: 600; }
.prose pre code .token.regex,
.prose pre code .token.important { color: #ffd479; }

/* --- Architecture diagram / image lightbox --- */
.prose figure, .prose .wp-block-image { margin: 1.8em 0; }
.prose figure img, .prose .wp-block-image img, .prose img {
	border-radius: 14px;
	border: 1px solid var(--border);
	background: var(--surface-2);
	cursor: zoom-in;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.prose figure img:hover, .prose .wp-block-image img:hover, .prose img:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	border-color: color-mix(in srgb, var(--fg) 18%, transparent);
}
.prose figcaption, .prose .wp-element-caption {
	text-align: center; font-size: 13px; color: var(--muted);
	margin-top: 10px; font-family: var(--font-sans);
}

.mc-lightbox {
	position: fixed; inset: 0; z-index: 9999;
	background: rgba(6,10,20,.92);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	display: grid; place-items: center;
	padding: 24px;
	animation: mc-fade-in .18s ease;
	cursor: zoom-out;
}
.mc-lightbox img {
	max-width: min(1200px, 96vw); max-height: 90vh;
	width: auto; height: auto;
	border-radius: 12px;
	box-shadow: 0 30px 80px rgba(0,0,0,.6);
	animation: mc-lb-in .22s cubic-bezier(.22,.8,.36,1);
}
@keyframes mc-lb-in { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mc-lightbox__close {
	position: absolute; top: 16px; right: 16px;
	width: 40px; height: 40px; border-radius: 999px;
	background: rgba(255,255,255,.1); color: #fff; border: 0;
	display: grid; place-items: center; cursor: pointer;
}
.mc-lightbox__close:hover { background: rgba(255,255,255,.18); }

/* --- Card polish --- */
.card { transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease; }
.card:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 40px -22px rgba(0,0,0,.45), 0 2px 8px -4px rgba(0,0,0,.2);
}
.card__body { padding: 20px 22px 22px; gap: 10px; }
.card__title { font-size: 17.5px; line-height: 1.4; }
.card__excerpt { line-height: 1.55; font-size: 13.5px; }
.card__meta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; letter-spacing: .02em; }
.card__cat { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; }
@media (max-width: 640px) {
	.post-grid { gap: 18px; }
	.card__body { padding: 16px 18px 18px; }
}

/* --- Mobile spacing --- */
@media (max-width: 640px) {
	.container { padding: 0 16px; }
	.article-header { padding: 32px 0 18px; }
	.article-layout { padding: 24px 16px 56px; }
	.article-cover { margin-top: 20px; border-radius: 14px; }
	.prose pre { padding: 40px 14px 16px; font-size: 12.5px; border-radius: 12px; }
	.prose h2 { font-size: 1.4em; }
	.prose h3 { font-size: 1.15em; }
}

/* --- AdSense ad-slot polish (clean, content-first) --- */
.ad-wrap { margin: 28px 0; display: flex; justify-content: center; }
.ad-wrap--mid { margin: 36px 0; }
.ad-slot {
	width: 100%; max-width: 100%;
	background: var(--surface-2);
	border: 1px dashed var(--border);
	border-radius: 12px; padding: 8px;
}
.ad-label { display: block; font-size: 10px; color: var(--muted); text-align: center; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }

/* --- Focus-visible polish for accessibility --- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
