:root {
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
		"Helvetica Neue", Arial, sans-serif;
	--ease: cubic-bezier(.22, .61, .36, 1);
	--spring: cubic-bezier(.34, 1.56, .64, 1);
	--txt: #f5fbff;
	--txt-dim: rgba(245, 251, 255, .84);
	--txt-faint: rgba(245, 251, 255, .6);
	--glass: rgba(5, 18, 34, .34);
	--glass-strong: rgba(14, 32, 54, .78);
	--glass-brd: rgba(255, 255, 255, .16);
	--radius: 26px;
	--accent: #8fe6ff;
	--accent-2: #eaf9ff;
	--accent-3: #4cc9ff;
	--glow: rgba(143, 230, 255, .46);
	--title-a: #f8feff;
	--title-b: #c9f1ff;
	--title-c: #55d6ff;
	--veil-a: rgba(4, 16, 30, .54);
	--veil-b: rgba(4, 16, 30, .14);
	--tint: rgba(120, 210, 255, .07);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
	height: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--txt);
	background: #081a2b;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; }
a { -webkit-tap-highlight-color: transparent; }

::selection {
	background: var(--accent);
	color: #04101c;
}

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

/* ---------- loading ---------- */

#loading {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	background: #081a2b;
	transition: opacity .55s var(--ease), visibility 0s .55s;
}

#loading.done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

#loading .spin {
	width: 46px;
	height: 46px;
	color: var(--accent);
}

#loading .spin svg {
	display: block;
	width: 100%;
	height: 100%;
	animation: spin 1.6s linear infinite;
}

#loading p {
	margin: 0;
	color: var(--txt-faint);
	font-size: 13px;
	letter-spacing: .25em;
	text-indent: .25em;
}

/* ---------- background ---------- */

#bg {
	position: fixed;
	inset: -5vmax;
	z-index: 0;
	background-color: #081a2b;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	transform: scale(1.06);
	transition: opacity 1.1s var(--ease);
	will-change: transform, opacity;
}

body:not(.js) #bg {
	background-image: linear-gradient(155deg, #b9e3fb, #2f6985 64%);
}

.veil {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(180deg, var(--veil-a) 0%, var(--veil-b) 32%, var(--veil-b) 62%, var(--veil-a) 100%),
		radial-gradient(130% 100% at 50% 42%, transparent 48%, var(--veil-a) 100%),
		linear-gradient(0deg, var(--tint), var(--tint));
}

.glow {
	display: none;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 2;
	width: 520px;
	height: 520px;
	margin: -260px 0 0 -260px;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
	opacity: .5;
	mix-blend-mode: screen;
	will-change: transform;
}

body.js .glow { display: block; }

/* ---------- layout ---------- */

.shell {
	position: relative;
	z-index: 10;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(20px, 4vw, 46px);
	padding-top: max(clamp(20px, 4vw, 46px), env(safe-area-inset-top));
	padding-bottom: clamp(10px, 2vw, 22px);
	pointer-events: none;
}

.shell > * { pointer-events: auto; }

.hero {
	position: relative;
	width: min(680px, 100%);
	padding: clamp(30px, 5vw, 48px) clamp(22px, 5vw, 54px);
	border-radius: var(--radius);
	text-align: center;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 34%),
		var(--glass);
	border: 1px solid var(--glass-brd);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	backdrop-filter: blur(16px) saturate(1.2);
	box-shadow:
		0 24px 64px rgba(0, 0, 0, .32),
		inset 0 1px 0 rgba(255, 255, 255, .1);
	animation: heroIn .9s var(--ease) .05s backwards;
	transition: transform .5s var(--ease), opacity .5s var(--ease), filter .5s var(--ease);
}

body[data-view="article"] .hero {
	transform: scale(.96) translateY(-10px);
	opacity: .34;
	filter: saturate(.72);
}

@keyframes heroIn {
	from { transform: translateY(22px) scale(.985); }
	to { transform: none; }
}

@keyframes rise {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: none; }
}

@keyframes riseChips {
	from { transform: translateY(20px); }
	to { transform: none; }
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ---------- avatar ---------- */

.avatar {
	width: 112px;
	height: 112px;
	margin: 0 auto 20px;
	position: relative;
	animation: rise .7s var(--ease) .1s backwards;
}

.avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .84);
	box-shadow:
		0 0 0 5px rgba(255, 255, 255, .06),
		0 12px 34px rgba(0, 0, 0, .5);
}

.avatar::before {
	content: "";
	position: absolute;
	inset: -8px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, transparent 0 38%, var(--accent) 58%, var(--accent-2) 74%, transparent 92%);
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
	animation: spin 7s linear infinite;
}

.avatar::after {
	content: "";
	position: absolute;
	inset: -20px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--glow), transparent 66%);
	opacity: .55;
	z-index: -1;
	filter: blur(8px);
}

/* ---------- copy ---------- */

.hero h1 {
	margin: 0 0 10px;
	font-size: clamp(27px, 5.4vw, 44px);
	font-weight: 800;
	letter-spacing: .035em;
	line-height: 1.25;
	background: linear-gradient(100deg, var(--title-a), var(--title-b) 46%, var(--title-c));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--accent-2);
	filter: drop-shadow(0 0 24px var(--glow)) drop-shadow(0 1px 10px rgba(0, 0, 0, .45));
	animation: rise .7s var(--ease) .18s backwards;
	text-wrap: balance;
}

.hero .tagline {
	margin: 0 0 22px;
	color: var(--txt-dim);
	font-size: clamp(15px, 2.6vw, 17px);
	letter-spacing: .1em;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
	animation: rise .7s var(--ease) .26s backwards;
}

