:root {
	--paper: #f3f1eb;
	--paper-deep: #e9e6de;
	--ink: #171714;
	--muted: #6c6a62;
	--line: rgba(23, 23, 20, 0.2);
	--accent: #9b3f2b;
	--gutter: clamp(1.25rem, 4vw, 4.5rem);
	--max-width: 100rem;
	--transition: 180ms ease;
}

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

body.subpage,
body.subpage.is-preload {
	min-width: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.7;
}

body.subpage::before,
body.subpage::after,
body.subpage #wrapper > .bg {
	display: none !important;
}

body.subpage #wrapper {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
}

body.subpage a {
	color: inherit;
	text-decoration-color: rgba(155, 63, 43, 0.55);
	text-underline-offset: 0.2em;
	transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

body.subpage a:hover {
	color: var(--accent) !important;
}

body.subpage #header {
	grid-column: 1;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	width: auto;
	height: auto;
	min-height: 7rem;
	margin: 0;
	padding: 0 0 0 var(--gutter);
	border-bottom: 1px solid var(--line);
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	pointer-events: auto;
	transform: none;
}

body.subpage #header .logo {
	border: 0;
	padding: 0;
	color: var(--ink) !important;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.2;
}

body.subpage #nav {
	grid-column: 2;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	width: auto;
	height: auto;
	min-height: 7rem;
	margin: 0;
	padding: 0 var(--gutter) 0 clamp(2rem, 4vw, 5rem);
	border-bottom: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	gap: clamp(1.25rem, 3vw, 3rem);
}

body.subpage #nav .links {
	display: flex;
	justify-content: flex-end;
	gap: 1.5rem;
	width: auto;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-weight: 400;
}

body.subpage #nav .links li {
	border: 0;
}

body.subpage #nav .links li:first-child,
body.subpage #nav .links li:last-child,
body.subpage #nav .icons {
	display: none;
}

body.subpage #nav .links li a {
	height: auto;
	padding: 0 0 0.16rem;
	border-bottom: 1px solid transparent;
	color: var(--ink);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 1.5;
	text-transform: none;
}

body.subpage #nav .subpage-language-switch {
	display: flex;
	flex: none;
	align-items: center;
	gap: 0.42rem;
	width: auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.subpage #nav .subpage-language-switch li {
	display: block;
	padding: 0;
	border: 0;
}

body.subpage #nav .subpage-language-switch li + li::before {
	margin-right: 0.42rem;
	color: var(--muted);
	content: "/";
}

body.subpage #nav .subpage-language-switch a {
	padding: 0 0 0.16rem;
	border-bottom: 1px solid transparent;
	color: var(--muted);
	font-family: inherit;
	font-size: 0.68rem;
	font-weight: 650;
	letter-spacing: 0.08em;
	text-decoration: none;
}

body.subpage #nav .subpage-language-switch a.is-active {
	border-bottom-color: var(--accent);
	color: var(--ink);
}

body.subpage #nav .links li:nth-child(2) { order: 1; }
body.subpage #nav .links li:nth-child(3) { order: 2; }
body.subpage #nav .links li:nth-child(5) { order: 3; }
body.subpage #nav .links li:nth-child(4) { order: 4; }

body.subpage #nav .links li.active,
body.subpage #nav .links li.active a {
	background: transparent;
	color: var(--ink);
}

body.subpage #nav .links li.active a {
	border-bottom-color: var(--accent);
}

body.subpage #nav .links li:nth-child(4) a::after {
	content: " ↗";
}

body.subpage #main {
	grid-column: 1 / -1;
	width: min(100%, var(--max-width));
	max-width: none;
	margin: 0 auto;
	padding: clamp(5rem, 9vw, 9rem) var(--gutter) clamp(7rem, 11vw, 11rem);
	background: transparent;
	box-shadow: none;
	color: var(--ink);
}

body.subpage #main > * {
	border: 0;
}

body.subpage #main > .post,
body.subpage #main > .posts,
body.subpage #main > header.major,
body.subpage #main > section,
body.subpage #main > h2 {
	padding-right: 0;
	padding-left: 0;
}

