/*
	Bohan – site styles.
	Colours come from the logo: red (#cc0000) and white, with ink-black type on rice-paper white.
*/

/* ---------- Tokens ---------- */

:root {
	color-scheme: light;

	--red: #cc0000;
	--red-deep: #990000;
	--red-bright: #e31b1b;
	--red-tint: #fbeae7;
	--paper: #faf6ef;
	--paper-deep: #f2eadd;
	--white: #ffffff;
	--ink: #17120f;
	--ink-soft: #4d453f;
	--ink-mute: #6f665f;
	--line: rgba(23, 18, 15, 0.12);
	--line-strong: rgba(23, 18, 15, 0.24);

	--font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "Noto Serif SC", serif;
	--font-hanzi: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
	/* Fraunces draws detached macrons (ā, ē, ō, ū), so pinyin gets its own face. */
	--font-pinyin: "Source Serif 4", "Noto Serif", Georgia, serif;

	--radius: 12px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(23, 18, 15, 0.06);
	--shadow: 0 1px 2px rgba(23, 18, 15, 0.05), 0 22px 44px -22px rgba(23, 18, 15, 0.3);
	--shadow-red: 0 34px 60px -30px rgba(153, 0, 0, 0.7);

	--container: 1180px;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--header-h: 76px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	/* 田 and 米 practice grids, the brush underline and the paper grain. */
	--grid-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 0V100M0 50H100' fill='none' stroke='%23cc0000' stroke-opacity='0.35' stroke-dasharray='5 4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
	--grid-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 0V100M0 50H100M0 0L100 100M100 0L0 100' fill='none' stroke='%23cc0000' stroke-opacity='0.3' stroke-dasharray='6 5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
	--brush: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12.5C40 7.5 92 5 150 5.6C205 6.2 252 7.8 297 6.4C299 6.3 299.6 8.6 297.4 9.2C252 12 206 12.8 152 13.2C98 13.6 52 15.4 6 17.6C2.6 17.8.4 13.4 2 12.5Z' fill='%23cc0000' fill-opacity='0.9'/%3E%3C/svg%3E");
	--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0 0.06 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 1rem);
}

html.nav-open {
	overflow: hidden;
}

body {
	margin: 0;
	min-height: 100vh;
	overflow-x: clip;
	background-color: var(--paper);
	background-image: var(--grain);
	color: var(--ink-soft);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

h1, h2, h3, h4 {
	margin: 0 0 0.5em;
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-wrap: balance;
}

p {
	margin: 0 0 1.25em;
	text-wrap: pretty;
}

a {
	color: var(--red);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color 0.2s;
}

a:hover {
	color: var(--red-deep);
}

strong {
	color: var(--ink);
	font-weight: 600;
}

[lang|="zh"] {
	font-family: var(--font-hanzi);
}

::selection {
	background: var(--red);
	color: var(--white);
}

:focus-visible {
	outline: 2px solid var(--red);
	outline-offset: 3px;
}

[hidden] {
	display: none !important;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: -4rem;
	left: 1rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--white);
}

.skip-link:focus {
	top: 1rem;
	color: var(--white);
}

/* ---------- Layout ---------- */

.container {
	width: min(100% - 2 * var(--gutter), var(--container));
	margin-inline: auto;
}

.section {
	padding-block: clamp(4rem, 9vw, 7.5rem);
}

.section--tight {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section--flush-top {
	padding-top: 0;
}

.section--deep {
	background-color: var(--paper-deep);
}

/* ---------- Type helpers ---------- */

.eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1.25rem;
	color: var(--red);
	font: 600 0.78rem/1.2 var(--font-body);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.eyebrow::before {
	content: "";
	flex: none;
	width: 0.6rem;
	height: 0.6rem;
	background: currentColor;
}

.eyebrow [lang|="zh"] {
	color: var(--ink-mute);
	font-size: 0.95rem;
	letter-spacing: 0.12em;
}

.eyebrow--white {
	color: var(--white);
}

.eyebrow--white [lang|="zh"] {
	color: rgba(255, 255, 255, 0.7);
}

.lead {
	max-width: 36rem;
	color: var(--ink-soft);
	font-size: clamp(1.1rem, 1.5vw, 1.28rem);
	line-height: 1.6;
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--red);
	font-weight: 600;
	text-decoration: none;
}

