/* agent.functorial.inc: the teaser. Shared look comes from style.css (copied from functorial.inc).
   The banner and the waitlist form are ergo's (ergo.functorial.inc/public/ergo.css), kept in step. */

:root {
	--agent: #2f6bff;      /* the ∘, on the light page */
	--agent-glow: #2f6bff;
	--ai: #8b6bff;
}
@media (prefers-color-scheme: dark) {
	:root { --agent: #8ab4f8; --agent-glow: #4a7bff; --ai: #b39bff; }
}

/* The banner bleeds past the edges; never let it scroll the page sideways. */
html, .agent { overflow-x: clip; }

.teaser {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 3.5rem 0 4rem;
}

.mark {
	margin: 0;
	font-weight: 400;
	font-size: clamp(4rem, 14vw, 8.5rem);
	line-height: 1;
	letter-spacing: -0.01em;
}
.mark span { color: var(--agent); margin-left: 0.06em; }

.teaser .tagline {
	margin: 0.6rem 0 0;
	font-size: clamp(1.3rem, 3vw, 1.8rem);
	font-style: italic;
	color: var(--muted);
}

/* Nothing to show yet, so the status card has the stage to itself, lit from behind. */
.stage {
	position: relative;
	width: min(60rem, 100%);
	aspect-ratio: 10 / 2.4;
	margin: 2.5rem 0 2.25rem;
	container-type: inline-size;
}

.glow {
	position: absolute;
	inset: 10% 8%;
	background:
		radial-gradient(50% 60% at 30% 50%, color-mix(in srgb, var(--agent-glow) 45%, transparent), transparent 70%),
		radial-gradient(45% 55% at 75% 50%, color-mix(in srgb, var(--ai) 40%, transparent), transparent 70%);
	filter: blur(48px);
	opacity: 0.6;
	animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.35; transform: scale(0.97); } }

/* The banner: a flat yellow status card, the colour of "pending". Sizes are in cqw. */
.ribbon {
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(100%, 52rem);
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 3cqw;
	padding: 2.6cqw 2.6cqw 2.6cqw 4.2cqw;
	z-index: 2;
	border-radius: 22px;
	color: #0b1020;
	background: #f7cf4a;
	border: 1.5px solid #0b1020;
	box-shadow: 0 18px 40px -18px rgba(11, 16, 32, 0.55);
}

.ribbon .words {
	display: flex;
	align-items: center;
	gap: 0.7em;
	font-size: clamp(1.4rem, 4.2cqw, 2.6rem);
	line-height: 1;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	white-space: nowrap;
	-webkit-text-stroke: 0.03em currentColor;
}
.ribbon .words b { font-weight: 400; margin-right: -0.22em; }

/* Waiting: three ∘ rings that fill in turn, like someone typing. */
.wait { display: inline-flex; gap: 0.32em; }
.wait i {
	width: 0.36em;
	aspect-ratio: 1;
	border-radius: 50%;
	border: 0.07em solid currentColor;
	animation: wait 1.6s ease-in-out infinite;
}
.wait i:nth-child(2) { animation-delay: 0.2s; }
.wait i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wait {
	0%, 60%, 100% { background: transparent; transform: translateY(0); }
	25% { background: currentColor; transform: translateY(-0.12em); }
}

