/*
 * Landing page styles. The palette is lifted from web/src/app.css so the
 * marketing page and the app do not look like two different products. Same
 * approach too: the full light palette on bare :root, dark redefining only what
 * differs, and no colour defined solely inside a media query.
 */
:root {
	color-scheme: light;

	--bg: #f4f6f8;
	--bg-raised: #ffffff;
	--bg-inset: #eef1f5;
	--surface: #e8ecf1;
	--border: #dbe0e7;
	--border-strong: #b9c2ce;
	--text: #14181d;
	--text-muted: #4f5a68;
	--text-faint: #6d7885;
	--accent: #1a5fd0;
	--accent-hover: #164fb0;
	--accent-soft: #dfe9fc;
	--accent-text: #ffffff;
	--bar: #2f6bc4;
	--bar-fill: #14418c;
	--bar-parent: #5a4bbd;
	--milestone: #b3760d;

	--radius: 6px;
	--radius-sm: 4px;

	--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
		sans-serif;
	--mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;

		--bg: #0e1116;
		--bg-raised: #151a21;
		--bg-inset: #0a0d12;
		--surface: #1a212a;
		--border: #232c37;
		--border-strong: #313d4b;
		--text: #e5eaf0;
		--text-muted: #97a3b2;
		--text-faint: #6b7787;
		--accent: #4c8dff;
		--accent-hover: #6ba1ff;
		--accent-soft: #17263d;
		--bar: #3d7ad6;
		--bar-fill: #2359a8;
		--bar-parent: #7566d6;
		--milestone: #d69220;
	}
}

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

html {
	scroll-behavior: smooth;
}

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

	* {
		transition: none !important;
	}
}

/*
 * Type scale. Steps sit roughly a quarter apart, because two levels within
 * about 15% of each other read as a mistake rather than a hierarchy - which is
 * exactly what went wrong here: h3 was 1.02rem against 16px body text, so every
 * card and step heading was a bold paragraph and readers scanned straight past.
 *
 *   eyebrow  0.75rem   600  uppercase, tracked
 *   small    0.875rem  400
 *   body     1rem      400  1.65
 *   lede     1.125rem  400  1.6
 *   h3       1.25rem   600  1.35
 *   h2       1.875-2.375rem 700 1.15
 *   h1       2.5-3.75rem   800  1.02
 *
 * Large type gets tighter tracking and tighter leading than body text; set at
 * body line-height it looks slack.
 */
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

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

code {
	font-family: var(--mono);
	font-size: 0.9em;
}

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

/* Layout ------------------------------------------------------------------ */

.wrap {
	max-width: 68rem;
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* Prose is capped narrower than the grid it sits in: a 68rem paragraph is a
   line length nobody finishes reading. */
.prose {
	max-width: 42rem;
}

.prose.center {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

section {
	padding: clamp(3rem, 7vw, 5rem) 0;
}

/* The header is sticky, so an anchor jump would otherwise land with the
   heading hidden behind it. */
[id] {
	scroll-margin-top: 4.75rem;
}

section.tint {
	background: var(--bg-raised);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.eyebrow {
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
	margin: 0 0 0.5rem;
}

h2 {
	font-size: clamp(1.875rem, 3.4vw, 2.375rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	margin: 0 0 1rem;
}

h3 {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	margin: 0 0 0.5rem;
}

/* Card, beat and step headings are a rank below a subsection heading. */
.card h3,
.beat h3,
.step h3 {
	font-size: 1.25rem;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

.subhead {
	margin-top: 3rem;
}

.lede {
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--text-muted);
	margin: 0;
}

/* Header ------------------------------------------------------------------ */

header {
	border-bottom: 1px solid var(--border);
	background: var(--bg);
	position: sticky;
	top: 0;
	z-index: 10;
}

header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	height: 3.75rem;
}

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

header nav {
	display: flex;
	align-items: center;
	gap: 1.4rem;
	font-size: 0.95rem;
}

header nav a {
	color: var(--text-muted);
	text-decoration: none;
}

header nav a:hover {
	color: var(--text);
}

header nav a.btn {
	color: var(--accent-text);
}

@media (max-width: 34rem) {
	header nav .hide-sm {
		display: none;
	}
}

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

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	background: var(--accent);
	color: var(--accent-text);
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	padding: 0.62rem 1.1rem;
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

.btn-secondary {
	background: transparent;
	color: var(--text-muted);
	border-color: var(--border);
}

.btn-secondary:hover {
	background: var(--bg-inset);
	color: var(--text);
	border-color: var(--border-strong);
}

/* Hero -------------------------------------------------------------------- */

.hero {
	/* padding-top only. The shorthand here would also reset the horizontal
	   padding this element inherits from .wrap, which it carries as a second
	   class - and losing that gutter lets the hero image run to both screen
	   edges on any viewport under the 68rem cap while every other section stays
	   inset. There is a test for it. */
	padding-top: clamp(2.5rem, 6vw, 5.5rem);
	text-align: center;
}

.hero h1 {
	font-size: clamp(2rem, 5.5vw, 3.75rem);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: -0.03em;
	margin: 0 auto 1.15rem;
	max-width: 18ch;
}

.hero .lede {
	font-size: clamp(1.125rem, 1.9vw, 1.25rem);
	max-width: 42rem;
	margin: 0 auto;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.7rem;
	margin-top: 1.9rem;
}

@media (max-width: 26rem) {
	.hero-actions {
		flex-direction: column;
	}

	.hero-actions .btn {
		width: 100%;
	}
}

.hero-note {
	margin: 1.15rem 0 0;
	font-size: 0.875rem;
	color: var(--text-muted);
}

/* The product shot is framed rather than floated: a bare screenshot on a page
   background reads as a stray image, and the frame is what makes it read as
   the application. */
.shot {
	margin-top: clamp(2rem, 4vw, 3.5rem);
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-raised);
	overflow: hidden;
	box-shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 18px 40px -24px rgb(0 0 0 / 35%);
}

.shot img {
	display: block;
	width: 100%;
}

.shot-caption {
	font-size: 0.875rem;
	color: var(--text-muted);
	text-align: center;
	margin: 1rem auto 0;
	max-width: 40rem;
}

/* Problem beats ----------------------------------------------------------- */

.beats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 2rem;
	margin-top: 2.75rem;
}

.beat p {
	margin: 0;
	color: var(--text-muted);
}

.beat .rule {
	width: 2rem;
	height: 3px;
	border-radius: 2px;
	background: var(--accent);
	margin-bottom: 1rem;
}

/* Steps ------------------------------------------------------------------- */

.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.5rem;
	margin-top: 2.75rem;
	counter-reset: step;
}

