/* Anyflo launch demo — brand palette per Anyflo Brand Guidelines:
 * black + beige (#EAE9E5) base, pastel accents (lavender, peach, cyan, green),
 * Outfit for headings/body, Datatype (mono) for labels and figures. */

:root {
	--bg: #000000;
	--surface: rgba(234, 233, 229, 0.035);
	--surface-2: rgba(234, 233, 229, 0.06);
	--border: rgba(234, 233, 229, 0.17);
	--border-strong: rgba(234, 233, 229, 0.32);
	--text: #eae9e5;
	--text-dim: rgba(234, 233, 229, 0.8);
	--beige: #eae9e5;
	--lavender: #c8b8dd;
	--peach: #e2b68e;
	--cyan: #87bac7;
	--green: #adcea6;
	--red: #e08b93;
}

* { box-sizing: border-box; }

button { touch-action: manipulation; }

html, body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	color: var(--text);
	font-family: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
	background: var(--bg);
}

.mono {
	font-family: "Datatype", ui-monospace, "JetBrains Mono", monospace;
	font-size: 0.92em;
	letter-spacing: 0.02em;
}

/* ============ header ============ */

header { padding: 30px 40px 12px; animation: rise 0.6s ease-out both; }

.brand-row {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.logo { height: 46px; width: auto; display: block; }

.brand-tag {
	font-family: "Datatype", ui-monospace, monospace;
	font-weight: 300;
	font-size: 14px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--text-dim);
	padding-left: 18px;
	border-left: 1px solid var(--border-strong);
}

.sub {
	margin: 12px 0 0;
	color: var(--text-dim);
	font-size: 16px;
	font-weight: 300;
	letter-spacing: 0.02em;
}

main {
	display: grid;
	grid-template-columns: 1fr 390px;
	gap: 22px;
	padding: 16px 40px 44px;
	align-items: start;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 22px 24px;
	transition: border-color 0.3s ease;
	animation: rise 0.65s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.card:hover { border-color: var(--border-strong); }
#mission { animation-delay: 0.06s; }
#telemetry { animation-delay: 0.14s; }

.card h2 {
	margin: 0 0 16px;
	font-family: "Datatype", ui-monospace, monospace;
	font-weight: 300;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.26em;
	color: var(--text-dim);
}

/* ============ stage ============ */

#stage-wrap {
	position: relative;
	border: 1px solid var(--border);
	border-radius: 4px;
	overflow: hidden;
	min-height: 440px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background: linear-gradient(180deg, rgba(234, 233, 229, 0.025), rgba(234, 233, 229, 0));
}

/* grain texture — brand graphics are soft, grain-textured */
#stage-wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0.5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.91 0 0 0 0 0.90 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#stage { width: 100%; height: 100%; display: block; position: absolute; inset: 0; }

#timeline {
	position: relative;
	z-index: 2;
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 52px 16px 18px;
	flex-wrap: wrap;
	justify-content: center;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82) 55%);
}

#timeline li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 2px;
	border: 1px solid var(--border-strong);
	color: rgba(234, 233, 229, 0.88);
	font-size: 14.5px;
	font-weight: 400;
	letter-spacing: 0.04em;
	background: rgba(0, 0, 0, 0.45);
	transition: all 0.4s ease;
	white-space: nowrap;
}

#timeline li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 19px;
	height: 19px;
	border-radius: 50%;
	border: 1px solid currentColor;
	font-family: "Datatype", ui-monospace, monospace;
	font-size: 12px;
}

#timeline li.active {
	color: var(--beige);
	border-color: var(--beige);
	box-shadow: 0 0 18px rgba(234, 233, 229, 0.18);
	background: rgba(234, 233, 229, 0.07);
	animation: step-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

#timeline li.done { color: var(--green); border-color: rgba(173, 206, 166, 0.45); }

#timeline li.done span { border-color: transparent; font-size: 0; }
#timeline li.done span::after { content: "✓"; font-size: 12px; }

#timeline li.failed { color: var(--red); border-color: rgba(224, 139, 147, 0.55); }

/* ============ mission card ============ */

.kv {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	font-size: 16px;
	border-bottom: 1px dashed rgba(234, 233, 229, 0.08);
}

.kv span {
	color: var(--text-dim);
	font-weight: 300;
	text-transform: uppercase;
	font-size: 0.82em;
	letter-spacing: 0.1em;
}
.kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

label {
	display: block;
	margin: 18px 0 7px;
	font-size: 14px;
	color: var(--text-dim);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

#dest {
	width: 100%;
	padding: 13px 14px;
	border-radius: 2px;
	border: 1px solid var(--border-strong);
	background: rgba(234, 233, 229, 0.04);
	color: var(--text);
	font-family: "Datatype", ui-monospace, monospace;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

#dest:focus {
	border-color: var(--beige);
	box-shadow: 0 0 0 3px rgba(234, 233, 229, 0.12), 0 0 26px rgba(234, 233, 229, 0.08);
}
#dest.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 139, 147, 0.12); }

.hint { margin-top: 9px; font-size: 14.5px; color: var(--red); }
.hint.warn { color: var(--peach); }

#launch {
	position: relative;
	overflow: hidden;
	width: 100%;
	margin-top: 22px;
	padding: 18px;
	font-family: "Outfit", system-ui, sans-serif;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.2em;
	color: #000;
	border: none;
	border-radius: 2px;
	cursor: pointer;
	background: linear-gradient(135deg, #ffffff, var(--beige) 60%, #d6d4ce);
	transition: transform 0.15s, box-shadow 0.3s;
	animation: pulse-strong 2.4s infinite;
}