.link-arrow i {
	font-size: 0.85em;
	transition: transform 0.3s var(--ease);
}

.link-arrow:hover i,
a:hover .link-arrow i {
	transform: translateX(4px);
}

/* ---------- Buttons ---------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	height: 3rem;
	padding: 0 1.4rem;
	border: 1.5px solid var(--line-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font: 600 0.95rem/1 var(--font-body);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.25s, border-color 0.25s, color 0.25s, transform 0.3s var(--ease), box-shadow 0.25s;
}

.button:hover {
	border-color: var(--ink);
	color: var(--ink);
	transform: translateY(-1px);
}

.button i {
	font-size: 0.9em;
}

.button .fa-arrow-right {
	transition: transform 0.3s var(--ease);
}

.button:hover .fa-arrow-right {
	transform: translateX(3px);
}

.button--red {
	border-color: var(--red);
	background: var(--red);
	color: var(--white);
	box-shadow: 0 12px 24px -14px rgba(153, 0, 0, 0.8);
}

.button--red:hover {
	border-color: var(--red-deep);
	background: var(--red-deep);
	color: var(--white);
}

.button--white {
	border-color: var(--white);
	background: var(--white);
	color: var(--red);
}

.button--white:hover {
	border-color: var(--paper);
	background: var(--paper);
	color: var(--red-deep);
}

.button--on-red {
	border-color: rgba(255, 255, 255, 0.6);
	color: var(--white);
}

.button--on-red:hover {
	border-color: var(--white);
	background: var(--white);
	color: var(--red);
}

.button--small {
	height: 2.5rem;
	padding: 0 1.1rem;
	font-size: 0.85rem;
}

.icon-button {
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: var(--white);
	color: var(--red);
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.icon-button:hover {
	border-color: var(--red);
	background: var(--red);
	color: var(--white);
}

/* "Posłuchaj" only makes sense when the browser has a Chinese voice. */
html:not(.can-speak-chinese) .speak {
	display: none;
}

/* ---------- Header ---------- */

.header-slot {
	min-height: var(--header-h);
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid transparent;
	background-color: rgba(250, 246, 239, 0.82);
	-webkit-backdrop-filter: saturate(150%) blur(14px);
	backdrop-filter: saturate(150%) blur(14px);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: var(--red);
}

.site-header.is-scrolled {
	border-bottom-color: var(--line);
	box-shadow: 0 12px 32px -24px rgba(23, 18, 15, 0.45);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 2rem;
	height: var(--header-h);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--ink);
	text-decoration: none;
}

.brand:hover {
	color: var(--ink);
}

.brand__mark {
	flex: none;
	width: 2.5rem;
	height: 2.5rem;
	box-shadow: 0 8px 16px -8px rgba(153, 0, 0, 0.7);
	transition: transform 0.5s var(--ease);
}

.brand:hover .brand__mark {
	transform: rotate(-8deg) scale(1.06);
}

.brand__name {
	font-family: var(--font-display);
	font-size: 1.65rem;
	font-weight: 650;
	letter-spacing: -0.035em;
	line-height: 1;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 2.25rem;
	margin-left: auto;
}

.site-nav ul {
	display: flex;
	gap: 1.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav ul a {
	position: relative;
	display: block;
	padding: 0.4rem 0;
	color: var(--ink);
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
}

.site-nav ul a::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 2px;
	background: var(--red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--ease);
}

.site-nav ul a:hover::after,
.site-nav ul a.active::after {
	transform: scaleX(1);
}

.site-nav ul a.active {
	color: var(--red);
}

.site-nav__extra,
.nav-toggle {
	display: none;
}

