:root {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--primary-soft: #eff6ff;
	--accent: #7c3aed;
	--ink: #0f172a;
	--body: #475569;
	--bg: #ffffff;
	--bg-alt: #f8fafc;
	--border: #e2e8f0;
	--radius: .75rem;
	--shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
	--shadow: 0 12px 32px rgba(15, 23, 42, .10);
	--font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	--mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--body);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	color: var(--primary-dark);
}

a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

::selection {
	background: var(--primary);
	color: #fff;
}

.container {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.topbar {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	max-width: 1120px;
	margin: 0 auto;
	padding: .55rem 1.5rem;
	background: var(--ink);
	color: rgba(255, 255, 255, .72);
	font-size: .82rem;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	max-width: 1120px;
	margin: 0 auto;
	padding: .85rem 1.5rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .7rem;
	color: var(--ink);
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: -.01em;
}

.brand:hover {
	color: var(--primary);
}

.brand-mark {
	width: 2rem;
	height: 2rem;
	border-radius: .6rem;
	background-image: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .95) 0 14%, rgba(255, 255, 255, 0) 22%), linear-gradient(135deg, var(--primary), var(--accent));
	box-shadow: var(--shadow-sm);
}

.site-nav {
	display: flex;
	align-items: center;
	gap: .35rem;
}

.nav-link {
	padding: .55rem 1rem;
	border-radius: 999px;
	color: var(--ink);
	font-size: .95rem;
	font-weight: 600;
	transition: background .15s ease, color .15s ease;
}

.nav-link:hover {
	background: var(--primary-soft);
	color: var(--primary);
}

.nav-link.is-current {
	background: var(--primary);
	color: #fff;
}

.nav-toggle,
.nav-toggle-label {
	display: none;
}

.site-main {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(2.5rem, 7vw, 5.5rem) 1.5rem clamp(3rem, 8vw, 6rem);
}

.site-main::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: min(34rem, 60vh);
	background: linear-gradient(180deg, #eef4ff 0%, rgba(255, 255, 255, 0) 100%);
	pointer-events: none;
	z-index: -1;
}

.site-main > h1:first-child,
.site-main > article > h1:first-child {
	max-width: 16em;
	margin: 0 0 1.25rem;
	color: var(--ink);
	font-size: clamp(2.1rem, 5.5vw, 4rem);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.02em;
}

.site-main > h1:first-child::after,
.site-main > article > h1:first-child::after {
	content: "";
	display: block;
	width: 4.5rem;
	height: .35rem;
	margin-top: 1.25rem;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
}

.site-main > h1:first-child + p,
.site-main > article > h1:first-child + p {
	max-width: 44rem;
	color: var(--body);
	font-size: clamp(1.1rem, 2.2vw, 1.35rem);
}

.site-main h1,
.site-main h2,
.site-main h3,
.site-main h4 {
	color: var(--ink);
	letter-spacing: -.01em;
}

.site-main h1 {
	margin: 0 0 1.25rem;
	font-size: clamp(1.9rem, 4.5vw, 3rem);
	font-weight: 800;
	line-height: 1.15;
}

.site-main h2 {
	margin: 3rem 0 1rem;
	font-size: clamp(1.5rem, 3.6vw, 2.25rem);
	font-weight: 700;
}

.site-main h3 {
	margin: 2.25rem 0 .75rem;
	font-size: 1.25rem;
	font-weight: 700;
}

.site-main h4 {
	margin: 1.75rem 0 .5rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.site-main p {
	margin: 0 0 1.25rem;
}

.site-main ul,
.site-main ol {
	margin: 0 0 1.5rem;
	padding-left: 1.5rem;
}

.site-main li {
	margin-bottom: .5rem;
}

.site-main blockquote {
	margin: 2rem 0;
	padding: 1rem 1.5rem;
	border-left: 4px solid var(--primary);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--primary-soft);
	color: var(--ink);
}

.site-main hr {
	height: 1px;
	margin: 3rem 0;
	border: 0;
	background: var(--border);
}

