.intro-page,
.welcome-page-slide {
	display: none;
}

.intro-page--active,
.welcome-page-slide--active {
	display: block;
}

.intro-stagger {
	opacity: 0;
	transform: translateY(12px);
	transition:
		opacity var(--motion-emphasized) var(--ease-standard),
		transform var(--motion-emphasized) var(--ease-spring);
}

.intro-stagger--visible {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.intro-stagger {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.speech-bubble__name,
	.speech-bubble__blobs,
	.speech-bubble__blob-top,
	.speech-bubble__blob-bottom,
	.speech-bubble__blob-tail {
		animation: none;
	}
}

.welcome-page {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-bottom: var(--spacing-xxl);
	width: 100%;
}

.welcome-content {
	width: 100%;
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
}

.welcome-page-slide {
	width: 100%;
}

#intro-container,
#welcome-container {
	width: 100%;
	max-width: 880px;
	margin: 0 auto;
	padding-bottom: 80px;
}

@media (width <= 768px) {
	#intro-container,
	#welcome-container {
		padding-bottom: calc(var(--app-bottom-chrome-height) + var(--app-bottom-tray-height) + var(--spacing-xl));
	}
}

.intro-page-wrap {
	font-family: var(--font-en);
	max-width: 880px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
}

.speech-bubble {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	margin-bottom: var(--spacing-xxl);
}

.speech-bubble--flip {
	grid-template-columns: 1fr auto;
}

.speech-bubble--flip .speech-bubble__char {
	order: 2;
}

.speech-bubble--flip .speech-bubble__wrap {
	order: 1;
}

.speech-bubble--sm {
	grid-template-columns: auto 1fr;
	max-width: 780px;
}