/* The waitlist button sits at the right end of the card. */
.join {
	position: relative;
	z-index: 1;
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.65em 1.3em;
	border-radius: 999px;
	background: #0b1020;
	color: #f7cf4a;
	font-size: clamp(0.95rem, 1.9cqw, 1.25rem);
	letter-spacing: 0.03em;
	text-decoration: none;
	white-space: nowrap;
	-webkit-text-stroke: 0.2px currentColor;
	transition: transform 150ms ease, color 150ms ease;
}
.join:hover, .join:focus-visible { color: #fff; transform: translateY(-1px); }
.join:focus-visible { outline: 2px solid #0b1020; outline-offset: 3px; }
.join span { transition: transform 150ms ease; }
.join:hover span { transform: translateX(3px); }

/* On a narrow stage the words and the button stack. */
@container (max-width: 620px) {
	.ribbon { flex-direction: column; gap: 1.1rem; padding: 1.4rem 1.2rem; border-radius: 18px; }
	.ribbon .words { font-size: 1.45rem; }
	.join { font-size: 0.95rem; }
}

/* The waitlist form. A centred card on wide screens, a sheet from the bottom on phones. */
.waitlist {
	width: min(30rem, calc(100vw - 2rem));
	padding: 0;
	border: 1px solid var(--rule);
	border-radius: 16px;
	background: var(--bg);
	color: var(--fg);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}
.waitlist::backdrop { background: rgba(11, 16, 32, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.waitlist[open] { animation: rise 220ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.wl-form, .wl-done { position: relative; padding: 1.75rem 1.75rem 1.5rem; }
.waitlist h2 { margin: 0 0 0.35rem; font-weight: 400; font-size: 1.8rem; line-height: 1.15; }
.wl-lede, .wl-done p { margin: 0 0 1.25rem; color: var(--muted); font-style: italic; }
.wl-form label { display: block; margin: 0 0 0.9rem; font-size: 1.05rem; }
.wl-form label small { color: var(--muted); font-style: italic; font-size: 0.9rem; margin-left: 0.25rem; }
.wl-form input {
	display: block;
	width: 100%;
	margin-top: 0.3rem;
	padding: 0.65rem 0.8rem;
	border: 1.5px solid color-mix(in srgb, var(--muted) 45%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, var(--bg) 70%, #fff 30%);
	color: var(--fg);
	font: inherit;
	font-size: 1.05rem;
	-webkit-text-stroke: 0;
}
@media (prefers-color-scheme: dark) { .wl-form input { background: color-mix(in srgb, var(--bg) 85%, #fff 15%); } }
.wl-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.wl-trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wl-error { min-height: 1.4em; margin: 0 0 0.6rem; color: #c43b45; font-size: 0.98rem; }
@media (prefers-color-scheme: dark) { .wl-error { color: #ef6b73; } }
.wl-error:empty { min-height: 0; margin: 0; }
.wl-submit {
	display: block;
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: 999px;
	color: #0b1020;
	background: #f7cf4a;
	box-shadow: 0 0 0 1.5px #0b1020;
	font: inherit;
	font-size: 1.15rem;
	letter-spacing: 0.06em;
	cursor: pointer;
}
.wl-submit:hover:not(:disabled) { filter: brightness(1.05); }
.wl-submit:disabled { opacity: 0.6; cursor: default; }
.wl-close {
	position: absolute;
	top: 0.6rem;
	right: 0.7rem;
	width: 2.4rem;
	height: 2.4rem;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--muted);
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}
.wl-close:hover { color: var(--fg); background: color-mix(in srgb, var(--muted) 15%, transparent); }
.wl-done { text-align: center; }
.wl-mark { margin: 0 !important; font-size: 3rem; line-height: 1; color: var(--agent) !important; font-style: normal !important; }
.wl-done b { color: var(--fg); font-style: normal; }

@media (max-width: 640px) {
	.waitlist { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
	.waitlist[open] { animation-name: sheet; }
	@keyframes sheet { from { transform: translateY(100%); } }
}

.hint {
	margin: 0 0 1.75rem;
	font-size: 1.25rem;
	color: var(--muted);
	max-width: 40ch;
	text-wrap: balance;
}

@media (max-width: 640px) {
	.teaser { padding-top: 2.5rem; }
	.stage { margin: 2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
	.glow, .wait i { animation: none; }
	.waitlist[open] { animation: none; }
}

/* catpad: free now, while the agent is not. */
.catpad {
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: 36rem;
	margin: 0 0 1.5rem;
	padding: 0.9rem 1.2rem;
	border: 1px solid var(--rule);
	border-radius: 14px;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: inherit;
	text-align: left;
	text-decoration: none;
	transition: border-color 150ms ease, transform 150ms ease;
}
.catpad:hover, .catpad:focus-visible { border-color: var(--agent); transform: translateY(-1px); }
.catpad .tag {
	flex: none;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--agent) 14%, transparent);
	color: var(--agent);
	font-size: 0.9rem;
	letter-spacing: 0.04em;
}
.catpad p { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.catpad p span { color: var(--muted); font-style: italic; }
.catpad i { flex: none; font-style: normal; color: var(--muted); transition: transform 150ms ease; }
.catpad:hover i { transform: translateX(3px); }
@media (max-width: 640px) {
	.catpad { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
	.catpad i { display: none; }
}
