/*
 * Vanilla Pag blog. Dark theme that matches the landing page.
 * Article reading-friendly typography; lots of breathing room.
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300..800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
	--bg:           hsl(0 0% 2.5%);
	--bg-2:         hsl(0 0% 4%);
	--surface:      hsl(0 0% 7%);
	--text:         hsl(0 0% 100%);
	--muted:        hsl(0 0% 67%);
	--faint:        hsl(0 0% 42%);
	--border:       hsl(0 0% 100% / 0.10);
	--border-strong: hsl(0 0% 100% / 0.20);
	--card-glass:   rgba(11, 11, 12, 0.77);
	--accent:       hsl(232 88% 64%);
	--accent-2:     hsl(280 80% 65%);
	--accent-grad:  linear-gradient(135deg, hsl(232 88% 64%), hsl(280 80% 65%));
	--ease:         cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: hsl(0 0% 22%) transparent; }
html, body { background: var(--bg); }
body {
	font-family: 'Bricolage Grotesque', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-optical-sizing: auto;
	color: var(--text);
	line-height: 1.65;
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-height: 100vh;
	background:
		radial-gradient(1200px 700px at 80% -10%, hsl(232 88% 64% / 0.10), transparent 55%),
		radial-gradient(900px 600px at 5% 105%, hsl(280 80% 65% / 0.08), transparent 60%),
		var(--bg);
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(0 0% 22%); border-radius: 999px; }

/* ── Navbar (matches landing) ── */
.navbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(6, 6, 6, 0.8);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	backdrop-filter: blur(20px) saturate(160%);
	border-bottom: 1px solid var(--border);
}
.nav-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 10px;
	background: var(--accent-grad);
	color: hsl(0 0% 5%);
	font-weight: 800;
	font-size: 0.95rem;
	box-shadow: 0 8px 24px -10px hsl(232 88% 64% / 0.5), inset 0 0 0 1px hsl(0 0% 100% / 0.22);
}
.nav-links { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-links a {
	padding: 0.45rem 0.9rem;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--muted);
	border-radius: 0.5rem;
	transition: color 200ms var(--ease), background 200ms var(--ease);
}
.nav-links a:hover { color: var(--text); background: hsl(0 0% 100% / 0.04); }
.nav-cta {
	background: var(--text);
	color: hsl(0 0% 5%) !important;
	padding: 0.5rem 1.05rem !important;
	border-radius: 999px !important;
	font-weight: 600;
	transition: background 200ms var(--ease);
}
.nav-cta:hover { background: hsl(0 0% 88%) !important; }

/* ── Blog index ── */
.blog-shell { max-width: 1280px; margin: 0 auto; padding: 4rem 1.5rem 3rem; }
.blog-hero {
	text-align: left;
	max-width: 48rem;
	margin-bottom: 3.5rem;
}
.blog-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.68rem;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.28em;
	font-weight: 700;
	margin-bottom: 1.2rem;
}
.blog-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--border-strong); }
.blog-hero h1 {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 400;
	letter-spacing: -0.028em;
	line-height: 1.05;
	color: var(--text);
	margin-bottom: 1rem;
}
.blog-hero p { color: var(--muted); font-size: 1.05rem; max-width: 36rem; }

.post-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}
@media (min-width: 760px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .post-grid { grid-template-columns: 1fr 1fr 1fr; } }

.post-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.75rem 1.75rem 1.85rem;
	background: var(--card-glass);
	border: 1px solid var(--border-strong);
	border-radius: 1.5rem;
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	color: var(--text);
	transition: border-color 240ms var(--ease), transform 280ms var(--ease);
	position: relative;
	overflow: hidden;
}
.post-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(80% 100% at 100% 0%, hsl(232 88% 64% / 0.10), transparent 65%);
	pointer-events: none;
	opacity: 0;
	transition: opacity 240ms var(--ease);
}
.post-card:hover { border-color: hsl(0 0% 100% / 0.30); transform: translateY(-2px); }
.post-card:hover::before { opacity: 1; }
.post-card > * { position: relative; }
.post-meta { display: inline-flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: var(--muted); }
.post-meta .category {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.65rem;
	background: hsl(232 88% 64% / 0.12);
	border: 1px solid hsl(232 88% 64% / 0.3);
	border-radius: 999px;
	color: hsl(232 88% 78%);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.05em;
}
.post-meta .date { font-variant-numeric: tabular-nums; }
.post-card h2 {
	font-size: 1.35rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.018em;
	color: var(--text);
}
.post-card p { color: var(--muted); font-size: 0.95rem; line-height: 1.55; flex: 1; }
.post-card .cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text);
	font-size: 0.88rem;
	font-weight: 500;
	transition: gap 200ms var(--ease);
}
.post-card:hover .cta { gap: 0.85rem; }

