/**
 * Hair Type Quiz — front-end styles.
 *
 * Design tokens are lifted from the colour season analysis quiz: Jost, a near
 * white page, near black ink, a raspberry accent, hairline rules, pill buttons
 * and 12px cards. Everything is namespaced under .htq and driven by custom
 * properties, so a theme can restyle the quiz by redefining the variables
 * rather than fighting specificity.
 *
 * This is a deliberately light-only design, to match the reference. All
 * colours are set explicitly, so it holds up inside a dark theme rather than
 * inheriting a background it was not designed for.
 */

.htq {
	--htq-font: "Jost", "Century Gothic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--htq-page: #f7f8f9;
	--htq-card: #ffffff;
	--htq-ink: #101322;
	--htq-body: #2a2e30;
	--htq-muted: #646b7d;
	--htq-line: #e8eaef;
	--htq-accent: #be1e4e;
	--htq-accent-tint: #fdf1f5;

	--htq-radius: 12px;
	--htq-pill: 100px;

	box-sizing: border-box;
	max-width: 62rem;
	margin: 0 auto;
	padding: 2rem 1.25rem 2.5rem;
	background: var(--htq-page);
	color: var(--htq-body);
	font-family: var(--htq-font);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

.htq *,
.htq *::before,
.htq *::after {
	box-sizing: inherit;
}

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

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

.htq__eyebrow {
	margin: 0 0 0.75rem;
	color: var(--htq-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1.6;
	text-transform: uppercase;
}

.htq__eyebrow--accent {
	color: var(--htq-accent);
}

.htq__display {
	margin: 0 0 0.75rem;
	color: var(--htq-ink);
	font-family: var(--htq-font);
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.04;
}

.htq__question {
	margin: 0 0 0.75rem;
	color: var(--htq-ink);
	font-family: var(--htq-font);
	font-size: clamp(1.5rem, 3.2vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.12;
}

.htq__lede {
	max-width: 34rem;
	margin: 0 0 1rem;
	color: var(--htq-body);
	font-size: 1.125rem;
	font-weight: 300;
}

.htq__help {
	margin: 0;
	color: var(--htq-muted);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.65;
}

.htq__meta {
	margin: 0 0 2rem;
	color: var(--htq-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * Progress — a 2px hairline, no radius
 * ------------------------------------------------------------------------ */

.htq__progress {
	display: none;
	margin-bottom: 2.75rem;
}

.htq--js .htq__progress {
	display: block;
}

.htq--js.htq--start .htq__progress {
	visibility: hidden;
}

.htq__progress-track {
	height: 2px;
	background: var(--htq-line);
}

.htq__progress-fill {
	width: 0;
	height: 2px;
	background: var(--htq-accent);
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------------
 * Screens
 * ------------------------------------------------------------------------ */

.htq--js .htq__screen {
	display: none;
}

.htq--js .htq__screen.is-active {
	display: block;
	animation: htq-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes htq-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

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

@media (prefers-reduced-motion: reduce) {
	.htq--js .htq__screen.is-active {
		animation: none;
	}

	.htq__progress-fill,
	.htq__option,
	.htq__btn {
		transition: none;
	}
}

.htq__screen--start {
	padding: 1rem 0 2rem;
}

.htq__screen--result:focus {
	outline: none;
}

/* The 320px / 1fr split: question on the left, answers on the right. */
.htq__split {
	display: grid;
	gap: 2rem;
}

@media (min-width: 56rem) {
	.htq__split {
		grid-template-columns: 20rem minmax(0, 1fr);
		gap: 2.4rem;
		align-items: start;
	}

	.htq__aside {
		position: sticky;
		top: 2rem;
	}
}

/* ---------------------------------------------------------------------------
 * Options
 * ------------------------------------------------------------------------ */

.htq__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.htq__options {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 34rem) {
	.htq__options--grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.htq__option {
	position: relative;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 1rem 1.125rem;
	background: var(--htq-card);
	border: 1px solid var(--htq-line);
	border-radius: var(--htq-radius);
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.htq__option:hover {
	border-color: #c9cdd8;
	transform: translateY(-1px);
}

.htq__option:focus-within {
	outline: 2px solid var(--htq-accent);
	outline-offset: 2px;
}

.htq__option:has(.htq__radio:checked) {
	background: var(--htq-accent-tint);
	border-color: var(--htq-accent);
	box-shadow: inset 0 0 0 1px var(--htq-accent);
}

.htq__option-body {
	flex: 1;
	min-width: 0;
}

.htq__option-label {
	display: block;
	color: var(--htq-ink);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
}

.htq__option-note {
	display: block;
	margin-top: 0.15rem;
	color: var(--htq-muted);
	font-size: 0.8125rem;
	font-weight: 300;
	line-height: 1.45;
}

/* The tick sits in a ring that fills in once the option is chosen. */
.htq__tick {
	display: grid;
	flex: none;
	place-items: center;
	width: 1.375rem;
	height: 1.375rem;
	color: transparent;
	background: transparent;
	border: 1px solid var(--htq-line);
	border-radius: 50%;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.htq__option:has(.htq__radio:checked) .htq__tick {
	color: #ffffff;
	background: var(--htq-accent);
	border-color: var(--htq-accent);
}

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

.htq__nav {
	display: none;
	gap: 0.5rem;
	align-items: center;
	margin-top: 1.75rem;
}

.htq--js .htq__nav {
	display: flex;
}

.htq__btn {
	padding: 1rem 1.875rem;
	font-family: var(--htq-font);
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.01em;
	border: 1px solid transparent;
	border-radius: var(--htq-pill);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.htq__btn:focus-visible {
	outline: 2px solid var(--htq-accent);
	outline-offset: 3px;
}

.htq__btn--primary {
	background: var(--htq-accent);
	color: #ffffff;
}

.htq__btn--primary:hover {
	background: #a5183f;
}

.htq__btn--ghost {
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	background: transparent;
	color: var(--htq-muted);
}

.htq__btn--ghost:hover {
	color: var(--htq-ink);
}

.htq__btn--ghost[hidden] {
	display: none;
}

.htq__error {
	margin: 1rem 0 0;
	color: var(--htq-accent);
	font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
 * Result
 * ------------------------------------------------------------------------ */

.htq--js .htq__nojs,
.htq--js .htq__display--all {
	display: none;
}

.htq--js .htq__result,
.htq--js .htq__trait {
	display: none;
}

.htq--js .htq__result.is-active,
.htq--js .htq__trait.is-active {
	display: block;
}

.htq__results {
	display: grid;
	gap: 1.5rem;
}

.htq__result {
	padding: 2rem;
	background: var(--htq-card);
	border: 1px solid var(--htq-line);
	border-radius: var(--htq-radius);
}

@media (min-width: 40rem) {
	.htq__result {
		padding: 2.75rem;
	}
}

.htq__result-head {
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--htq-line);
}

.htq__result-name {
	margin-bottom: 0.25rem;
}

.htq__result-label {
	margin: 0 0 1rem;
	color: var(--htq-accent);
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.htq__result-summary {
	max-width: 40rem;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 300;
}

.htq__result-detail {
	max-width: 40rem;
	margin: 0;
	color: var(--htq-muted);
	font-weight: 300;
}

.htq__tips {
	padding-top: 1.5rem;
	margin-top: 1.75rem;
	border-top: 1px solid var(--htq-line);
}

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

.htq__tips-list li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.65rem;
	font-size: 0.9375rem;
	font-weight: 300;
}

.htq__tips-list li::before {
	position: absolute;
	top: 0.62em;
	left: 0;
	width: 5px;
	height: 5px;
	background: var(--htq-accent);
	border-radius: 50%;
	content: "";
}

.htq__traits {
	display: grid;
	gap: 1rem;
	margin-top: 1.5rem;
}

@media (min-width: 46rem) {
	.htq--js .htq__traits {
		grid-template-columns: repeat(3, 1fr);
	}
}

.htq__trait {
	padding: 1.5rem;
	background: var(--htq-card);
	border: 1px solid var(--htq-line);
	border-radius: var(--htq-radius);
}

.htq__trait-name {
	margin: 0 0 0.5rem;
	color: var(--htq-ink);
	font-size: 1.375rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.htq__trait-text {
	margin: 0;
	color: var(--htq-muted);
	font-size: 0.875rem;
	font-weight: 300;
	line-height: 1.6;
}

.htq__again {
	margin-top: 1.75rem;
}

.htq__again[hidden] {
	display: none;
}

/* ---------------------------------------------------------------------------
 * FAQ
 * ------------------------------------------------------------------------ */

.htq--faq {
	padding-top: 1rem;
}

.htq__display--faq {
	margin-bottom: 2rem;
	font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.htq__faq {
	display: grid;
	gap: 1rem;
}

.htq__faq-item {
	padding: 1.75rem;
	background: var(--htq-card);
	border: 1px solid var(--htq-line);
	border-radius: var(--htq-radius);
}

.htq__faq-q {
	margin: 0 0 0.6rem;
	color: var(--htq-ink);
	font-family: var(--htq-font);
	font-size: 1.1875rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.3;
}

.htq__faq-a {
	max-width: 44rem;
	margin: 0;
	color: var(--htq-muted);
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.7;
}
