:root {
	color-scheme: light;
	--carnival-pink: #ff01b4;
	--carnival-purple: #5f1da1;
	--carnival-cyan: #03ecee;
	--carnival-yellow: #ffff01;
	--carnival-white: #fff;
	--canvas: #5f1da1;
	--panel-border: rgba(255, 255, 255, 0.75);
	font-family: "Figtree", sans-serif;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
}

* {
	box-sizing: border-box;
}

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	padding: 0 0 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	background-color: var(--canvas);
	background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1.25px, transparent 1.5px);
	background-size: 24px 24px;
	color: var(--carnival-white);
	font-size: 20px;
}

button,
input,
summary,
select {
	font: inherit;
}

button {
	color: inherit;
}

.site-nav {
	position: relative;
	z-index: 2;
	width: 100%;
	padding: 16px clamp(12px, 2.5vw, 36px);
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.nav-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 32px;
}

.language-picker {
	position: relative;
}

.language-picker summary {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	color: var(--carnival-white);
	cursor: pointer;
	list-style: none;
}

.language-picker summary::-webkit-details-marker {
	display: none;
}

.language-picker summary svg {
	width: 32px;
	height: 32px;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.language-picker summary:focus-visible,
.language-options button:focus-visible {
	outline: 3px solid var(--carnival-yellow);
	outline-offset: 4px;
}

.language-options {
	position: absolute;
	top: calc(100% + 24px);
	right: 0;
	z-index: 3;
	min-width: 192px;
	margin: 0;
	padding: 16px 0;
	border-radius: 40px;
	background: var(--carnival-yellow);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	list-style: none;
}

.language-options button {
	width: 100%;
	padding: 8px 20px;
	border: 0;
	background: transparent;
	color: #000;
	font-size: 22px;
	text-align: center;
	cursor: pointer;
}

.language-options button:hover,
.language-options button[aria-pressed="true"] {
	font-weight: 700;
}

.quiz-shell {
	width: min(calc(100% - 24px), 920px);
	margin: auto;
}

.panel {
	width: 100%;
	border: 3px solid var(--panel-border);
	background: var(--carnival-pink);
	box-shadow: 0 0 0 1px rgba(95, 29, 161, 0.12);
	animation: panel-arrive 220ms ease-out both;
	transition: opacity 0.3s ease;
	opacity: 1;
}

.panel[hidden],
.mailing-list-status[hidden],
.question-error[hidden],
.submission-error[hidden] {
	display: none;
}

.panel.is-fading {
	opacity: 0;
}

.intro-screen,
.question-screen,
.result-screen {
	padding: 40px;
}

.intro-screen {
	min-height: 754px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 30px;
	text-align: center;
}

.carnival-logo {
	display: block;
	width: 280px;
	height: 162px;
	object-fit: contain;
}

.intro-copy h1 {
	margin: 0 0 18px;
	color: var(--carnival-purple);
	font-family: "Righteous", sans-serif;
	font-size: 60px;
	font-weight: 400;
	line-height: 1.08;
	text-transform: uppercase;
}

.intro-copy p {
	margin: 0 auto;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.5;
}

.mailing-list-section {
	width: 100%;
	max-width: 640px;
	margin-top:1rem;
}

.mailing-list-section h2 {
	margin: 0 0 16px;
	color: var(--carnival-purple);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
}

.mailing-list-form {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.form-row {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.form-field {
	flex: 1 1 200px;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.mailing-list-form label {
	color: var(--carnival-purple);
	font-size: 20px;
	font-weight: 700;
	text-align: left;
}

.mailing-list-form input:focus-visible {
	outline: 3px solid var(--carnival-yellow);
	outline-offset: 3px;
}

.mailing-list-form input:not([type="checkbox"]):not([type="radio"]) {
	width: 100%;
	min-height: 54px;
	padding: 10px 12px;
	border: 2px solid var(--carnival-white);
	border-radius: 0;
	background: var(--carnival-white);
	color: #000;
	font-size: 20px;
}

.phone-field {
	display: flex;
	gap: 0.5rem;
}

.phone-field select {
	flex: 0 0 auto;
}

.phone-field input {
	flex: 1 1 auto;
}

.consent-checkbox input {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	margin: 0.15rem 0 0;
	accent-color: var(--carnival-purple);
}

.mailing-list-status {
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
	text-align: left;
}

.intro-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 8px;
}

.intro-actions .button {
	flex: 1 1 0;
}

.button {
	min-height: 54px;
	padding: 10px 22px;
	border: 3px solid transparent;
	border-radius: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: "Righteous", sans-serif;
	font-size: 20px;
	line-height: 1.5;
	text-align: center;
	cursor: pointer;
	transition: transform 120ms ease, filter 120ms ease;
}

.button:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

.button:active {
	transform: translateY(1px);
}

.button:disabled {
	cursor: wait;
	opacity: 0.7;
}

.button:focus-visible {
	outline: 3px solid var(--carnival-white);
	outline-offset: 4px;
}

.button-primary {
	background: var(--carnival-yellow);
	color: #000;
}

.button-secondary {
	border-color: var(--carnival-white);
	background: transparent;
	color: var(--carnival-white);
}

.question-screen {
	min-height: 514px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 32px;
}

.progress {
	width: 100%;
	min-height: 32px;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	list-style: none;
}

.progress-step {
	flex: 1 1 0;
	display: flex;
	justify-content: center;
}

.progress-step:not(:last-child) {
	position: relative;
}

.progress-step:not(:last-child)::after {
	position: absolute;
	z-index: -1;
	top: 50%;
	left: calc(50% + 20px);
	width: calc(100% - 40px);
	height: 3px;
	background: rgba(255, 255, 255, 0.75);
	content: "";
	transform: translateY(-50%);
}

.progress-step.is-complete:not(:last-child)::after {
	background: var(--carnival-purple);
}

.progress-step span {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: #ff80da;
	color: var(--carnival-purple);
	font-family: "Righteous", sans-serif;
	font-size: 20px;
	line-height: 1;
}

.progress-step.is-current span,
.progress-step.is-complete span {
	background: var(--carnival-purple);
	color: var(--carnival-white);
}

.question-form,
.question-form fieldset {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.question-form fieldset {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.question-error,
.submission-error {
	color: var(--carnival-white);
	font-size: 18px;
	font-weight: 700;
}

.question-error {
	margin: 12px 0 0;
}

.submission-error {
	margin: 16px 0 0;
	text-align: right;
}

.question-form legend {
	width: 100%;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: var(--carnival-purple);
	font-size: 34px;
	font-weight: 700;
	line-height: 1.2;
}

.question-kicker {
	font-family: "Righteous", sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
}

.answer-option {
	position: relative;
	min-height: 52px;
	padding: 8px 16px;
	border: 3px solid var(--carnival-white);
	display: grid;
	align-items: center;
	justify-items: start;
	color: var(--carnival-white);
	text-align: left;
	cursor: pointer;
	transition: color 140ms ease, background-color 140ms ease;
}

.answer-option:hover:not(:has(input:checked)) {
	background: rgba(255, 255, 255, 0.25);
}

.answer-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	clip-path: inset(50%);
}

.answer-option span {
	font-size: 20px;
	font-weight: 500;
	line-height: 1.5;
}

.answer-option:has(input:checked) {
	border-color: transparent;
	background: var(--carnival-cyan);
	color: #000;
}

.answer-option:has(input:checked) span {
	font-weight: 700;
}

.answer-option:has(input:focus-visible) {
	outline: 3px solid var(--carnival-yellow);
	outline-offset: 3px;
}

.question-footer {
	min-height: 48px;
	margin-top: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.step-label {
	margin: 0;
	color: var(--carnival-purple);
	font-family: "Righteous", sans-serif;
	font-size: 20px;
	line-height: 1.5;
	white-space: nowrap;
}

.button-row,
.result-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.result-screen {
	min-height: 984px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
}

.persona-pill {
	min-height: 36px;
	margin: 0;
	padding: 4px 28px;
	border-radius: 999px;
	background: var(--carnival-purple);
	font-family: "Righteous", sans-serif;
	font-size: 18px;
	line-height: 28px;
}

.persona-art {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2160 / 2697;
	border: 1px solid rgba(255, 255, 255, 0.8);
	object-fit: cover;
}

.persona-art:not([data-loaded="true"]) {
	visibility: hidden;
}

.persona-copy {
	width: 100%;
}

.persona-copy h2 {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-family: "Righteous", sans-serif;
	font-weight: 400;
	line-height: 1.2;
}

.persona-copy h2 span {
	color: var(--carnival-purple);
	font-size: 32px;
}

.persona-copy h2 strong {
	color: var(--carnival-yellow);
	font-size: 52px;
	font-weight: 400;
}

.persona-progress {
	width: 100%;
	min-height: 5px;
	margin-top: auto;
	display: flex;
	gap: 4px;
}

.persona-progress span {
	flex: 1 1 0;
	height: 5px;
	background: var(--carnival-white);
}

.persona-progress span:nth-child(5),
.persona-progress span:nth-child(n + 7) {
	flex-grow: 0.4;
}

.persona-progress span:nth-child(6) {
	background: #f79cff;
}

@keyframes panel-arrive {
	from {
		opacity: 0.7;
		transform: translateY(5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (min-width: 601px) {
	body {
		height: 100vh;
		overflow: hidden;
		padding-bottom: 8px;
	}

	.site-nav {
		flex: 0 0 auto;
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.quiz-shell {
		flex: 1 1 auto;
		min-height: 0;
		margin: 8px auto;
		display: flex;
		align-items: center;
	}

	.panel {
		max-height: calc(100vh - 72px);
		overflow: auto;
	}

	.intro-screen {
		min-height: 0;
		height: min(754px, calc(100vh - 72px));
		padding: 8px 40px;
		gap: 6px;
	}

	.carnival-logo {
		flex: 0 0 auto;
		width: 160px;
		height: 56px;
	}

	.intro-copy h1 {
		margin-bottom: 4px;
		font-size: 38px;
	}

	.intro-copy p {
		font-size: 16px;
		line-height: 1.35;
	}

	.mailing-list-section h2 {
		font-size: 22px;
	}

	.mailing-list-form {
		gap: 8px;
	}

	.mailing-list-form label {
		font-size: 15px;
	}

	.mailing-list-form input:not([type="checkbox"]):not([type="radio"]) {
		min-height: 44px;
		height: 44px;
		padding: 6px 10px;
		font-size: 15px;
	}

	.phone-field select {
		height: 44px;
	}

	.form-row {
		gap: 16px;
	}

	.form-field {
		gap: 6px;
	}

	.consent-checkbox {
		margin-top: 0.5rem;
		display: flex;
		align-items: flex-start;
		gap: 8px;
		line-height: 1.25;
		font-size: 14px;
	}

	.intro-actions {
		margin-top: 4px;
	}

	.intro-actions .button {
		max-width: 260px;
		min-height: 44px;
		margin: 0 auto;
		font-size: 16px;
	}

	.question-screen {
		min-height: 0;
		height: min(514px, calc(100vh - 72px));
		padding: 24px 40px;
		gap: 24px;
	}

	.question-form legend {
		margin-bottom: 14px;
		font-size: 28px;
	}

	.question-kicker {
		font-size: 16px;
	}

	.answer-option {
		min-height: 46px;
		padding-block: 8px;
	}

	.answer-option span {
		font-size: 16px;
	}

	.question-footer {
		margin-top: 16px;
	}

	.step-label,
	.question-footer .button {
		font-size: 16px;
	}

	.result-screen {
		min-height: 0;
		height: min(984px, calc(100vh - 72px));
		padding: 16px 40px 12px;
		gap: 16px;
	}

	.persona-art {
		width: 360px;
		margin: 0 auto;
		object-fit: contain;
	}

	.persona-pill {
		min-height: 30px;
		line-height: 22px;
		font-size: 16px;
	}

	.persona-copy h2 {
		gap: 2px;
	}

	.persona-copy h2 span {
		font-size: 24px;
	}

	.persona-copy h2 strong {
		font-size: 38px;
	}
}

@media (max-width: 600px) {
	body {
		padding-bottom: 12px;
		font-size: 18px;
	}

	.site-nav {
		padding: 12px;
	}

	.nav-actions {
		gap: 20px;
	}

	.language-options {
		top: calc(100% + 16px);
		min-width: 176px;
		border-radius: 32px;
	}

	.language-options button,
	.progress-step span {
		font-size: 18px;
	}

	.language-options button {
		font-size: 20px;
	}

	.intro-screen,
	.question-screen,
	.result-screen {
		padding: 24px 12px;
	}

	.intro-screen {
		min-height: 0;
		gap: 26px;
	}

	.carnival-logo {
		width: 220px;
		height: 128px;
	}

	.intro-copy h1 {
		font-size: 42px;
	}

	.intro-copy p,
	.answer-option span {
		font-size: 18px;
	}

	.mailing-list-section h2 {
		font-size: 24px;
	}

	.mailing-list-form label,
	.mailing-list-form input:not([type="checkbox"]):not([type="radio"]) {
		font-size: 18px;
	}

	.intro-actions {
		gap: 8px;
	}

	.question-screen {
		min-height: 0;
		gap: 28px;
	}

	.question-form legend {
		font-size: 26px;
	}

	.question-error,
	.submission-error,
	.question-kicker {
		font-size: 16px;
	}

	.step-label {
		font-size: 18px;
	}

	.persona-pill {
		font-size: 16px;
	}

	.persona-copy h2 span {
		font-size: 28px;
	}

	.question-footer {
		align-items: flex-start;
		flex-direction: column;
	}

	.button-row {
		width: 100%;
		justify-content: flex-end;
	}

	.button {
		font-size: 18px;
		padding-inline: 12px;
	}

	.result-screen {
		min-height: 0;
		gap: 22px;
	}

	.persona-copy h2 strong {
		font-size: 42px;
	}

	.desktop-break {
		display: none;
	}
}

html[lang^="zh"] body {
	font-family: "Noto Sans HK", "Figtree", sans-serif;
}

html[lang^="zh"] .desktop-break {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
