/* Cueball landing page. Plain CSS, light and dark through prefers-color-scheme. */

:root {
	--bg: #f7f7f5;
	--surface: #ffffff;
	--text: #18181b;
	--muted: #52525b;
	--faint: #71717a;
	--line: #e4e4e7;
	--accent: #3f46c9;
	--accent-hover: #343ab0;
	--accent-text: #ffffff;
	--focus: #3f46c9;
	--ok: #13723f;
	--err: #b42318;
	--ball: #ffffff;
	--ball-edge: #18181b;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 40px -12px rgb(24 24 27 / 0.25);

	/* The terminal mock is dark in both themes, like most terminals. */
	--term-bg: #15161a;
	--term-bar: #1d1e23;
	--term-line: #2a2b31;
	--term-text: #e6e6e9;
	--term-faint: #8b8c94;
	--term-accent: #8fa2ff;
	--term-green: #5fd38d;
	--term-amber: #f0b45a;

	--radius: 14px;
	--sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0d0e10;
		--surface: #15161a;
		--text: #ececef;
		--muted: #a8a8b3;
		--faint: #8b8b96;
		--line: #26272d;
		--accent: #9aa8ff;
		--accent-hover: #b4bfff;
		--accent-text: #0d0e10;
		--focus: #9aa8ff;
		--ok: #6ad69a;
		--err: #ff8a80;
		--ball: #f4f4f5;
		--ball-edge: #f4f4f5;
		--shadow: 0 0 0 1px #24252b, 0 20px 60px -20px rgb(0 0 0 / 0.8);
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

h1,
h2,
h3,
p {
	margin: 0;
}

[hidden] {
	display: none;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
}

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

.wrap {
	width: 100%;
	max-width: 1040px;
	margin-inline: auto;
	padding-inline: 16px;
}

@media (min-width: 720px) {
	.wrap {
		padding-inline: 32px;
	}
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 10;
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow);
}

.skip:focus {
	top: 12px;
}

/* Header */

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-block: 20px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-weight: 650;
	font-size: 1.125rem;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.brand-mark {
	width: 26px;
	height: 26px;
}

.ball {
	fill: var(--ball);
	stroke: var(--ball-edge);
	stroke-width: 2;
}

.ball-shine {
	fill: var(--ball-edge);
	opacity: 0.18;
}

/* Hero */

.hero {
	padding-top: 40px;
	padding-bottom: 36px;
	text-align: center;
}

.hero h1 {
	font-size: clamp(2.25rem, 6.5vw, 3.75rem);
	line-height: 1.08;
	letter-spacing: -0.03em;
	font-weight: 700;
	text-wrap: balance;
}

.subline {
	max-width: 38rem;
	margin: 18px auto 28px;
	color: var(--muted);
	font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
	line-height: 1.55;
	text-wrap: pretty;
}

@media (min-width: 720px) {
	.hero {
		padding-top: 72px;
		padding-bottom: 48px;
	}
}

/* Buttons */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 20px;
	border: 0;
	border-radius: 10px;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 120ms ease;
}

.button-primary {
	background: var(--accent);
	color: var(--accent-text);
}

.button-primary:hover {
	background: var(--accent-hover);
}

.button[disabled] {
	opacity: 0.65;
	cursor: progress;
}

/* Screenshot slot */

.shot {
	padding-bottom: 40px;
}

@media (min-width: 720px) {
	.shot {
		padding-bottom: 56px;
	}
}

.shot-frame {
	margin: 0;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.shot-img {
	width: 100%;
	border-radius: var(--radius);
}

/* The stand-in: an HTML/CSS mock of the Cueball terminal window. */

.term {
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--term-bg);
	color: var(--term-text);
	font-family: var(--mono);
	font-size: clamp(0.625rem, 1.9vw, 0.875rem);
	line-height: 1.7;
}

.term-bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 10px 14px;
	background: var(--term-bar);
	border-bottom: 1px solid var(--term-line);
}

.dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	flex: none;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.term-title {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	color: var(--term-faint);
	font-size: 0.95em;
}

.term-body {
	display: grid;
	grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
	min-height: clamp(150px, 25vw, 260px);
}

.term-list {
	padding: 12px 0;
	border-right: 1px solid var(--term-line);
}

.row,
.rule,
.line,
.pane-head {
	overflow: hidden;
	white-space: pre;
	text-overflow: ellipsis;
}

.row {
	display: flex;
	gap: 0.6em;
	padding: 0 12px;
}

.row .name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.row .num {
	color: var(--term-faint);
}

.row .mark {
	width: 1ch;
	color: var(--term-accent);
}

.row-on {
	background: rgb(143 162 255 / 0.12);
}

.row-on .name {
	color: #ffffff;
	font-weight: 600;
}

