:root {
	--page-bg: #f3f6fb;
	--surface: #ffffff;
	--surface-soft: #f7f9fc;
	--text: #172033;
	--text-soft: #667085;
	--line: #e6eaf0;
	--primary: #5b5bd6;
	--primary-dark: #4444b8;
	--accent: #13b8a6;
	--shadow: 0 24px 70px rgba(30, 41, 59, 0.1);
	--content-width: 1080px;
	--reading-width: 780px;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	background: var(--page-bg);
}

body {
	min-width: 320px;
	margin: 0;
	color: var(--text);
	background:
		radial-gradient(circle at 8% 4%, rgba(91, 91, 214, 0.12), transparent 26rem),
		radial-gradient(circle at 92% 14%, rgba(19, 184, 166, 0.1), transparent 24rem),
		var(--page-bg);
	font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.85;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: color 180ms ease, background-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

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

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

.reading-progress {
	position: fixed;
	inset: 0 auto auto 0;
	z-index: 100;
	width: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	box-shadow: 0 0 14px rgba(91, 91, 214, 0.45);
	transition: width 80ms linear;
}

#preloader {
	display: none;
}

#main-container {
	min-height: calc(100vh - 112px);
}

.openNav {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	height: 68px;
	border-bottom: 1px solid rgba(230, 234, 240, 0.85);
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 8px 30px rgba(30, 41, 59, 0.04);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

.iconflat {
	display: none;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 18px;
	width: min(calc(100% - 48px), var(--content-width));
	margin: 0 auto;
}

.brand-home {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: var(--text);
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.brand-home::before {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 10px;
	color: #fff;
	background: linear-gradient(135deg, var(--primary), #7979ed);
	box-shadow: 0 8px 20px rgba(91, 91, 214, 0.28);
	content: "H";
	font-size: 15px;
	letter-spacing: 0;
}

.brand-home:hover {
	color: var(--primary);
	transform: translateY(-1px);
}

.brand-section {
	padding-left: 18px;
	border-left: 1px solid var(--line);
	color: var(--text-soft);
	font-size: 13px;
}

.site-header,
.blank,
.headertop {
	display: none;
}

.wrapper {
	width: 100%;
}

.content-area {
	width: min(calc(100% - 48px), var(--content-width));
	margin: 0 auto;
	padding: 52px 0 68px;
}

.site-main {
	width: 100%;
}

.hentry {
	overflow: hidden;
	margin: 0;
	border: 1px solid rgba(230, 234, 240, 0.92);
	border-radius: 26px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.entry-header {
	position: relative;
	overflow: hidden;
	padding: 68px clamp(32px, 7vw, 96px) 48px;
	border-bottom: 1px solid var(--line);
	background:
		linear-gradient(135deg, rgba(91, 91, 214, 0.09), rgba(19, 184, 166, 0.05)),
		var(--surface);
}

.entry-header::before {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 22px;
	padding: 7px 12px;
	border: 1px solid rgba(91, 91, 214, 0.18);
	border-radius: 999px;
	color: var(--primary);
	background: rgba(255, 255, 255, 0.74);
	content: "ENGINEERING  ·  TYPESCRIPT";
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.13em;
}

.entry-header::after {
	position: absolute;
	top: -88px;
	right: -56px;
	width: 250px;
	height: 250px;
	border: 48px solid rgba(91, 91, 214, 0.055);
	border-radius: 50%;
	content: "";
	pointer-events: none;
}

.entry-title {
	position: relative;
	z-index: 1;
	max-width: 820px;
	margin: 0;
	color: #111827;
	font-size: clamp(32px, 5vw, 54px);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -0.045em;
	overflow-wrap: anywhere;
}

.entry-header hr {
	width: 52px;
	height: 4px;
	margin: 28px 0 20px;
	border: 0;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--primary), var(--accent));
}

.breadcrumbs {
	position: relative;
	z-index: 1;
	color: var(--text-soft);
	font-size: 13px;
}

#crumbs {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

#crumbs::before {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 4px rgba(19, 184, 166, 0.11);
	content: "";
}

.entry-content {
	width: min(calc(100% - 64px), var(--reading-width));
	margin: 0 auto;
	padding: 58px 0 72px;
	color: #344054;
	font-size: 17px;
	line-height: 2;
	overflow-wrap: anywhere;
	word-break: normal;
}

.entry-content p {
	margin: 0 0 1.65em;
}

.entry-content p:last-child {
	margin-bottom: 0;
}

.entry-content p:first-child {
	color: #283548;
	font-size: 18px;
}

.entry-content strong,
.entry-content b {
	color: #111827;
	font-weight: 750;
}

.entry-content code,
.entry-content kbd {
	padding: 0.2em 0.45em;
	border: 1px solid #e4e7ec;
	border-radius: 6px;
	color: #4545b8;
	background: #f7f7ff;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 0.88em;
}

.entry-content pre {
	overflow: auto;
	margin: 1.8em 0;
	padding: 22px 24px;
	border: 1px solid #252c3b;
	border-radius: 14px;
	color: #e6edf6;
	background: #151a24;
	line-height: 1.7;
	box-shadow: 0 12px 30px rgba(17, 24, 39, 0.14);
}

.entry-content pre code {
	padding: 0;
	border: 0;
	color: inherit;
	background: transparent;
}

.entry-content blockquote {
	margin: 2em 0;
	padding: 18px 22px;
	border-left: 4px solid var(--primary);
	border-radius: 0 12px 12px 0;
	color: #475467;
	background: var(--surface-soft);
}

.entry-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 2em auto;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(30, 41, 59, 0.12);
}