/* light band sweeping across the CTA */
#launch::before {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 45%;
	height: 100%;
	background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.7), transparent);
	transform: skewX(-20deg);
	animation: shine 3.6s ease-in-out infinite;
}

#launch:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 0 40px rgba(234, 233, 229, 0.55), 0 0 110px rgba(234, 233, 229, 0.25);
}

#launch:active:not(:disabled) { transform: translateY(0) scale(0.99); }

#launch:disabled { opacity: 0.4; cursor: not-allowed; animation: none; }
#launch:disabled::before { animation: none; }

@keyframes pulse-strong {
	0%, 100% { box-shadow: 0 0 18px rgba(234, 233, 229, 0.3), 0 0 55px rgba(234, 233, 229, 0.12); }
	50% { box-shadow: 0 0 36px rgba(234, 233, 229, 0.55), 0 0 90px rgba(234, 233, 229, 0.22); }
}

@keyframes shine {
	0%, 45% { left: -80%; }
	100% { left: 170%; }
}

button.ghost {
	margin-top: 16px;
	width: 100%;
	padding: 11px;
	background: transparent;
	border: 1px solid var(--border-strong);
	color: var(--text-dim);
	border-radius: 2px;
	cursor: pointer;
	font-family: "Outfit", system-ui, sans-serif;
	font-size: 15px;
	letter-spacing: 0.06em;
	transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

button.ghost:hover {
	color: var(--text);
	border-color: var(--beige);
	box-shadow: 0 0 18px rgba(234, 233, 229, 0.1);
}

/* ============ status badge — pastel palette per status ============ */

#t-status {
	padding: 3px 10px;
	border-radius: 2px;
	font-family: "Datatype", ui-monospace, monospace;
	font-size: 14px;
	letter-spacing: 0.06em;
	border: 1px solid var(--border);
}

@keyframes pulse {
	0%, 100% { box-shadow: 0 0 10px rgba(234, 233, 229, 0.1); }
	50% { box-shadow: 0 0 20px rgba(234, 233, 229, 0.28); }
}

#t-status.s-new, #t-status.s-selected { color: var(--text-dim); }
#t-status.s-bidding { color: var(--lavender); border-color: var(--lavender); animation: pulse 1.6s infinite; }
#t-status.s-accepted { color: var(--peach); border-color: var(--peach); }
#t-status.s-executing { color: var(--cyan); border-color: var(--cyan); animation: pulse 1.2s infinite; }
#t-status.s-delivered { color: var(--green); border-color: var(--green); }
#t-status.s-expired, #t-status.s-rejected, #t-status.s-cancelled,
#t-status.s-depositNotAck, #t-status.s-deliveryNotAck { color: var(--red); border-color: var(--red); }

a { color: var(--cyan); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ============ delivered banner ============ */

#banner {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.82);
	z-index: 50;
	backdrop-filter: blur(5px);
}

.banner-box {
	text-align: center;
	width: min(520px, calc(100vw - 40px));
	padding: 44px 60px;
	border-radius: 4px;
	border: 1px solid rgba(173, 206, 166, 0.4);
	background: radial-gradient(600px 300px at 50% 0%, rgba(173, 206, 166, 0.1), transparent), #000;
	box-shadow: 0 0 70px rgba(173, 206, 166, 0.18);
	animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.banner-logo { height: 74px; width: auto; margin-bottom: 20px; opacity: 0.95; }

.banner-title {
	font-size: 32px;
	font-weight: 500;
	letter-spacing: 0.06em;
	color: var(--green);
}

.banner-sub { margin-top: 12px; color: var(--text-dim); font-size: 17px; font-weight: 300; }
#banner-link {
	display: inline-block;
	margin-top: 18px;
	font-size: 15px;
	font-family: "Datatype", ui-monospace, monospace;
}

@keyframes pop {
	from { transform: scale(0.7); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* ============ toast ============ */

#toast {
	position: fixed;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	padding: 11px 18px;
	border-radius: 2px;
	background: rgba(10, 5, 6, 0.94);
	border: 1px solid rgba(224, 139, 147, 0.5);
	color: var(--red);
	font-size: 15.5px;
	z-index: 60;
	max-width: 80vw;
}

/* ============ motion ============ */

@keyframes rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes step-pop {
	0% { transform: scale(0.92); }
	60% { transform: scale(1.07); }
	100% { transform: scale(1); }
}

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

/* ============ responsive — must stay last: these override the base rules above ============ */

@media (max-width: 980px) {
	main { grid-template-columns: 1fr; }
	header, main { padding-left: 18px; padding-right: 18px; }
	.logo { height: 36px; }
}

@media (max-width: 640px) {
	header { padding: 20px 16px 8px; }
	.brand-tag { font-size: 11px; letter-spacing: 0.24em; padding-left: 14px; }
	.sub { font-size: 15px; }
	main { padding: 12px 16px 28px; gap: 16px; }
	.card { padding: 18px 16px; }
	#timeline { padding-top: 40px; gap: 6px; }
	#timeline li { font-size: 12.5px; padding: 6px 10px; }
	#timeline li span { width: 16px; height: 16px; font-size: 10px; }

	/* 16px inputs prevent iOS Safari auto-zoom on focus */
	#dest { font-size: 16px; }

	.banner-box { padding: 34px 22px; }
	.banner-title { font-size: 24px; }
	.banner-sub { font-size: 15px; }
	.banner-logo { height: 58px; }
}