@media (max-width: 900px) {
	.site-header {
		background-color: var(--paper);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.nav-open .site-header {
		background-color: transparent;
	}

	.nav-open .brand {
		position: relative;
		z-index: 2;
		color: var(--white);
	}

	.nav-toggle {
		position: relative;
		z-index: 2;
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 6px;
		width: 2.75rem;
		height: 2.75rem;
		margin-left: auto;
		padding: 0 0.6rem;
		border: 0;
		border-radius: 50%;
		background: transparent;
		color: var(--ink);
		cursor: pointer;
	}

	.nav-toggle span {
		display: block;
		height: 2px;
		border-radius: 2px;
		background: currentColor;
		transition: transform 0.4s var(--ease);
	}

	.nav-open .nav-toggle {
		color: var(--white);
	}

	.nav-open .nav-toggle span:first-child {
		transform: translateY(4px) rotate(45deg);
	}

	.nav-open .nav-toggle span:last-child {
		transform: translateY(-4px) rotate(-45deg);
	}

	/* Full-screen red menu that grows out of the menu button. */
	.site-nav {
		position: fixed;
		inset: 0;
		z-index: 1;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: 2.5rem;
		margin: 0;
		padding: calc(var(--header-h) + 1rem) var(--gutter) 2.5rem;
		background: var(--red);
		clip-path: circle(0 at calc(100% - var(--gutter) - 1.4rem) calc(var(--header-h) / 2));
		visibility: hidden;
		transition: clip-path 0.6s var(--ease), visibility 0s 0.6s;
	}

	.nav-open .site-nav {
		clip-path: circle(150% at calc(100% - var(--gutter) - 1.4rem) calc(var(--header-h) / 2));
		visibility: visible;
		transition: clip-path 0.7s var(--ease);
	}

	.site-nav ul {
		flex-direction: column;
		gap: 0.25rem;
	}

	.site-nav ul a,
	.site-nav ul a.active {
		color: var(--white);
		font-family: var(--font-display);
		font-size: clamp(2.4rem, 10vw, 3.4rem);
		font-weight: 500;
		letter-spacing: -0.03em;
		line-height: 1.15;
	}

	.site-nav ul a::after {
		height: 3px;
		background: var(--white);
	}

	.site-nav .button--red {
		border-color: var(--white);
		background: var(--white);
		color: var(--red);
		box-shadow: none;
	}

	.site-nav__extra {
		display: block;
		margin: 0;
		color: rgba(255, 255, 255, 0.85);
	}

	.site-nav__extra a {
		color: var(--white);
	}
}

/* ---------- Hero ---------- */

.hero,
.page-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.hero {
	padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 8vw, 6.5rem);
}

.hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
	align-items: center;
	gap: clamp(2.5rem, 6vw, 5.5rem);
}

.hero h1 {
	margin-bottom: 2.1rem;
	font-size: clamp(2.7rem, 6.4vw, 5.6rem);
	letter-spacing: -0.03em;
	line-height: 1;
}

h1 em {
	position: relative;
	color: var(--red);
	font-style: italic;
	font-weight: 500;
	white-space: nowrap;
}

h1 em::after {
	content: "";
	position: absolute;
	right: -0.06em;
	bottom: -0.1em;
	left: -0.04em;
	height: 0.2em;
	background: var(--brush) no-repeat center / 100% 100%;
	animation: brush 1.1s 0.5s var(--ease) both;
}

.hero__visual {
	position: relative;
	isolation: isolate;
	display: flex;
	justify-content: center;
	padding: 1.5rem 0;
}

/* A calligraphy practice sheet behind the red card. */
.hero__visual::before {
	content: "";
	position: absolute;
	top: -4%;
	right: -2%;
	z-index: -1;
	width: 82%;
	aspect-ratio: 1;
	border: 1.5px solid rgba(204, 0, 0, 0.3);
	background: var(--white) var(--grid-star) center / 100% 100% no-repeat;
	box-shadow: var(--shadow);
	transform: rotate(6deg);
}

@media (max-width: 900px) {
	.hero__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero__visual::before {
		right: 4%;
		width: 70%;
	}
}

/* ---------- Dictionary search ---------- */

.search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 40rem;
	margin: 2rem 0 0;
	padding: 0.4rem 0.4rem 0.4rem 0.6rem;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	background: var(--white);
	box-shadow: var(--shadow);
	transition: border-color 0.25s, box-shadow 0.25s;
}

.search:focus-within {
	border-color: var(--red);
	box-shadow: 0 0 0 5px rgba(204, 0, 0, 0.1), var(--shadow);
}

.search__lang {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.8rem;
	border-radius: 999px;
	background: var(--red-tint);
	color: var(--red);
	font: 600 0.78rem/1 var(--font-body);
	letter-spacing: 0.06em;
}

.search__lang i {
	font-size: 0.7rem;
}

.search input {
	flex: 1;
	min-width: 0;
	padding: 0.7rem 0.25rem;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--ink);
	font: 500 1.125rem/1.2 var(--font-body);
	-webkit-appearance: none;
	appearance: none;
}