.step {
	position: relative;
	padding-left: 2.5rem;
}

.step::before {
	counter-increment: step;
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 1.5rem;
	height: 1.5rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font-family: var(--mono);
	font-size: 0.8125rem;
	font-weight: 700;
}

.step p {
	margin: 0;
	color: var(--text-muted);
}

/* Cards ------------------------------------------------------------------- */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.5rem;
	margin-top: 2.75rem;
}

.card {
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.6rem;
	transition: border-color 0.15s;
}

section.tint .card {
	background: var(--bg);
}

.card:hover {
	border-color: var(--border-strong);
}

.card p {
	margin: 0;
	color: var(--text-muted);
}

/* Code sample ------------------------------------------------------------- */

pre {
	background: var(--bg-inset);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.15rem 1.25rem;
	overflow-x: auto;
	font-size: 0.875rem;
	line-height: 1.6;
	margin: 2rem 0 0;
}

pre code {
	font-size: inherit;
}

.code-note {
	margin: 0.85rem 0 0;
	font-size: 0.875rem;
	color: var(--text-muted);
}

/* Plans ------------------------------------------------------------------- */

.plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
	gap: 1.5rem;
	margin-top: 2.75rem;
}

.plan {
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
}

section.tint .plan {
	background: var(--bg);
}

.plan .plan-name {
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--text-muted);
}

.plan .price {
	font-size: clamp(1.625rem, 2.6vw, 2rem);
	font-weight: 700;
	line-height: 1.1;
	margin: 0.4rem 0 0;
	letter-spacing: -0.025em;
}

.plan .price span {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-muted);
	letter-spacing: 0;
}

.plan .who {
	margin: 0.6rem 0 0;
	color: var(--text-muted);
}

.plan ul {
	margin: 1.1rem 0 0;
	padding: 0;
	list-style: none;
	color: var(--text-muted);
}

.plan li {
	position: relative;
	padding-left: 1.15rem;
	margin-bottom: 0.45rem;
}

.plan li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 6px;
	height: 6px;
	border-radius: 1px;
	background: var(--accent);
	transform: rotate(45deg);
}

.plan li:last-child {
	margin-bottom: 0;
}

/* Tables ------------------------------------------------------------------ */

table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1.5rem;
	font-size: 1rem;
}

th,
td {
	text-align: left;
	padding: 0.65rem 0.8rem;
	border-bottom: 1px solid var(--border);
}

th {
	font-family: var(--mono);
	font-weight: 600;
	color: var(--text-muted);
	font-size: 0.75rem;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.07em;
}

td:not(:first-child),
th:not(:first-child) {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
	border-bottom: none;
}

/* Shown only where the table cannot fit; iOS hides the scrollbar until a
   gesture starts, so a table that scrolls silently reads as truncated. */
.scroll-hint {
	display: none;
}

@media (max-width: 44rem) {
	.scroll-hint {
		display: block;
	}
}

.table-scroll {
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-raised);
	margin-top: 1.5rem;
}

section.tint .table-scroll {
	background: var(--bg);
}

.table-scroll table {
	margin-top: 0;
	min-width: 34rem;
}

.yes {
	color: var(--accent);
	font-weight: 600;
}

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

.faq {
	margin-top: 2.5rem;
	max-width: 46rem;
}

details {
	border-bottom: 1px solid var(--border);
}

details summary {
	cursor: pointer;
	padding: 1.1rem 2rem 1.1rem 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.4;
	list-style: none;
	position: relative;
}

details summary::-webkit-details-marker {
	display: none;
}

details summary::after {
	content: '+';
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--mono);
	font-size: 1.15rem;
	color: var(--text-faint);
}

details[open] summary::after {
	content: '\2013';
}

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

details p {
	margin: 0 0 1.2rem;
	color: var(--text-muted);
}

/* Closing call to action -------------------------------------------------- */

.cta {
	background: var(--accent-soft);
	border: 1px solid var(--accent);
	border-radius: 10px;
	padding: 3rem 2rem;
	text-align: center;
}

.cta h2 {
	margin-bottom: 0.6rem;
}

.cta .lede {
	margin: 0 auto;
	max-width: 34rem;
}

/* Notes and footer -------------------------------------------------------- */

.note {
	color: var(--text-muted);
	font-size: 0.875rem;
	line-height: 1.6;
	margin-top: 1rem;
}

/* The two most load-bearing sentences in the pricing section are bold inside a
   .note; without this they render bold in the quietest colour on the page. */
.note strong {
	color: var(--text);
}

footer {
	border-top: 1px solid var(--border);
	padding: 2.5rem 0 3.5rem;
	color: var(--text-muted);
	font-size: 0.875rem;
}

footer .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

footer nav {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

footer a {
	color: var(--text-muted);
	text-decoration: none;
}

footer a:hover {
	color: var(--text);
}