/* ── Article ── */
.article-shell {
	max-width: 720px;
	margin: 0 auto;
	padding: 3rem 1.5rem 4rem;
}
.article-back {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--muted);
	font-size: 0.88rem;
	margin-bottom: 2.5rem;
	transition: color 200ms var(--ease);
}
.article-back:hover { color: var(--text); }
.article-header {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--border);
}
.article-header .post-meta { margin-bottom: 1.25rem; }
.article-header h1 {
	font-size: clamp(2rem, 4.5vw, 3rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.028em;
	color: var(--text);
	margin-bottom: 1rem;
}
.article-header .excerpt {
	font-size: 1.15rem;
	color: var(--muted);
	line-height: 1.55;
}

.article-body { font-size: 1.025rem; color: var(--text); }
.article-body p {
	color: var(--text);
	margin-bottom: 1.25rem;
	line-height: 1.75;
}
.article-body p:has(+ h2) { margin-bottom: 0.5rem; }
.article-body h2 {
	font-size: 1.65rem;
	font-weight: 500;
	letter-spacing: -0.022em;
	color: var(--text);
	margin: 3rem 0 1.1rem;
	line-height: 1.2;
}
.article-body h3 {
	font-size: 1.2rem;
	font-weight: 500;
	letter-spacing: -0.012em;
	color: var(--text);
	margin: 2.25rem 0 0.85rem;
	line-height: 1.3;
}
.article-body ul, .article-body ol {
	margin: 0 0 1.5rem;
	padding-left: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.article-body ol { counter-reset: ol; }
.article-body li {
	color: var(--text);
	font-size: 1.025rem;
	padding-left: 1.5rem;
	position: relative;
	line-height: 1.65;
}
.article-body ul li::before {
	content: "";
	position: absolute;
	left: 0; top: 0.65rem;
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--accent-grad);
	box-shadow: 0 0 8px hsl(232 88% 64% / 0.5);
}
.article-body ol li {
	counter-increment: ol;
	padding-left: 2rem;
}
.article-body ol li::before {
	content: counter(ol);
	position: absolute;
	left: 0; top: 0;
	width: 1.5rem;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 0.85rem;
	font-weight: 600;
	color: hsl(232 88% 75%);
}
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { font-style: italic; color: var(--muted); }
.article-body a {
	color: var(--text);
	border-bottom: 1px solid hsl(232 88% 64% / 0.6);
	transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.article-body a:hover { color: hsl(232 88% 75%); border-bottom-color: hsl(232 88% 75%); }
.article-body code:not(pre code) {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 0.85em;
	background: hsl(0 0% 100% / 0.06);
	border: 1px solid var(--border);
	padding: 0.15rem 0.45rem;
	border-radius: 0.35rem;
	color: hsl(232 88% 80%);
}
.article-body pre.post-code {
	background: hsl(0 0% 0% / 0.5);
	border: 1px solid var(--border-strong);
	border-radius: 1rem;
	padding: 1.1rem 1.25rem;
	overflow-x: auto;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--text);
	margin: 1.5rem 0;
}
.article-body pre.post-code code { font-family: inherit; }
.article-body table.post-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
	border: 1px solid var(--border-strong);
	border-radius: 1rem;
	overflow: hidden;
}
.article-body table.post-table th,
.article-body table.post-table td {
	padding: 0.85rem 1rem;
	font-size: 0.9rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
.article-body table.post-table th {
	background: hsl(0 0% 100% / 0.04);
	color: var(--muted);
	font-weight: 600;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.article-body table.post-table tr:last-child td { border-bottom: none; }
.article-body table.post-table td { color: var(--text); }

/* ── Related posts ── */
.related-shell {
	max-width: 1280px;
	margin: 0 auto;
	padding: 3rem 1.5rem;
	border-top: 1px solid var(--border);
}
.related-shell h3 {
	font-size: 0.7rem;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-weight: 700;
	margin-bottom: 1.5rem;
}

/* ── CTA strip ── */
.blog-cta {
	max-width: 1280px;
	margin: 0 auto 4rem;
	padding: 3rem 1.5rem 0;
}
.blog-cta-inner {
	position: relative;
	border-radius: 2rem;
	padding: 3.5rem 1.5rem;
	text-align: center;
	overflow: hidden;
	background:
		radial-gradient(800px 600px at 50% 0%, hsl(232 88% 64% / 0.30), transparent 60%),
		radial-gradient(600px 600px at 90% 100%, hsl(280 80% 65% / 0.30), transparent 65%),
		hsl(0 0% 6%);
	border: 1px solid var(--border-strong);
}
.blog-cta h2 {
	font-size: clamp(1.6rem, 3.5vw, 2.4rem);
	font-weight: 400;
	letter-spacing: -0.022em;
	color: var(--text);
	margin-bottom: 0.85rem;
}
.blog-cta p { color: var(--muted); margin-bottom: 1.5rem; max-width: 32rem; margin-left: auto; margin-right: auto; }
.blog-cta .btn-primary,
.blog-cta .btn-secondary {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 1.5rem;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 600;
	transition: transform 120ms var(--ease), filter 200ms var(--ease);
	border: 1px solid transparent;
}
.blog-cta .btn-primary {
	background: var(--text);
	color: hsl(0 0% 5%);
	box-shadow: 0 16px 28px -16px hsl(0 0% 100% / 0.35);
}
.blog-cta .btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.blog-cta .btn-secondary {
	background: hsl(0 0% 100% / 0.06);
	color: var(--text);
	border-color: hsl(0 0% 100% / 0.18);
}
.blog-cta-buttons { display: inline-flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }

/* ── Footer ── */
.footer {
	border-top: 1px solid var(--border);
	padding: 2rem 1.5rem;
	margin-top: 2rem;
}
.footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
}
@media (min-width: 768px) { .footer-inner { flex-direction: row; } }
.footer-meta { color: var(--faint); font-size: 0.85rem; }
.footer-links { display: inline-flex; gap: 1.25rem; }
.footer-links a { color: var(--muted); font-size: 0.85rem; transition: color 200ms var(--ease); }
.footer-links a:hover { color: var(--text); }

/* ── Glossary ── */
.glossary-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-top: 2rem;
}
@media (min-width: 720px)  { .glossary-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .glossary-grid { grid-template-columns: 1fr 1fr 1fr; } }
.glossary-card {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 1.25rem 1.4rem 1.4rem;
	background: hsl(0 0% 100% / 0.03);
	border: 1px solid var(--border);
	border-radius: 1.1rem;
	color: var(--text);
	transition: background 240ms var(--ease), border-color 240ms var(--ease), transform 240ms var(--ease);
}
.glossary-card:hover {
	background: hsl(0 0% 100% / 0.06);
	border-color: hsl(0 0% 100% / 0.18);
	transform: translateY(-2px);
}
.glossary-card h2 {
	font-size: 1.05rem;
	font-weight: 500;
	letter-spacing: -0.014em;
	color: var(--text);
}
.glossary-card p {
	font-size: 0.88rem;
	color: var(--muted);
	line-height: 1.55;
	flex: 1;
}
.glossary-card .cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--text);
	font-size: 0.82rem;
	font-weight: 500;
}