body.subpage #main > header.major,
body.subpage .post > header.major {
	max-width: 72rem;
	margin: 0 0 clamp(4rem, 8vw, 8rem);
	padding: 0;
	text-align: left;
}

body.subpage #main header.major h1,
body.subpage #main .post header.major h1 {
	margin: 0;
	font-family: inherit;
	font-size: clamp(3.8rem, 8vw, 8.5rem);
	font-weight: 500;
	letter-spacing: -0.055em;
	line-height: 0.88;
	text-transform: none;
}

body.subpage #main header.major h1 [lang="zh-CN"] {
	font-size: 0.82em;
	letter-spacing: 0;
	line-height: 1.05;
}

body.subpage #main > header.major h2 {
	margin: 0;
	font-size: clamp(2.8rem, 6vw, 6.5rem);
	font-weight: 500;
	letter-spacing: -0.05em;
	line-height: 0.95;
}

body.subpage #main header.major p {
	max-width: 38rem;
	margin: 1.75rem 0 0;
	color: var(--muted);
	font-family: inherit;
	font-size: clamp(1rem, 1.5vw, 1.25rem);
	font-style: normal;
	line-height: 1.55;
	text-align: left;
}

body.subpage #main h2,
body.subpage #main h3,
body.subpage #main h4 {
	color: var(--ink);
	font-family: inherit;
	font-weight: 520;
	letter-spacing: -0.035em;
	line-height: 1.08;
	text-transform: none;
	overflow-wrap: anywhere;
}

body.subpage #main > h2 {
	margin: clamp(3rem, 7vw, 7rem) 0 2rem;
	font-size: clamp(2rem, 4vw, 4.5rem);
}

body.subpage #main p,
body.subpage #main li {
	color: var(--ink);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.75;
}

body.subpage #main .date {
	display: block;
	margin: 0.8rem 0 0;
	color: var(--muted);
	font-family: inherit;
	font-size: 0.72rem;
	font-style: normal;
	font-weight: 650;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

body.subpage #main .date::before,
body.subpage #main .date::after {
	display: none;
	content: none;
}

body.subpage #main .posts {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	width: 100%;
	margin: 0;
	padding: 0 0 clamp(3rem, 7vw, 7rem);
	border-top: 0;
}

body.subpage #main .posts article {
	display: block;
	width: 100%;
	padding: clamp(2.5rem, 5vw, 5rem) 0 clamp(5rem, 9vw, 9rem);
	border: 0;
	border-top: 1px solid var(--ink);
	text-align: left;
}

body.subpage #main .posts article header {
	max-width: 58rem;
	margin: 0 0 clamp(2rem, 4vw, 4rem);
}

body.subpage #main .posts article h3 {
	margin: 0;
	font-size: clamp(2rem, 4.5vw, 5rem);
	line-height: 1;
}

body.subpage #main .posts article h3 a {
	border: 0;
}

body.subpage #main .image {
	border: 0;
	background: var(--paper-deep);
}

body.subpage #main .posts .image.fit {
	aspect-ratio: 16 / 10;
	margin: 0 0 clamp(2rem, 4vw, 4rem);
	overflow: hidden;
}

body.subpage #main .posts .image.fit img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.subpage #main .posts .image.fit:hover img {
	transform: scale(1.015);
}

body.subpage #main .actions {
	margin-top: 0;
	padding-top: 1.2rem;
}

body.subpage #main .button,
body.subpage #main button,
body.subpage #main input[type="submit"] {
	height: auto;
	padding: 0.2rem 0;
	border: 0;
	border-bottom: 1px solid currentColor;
	box-shadow: none;
	color: var(--ink) !important;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 450;
	letter-spacing: 0.02em;
	line-height: 1.7;
	text-transform: none;
}

body.subpage #main .button:hover {
	border-color: var(--accent) !important;
	color: var(--accent) !important;
}

body.subpage #main .post {
	max-width: 58rem;
	margin: 0 auto;
	padding-top: 0;
}

body.subpage #main .post > h2 {
	margin-top: 4.5rem;
	font-size: clamp(2rem, 4vw, 3.6rem);
}

body.subpage #main .post > h3 {
	margin-top: 3rem;
	font-size: clamp(1.45rem, 2.5vw, 2.2rem);
}