.speech-bubble-chat-log {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.speech-bubble-chat-log .speech-bubble--sm {
	max-width: 60%;
	min-width: 720px;
}

.speech-bubble-chat-log .speech-bubble--flip {
	margin-left: 0 !important;
}

.speech-bubble--page {
	max-width: 1280px;
}

.speech-bubble--page .speech-bubble__char img {
	height: 280px;
}

.speech-bubble--sm.speech-bubble--flip {
	grid-template-columns: 1fr auto;
	margin-left: auto;
}

.speech-bubble__char {
	position: relative;
	z-index: 2;
}

.speech-bubble__char img {
	height: 340px;
	width: auto;
	display: block;
	filter: drop-shadow(0 6px 16px oklch(14% 0 0deg / 12%));
}

.speech-bubble--sm .speech-bubble__char img {
	height: 160px;
	filter: drop-shadow(0 3px 10px oklch(14% 0 0deg / 8%));
}

.speech-bubble__wrap {
	position: relative;
	filter: drop-shadow(0 3px 12px oklch(14% 0 0deg / 3%));
}

.speech-bubble__name {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	padding: 0.4rem 1.6rem 0.5rem;
	font-family: var(--font-en);
	background-color: var(--color-matcha-400);
	border-radius: 999px;
	position: relative;
	z-index: 3;
	margin-left: var(--spacing-md);
	margin-bottom: -16px;
	animation: name-float calc(var(--motion-celebration) * 3) var(--ease-standard) infinite alternate;
}

@keyframes name-float {
	from {
		transform: perspective(2rem) rotateX(1deg) rotateZ(-6deg) translateX(15%) translateY(0);
	}

	to {
		transform: perspective(2rem) rotateX(1deg) rotateZ(-4deg) translateX(15%) translateY(-2px);
	}
}

.speech-bubble--flip .speech-bubble__name {
	margin-left: auto;
	margin-right: var(--spacing-md);
	display: flex;
	width: fit-content;
	animation-name: name-float-flip;
}

@keyframes name-float-flip {
	from {
		transform: perspective(2rem) rotateX(1deg) rotateZ(6deg) translateY(0);
	}

	to {
		transform: perspective(2rem) rotateX(1deg) rotateZ(4deg) translateY(-2px);
	}
}

.speech-bubble__name-main {
	font-size: var(--size-xl);
	color: var(--color-matcha-900);
	line-height: 1.2;
	font-weight: 700;
}

.speech-bubble__name-role {
	font-size: 0.65rem;
	font-weight: 600;
	color: var(--color-matcha-800);
	opacity: 0.5;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.speech-bubble__name--seiji {
	background-color: var(--color-seiji-300);
}

.speech-bubble__name--seiji .speech-bubble__name-main {
	color: var(--color-seiji-900);
}

.speech-bubble__name--seiji .speech-bubble__name-role {
	color: var(--color-seiji-800);
}

.speech-bubble__name--sakura {
	background-color: var(--color-sakura-300);
}

.speech-bubble__name--sakura .speech-bubble__name-main {
	color: var(--color-sakura-900);
}

.speech-bubble__name--sakura .speech-bubble__name-role {
	color: var(--color-sakura-800);
}

.speech-bubble__blobs {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 200px;
	filter: url("#fancy-goo");
	transform-origin: left center;
	animation: speech-bubble-pop-in var(--motion-emphasized) var(--ease-emphasized) both;
}

.speech-bubble--flip .speech-bubble__blobs {
	transform-origin: right center;
	animation-name: speech-bubble-pop-in-flip;
}

.speech-bubble--sm .speech-bubble__blobs {
	min-height: 150px;
	filter: url("#chibi-goo");
}

@keyframes speech-bubble-pop-in {
	0% {
		opacity: 0;
		transform: translateX(-6px) scale(0.97);
	}

	70% {
		opacity: 1;
		transform: translateX(0) scale(1.003);
	}

	100% {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

@keyframes speech-bubble-pop-in-flip {
	0% {
		opacity: 0;
		transform: translateX(6px) scale(0.97);
	}

	70% {
		opacity: 1;
		transform: translateX(0) scale(1.003);
	}

	100% {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

.speech-bubble__blob-top {
	position: absolute;
	top: 0;
	width: 100%;
	height: 75%;
	background-color: var(--color-white);
	border-radius: 40% 40% 30% 30% / 150%;
	animation: blob calc(var(--motion-celebration) * 3) var(--ease-standard) calc(var(--motion-fast) * 2) infinite
		alternate;
	transform-origin: center;
}

.speech-bubble__blob-bottom {
	position: absolute;
	bottom: 0;
	width: 94%;
	left: 3%;
	height: 40%;
	background-color: var(--color-white);
	border-radius: 5% 5% 20% 20% / 100%;
	animation: blob calc(var(--motion-celebration) * 2) var(--ease-standard) infinite alternate;
}

.speech-bubble__blob-tail {
	position: absolute;
	top: 35%;
	left: -8px;
	width: 50px;
	height: 46px;
	background-color: var(--color-white);
	border-radius: 50% 50% 60% 30%;
	animation: blob calc(var(--motion-celebration) * 2.3) var(--ease-standard) calc(var(--motion-fast) * 4) infinite
		alternate;
}

.speech-bubble--flip .speech-bubble__blob-tail {
	left: auto;
	right: -8px;
	border-radius: 50% 50% 30% 60%;
}

.speech-bubble--sm .speech-bubble__blob-top,
.speech-bubble--sm .speech-bubble__blob-bottom,
.speech-bubble--sm .speech-bubble__blob-tail {
	background-color: var(--color-gray-100);
}

.speech-bubble--sm .speech-bubble__blob-tail {
	width: 36px;
	height: 32px;
	top: 38%;
	left: -6px;
}

.speech-bubble--sm.speech-bubble--flip .speech-bubble__blob-tail {
	left: auto;
	right: -6px;
}

@keyframes blob {
	from {
		transform: rotate(0.3deg) scale(1);
	}

	to {
		transform: rotate(-0.3deg) scale(0.99);
	}
}

.speech-bubble__text-wrap {
	position: relative;
	z-index: 2;
	margin: auto 0;
	padding: 44px 52px;
}

.speech-bubble--sm .speech-bubble__text-wrap {
	padding: 40px 44px;
}

.speech-bubble__text {
	font-size: var(--size-2xl);
	font-weight: 500;
	line-height: var(--leading-relaxed);
	color: var(--color-gray-700);
	text-align: center;
	margin: 0;
}

.speech-bubble--sm .speech-bubble__text {
	font-size: var(--size-xl);
}

.speech-bubble__text strong {
	font-weight: 600;
	color: var(--color-matcha-500);
}

.speech-bubble:has(.speech-bubble__name--seiji) .speech-bubble__text strong,
.speech-bubble:has(.speech-bubble__name--seiji) .intro-term {
	color: var(--color-seiji-500);
}

.speech-bubble:has(.speech-bubble__name--sakura) .speech-bubble__text strong,
.speech-bubble:has(.speech-bubble__name--sakura) .intro-term {
	color: var(--color-sakura-500);
}

.intro-prose {
	max-width: 700px;
	text-align: center;
	margin: 0 auto var(--spacing-xxl);
}

.intro-prose__heading {
	font-size: var(--size-5xl);
	font-weight: 700;
	color: var(--color-gray-900);
	margin-bottom: var(--spacing-md);
	line-height: var(--leading-snug);
	letter-spacing: var(--letter-spacing-sm);
}

.intro-prose__text {
	font-size: var(--size-xl);
	color: var(--color-gray-600);
	line-height: var(--leading-loose);
	margin: 0 0 var(--spacing-sm);
	font-weight: 500;
}

.intro-prose__text:last-child {
	margin-bottom: 0;
}

.intro-term {
	font-weight: 600;
	color: var(--color-matcha-500);
}

.intro-hero {
	text-align: center;
	margin-bottom: var(--spacing-xxl);
}

.intro-hero__badge {
	display: inline-block;
	background: var(--color-matcha-400);
	color: var(--color-matcha-900);
	font-size: var(--size-sm);
	font-weight: 700;
	padding: var(--spacing-xs) var(--spacing-md);
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: var(--spacing-md);
}

.intro-hero__title {
	font-size: 2.8rem;
	font-weight: 800;
	letter-spacing: var(--letter-spacing-sm);
	line-height: var(--leading-tight);
	color: var(--color-gray-900);
	margin-bottom: var(--spacing-xs);
}

.intro-hero__sub {
	font-size: var(--size-2xl);
	color: var(--color-gray-500);
	font-weight: 500;
}

.intro-kanji-section {
	text-align: center;
	margin-bottom: var(--spacing-xxl);
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

.intro-kanji-section .intro-prose__text {
	margin: 0;
}

.intro-kanji-section .intro-prose__text:first-of-type {
	margin-bottom: var(--spacing-sm);
}

.intro-kanji-section .intro-prose__text:last-of-type {
	margin-top: var(--spacing-md);
	font-style: italic;
	color: var(--color-gray-500);
}

.intro-kanji-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--spacing-sm);
	margin: var(--spacing-lg) auto;
	max-width: 760px;
}

.intro-composition {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-lg);
	margin: 0 auto var(--spacing-xxl);
	padding: var(--spacing-lg) 0;
	max-width: 580px;
	text-align: center;
}

.intro-composition__operator {
	font-size: var(--size-3xl);
	color: var(--color-gray-300);
	font-weight: 300;
}

@media (width <= 768px) {
	.speech-bubble,
	.speech-bubble--flip {
		grid-template-columns: 1fr;
	}

	.speech-bubble__char {
		margin: 0 auto;
		order: 0 !important;
	}

	.speech-bubble__char img {
		height: 200px;
	}

	.speech-bubble__wrap {
		order: 0 !important;
	}

	.speech-bubble__blob-tail {
		display: none;
	}

	.speech-bubble--flip .speech-bubble__name {
		margin-right: 0;
		margin-left: var(--spacing-md);
	}

	.speech-bubble--sm,
	.speech-bubble--sm.speech-bubble--flip {
		grid-template-columns: 1fr;
		max-width: 100%;
	}

	.speech-bubble-chat-log .speech-bubble--sm {
		min-width: unset;
	}

	.speech-bubble--sm .speech-bubble__char img {
		height: 100px;
	}

	.speech-bubble--sm .speech-bubble__blob-tail {
		display: none;
	}

	.speech-bubble__blobs {
		min-height: 140px;
	}

	.speech-bubble--sm .speech-bubble__blobs {
		min-height: 100px;
	}

	.intro-hero__title {
		font-size: var(--size-5xl);
	}

	.intro-page-wrap {
		padding: 0 var(--spacing-md);
	}

	.intro-prose__heading {
		font-size: var(--size-3xl);
	}

	.intro-prose__text {
		font-size: var(--size-lg);
	}

	.speech-bubble__text {
		font-size: var(--size-lg);
	}

	.speech-bubble--sm .speech-bubble__text {
		font-size: var(--size-md);
	}

	.intro-hero__sub {
		font-size: var(--size-xl);
	}

	.speech-bubble__text-wrap {
		padding: var(--spacing-lg);
	}

	.speech-bubble--sm .speech-bubble__text-wrap {
		padding: var(--spacing-md);
	}

	.speech-bubble,
	.intro-prose,
	.intro-hero,
	.intro-kanji-section {
		margin-bottom: var(--spacing-lg);
	}

	.intro-composition {
		margin-bottom: var(--spacing-lg);
		gap: var(--spacing-sm);
		padding: var(--spacing-md) 0;
		flex-wrap: wrap;
	}

	.intro-kanji-grid {
		gap: var(--spacing-xs);
	}
}

@media (width <= 480px) {
	.intro-page-wrap {
		padding: 0 var(--spacing-xs);
	}

	.intro-hero__title {
		font-size: var(--size-3xl);
	}

	.intro-prose__heading {
		font-size: var(--size-2xl);
	}

	.speech-bubble__char img {
		height: 160px;
	}

	.speech-bubble__text {
		font-size: var(--size-md);
	}

	.speech-bubble--sm .speech-bubble__text {
		font-size: var(--size-sm);
	}

	.speech-bubble__text-wrap {
		padding: var(--spacing-md);
	}

	.speech-bubble--sm .speech-bubble__text-wrap {
		padding: var(--spacing-sm);
	}

	.speech-bubble__blobs {
		min-height: 100px;
	}

	.speech-bubble,
	.intro-prose,
	.intro-hero,
	.intro-kanji-section {
		margin-bottom: var(--spacing-md);
	}

	.intro-composition {
		margin-bottom: var(--spacing-md);
		gap: var(--spacing-xs);
	}

	.intro-composition__operator {
		font-size: var(--size-2xl);
	}
}
