/*
 * TickerFetch landing page.
 *
 * Colour pairs are measured, not eyeballed — every value below passes WCAG 2.2 AA
 * in both themes (text 4.5:1, form-control boundaries and focus rings 3:1).
 * light-dark() is deliberately avoided: where it is unsupported the declaration is
 * invalid at computed-value time and resolves to unset, which would erase the CTA.
 */

:root {
	color-scheme: light dark;

	--surface: #fbfcfc;
	--surface-2: #f1f5f4;
	--text: #12181a;
	--text-muted: #4f5d63;
	--border: #d6dedd;
	--border-strong: #768582;
	--accent-fill: #0f766e;
	--accent-text: #115e59;
	--on-accent: #ffffff;
	--shadow: 0 2px 4px rgb(18 24 26 / 6%);

	--s1: 0.25rem;
	--s2: 0.5rem;
	--s3: 1rem;
	--s4: 1.5rem;
	--s5: 2rem;
	--s6: 3rem;
	--s7: 4rem;
	--s8: 6rem;

	--r-card: 12px;
	--r-control: 8px;

	--sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;

	--measure: 68ch;
	--page: 68rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--surface: #0f1513;
		--surface-2: #18211f;
		--text: #e6edeb;
		--text-muted: #9bada9;
		--border: #2b3735;
		--border-strong: #647572;
		--accent-fill: #2dd4bf;
		--accent-text: #2dd4bf;
		--on-accent: #0f1513;
		/* elevation by surface, not shadow */
		--shadow: none;
	}
}

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

html {
	scroll-behavior: smooth;
}

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--surface);
	color: var(--text);
	font: 1.0625rem/1.6 var(--sans);
	-webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
	line-height: 1.2;
	text-wrap: balance;
	margin: 0 0 var(--s3);
}

h1 {
	font-size: clamp(2rem, 1.35rem + 3.1vw, 3.15rem);
	letter-spacing: -0.02em;
}

h2 {
	font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
	letter-spacing: -0.01em;
}

h3 {
	font-size: 1.125rem;
}

p,
li {
	max-width: var(--measure);
}

a {
	color: var(--accent-text);
	text-underline-offset: 2px;
}

a:hover {
	text-decoration-thickness: 2px;
}

code,
kbd {
	font-family: var(--mono);
	font-size: 0.9375em;
}

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

/* Deep-link targets are focusable so keyboard users land in the section, but a
   mouse click on one should not paint a ring. */
[tabindex="-1"]:focus:not(:focus-visible) {
	outline: none;
}

.skip {
	position: absolute;
	left: -9999px;
	top: var(--s2);
	padding: var(--s2) var(--s3);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--r-control);
	z-index: 10;
}

.skip:focus {
	left: var(--s3);
}

.wrap {
	max-width: var(--page);
	margin-inline: auto;
	padding-inline: var(--s3);
}

/* ---------- header / footer ---------- */

.site-head {
	border-bottom: 1px solid var(--border);
}

.site-head .wrap {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s3);
	align-items: center;
	justify-content: space-between;
	padding-block: var(--s3);
}

.brand {
	font-weight: 650;
	font-size: 1.0625rem;
	color: var(--text);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: var(--s2);
}

.brand__mark {
	font-family: var(--mono);
	color: var(--accent-text);
}

.site-head nav {
	display: flex;
	gap: var(--s3);
	flex-wrap: wrap;
}

.site-head nav a {
	padding: var(--s1) var(--s2);
}

.site-foot {
	border-top: 1px solid var(--border);
	margin-top: var(--s8);
	padding-block: var(--s5);
	color: var(--text-muted);
	font-size: 0.9375rem;
}

.site-foot ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--s3);
	padding: 0;
	margin: 0 0 var(--s2);
}

.site-foot a {
	display: inline-block;
	padding: var(--s1) 0;
}

/* ---------- sections ---------- */

main section {
	padding-block: var(--s7);
	scroll-margin-top: var(--s4);
}

main section + section {
	border-top: 1px solid var(--border);
}

.lede {
	font-size: 1.1875rem;
	color: var(--text-muted);
}

/* ---------- hero ---------- */

.hero .wrap {
	display: grid;
	gap: var(--s6);
	align-items: center;
}

@media (min-width: 56rem) {
	.hero .wrap {
		grid-template-columns: 1.05fr 0.95fr;
	}
}

.hero p {
	font-size: 1.1875rem;
}

.hero__cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s3);
	margin-top: var(--s5);
}

.hero__note {
	color: var(--text-muted);
	font-size: 0.9375rem;
	margin: 0;
}

/* spreadsheet illustration — real markup, so it scales and costs no requests */

.sheet {
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	background: var(--surface-2);
	box-shadow: var(--shadow);
	overflow: hidden;
	font-family: var(--mono);
	font-size: 0.875rem;
}

.sheet__bar {
	display: flex;
	align-items: center;
	gap: var(--s2);
	padding: var(--s2) var(--s3);
	border-bottom: 1px solid var(--border);
	background: var(--surface);
	overflow-x: auto;
	white-space: nowrap;
}

.sheet__fx {
	color: var(--text-muted);
	font-style: italic;
	padding-right: var(--s2);
	border-right: 1px solid var(--border);
}