/* ── Guide TOC ── */
.guide-shell { position: relative; }
.guide-toc {
	margin: 0 0 2.5rem;
	padding: 1rem 1.25rem 1.1rem;
	background: hsl(0 0% 100% / 0.025);
	border: 1px solid var(--border);
	border-radius: 1rem;
}
.guide-toc h3 {
	font-size: 0.66rem;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-weight: 700;
	margin-bottom: 0.75rem;
}
.guide-toc ol {
	margin: 0;
	padding-left: 0;
	list-style: none;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.4rem;
	counter-reset: tocol;
}
@media (min-width: 720px) { .guide-toc ol { grid-template-columns: 1fr 1fr; } }
.guide-toc li {
	counter-increment: tocol;
	padding-left: 1.65rem;
	position: relative;
	font-size: 0.9rem;
}
.guide-toc li::before {
	content: counter(tocol, decimal-leading-zero);
	position: absolute;
	left: 0; top: 0;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 0.75rem;
	color: hsl(232 88% 75%);
	font-weight: 600;
}
.guide-toc a { color: var(--muted); transition: color 200ms var(--ease); }
.guide-toc a:hover { color: var(--text); }

.article-body section { scroll-margin-top: 100px; padding-top: 0.5rem; }
.article-body section + section { margin-top: 1.5rem; }

.comp-table-wrap { overflow-x: auto; margin: 0 0 2rem; }
.comp-table-wrap table.post-table th,
.comp-table-wrap table.post-table td { vertical-align: top; }
.comp-table-wrap table.post-table th:not(:first-child) { color: var(--text); }

/* ── Inline FAQ inside guide ── */
.article-body .faq-item {
	margin: 0.6rem 0;
	background: hsl(0 0% 100% / 0.03);
	border: 1px solid var(--border);
	border-radius: 0.85rem;
	overflow: hidden;
}
.article-body .faq-item summary {
	cursor: pointer;
	list-style: none;
	padding: 0.95rem 1.15rem;
	color: var(--text);
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem;
}
.article-body .faq-item summary::-webkit-details-marker { display: none; }
.article-body .faq-item summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); transition: transform 200ms var(--ease); }
.article-body .faq-item[open] summary::after { transform: rotate(45deg); }
.article-body .faq-item .faq-body { padding: 0 1.15rem 1rem; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.article-body .faq-item .faq-body a { color: var(--text); border-bottom: 1px solid hsl(232 88% 64% / 0.6); }