.search input::placeholder {
	color: var(--ink-mute);
	opacity: 1;
}

.search .button {
	height: 3.25rem;
	padding-inline: 1.5rem;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 1.1rem 0 0;
	color: var(--ink-mute);
	font-size: 0.9rem;
}

.chip {
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font: 500 0.875rem/1.2 var(--font-body);
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
	border-color: var(--red);
	background: var(--red-tint);
	color: var(--red);
}

.result {
	max-width: 40rem;
	margin: 1.75rem 0 0;
	padding: 1.5rem 1.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow);
	animation: rise 0.5s var(--ease) both;
}

.result__status {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
}

.result[data-state="loading"] .result__status::before {
	content: "";
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid var(--line-strong);
	border-top-color: var(--red);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.result[data-state="error"] {
	border-color: rgba(204, 0, 0, 0.35);
	background: var(--red-tint);
}

.result[data-state="error"] .result__status {
	color: var(--red-deep);
}

.result__label {
	margin: 0 0 1rem;
	color: var(--ink-mute);
	font-size: 0.9rem;
}

.result__body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem 1.75rem;
}

.result__body p {
	margin: 0;
}

.result .pinyin {
	margin-bottom: 0.4rem;
	color: var(--red);
	font: italic 500 1.75rem/1.2 var(--font-pinyin);
}

.tag {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--paper-deep);
	color: var(--ink);
	font-size: 0.8rem;
	font-weight: 500;
}

.result__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.4rem;
}

@media (max-width: 560px) {
	.search {
		flex-wrap: wrap;
		padding: 0.5rem;
		border-radius: var(--radius-lg);
	}

	.search .button {
		flex: 1 0 100%;
	}
}

/* ---------- Hanzi in a 田字格 grid ---------- */

.hanzi-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.hanzi-grid > span {
	display: grid;
	place-items: center;
	width: 4.75rem;
	height: 4.75rem;
	border: 1.5px solid rgba(204, 0, 0, 0.55);
	background: var(--white) var(--grid-cross) center / 100% 100% no-repeat;
	color: var(--ink);
	font: 600 3.1rem/1 var(--font-hanzi);
}

.hanzi-grid.long > span {
	width: 3.6rem;
	height: 3.6rem;
	font-size: 2.3rem;
}

.hanzi-grid.plain {
	color: var(--ink);
	font: 600 2.2rem/1.3 var(--font-hanzi);
}

/* ---------- Word of the day: a red seal ---------- */