.hero .hero-note {
	margin: 3px 0;
	color: var(--txt-dim);
	font-size: 14.5px;
	letter-spacing: .04em;
	text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
	animation: rise .7s var(--ease) .32s backwards;
}

.hero .link-label {
	margin: 26px 0 0;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .24em;
	text-indent: .24em;
	color: var(--txt-faint);
	animation: rise .7s var(--ease) .38s backwards;
}

.hero .chips + .link-label { animation-delay: .46s; }

/* ---------- chips ---------- */

.chips {
	width: min(500px, 100%);
	margin: 14px auto 0;
	display: grid;
	gap: 10px;
	text-align: left;
	animation: riseChips .7s var(--ease) .42s backwards;
}

.chips-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips-more { grid-template-columns: repeat(2, minmax(0, 1fr)); animation-delay: .5s; }

.chip {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 11px 15px;
	border-radius: 14px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	color: var(--c);
	text-decoration: none;
	background: rgba(72, 122, 156, .26);
	border: 1px solid rgba(255, 255, 255, .12);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
	transition:
		transform .25s var(--spring),
		background .25s,
		border-color .25s,
		box-shadow .25s,
		color .25s;
}

.chip .ic {
	width: 20px;
	flex: 0 0 20px;
	text-align: center;
	font-size: 18px;
	color: var(--c);
	text-shadow: 0 0 16px var(--c);
}

.chip .dot {
	width: 8px;
	height: 8px;
	flex: 0 0 8px;
	margin: 0 6px;
	border-radius: 50%;
	background: var(--c);
	box-shadow: 0 0 12px var(--c);
}

.chip .arr {
	margin-left: auto;
	font-size: 13px;
	color: var(--c);
	opacity: .75;
	transition: transform .25s var(--ease), opacity .25s;
}

.chip:hover,
.chip:focus-visible {
	transform: translateX(6px);
	background: rgba(32, 66, 94, .42);
	border-color: var(--c);
	box-shadow:
		0 6px 20px rgba(0, 0, 0, .3),
		0 0 16px -4px var(--c);
}

.chip:hover .arr,
.chip:focus-visible .arr {
	transform: translate(3px, -3px);
	opacity: 1;
}

/* ---------- footer ---------- */

.footer {
	position: relative;
	z-index: 10;
	flex: 0 0 auto;
	padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
	text-align: center;
	color: var(--txt-faint);
	font-size: 12px;
	letter-spacing: .04em;
	text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}

.footer p { margin: 0; }

/* ---------- canvas ---------- */

#fx {
	position: fixed;
	inset: 0;
	z-index: 20;
	pointer-events: none;
}

/* ---------- panel ---------- */

.panel {
	position: fixed;
	inset: 0;
	z-index: 30;
	background: rgba(4, 14, 26, .5);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	display: grid;
	place-items: center;
	padding: clamp(16px, 4vw, 40px);
	padding-top: max(clamp(16px, 4vw, 40px), env(safe-area-inset-top));
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .4s var(--ease), visibility 0s .4s;
}

.panel.active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity .4s var(--ease);
}

.panel .card {
	position: relative;
	width: min(660px, 100%);
	max-height: min(80vh, 760px);
	max-height: min(80dvh, 760px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 52px);
	border-radius: var(--radius);
	background: var(--glass-strong);
	border: 1px solid var(--glass-brd);
	-webkit-backdrop-filter: blur(18px) saturate(1.3);
	backdrop-filter: blur(18px) saturate(1.3);
	box-shadow:
		0 34px 90px rgba(0, 0, 0, .55),
		inset 0 1px 0 rgba(255, 255, 255, .08);
	transform: translateY(28px) scale(.965);
	transition: transform .45s var(--spring);
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

.panel.active .card { transform: none; }

.panel .card::-webkit-scrollbar { width: 8px; }
.panel .card::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .18);
	border-radius: 8px;
}

.panel-kicker {
	margin: 0 0 8px;
	color: var(--accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .26em;
	text-indent: .26em;
}

.panel h2 {
	margin: 0 0 18px;
	font-size: clamp(24px, 4vw, 32px);
	line-height: 1.3;
	color: var(--title-b);
	text-shadow: 0 0 22px var(--glow);
}

.panel p {
	margin: 10px 0;
	color: var(--txt-dim);
	font-size: 15px;
	line-height: 1.85;
}

.panel code {
	padding: 2px 6px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .08);
	color: var(--accent-2);
	font-size: .92em;
}

.panel .panel-meta {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	font-size: 14px;
}

.panel .panel-meta a {
	color: var(--accent-2);
	text-decoration: none;
	border-bottom: 1px dashed rgba(255, 255, 255, .28);
}

.panel .panel-meta a:hover { color: #fff; border-bottom-color: var(--accent); }

.panel-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 24px;
	padding: 10px 20px;
	border-radius: 999px;
	color: var(--txt);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .14);
	transition: transform .25s var(--spring), border-color .25s, background .25s;
}

.panel-close:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
	background: rgba(255, 255, 255, .1);
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
	.chips-main,
	.chips-more { grid-template-columns: 1fr; }

	.hero { padding: 30px 20px 28px; border-radius: 22px; }
	.avatar { width: 94px; height: 94px; margin-bottom: 17px; }
	.hero .tagline { margin-bottom: 18px; }
	.hero .link-label { margin-top: 22px; }
	.footer { font-size: 11px; }
}

@media (pointer: coarse) {
	body.js .glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	body.js .glow { display: none; }
	#fx { display: none; }
}
