/* ------------------------------------------------------------------
   Loki waitlist
   Mobile-first (matches the 393x852 mockup), two columns from 980px.
   ------------------------------------------------------------------ */

:root {
	--bg: #2b2454;
	--bg-elev: #322a5e;
	--panel: rgba(50, 42, 94, 0.55);
	--border: #4d4580;
	--border-hover: #6a61a6;
	--heading: #ffffff;
	--subtext: #b5b0d6;
	--placeholder: #8a84b8;
	--accent: #f0a585;
	--accent-hover: #f7b89b;
	--accent-soft: rgba(240, 165, 133, 0.16);
	--accent-ink: #2b2454;
	--danger: #ffb3a7;
	--divider: rgba(255, 255, 255, 0.12);
	--step-circle: #443c76;
	--step-text: #d9d6ec;
	--pill: 999px;
	--radius-card: 18px;
	--shell: 1080px;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100dvh;
	background-color: var(--bg);
	background-image:
		radial-gradient(38rem 30rem at 88% -6%, rgba(240, 165, 133, 0.12), transparent 62%),
		radial-gradient(34rem 28rem at -8% 106%, rgba(129, 116, 226, 0.2), transparent 62%);
	background-repeat: no-repeat;
	color: var(--heading);
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

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

[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
	outline: none;
}

/* --- signup / confirmation states --------------------------------- */

.when-done {
	display: none;
}

html[data-loki-state="done"] .when-signup {
	display: none;
}

html[data-loki-state="done"] .when-done {
	display: block;
}

.state,
.panel {
	animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

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

/* --- shell -------------------------------------------------------- */

.page {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	max-width: var(--shell);
	margin-inline: auto;
	padding: 20px 22px 44px;
}

.masthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wordmark {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.layout {
	flex: 1;
	display: grid;
	gap: 36px;
	align-content: start;
	padding-block-start: clamp(56px, 19vh, 140px);
}

.primary,
.secondary {
	min-width: 0;
}

/* --- copy ---------------------------------------------------------- */

.headline {
	margin: 0 0 14px;
	font-size: clamp(2.05rem, 9vw, 2.5rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.subtext {
	margin: 0 0 18px;
	max-width: 34ch;
	color: var(--subtext);
	text-wrap: pretty;
}

.confirm-email {
	color: var(--heading);
	font-weight: 600;
}

.social-proof {
	margin: 0 0 16px;
	color: var(--accent);
	font-size: 0.9rem;
	font-weight: 600;
}

.text-link {
	padding: 0;
	border: none;
	background: none;
	color: var(--subtext);
	font: inherit;
	font-size: 0.95rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.text-link:hover {
	color: var(--heading);
}

/* --- signup form ---------------------------------------------------- */

.waitlist-form {
	margin: 0;
}

.field-row {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.email-input {
	width: 100%;
	padding: 15px 20px;
	border: 1px solid var(--border);
	border-radius: var(--pill);
	background: var(--bg-elev);
	color: var(--heading);
	font: inherit;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}

.email-input::placeholder {
	color: var(--placeholder);
}

.email-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.email-input[aria-invalid="true"] {
	border-color: var(--danger);
}

.cta-button {
	padding: 15px 26px;
	border: none;
	border-radius: var(--pill);
	background: var(--accent);
	color: var(--accent-ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition:
		background-color 0.15s ease,
		transform 0.12s ease;
}

.cta-button:hover:not(:disabled) {
	background: var(--accent-hover);
}

.cta-button:active:not(:disabled) {
	transform: translateY(1px);
}

.cta-button:disabled {
	opacity: 0.65;
	cursor: default;
}

.cta-button--block {
	width: 100%;
}

/* Answer recorded - reads as confirmed rather than merely disabled. */
.cta-button--saved:disabled {
	opacity: 1;
	background: var(--accent-soft);
	box-shadow: inset 0 0 0 1px var(--accent);
	color: var(--accent);
}

.form-message {
	margin: 12px 0 0;
	color: var(--subtext);
	font-size: 0.88rem;
}

.form-message--error {
	color: var(--danger);
}

.form-message--success {
	color: var(--accent);
}

/* --- how it works ---------------------------------------------------- */

.divider {
	width: 100%;
	margin: 0 0 24px;
	border: none;
	border-top: 1px solid var(--divider);
}

/* Labels the card on desktop; on mobile the divider already does that job. */
.panel-eyebrow {
	display: none;
}

.steps {
	display: grid;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.steps li {
	display: flex;
	align-items: center;
	gap: 14px;
}

.step-number {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--step-circle);
	font-size: 0.8rem;
	font-weight: 700;
}

.step-text {
	color: var(--step-text);
	font-size: 0.95rem;
}

/* --- study-topic card ------------------------------------------------- */

.panel--survey {
	padding: 22px 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	background: var(--panel);
}

.topic-set {
	min-width: 0;
	margin: 0 0 18px;
	padding: 0;
	border: none;
}

.panel-title {
	padding: 0;
	margin: 0 0 14px;
	font-size: 1.05rem;
	font-weight: 700;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.chip {
	position: relative;
	display: inline-flex;
}

.chip-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.chip-label {
	display: inline-block;
	padding: 9px 16px;
	border: 1px solid var(--border);
	border-radius: var(--pill);
	color: var(--step-text);
	font-size: 0.92rem;
	cursor: pointer;
	user-select: none;
	transition:
		border-color 0.15s ease,
		background-color 0.15s ease,
		color 0.15s ease;
}

.chip-label:hover {
	border-color: var(--border-hover);
	color: var(--heading);
}

.chip-input:checked + .chip-label {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

.chip-input:focus-visible + .chip-label {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.chip-input:disabled + .chip-label {
	cursor: default;
}

/* --- tablet ------------------------------------------------------------ */

@media (min-width: 640px) {
	.page {
		padding: 28px 40px 52px;
	}

	.field-row {
		flex-direction: row;
		align-items: center;
		gap: 10px;
	}

	.email-input {
		flex: 1 1 auto;
		min-width: 0;
	}

	.field-row .cta-button {
		flex: 0 0 auto;
	}
}

/* --- desktop ----------------------------------------------------------- */

@media (min-width: 980px) {
	.page {
		padding: 34px 56px 60px;
	}

	.wordmark {
		font-size: 1.15rem;
	}

	.layout {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
		gap: 72px;
		align-content: center;
		align-items: center;
		padding-block-start: 0;
	}

	.headline {
		margin-bottom: 18px;
		font-size: clamp(2.6rem, 4.4vw, 3.5rem);
	}

	.subtext {
		max-width: 38ch;
		margin-bottom: 22px;
		font-size: 1.12rem;
	}

	.social-proof {
		font-size: 0.95rem;
	}

	.panel--steps {
		padding: 32px;
		border: 1px solid var(--border);
		border-radius: var(--radius-card);
		background: var(--panel);
	}

	.panel--steps .divider {
		display: none;
	}

	.panel-eyebrow {
		display: block;
		margin: 0 0 22px;
		color: var(--subtext);
		font-size: 0.75rem;
		font-weight: 600;
		letter-spacing: 0.12em;
		text-transform: uppercase;
	}

	.steps {
		gap: 24px;
	}

	.step-number {
		width: 32px;
		height: 32px;
		font-size: 0.85rem;
	}

	.step-text {
		font-size: 1rem;
	}

	.panel--survey {
		padding: 30px 32px;
	}

	.panel-title {
		margin-bottom: 18px;
		font-size: 1.15rem;
	}
}

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