html,
body,
div,
img,
h1,
p,
a,
ul,
li,
footer,
header,
nav {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

footer,
header,
nav {
	display: block;
}

body {
	line-height: 1;
}

ul {
	list-style: none;
}

/* reduced reset */

body {
	text-size-adjust: none;
}

/* Basic */

html {
	box-sizing: border-box;
}

*,
*:before,
*:after {
	box-sizing: inherit;
	user-select: none;
	-webkit-touch-callout: none;
}

:root {
	--bg-base: #1b1f22;
	--text-primary: #ffffff;
	--text-secondary: rgba(255, 255, 255, 0.75);
	--border-strong: #ffffff;
	--border-muted: rgba(255, 255, 255, 0.5);
	--accent-25: rgba(255, 255, 255, 0.075);
	--accent-50: rgba(255, 255, 255, 0.175);
	--overlay-gradient: rgba(19, 21, 25, 0.5);
	--overlay-radial: rgba(0, 0, 0, 0.25);
	--preload-cover: #000000;
	color-scheme: dark;
}

body {
	background: var(--bg-base);
}

body.is-preload *,
body.is-preload *:before,
body.is-preload *:after {
	animation: none !important;
	transition: none !important;
}

/* Type */

html {
	font-size: clamp(15px, 0.5vw + 11px, 18px);
}

body {
	color: var(--text-primary);
	font-family: "MiSans VF", sans-serif;
	font-weight: 300;
	font-size: 1rem;
	line-height: 1.65;
}

a {
	transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out,
		border-bottom-color 0.2s ease-in-out;
	border-bottom: dotted 1px var(--border-muted);
	text-decoration: none;
	color: inherit;
}

a:hover {
	border-bottom-color: transparent;
}

p {
	margin: 0 0 2rem 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--text-primary);
	font-weight: 650;
	line-height: 1.5;
	margin: 0 0 1rem 0;
	letter-spacing: 0.1rem;
}

h1 {
	font-size: 2.8rem;
	line-height: 1.3;
	letter-spacing: 0rem;
}

@media screen and (max-width: 480px) {
	h1 {
		font-size: 2.4rem;
	}
}

/* BG */

#bg {
	transform: scale(1);
	backface-visibility: hidden;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	z-index: 1;
	contain: strict;
}

#bg:before,
#bg:after {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#bg:before {
	transition: background-color 2.5s ease-in-out;
	transition-delay: 0.3s;
	background-image: linear-gradient(to top, var(--overlay-gradient), var(--overlay-gradient)), url("/overlay.png");
	background-size: auto, 256px 256px;
	background-position: center, center;
	background-repeat: no-repeat, repeat;
	z-index: 2;
}

body.is-preload #bg:before {
	background-color: var(--preload-cover);
}

#bg:after {
	transform: scale(1.02);
	transition: transform 0.325s ease-in-out, filter 0.325s ease-in-out;
	filter: blur(1px);
	background-image: var(--bg-image);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	z-index: 1;
	will-change: transform, filter;
}

/* Wrapper */

#wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	position: relative;
	min-height: 100vh;
	width: 100%;
	padding: clamp(1rem, 3vw + 0.5rem, 4rem) clamp(1rem, 2vw + 0.5rem, 2rem);
	z-index: 3;
	contain: layout style;
}

#wrapper:before {
	content: "";
	display: block;
}

/* Header */

#header {
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: transform 0.325s ease-in-out, filter 0.325s ease-in-out, opacity 0.325s ease-in-out;
	background-image: radial-gradient(var(--overlay-radial) 25%, transparent 55%);
	max-width: 100%;
	text-align: center;
}

#header>* {
	transition: opacity 0.325s ease-in-out;
	position: relative;
	margin-top: 3.5rem;
}

#header>*:before {
	content: "";
	display: block;
	position: absolute;
	top: calc(-3.5rem - 1px);
	left: 50%;
	transform: translateX(-50%);
	width: 1px;
	height: calc(3.5rem + 1px);
	background: var(--border-strong);
}

#header> :first-child {
	margin-top: 0;
}

#header> :first-child:before {
	display: none;
}

#header .logo {
	width: 6rem;
	height: 6rem;
	line-height: 6rem;
	border: solid 1px var(--border-strong);
	border-radius: 100%;
}

#header .content {
	border-style: solid;
	border-color: var(--border-strong);
	border-top-width: 1px;
	border-bottom-width: 1px;
	max-width: 100%;
}

