:root {
	--bg: #fbfbfd;
	--surface: #ffffff;
	--text: #1f2329;
	--muted: #6b7280;
	--accent: #3ea0f0;
	--accent-strong: #2e8be0;
	--accent-soft: rgba(62, 160, 240, 0.12);
	--border: #e5e7eb;
	--code-bg: #f4f6f8;
	--pre-bg: #0f1419;
	--pre-fg: #e6e6e6;
	--max-content: 720px;
	--sidebar-width: 280px;
	--font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-ui);
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--sidebar-width);
	height: 100vh;
	background: var(--surface);
	border-right: 1px solid var(--border);
	padding: 28px 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sidebar-home {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--muted);
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 8px;
	align-self: flex-start;
	transition: color 140ms ease, background 140ms ease;
}

.sidebar-home:hover {
	color: var(--accent);
	background: var(--accent-soft);
}

.sidebar-accordion {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Accordion summary — hidden on desktop, visible on mobile */
.sidebar-summary {
	display: none;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	padding: 12px 14px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.10em;
	list-style: none;
	user-select: none;
	transition: background 140ms ease;
}

.sidebar-summary::-webkit-details-marker {
	display: none;
}

.sidebar-summary::marker {
	display: none;
}

.sidebar-summary:hover {
	background: rgba(62, 160, 240, 0.18);
}

.sidebar-chevron {
	font-size: 11px;
	transition: transform 200ms ease;
}

.sidebar-accordion[open] > .sidebar-summary .sidebar-chevron {
	transform: rotate(180deg);
}

.sidebar-list {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	min-height: 0;
}

.sidebar-link {
	display: block;
	padding: 12px 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--text);
	text-decoration: none;
	border-top: 1px solid var(--border);
	transition: color 140ms ease, background 140ms ease;
	line-height: 1.4;
}

.sidebar-link:first-of-type {
	border-top: 0;
}

.sidebar-link:hover {
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 8px;
}

.sidebar-link:hover + .sidebar-link {
	border-top-color: transparent;
}

.sidebar-link.is-active {
	color: var(--accent-strong);
	background: var(--accent-soft);
	font-weight: 600;
	border-radius: 8px;
	border-top-color: transparent;
}

.sidebar-link.is-active + .sidebar-link {
	border-top-color: transparent;
}

/* Content */
.content {
	margin-left: var(--sidebar-width);
	padding: 64px 48px 96px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.post {
	width: 100%;
	max-width: var(--max-content);
	font-size: 17px;
	color: var(--text);
}

.post > br {
	display: none;
}

.post h1 {
	font-size: 36px;
	margin: 0 0 8px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.post h2 {
	font-size: 24px;
	margin: 44px 0 12px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.post h3 {
	font-size: 18px;
	margin: 28px 0 8px;
	font-weight: 600;
	line-height: 1.4;
}

.post p {
	margin: 0 0 16px;
}

.post a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-color: rgba(62, 160, 240, 0.4);
	text-underline-offset: 3px;
	transition: text-decoration-color 140ms ease;
}

.post a:hover {
	text-decoration-color: var(--accent);
}

.post strong, .post b {
	font-weight: 600;
	color: #0f172a;
}

.post em, .post i {
	font-style: italic;
}

.post code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	background: var(--code-bg);
	padding: 2px 6px;
	border-radius: 4px;
	color: #1f2937;
}

.post pre {
	background: var(--pre-bg);
	color: var(--pre-fg);
	padding: 20px 24px;
	border-radius: 10px;
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
	margin: 24px 0;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.post pre code {
	background: transparent;
	padding: 0;
	border-radius: 0;
	font-size: inherit;
	color: inherit;
	font-family: var(--font-mono);
}

.post blockquote {
	border-left: 3px solid var(--accent);
	padding: 4px 0 4px 20px;
	margin: 24px 0;
	color: var(--muted);
	font-style: italic;
}

.post hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 36px 0;
}

.post ul, .post ol {
	margin: 0 0 16px;
	padding-left: 24px;
}

.post li {
	margin-bottom: 6px;
}

.post img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 16px 0;
}

/* Previous / Next — minimal text indicators */
.post-nav {
	width: 100%;
	max-width: var(--max-content);
	margin-top: 48px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-size: 14px;
}

.post-nav-link {
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
	padding: 4px 2px;
	transition: color 140ms ease;
}

.post-nav-link:hover {
	color: var(--accent-strong);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.post-nav-link--next {
	margin-left: auto;
}

.post-nav-link.is-disabled {
	color: var(--muted);
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

@media (max-width: 900px) {
	.sidebar {
		position: static;
		width: 100%;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--border);
		padding: 20px;
		gap: 12px;
	}

	.sidebar-summary {
		display: flex;
	}

	.sidebar-accordion[open] > .sidebar-list {
		max-height: 50vh;
	}

	.sidebar-list {
		padding-top: 4px;
	}

	.content {
		margin-left: 0;
		padding: 32px 20px 64px;
	}

	.post {
		font-size: 16px;
	}

	.post h1 {
		font-size: 28px;
	}

	.post h2 {
		font-size: 21px;
	}

	.post-nav {
		margin-top: 48px;
		padding-top: 24px;
	}
}

@media (max-width: 600px) {
	.sidebar {
		padding: 16px;
		gap: 8px;
	}

	.sidebar-home {
		font-size: 12px;
	}

	.sidebar-link {
		padding: 10px 8px;
		font-size: 13px;
	}

	.content {
		padding: 24px 18px 48px;
	}

	.post {
		font-size: 16px;
	}

	.post h1 {
		font-size: 24px;
	}

	.post h2 {
		font-size: 19px;
		margin-top: 32px;
	}

	.post h3 {
		font-size: 16px;
	}

	.post pre {
		padding: 14px 16px;
		font-size: 13px;
		border-radius: 8px;
		margin: 18px -18px;
	}

	.post blockquote {
		padding-left: 14px;
		margin: 18px 0;
	}

	.post-nav {
		font-size: 13px;
		margin-top: 40px;
	}
}