.cd-top-box {
	position: fixed;
	right: clamp(18px, 3vw, 38px);
	bottom: 28px;
	z-index: 40;
}

.cd-top {
	display: grid;
	width: 46px;
	height: 46px;
	place-items: center;
	border: 1px solid rgba(230, 234, 240, 0.95);
	border-radius: 14px;
	color: var(--text);
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 12px 30px rgba(30, 41, 59, 0.15);
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px);
	backdrop-filter: blur(12px);
}

.cd-top::before {
	content: "↑";
	font-size: 21px;
	font-weight: 700;
	line-height: 1;
}

.cd-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.cd-top:hover {
	color: #fff;
	background: var(--primary);
	transform: translateY(-2px);
}

.site-footer {
	padding: 0 24px 34px;
	text-align: center;
}

.footertext {
	color: var(--text-soft);
	font-size: 12px;
}

.footertext p {
	margin: 0;
}

.footertext a {
	color: inherit;
}

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

@media (max-width: 720px) {
	.openNav {
		height: 60px;
	}

	.site-branding,
	.content-area {
		width: min(calc(100% - 28px), var(--content-width));
	}

	.brand-section {
		display: none;
	}

	.content-area {
		padding: 22px 0 40px;
	}

	.hentry {
		border-radius: 18px;
	}

	.entry-header {
		padding: 42px 24px 34px;
	}

	.entry-header::before {
		margin-bottom: 17px;
		font-size: 10px;
	}

	.entry-header::after {
		top: -116px;
		right: -110px;
	}

	.entry-title {
		font-size: clamp(29px, 9vw, 40px);
		letter-spacing: -0.035em;
	}

	.entry-header hr {
		margin: 22px 0 17px;
	}

	.entry-content {
		width: calc(100% - 40px);
		padding: 38px 0 48px;
		font-size: 16px;
		line-height: 1.9;
	}

	.entry-content p:first-child {
		font-size: 16.5px;
	}

	.cd-top-box {
		right: 16px;
		bottom: 18px;
	}

	.cd-top {
		width: 42px;
		height: 42px;
		border-radius: 12px;
	}
}

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

	* {
		transition-duration: 0.01ms !important;
	}
}