.seal-card {
	position: relative;
	width: min(100%, 25rem);
	padding: 2.5rem 2.5rem 2.25rem 3.25rem;
	border-radius: 4px;
	background: radial-gradient(130% 100% at 25% 15%, var(--red-bright) 0%, var(--red) 45%, #a30000 100%);
	box-shadow: var(--shadow-red);
	color: var(--white);
	transform: rotate(-2.5deg);
	animation: stamp 1s 0.15s var(--ease) both;
}

/* The bar and the frame of the Bohan logo. */
.seal-card::before,
.seal-card::after {
	content: "";
	position: absolute;
	pointer-events: none;
}

.seal-card::before {
	inset: 1rem 1rem 1rem 2.15rem;
	border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.seal-card::after {
	top: 1rem;
	bottom: 1rem;
	left: 1.15rem;
	width: 1.5px;
	background: rgba(255, 255, 255, 0.7);
}

.seal-card__label {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem;
	color: rgba(255, 255, 255, 0.85);
	font: 600 0.72rem/1.2 var(--font-body);
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.seal-card__hanzi {
	margin: 0 0 0.6rem;
	font-family: var(--font-brush);
	font-size: min(8rem, calc(min(17rem, 62vw) / var(--chars, 2)));
	font-weight: 400;
	line-height: 1.05;
	text-shadow: 0 3px 0 rgba(90, 0, 0, 0.25);
}

.seal-card__pinyin {
	margin: 0;
	font: italic 500 1.65rem/1.2 var(--font-pinyin);
}

.seal-card__meaning {
	margin: 0.2rem 0 0.75rem;
	font-size: 1.1rem;
	font-weight: 600;
}

.seal-card__note {
	margin: 0 0 1.5rem;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.95rem;
	line-height: 1.55;
}

.seal-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* ---------- Marquee of words ---------- */

.marquee {
	overflow: hidden;
	background: var(--red);
	color: var(--white);
}

.marquee__track {
	display: flex;
	width: max-content;
	animation: marquee 70s linear infinite;
}

.marquee:hover .marquee__track {
	animation-play-state: paused;
}

.marquee__group {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin: 0;
	padding: 1.1rem 0.75rem;
	list-style: none;
	white-space: nowrap;
}

.marquee__group li {
	display: inline-flex;
	align-items: baseline;
	gap: 0.6rem;
}

.marquee__group li::after {
	content: "";
	align-self: center;
	width: 0.4rem;
	height: 0.4rem;
	margin-left: 1.5rem;
	background: rgba(255, 255, 255, 0.55);
	transform: rotate(45deg);
}

.marquee [lang|="zh"] {
	font-family: var(--font-brush);
	font-size: 1.65rem;
	line-height: 1;
}

.marquee .py {
	font: italic 500 1.05rem/1 var(--font-pinyin);
}

.marquee .pl {
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.95rem;
}

/* ---------- Section heads ---------- */

.section-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
	align-items: end;
	gap: 1.5rem 3rem;
	margin-bottom: clamp(2.25rem, 5vw, 3.75rem);
}

.section-head h2 {
	margin: 0;
	font-size: clamp(2.2rem, 4.6vw, 3.8rem);
	letter-spacing: -0.035em;
	line-height: 1.02;
}

.section-head p {
	margin: 0 0 1rem;
}

.section-head p:last-child {
	margin-bottom: 0;
}

@media (max-width: 800px) {
	.section-head {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Books ---------- */

.feature-book {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(1.75rem, 5vw, 4rem);
	margin-bottom: 1.5rem;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow);
}

.feature-book__cover,
.book__cover {
	display: grid;
	place-items: center;
	overflow: hidden;
	background: linear-gradient(155deg, #f7f2ea, #e9dfcf);
}

.feature-book__cover {
	aspect-ratio: 4 / 3;
	padding: clamp(1rem, 3vw, 2rem);
	border-radius: var(--radius);
}

.feature-book__cover img,
.book__cover img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 14px 18px rgba(23, 18, 15, 0.2));
	transition: transform 0.7s var(--ease);
}

.feature-book:hover .feature-book__cover img,
.book:hover .book__cover img {
	transform: scale(1.05) rotate(-1deg);
}

.feature-book__body {
	padding: clamp(0.25rem, 2vw, 1.5rem);
}

.feature-book h2,
.feature-book h3 {
	margin-bottom: 0.4rem;
	font-size: clamp(2rem, 3.6vw, 3rem);
	letter-spacing: -0.03em;
}

.book__tag {
	margin: 0 0 0.6rem;
	color: var(--red);
	font: 600 0.72rem/1.3 var(--font-body);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.book__authors {
	margin: 0 0 0.9rem;
	color: var(--ink-mute);
	font-size: 0.875rem;
}

.books {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem;
}

.book {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow-sm);
	transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.book:hover {
	box-shadow: var(--shadow);
	transform: translateY(-6px);
}

.book__cover {
	aspect-ratio: 1 / 1;
	padding: 1.25rem;
}

.book__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.25rem 1.4rem 1.4rem;
}

.book h3 {
	margin: 0 0 0.35rem;
	font-size: 1.3rem;
	letter-spacing: -0.015em;
	line-height: 1.2;
}

.book__desc {
	margin: 0 0 1.25rem;
	font-size: 0.95rem;
}

.book .link-arrow {
	margin-top: auto;
}

.book-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	margin-top: 1.5rem;
	padding: 1.75rem 2rem;
	border: 1.5px dashed rgba(204, 0, 0, 0.45);
	border-radius: var(--radius-lg);
	background: rgba(255, 255, 255, 0.55);
}

.book-cta h3 {
	margin: 0 0 0.25rem;
	font-size: 1.5rem;
}

.book-cta p {
	margin: 0;
}

@media (max-width: 1100px) {
	.books {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 800px) {
	.feature-book {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 560px) {
	.books {
		grid-template-columns: minmax(0, 1fr);
	}

	.book__cover {
		aspect-ratio: 4 / 3;
	}
}

/* ---------- Stats ---------- */

.stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border-block: 1px solid var(--line);
}

.stat {
	margin: 0;
	padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1rem, 3vw, 2rem);
	border-left: 1px solid var(--line);
}

.stat:first-child {
	padding-left: 0;
	border-left: 0;
}

.stat__value {
	display: block;
	color: var(--red);
	font: 600 clamp(3.2rem, 7vw, 5.5rem)/0.95 var(--font-display);
	letter-spacing: -0.045em;
}

.stat__label {
	display: block;
	max-width: 16rem;
	margin-top: 0.75rem;
}

@media (max-width: 700px) {
	.stats {
		grid-template-columns: minmax(0, 1fr);
	}

	.stat {
		padding-left: 0;
		border-top: 1px solid var(--line);
		border-left: 0;
	}

	.stat:first-child {
		border-top: 0;
	}
}

/* ---------- Services (一 二 三) ---------- */

.services {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}

.service {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 2rem 1.9rem 1.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
	color: var(--ink-soft);
	text-decoration: none;
	transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.service:hover {
	color: var(--ink-soft);
	box-shadow: var(--shadow);
	transform: translateY(-6px);
}

.service::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 4px;
	background: var(--red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.5s var(--ease);
}

.service:hover::after {
	transform: scaleX(1);
}

.service__num {
	display: block;
	margin-bottom: 1.25rem;
	color: var(--red);
	font: 4.5rem/1 var(--font-brush);
}

.service h3 {
	margin-bottom: 0.6rem;
	font-size: 1.7rem;
}

.service p {
	margin-bottom: 1.5rem;
}

.service .link-arrow {
	margin-top: auto;
}

@media (max-width: 900px) {
	.services {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Highlights ---------- */

.highlights {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: 1.25rem;
}

.highlight {
	padding: 1.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
}

.highlight__icon {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	margin-bottom: 1.1rem;
	border-radius: var(--radius);
	background: var(--red-tint);
	color: var(--red);
	font-size: 1.15rem;
}

.highlight h3 {
	margin-bottom: 0.4rem;
	font-size: 1.35rem;
}

.highlight p {
	margin: 0;
}

/* ---------- Tones cheat sheet ---------- */

.tones {
	width: 100%;
	padding: 1.75rem 1.75rem 0.75rem;
	border: 1px solid var(--line);
	border-top: 4px solid var(--red);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow);
}

.tones h2 {
	margin-bottom: 0.35rem;
	font-size: 1.9rem;
}

.tones > p:not(.eyebrow) {
	color: var(--ink-mute);
	font-size: 0.95rem;
}

.tones ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tone {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 1rem;
	padding: 0.85rem 0;
	border-top: 1px solid var(--line);
}

.tone svg {
	width: 3rem;
	height: 2rem;
	overflow: visible;
}

.tone path {
	fill: none;
	stroke: var(--red);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 3;
}

.tone__py {
	color: var(--ink);
	font: italic 500 1.45rem/1.1 var(--font-pinyin);
}

.tone__py [lang|="zh"] {
	margin-left: 0.35rem;
	font-size: 1.3rem;
	font-style: normal;
	font-weight: 600;
}

.tone__pl {
	display: block;
	margin-top: 0.15rem;
	color: var(--ink-mute);
	font-size: 0.85rem;
}

/* ---------- Page hero (subpages) ---------- */

.page-hero {
	padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 5vw, 4rem);
}

.page-hero h1 {
	max-width: 15ch;
	margin-bottom: 2.1rem;
	font-size: clamp(2.9rem, 7.5vw, 6rem);
	letter-spacing: -0.032em;
	line-height: 1;
}

.page-hero__decor {
	position: absolute;
	top: 50%;
	right: calc(var(--gutter) * -0.5);
	z-index: -1;
	color: var(--red);
	font: clamp(9rem, 24vw, 19rem)/1 var(--font-brush);
	opacity: 0.08;
	pointer-events: none;
	transform: translateY(-46%);
	user-select: none;
}

/* ---------- About ---------- */

.about-image {
	margin: 0 0 clamp(3rem, 6vw, 4.5rem);
	overflow: hidden;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
}

.about-image img {
	width: 100%;
	aspect-ratio: 4 / 1;
	object-fit: cover;
}

.story {
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
	gap: clamp(2rem, 6vw, 5rem);
}

.story h2 {
	font-size: clamp(2rem, 4vw, 3.2rem);
	letter-spacing: -0.035em;
}

.timeline {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.timeline::before {
	content: "";
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 0.45rem;
	width: 2px;
	background: linear-gradient(var(--red), rgba(204, 0, 0, 0.12));
}

.timeline li {
	position: relative;
	padding: 0 0 2.25rem 2.75rem;
}

.timeline li:last-child {
	padding-bottom: 0;
}

.timeline li::before {
	content: "";
	position: absolute;
	top: 0.3rem;
	left: 0;
	width: 1rem;
	height: 1rem;
	border: 3px solid var(--paper);
	background: var(--red);
	box-shadow: 0 0 0 1.5px var(--red);
}

.timeline__when {
	color: var(--red);
	font: 600 0.78rem/1.2 var(--font-body);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.timeline h3 {
	margin: 0.4rem 0;
	font-size: 1.5rem;
}

.timeline p {
	margin: 0;
}

@media (max-width: 800px) {
	.story {
		grid-template-columns: minmax(0, 1fr);
	}

	.about-image img {
		aspect-ratio: 2 / 1;
	}
}

/* ---------- Consulting ---------- */

.consulting {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
	align-items: start;
	gap: clamp(2rem, 6vw, 5rem);
}

.statement {
	margin: 0 0 2rem;
	padding-left: clamp(1.25rem, 3vw, 2.25rem);
	border-left: 3px solid var(--red);
	color: var(--ink);
	font: 500 clamp(1.5rem, 3vw, 2.3rem)/1.3 var(--font-display);
	letter-spacing: -0.02em;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.note-card {
	padding: 1.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--white);
	box-shadow: var(--shadow-sm);
}

.note-card h2 {
	font-size: 1.5rem;
}

@media (max-width: 800px) {
	.consulting {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Call to action and footer ---------- */

.cta {
	position: relative;
	overflow: hidden;
	background: var(--red);
	color: var(--white);
}

.cta__inner {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) auto;
	align-items: center;
	gap: 2rem 3rem;
	padding-block: clamp(3.5rem, 8vw, 6rem);
}

.cta h2 {
	margin: 0 0 0.5rem;
	color: var(--white);
	font-size: clamp(2.4rem, 5.5vw, 4.4rem);
	letter-spacing: -0.04em;
}

.cta p:not(.eyebrow) {
	margin: 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.15rem;
}

.cta .eyebrow {
	margin-bottom: 1rem;
}

.cta__decor {
	position: absolute;
	right: -0.05em;
	bottom: -0.3em;
	color: rgba(255, 255, 255, 0.08);
	font: clamp(9rem, 26vw, 22rem)/1 var(--font-brush);
	pointer-events: none;
	user-select: none;
}

@media (max-width: 800px) {
	.cta__inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

.site-footer {
	padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
	background: var(--ink);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.95rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
	gap: 2.5rem;
}

.site-footer .brand,
.site-footer .brand:hover {
	margin-bottom: 1.25rem;
	color: var(--white);
}

.site-footer p {
	max-width: 24rem;
}

.site-footer h3 {
	margin: 0 0 1.1rem;
	color: var(--white);
	font: 600 0.75rem/1.2 var(--font-body);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer li {
	margin-bottom: 0.6rem;
}

.site-footer a {
	color: var(--white);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--white);
	text-decoration: underline;
}

.footer-contact i {
	width: 1.5rem;
	color: #ff7a6e;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.85rem;
}

.footer-bottom p {
	margin: 0;
}

@media (max-width: 800px) {
	.footer-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
	transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Animations ---------- */

@keyframes stamp {
	0% {
		opacity: 0;
		transform: rotate(-9deg) scale(1.18);
	}

	55% {
		opacity: 1;
		transform: rotate(-1.5deg) scale(0.97);
	}

	100% {
		opacity: 1;
		transform: rotate(-2.5deg) scale(1);
	}
}

@keyframes brush {
	from {
		clip-path: inset(0 100% 0 0);
	}

	to {
		clip-path: inset(0 0 0 0);
	}
}

@keyframes marquee {
	to {
		transform: translateX(-50%);
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

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

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

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

	.js .reveal {
		opacity: 1;
		transform: none;
	}
}