body.subpage #main .box {
	margin: 2.5rem 0;
	padding: 1.5rem 0 1.5rem 1.5rem;
	border: 0;
	border-left: 2px solid var(--accent);
	background: transparent;
}

body.subpage #main hr {
	border: 0;
	border-top: 1px solid var(--line);
}

body.subpage #main video,
body.subpage #main iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
	background: #000;
}

body.subpage-photography #main {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

body.subpage-photography #main > header.major {
	grid-column: 1 / -1;
	width: 100%;
}

body.subpage-photography #main .gallery-item {
	grid-column: span 6;
	min-width: 0;
	margin: 0 0 clamp(2rem, 4vw, 4rem);
	padding: 0;
}

body.subpage-photography #main .gallery-item .image.fit {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

body.subpage-photography #main .gallery-item img {
	width: 100%;
	height: auto;
	min-height: 0;
	object-fit: contain;
	transition: none;
}

body.subpage-photography #main .gallery-item figcaption {
	margin-top: 0.8rem;
	color: var(--muted);
	font-size: 0.78rem;
	letter-spacing: 0.02em;
	line-height: 1.5;
}

body.subpage #footer {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.75fr);
	gap: clamp(3rem, 8vw, 8rem);
	width: min(calc(100% - (2 * var(--gutter))), calc(var(--max-width) - (2 * var(--gutter))));
	margin: 0 auto;
	padding: clamp(3rem, 6vw, 6rem) 0;
	border-top: 1px solid var(--ink);
	background: transparent;
	color: var(--ink);
}

body.subpage #footer::before {
	content: "Ruiqi Yang";
	font-size: clamp(2.8rem, 6vw, 6.5rem);
	font-weight: 500;
	letter-spacing: -0.04em;
	line-height: 0.9;
}

body.subpage #footer > .split.contact {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	width: 100%;
}

body.subpage #footer > .split.contact > section {
	padding: 0;
	border: 0;
}

body.subpage #footer h3 {
	width: auto;
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-size: 0.68rem;
	letter-spacing: 0.12em;
}

body.subpage #footer p,
body.subpage #footer a {
	color: var(--ink);
	font-size: 0.85rem;
}

body.subpage #footer .icons {
	margin: 0;
}

body.subpage #copyright {
	grid-column: 1 / -1;
	width: min(100%, var(--max-width));
	margin: 0 auto;
	padding: 0 var(--gutter) 2.5rem;
	color: var(--muted);
}

body.subpage #copyright ul {
	margin: 0;
}

body.subpage #copyright li {
	border: 0;
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: none;
}

body.subpage #copyright li + li {
	display: none;
}

body.subpage #navPanel,
body.subpage #navPanelToggle {
	display: none !important;
}

@media (max-width: 48rem) {
	body.subpage #wrapper {
		grid-template-columns: auto minmax(0, 1fr);
	}

	body.subpage #header {
		min-height: 7.5rem;
		padding: 1.25rem 0 1.25rem var(--gutter);
	}

	body.subpage #nav {
		flex-direction: column;
		justify-content: flex-end;
		align-items: flex-end;
		min-height: 7.5rem;
		padding: 1rem var(--gutter) 1rem 1rem;
		overflow: visible;
		gap: 0.7rem;
	}

	body.subpage #nav .links {
		display: grid;
		grid-template-columns: repeat(2, auto);
		justify-content: end;
		gap: 0.5rem 1.15rem;
		white-space: nowrap;
	}

	body.subpage #main {
		padding-top: 3.5rem;
	}

	body.subpage #footer > .split.contact {
		grid-template-columns: 1fr;
	}

	body.subpage #main .posts {
		gap: 0;
	}

	body.subpage #main .post {
		width: 100%;
	}

	body.subpage #main .post .image.left,
	body.subpage #main .post .image.right {
		float: none;
		width: 100%;
		max-width: none;
		margin: 2rem 0;
	}

	body.subpage-photography #main {
		grid-template-columns: 1fr;
	}

	body.subpage-photography #main .gallery-item {
		grid-column: 1;
	}

	body.subpage #footer {
		grid-template-columns: 1fr;
	}
}

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