.site-main img {
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.site-main code {
	padding: .1em .35em;
	border: 1px solid var(--border);
	border-radius: .35rem;
	background: #f1f5f9;
	color: var(--ink);
	font-family: var(--mono);
	font-size: .9em;
}

.site-main pre {
	overflow-x: auto;
	padding: 1.25rem;
	border-radius: var(--radius);
	background: var(--ink);
	color: #e2e8f0;
	font-family: var(--mono);
	line-height: 1.6;
}

.site-main pre code {
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
}

.site-main table {
	width: 100%;
	margin: 0 0 1.5rem;
	border-collapse: collapse;
}

.site-main th,
.site-main td {
	padding: .75rem .9rem;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

.site-main th {
	background: var(--bg-alt);
	color: var(--ink);
	font-weight: 700;
}

.content-list {
	margin: 2.5rem 0 0;
}

.post-items,
.page-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-item,
.page-item {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	padding: 1.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	box-shadow: var(--shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.post-item::before,
.page-item::before {
	content: "";
	width: 2.5rem;
	height: .3rem;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
}

.post-item:hover,
.page-item:hover {
	transform: translateY(-4px);
	border-color: var(--primary);
	box-shadow: var(--shadow);
}

.post-item h3,
.page-item h4 {
	margin: 0;
	color: var(--ink);
}

.post-item h3 {
	font-size: 1.35rem;
}

.post-date {
	align-self: flex-start;
	padding: .2rem .65rem;
	border-radius: 999px;
	background: var(--primary-soft);
	color: var(--primary-dark);
	font-family: var(--mono);
	font-size: .75rem;
}

.post-item .excerpt,
.page-item .description {
	margin: 0;
	color: var(--body);
	font-size: .95rem;
}

.read-more {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	margin-top: auto;
	padding: .55rem 1.1rem;
	border-radius: 999px;
	background: var(--primary);
	color: #fff;
	font-size: .9rem;
	font-weight: 600;
	transition: background .15s ease, transform .15s ease;
}

.read-more:hover {
	background: var(--primary-dark);
	color: #fff;
	transform: translateY(-1px);
}

.no-items {
	color: var(--body);
	font-style: italic;
}

.site-main > ul:not([class]) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin: 2.5rem 0 0;
	padding: 0;
	list-style: none;
}

.site-main > ul:not([class]) > li {
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	box-shadow: var(--shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.site-main > ul:not([class]) > li:hover {
	transform: translateY(-4px);
	border-color: var(--primary);
	box-shadow: var(--shadow);
}

.site-main > ul:not([class]) > li > a {
	display: block;
	padding: .35rem 0;
	color: var(--ink);
	font-size: 1.15rem;
	font-weight: 700;
}

.site-main > ul:not([class]) > li > a:hover {
	color: var(--primary);
}

.site-footer {
	margin-top: 4rem;
	background: var(--ink);
	color: rgba(255, 255, 255, .75);
}

.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 2.5rem;
	max-width: 1120px;
	margin: 0 auto;
	padding: 3.5rem 1.5rem 2.5rem;
}

.footer-brand .brand {
	color: #fff;
}

.footer-brand p {
	max-width: 36ch;
	margin: 1rem 0 0;
}

.footer-col h4 {
	margin: 0 0 1rem;
	color: #fff;
	font-size: .85rem;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.footer-link {
	display: block;
	padding: .3rem 0;
	color: rgba(255, 255, 255, .7);
}

.footer-link:hover {
	color: #fff;
}

.footer-col p {
	margin: .6rem 0;
}

.footer-col a {
	color: #93c5fd;
}

.footer-col a:hover {
	color: #fff;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .5rem 2rem;
	max-width: 1120px;
	margin: 0 auto;
	padding: 1.25rem 1.5rem 2rem;
	border-top: 1px solid rgba(255, 255, 255, .12);
	color: rgba(255, 255, 255, .5);
	font-size: .85rem;
}

.footer-bottom p {
	margin: 0;
}

@media (max-width: 860px) {
	.footer-grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.post-items,
	.page-items {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.nav-toggle,
	.nav-toggle-label {
		display: inline-flex;
	}

	.nav-toggle {
		position: absolute;
		opacity: 0;
		pointer-events: none;
	}

	.nav-toggle-label {
		cursor: pointer;
		padding: .5rem .9rem;
		border: 1px solid var(--border);
		border-radius: 999px;
		color: var(--ink);
		font-size: .9rem;
		font-weight: 600;
	}

	.site-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		max-height: 0;
		overflow: hidden;
		background: #fff;
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		transition: max-height .25s ease;
	}

	.nav-toggle:checked ~ .site-nav {
		max-height: 70vh;
		overflow: auto;
	}

	.nav-link {
		padding: .9rem 1.5rem;
		border-radius: 0;
		border-bottom: 1px solid var(--border);
	}

	.nav-link.is-current {
		border-radius: 0;
	}

	.topbar {
		justify-content: center;
	}

	.topbar span:last-child {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.post-item:hover,
	.page-item:hover {
		transform: none;
	}
}