#header .content .inner {
	transition: max-height 0.75s ease, padding 0.75s ease, opacity 0.325s ease-in-out;
	transition-delay: 0.25s;
	padding: clamp(2rem, 2vw + 1rem, 3rem) clamp(1rem, 1.5vw + 0.5rem, 2rem);
	max-height: 40rem;
	overflow: hidden;
}

#header .content .inner> :last-child {
	margin-bottom: 0;
}

#header nav {
	width: fit-content;
	max-width: 100%;
}

/* 桌面：固定 6 列，12 个链接自动排成两排 */
#header nav ul {
	display: grid;
	grid-template-columns: repeat(6, minmax(7rem, 1fr));
	position: relative;
	margin-bottom: 0;
	list-style: none;
	padding-left: 0;
	border: solid 1px var(--border-strong);
	border-radius: 4px;
	overflow: hidden;
}

#header nav ul li {
	padding-left: 0;
	border-left: solid 1px var(--border-strong);
	border-top: solid 1px var(--border-strong);
}

/* 每排第一个不要左边框，第一排不要上边框 */
#header nav ul li:nth-child(6n+1) {
	border-left: 0;
}

#header nav ul li:nth-child(-n+6) {
	border-top: 0;
}

#header nav ul li a {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 2.75rem;
	height: 100%;
	padding: 0.6rem 1rem;
	text-transform: uppercase;
	letter-spacing: 0.15rem;
	font-size: 0.85rem;
	line-height: 1.3;
	white-space: normal;
	word-break: break-word;
	border-bottom: 0;
}

#header nav ul li a:hover {
	background-color: var(--accent-25);
}

#header nav ul li a:active {
	background-color: var(--accent-50);
}

body.is-preload #header {
	filter: blur(0.125rem);
}

body.is-preload #header>* {
	opacity: 0;
}

body.is-preload #header .content .inner {
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	opacity: 0;
}

/* 平板：4 列 */
@media screen and (min-width: 641px) and (max-width: 900px) {
	#header nav ul {
		grid-template-columns: repeat(4, minmax(6.5rem, 1fr));
	}

	#header nav ul li:nth-child(6n+1) {
		border-left: solid 1px var(--border-strong);
	}

	#header nav ul li:nth-child(4n+1) {
		border-left: 0;
	}

	#header nav ul li:nth-child(-n+6) {
		border-top: solid 1px var(--border-strong);
	}

	#header nav ul li:nth-child(-n+4) {
		border-top: 0;
	}
}

/* 手机：固定 2 列，竖排（六排） */
@media screen and (max-width: 640px) {
	#header nav {
		width: 92%;
	}

	#header nav ul {
		grid-template-columns: repeat(2, 1fr);
		width: 100%;
	}

	#header nav ul li:nth-child(6n+1),
	#header nav ul li:nth-child(4n+1) {
		border-left: solid 1px var(--border-strong);
	}

	#header nav ul li:nth-child(2n+1) {
		border-left: 0;
	}

	#header nav ul li:nth-child(-n+6),
	#header nav ul li:nth-child(-n+4) {
		border-top: solid 1px var(--border-strong);
	}

	#header nav ul li:nth-child(-n+2) {
		border-top: 0;
	}

	#header nav ul li a {
		min-height: 3rem;
		padding: 0.6rem 0.5rem;
		font-size: 0.78rem;
		letter-spacing: 0.08rem;
	}
}

/* Landscape mobile */

@media screen and (max-height: 500px) and (orientation: landscape) {
	#header>* {
		margin-top: 2rem;
	}

	#header>*:before {
		top: calc(-2rem - 1px);
		height: calc(2rem + 1px);
	}
}

/* Footer */

#footer {
	transition: transform 0.325s ease-in-out, filter 0.325s ease-in-out, opacity 0.325s ease-in-out;
	width: 100%;
	max-width: 100%;
	margin-top: 2rem;
	text-align: center;
}

#footer .copyright {
	letter-spacing: 0.15rem;
	font-size: 0.7rem;
	opacity: 0.75;
	margin-bottom: env(safe-area-inset-bottom, 0px);
	text-transform: uppercase;
	color: var(--text-secondary);
}

@media screen and (max-width: 480px) {
	#footer .copyright {
		font-size: 0.65rem;
	}
}

body.is-preload #footer {
	opacity: 0;
}
