header {
	font-family: var(--primaryFont);
	padding: 2rem 2rem;
}

:where(header) a {
	text-decoration: none;

	&.active {
		font-weight: bold;
	}
}

:where(header) nav ul {
	list-style-type: none;
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	/* 水平排列 */
	justify-content: center;
	/* 居中对齐 */
	align-items: center;
	/* 垂直居中 */
	gap: 0rem 3rem;
	padding: 0;
	margin: 0;
}

/* 桌面端菜单容器的样式 */
.main-nav {
	position: static;
	transform: none;
	visibility: visible;
	width: auto;
	height: auto;
	pointer-events: auto;
	opacity: 1;
	display: flex;
	/* 确保它在桌面端是 flex 容器 */
	justify-content: center;
	align-items: center;
	background: none;
	color: inherit;
}

:where(header) a:hover {
	text-decoration: underline;
}

:where(header) svg {
	fill: currentColor;
}

header {
	background: var(--lightAccent);
	color: var(--darker);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

@media (min-width: 48rem) {
	header {
		justify-content: center;
		flex-wrap: wrap;
		height: 3rem;
	}
}

.site-title {
	font-family: var(--accentFont);
	font-size: 2.1rem;
	line-height: 1;
	color: inherit;
	text-align: center;
	margin: 0;
	display: block;
	font-size: 1.4rem;
	font-weight: bold;

	@media (min-width: 48rem) {
		width: 100%;
		font-size: 1.6rem;
	}
}

.menu-button {
	margin: 0;
	background: transparent !important;
	color: inherit;
	padding: 0;
	border: 0;
	width: 2rem;
}

@media (min-width: 48rem) {
	.menu-button {
		display: none;
	}
}

@media (max-width: 767px) {

	/* 1. 将菜单容器变为全屏覆盖层 */
	.main-nav {
		position: fixed;
		z-index: 2;
		top: 0;
		left: 0;
		transform: translateX(-100vw);
		visibility: hidden;
		width: 100%;
		height: 100vh;
		pointer-events: none;
		opacity: 0;
		justify-content: flex-end;
		/* 容器靠右 */
		align-items: flex-start;
		/* 容器靠上 */
		background: var(--darker);
		color: var(--paper);
		transition: all 0.25s cubic-bezier(0.785, 0.135, 0.15, 0.86);
	}

	.main-nav.open {
		transform: translateX(0);
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
	}

	/* 2. 将链接列表变为垂直排列、靠右对齐 */
	:where(header) nav ul {
		flex-direction: column;
		/* 改为垂直排列 */
		justify-content: space-evenly;
		align-content: stretch;
		align-items: flex-end;
		/* 右对齐 */
		gap: 0.5rem 1.5rem;
		padding-top: 5rem;
		padding-right: 2rem;
	}
}


.main-nav.open {
	transform: translateX(0);
	opacity: 1;
	pointer-events: unset;
	visibility: unset;
}


.main-nav.open li {
	--delay: 0.1s;
	opacity: 0;
	animation: slide_in_left 0.2s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

.main-nav a {
	color: inherit;
}

.main-nav li:nth-of-type(1) {
	animation-delay: calc(var(--delay) * 1);
}

.main-nav li:nth-of-type(2) {
	animation-delay: calc(var(--delay) * 2);
}

.main-nav li:nth-of-type(3) {
	animation-delay: calc(var(--delay) * 3);
}

.main-nav li:nth-of-type(4) {
	animation-delay: calc(var(--delay) * 4);
}

.main-nav li:nth-of-type(5) {
	animation-delay: calc(var(--delay) * 5);
}

.main-nav li:nth-of-type(6) {
	animation-delay: calc(var(--delay) * 6);
}

.main-nav li:nth-of-type(7) {
	animation-delay: calc(var(--delay) * 7);
}

.main-nav li:nth-of-type(8) {
	animation-delay: calc(var(--delay) * 8);
}

@media (min-width: 48rem) {
	header .main-nav {
		opacity: 1;
		transform: none;
		position: unset;
		height: auto;
		width: auto;
		background: unset;
		pointer-events: unset;
		visibility: unset;
		color: inherit;
		outline: none;
	}

	header .main-nav ul {
		margin: 1rem auto 0;
		padding-top: 0.5rem;
		transform: translateY(-37px);
		width: max-content;
		outline: none;
	}

	header .main-nav li {
		font-size: inherit;
		display: initial;
		width: initial;
		text-align: initial;
		margin-bottom: 0;
		outline: none;
	}
}

.menu-button {
	position: absolute;
	top: 2rem;
	right: 2rem;
}

.main nav ul li {
	font-size: 1.2rem;
	display: block;
	width: 100%;
	text-align: center;
	margin-bottom: calc(0.2rem + 2vh);
}

footer {
	background: var(--darker);
	color: var(--paper);
	display: grid;
	grid-template-columns: 100%;
	align-items: stretch;
	gap: 2rem;
}

footer p {
	text-align: center;
}

.skip-to-content-link {
	position: absolute;
	top: -6rem;
	left: 0;
	padding: 0.5em;
	opacity: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 3rem;
	background: var(--darker);
	color: var(--background);
}

.skip-to-content-link:focus {
	transform: translateY(6rem);
	opacity: 1;
	z-index: 11;
}