.row-dim {
	color: var(--term-faint);
}

.rule {
	padding: 4px 12px;
	color: var(--term-faint);
}

.state {
	flex: none;
}

.state-working { color: var(--term-amber); }
.state-idle { color: var(--term-faint); }

.term-pane {
	padding: 12px 16px;
	min-width: 0;
}

.pane-head {
	margin-bottom: 6px;
	color: var(--term-accent);
	font-weight: 600;
}

.prompt {
	color: var(--term-accent);
}

.tool {
	color: var(--term-green);
}

.faint,
.term .faint {
	color: var(--term-faint);
}

.spin {
	color: var(--term-amber);
}

.term-status {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.6em;
	padding: 8px 14px;
	border-top: 1px solid var(--term-line);
	background: var(--term-bar);
}

.ready {
	color: var(--term-green);
}

@media (max-width: 520px) {
	.term-body {
		grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
	}
	.row { padding: 0 8px; gap: 0.45em; }
	.rule { padding: 4px 8px; }
	.term-pane { padding: 12px 10px; }
	.dot { width: 9px; height: 9px; }
}

/* Features */

.about {
	padding-bottom: 48px;
}

@media (min-width: 720px) {
	.about {
		padding-bottom: 64px;
	}
}

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

/* Five cards: 2 + 2 + 1 wide on tablets, 3 + 2 on desktop, with no gaps. */
@media (min-width: 720px) {
	.features {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.features li:last-child {
		grid-column: 1 / -1;
	}
}

@media (min-width: 980px) {
	.features {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
	.features li {
		grid-column: span 2;
	}
	.features li:nth-child(n + 4),
	.features li:last-child {
		grid-column: span 3;
	}
}

/* No border: a soft panel on the page background, so the page reads less boxed. */
.features li {
	padding: 20px 22px;
	border-radius: 12px;
	background: var(--surface);
}

.features h3 {
	margin-bottom: 4px;
	font-size: 1rem;
	font-weight: 650;
	letter-spacing: -0.005em;
}

.features p {
	color: var(--muted);
	font-size: 0.9375rem;
}

/* Signup: an open section on the page background, no card. */

.signup {
	padding-top: 8px;
	padding-bottom: 56px;
	scroll-margin-top: 24px;
}

@media (min-width: 720px) {
	.signup {
		padding-top: 16px;
		padding-bottom: 88px;
	}
}

.signup:focus {
	outline: none;
}

.signup-inner {
	max-width: 520px;
	margin-inline: auto;
	text-align: center;
}

.signup h2 {
	font-size: clamp(1.25rem, 3.4vw, 1.5rem);
	line-height: 1.25;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.signup-note {
	margin-top: 8px;
	color: var(--muted);
}

.signup-form {
	margin-top: 20px;
}

/* The signup: one narrow field with the button inside it. */
.signup-form {
	max-width: 400px;
	margin-inline: auto;
}

.field-row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.field-row:focus-within {
	outline: 2px solid var(--focus);
	outline-offset: 1px;
}

/* "Get notified at release" was clicked: a soft accent glow that fades out. */
.field-row.highlight {
	animation: field-highlight 1.6s ease-out;
}

@keyframes field-highlight {
	0%,
	25% {
		box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent);
	}
	100% {
		box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent);
	}
}

@media (prefers-reduced-motion: reduce) {
	.field-row.highlight {
		animation-timing-function: steps(1, end);
	}
}

.field-row:has(input[aria-invalid="true"]) {
	border-color: var(--err);
}

.field-row input {
	flex: 1;
	min-width: 0;
	min-height: 36px;
	padding: 6px 10px;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	/* 16px or more stops iOS Safari from zooming into the field. */
	font-size: 1rem;
}

.field-row input:focus {
	outline: none;
}

.field-row .button {
	min-height: 36px;
	padding: 6px 14px;
	border-radius: 8px;
	font-size: 0.9375rem;
	white-space: nowrap;
}

@media (min-width: 480px) {
	/* Phones keep 16px in the field so iOS Safari doesn't zoom. */
	.field-row input {
		font-size: 0.9375rem;
	}
}

.field-row input::placeholder {
	color: var(--faint);
}

/* Honeypot: out of sight and out of the tab order. */
.hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.status {
	min-height: 1.6em;
	margin-top: 10px;
	font-size: 0.9375rem;
	font-weight: 550;
}

.status[data-kind="ok"] {
	color: var(--ok);
}

.status[data-kind="error"] {
	color: var(--err);
}

/* No message yet: no gap between the field and the privacy line. */
.status:empty {
	min-height: 0;
	margin-top: 0;
}

.privacy {
	margin-top: 10px;
	color: var(--faint);
	font-size: 0.8125rem;
}