.sheet__grid {
	display: grid;
	grid-template-columns: 2.5rem 1fr auto;
	overflow-x: auto;
}

.sheet__grid > * {
	padding: var(--s2) var(--s3);
	border-bottom: 1px solid var(--border);
	border-right: 1px solid var(--border);
	white-space: nowrap;
}

.sheet__grid > .sheet__row-head {
	color: var(--text-muted);
	background: var(--surface);
	text-align: right;
	padding-inline: var(--s2);
}

.sheet__grid > .sheet__num {
	text-align: right;
	border-right: 0;
	font-variant-numeric: tabular-nums;
}

.sheet__caption {
	margin: var(--s2) 0 0;
	font-size: 0.875rem;
	color: var(--text-muted);
	font-family: var(--sans);
}

/* ---------- buttons ---------- */

.btn {
	display: inline-block;
	font: inherit;
	font-weight: 600;
	/* horizontal padding = 2x vertical */
	padding: var(--s3) var(--s5);
	min-height: 44px;
	border: 1px solid transparent;
	border-radius: var(--r-control);
	background: var(--accent-fill);
	color: var(--on-accent);
	text-decoration: none;
	cursor: pointer;
}

.btn:hover {
	filter: brightness(1.08);
}

.btn[aria-disabled="true"] {
	filter: saturate(0.5) brightness(0.95);
	cursor: progress;
}

.btn--quiet {
	background: transparent;
	color: var(--accent-text);
	border-color: var(--border-strong);
}

/* ---------- forms ---------- */

.form {
	max-width: 34rem;
	margin-top: var(--s4);
}

.field {
	display: grid;
	gap: var(--s2);
}

.field label {
	font-weight: 600;
}

.field input {
	font: inherit;
	padding: var(--s3);
	min-height: 44px;
	border: 1px solid var(--border-strong);
	border-radius: var(--r-control);
	background: var(--surface);
	color: var(--text);
	width: 100%;
}

.field input::placeholder {
	color: var(--text-muted);
}

.field input[aria-invalid="true"] {
	border-color: currentColor;
	border-width: 2px;
}

.field__hint {
	font-size: 0.9375rem;
	color: var(--text-muted);
	margin: 0;
}

/* Pre-existing in the DOM and toggled with visibility, which announces far more
   reliably than inserting the node. */
.field__error {
	visibility: hidden;
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0;
	min-height: 1.5rem;
}

.field__error[data-shown="true"] {
	visibility: visible;
}

.form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s3);
	align-items: center;
	margin-top: var(--s3);
}

/* Space is reserved so the message cannot shift the page; the region sits after
   the button so appearing text never pushes the control the user just pressed. */
.status {
	min-height: 4.5rem;
	margin: var(--s3) 0 0;
	padding-left: var(--s3);
	border-left: 4px solid transparent;
	font-size: 0.9375rem;
	max-width: var(--measure);
}

.status:empty {
	border-left-color: transparent;
}

.status[data-tone="ok"] {
	border-left-color: var(--accent-fill);
}

.status[data-tone="warn"],
.status[data-tone="error"] {
	border-left-color: var(--border-strong);
}

.status b {
	font-weight: 650;
}

.noscript {
	margin-top: var(--s3);
	font-size: 0.9375rem;
	color: var(--text-muted);
}

/* ---------- cards / pricing ---------- */

.cards {
	display: grid;
	gap: var(--s4);
	margin-top: var(--s5);
	padding: 0;
	list-style: none;
}

@media (min-width: 44rem) {
	.cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}
}

.card {
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	background: var(--surface-2);
	box-shadow: var(--shadow);
	/* nested radius: inner = outer - gap */
	padding: var(--s4);
	max-width: none;
}

.card--featured {
	border-color: var(--accent-fill);
}

.card h3 {
	margin-bottom: var(--s1);
}

.price {
	font-size: 2rem;
	font-weight: 650;
	letter-spacing: -0.02em;
}

.price small {
	font-size: 1rem;
	font-weight: 400;
	color: var(--text-muted);
}

.badge {
	display: inline-block;
	font-size: 0.8125rem;
	font-weight: 600;
	padding: var(--s1) var(--s2);
	border: 1px solid var(--accent-fill);
	border-radius: 999px;
	color: var(--accent-text);
	margin-left: var(--s2);
}

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

/* ---------- content lists ---------- */

.stack > * + * {
	margin-top: var(--s3);
}

.checks {
	padding-left: var(--s4);
}

.checks li {
	margin-bottom: var(--s2);
}

.faq h3 {
	margin-top: var(--s5);
}

.faq h3:first-of-type {
	margin-top: var(--s4);
}

dl.errors {
	margin: var(--s3) 0 0;
	display: grid;
	gap: var(--s2) var(--s3);
}

@media (min-width: 40rem) {
	dl.errors {
		grid-template-columns: max-content 1fr;
	}
}

dl.errors dt {
	font-family: var(--mono);
	font-size: 0.875rem;
	color: var(--accent-text);
}

dl.errors dd {
	margin: 0 0 var(--s2);
	max-width: var(--measure);
}

.legal h2 {
	margin-top: var(--s6);
}

.legal p,
.legal li {
	max-width: var(--measure);
}
