/* KeepTier — locked tokens & components.
   See product/branding.md §2 for the why behind every color.
   Do not introduce raw colors in component CSS — always reference a token. */

:root {
	/* Palette */
	--bg:          #0c1014;
	--bg-elev:     #161b21;
	--fg:          #f1f5f9;
	--muted:       #94a3b8;
	--line:        #1e2630;
	--accent:      #10b981;  /* the kept tier */
	--accent-ink:  #04150f;  /* text on --accent */
	--tax:         #ef4444;  /* rationed: only the Apple-tax loss number */
	--receipt:     #fafafa;  /* pure white, only inside .receipt */

	/* Type */
	--font:      system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;

	/* Layout */
	--radius: 10px;
	--radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--fg);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

main { max-width: 760px; margin: 0 auto; padding: 40px 24px 64px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 48px; }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; }
.brand-nav { display: flex; gap: 20px; font-size: 14px; }
.brand-nav a {
	color: var(--muted); text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 2px;
}
.brand-nav a:hover { color: var(--fg); border-bottom-color: var(--line); }

/* Typography ───────────────────────────────────────────── */
h1 {
	font-size: clamp(36px, 5vw, 56px);
	line-height: 1.05;
	margin: 0 0 16px;
	letter-spacing: -0.02em;
	font-weight: 700;
}
h2 { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.01em; font-weight: 700; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 32px; max-width: 60ch; }
.mono, code, kbd { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* Calculator input (the hero in Direction A) ─────────────── */
.calculator {
	display: flex; gap: 8px; flex-wrap: wrap;
	margin: 0 0 16px;
}
.calculator input[type=url],
.calculator input[type=text] {
	flex: 1 1 280px;
	padding: 14px 16px;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--fg);
	font: inherit;
	font-family: var(--font-mono);
	font-size: 15px;
}
.calculator input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.calculator button {
	padding: 14px 22px;
	background: var(--accent);
	color: var(--accent-ink);
	border: 0;
	border-radius: var(--radius);
	font-weight: 700;
	cursor: pointer;
	font: inherit;
	letter-spacing: -0.01em;
}
.calculator button:hover { filter: brightness(1.06); }
.calculator-msg { color: var(--muted); min-height: 1.4em; margin: 0; font-size: 14px; }

/* Receipt (the post-submission output, also the comparison rows) */
.receipt {
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 20px 22px;
	font-family: var(--font-mono);
	font-size: 15px;
	color: var(--receipt);
	line-height: 1.7;
}
.receipt h3 {
	font-family: var(--font);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 14px;
}
.receipt-row { display: flex; justify-content: space-between; gap: 16px; }
.receipt-row .label { color: var(--muted); }
.receipt-row .val   { font-variant-numeric: tabular-nums; }
.receipt-rule { border: 0; border-top: 1px dashed var(--line); margin: 10px 0; }
.receipt-total .val { font-weight: 700; font-size: 17px; }
.receipt-loss .val  { color: var(--tax); font-weight: 700; }
.receipt-keep .val  { color: var(--accent); font-weight: 700; }

/* Primary post-submission receipt (one wide card, above the compare row) */
.receipt-hero { margin: 32px 0 16px; }
.receipt-hero .receipt-total .val { color: var(--fg); }

.receipt-caption {
	color: var(--muted); font-size: 15px; line-height: 1.6;
	margin: 8px 2px 24px; max-width: 60ch;
}

/* Three-up comparison (Patreon iOS / Patreon web / KeepTier) */
.compare-title {
	font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
	margin: 24px 0 12px; color: var(--fg);
}
.compare {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(3, 1fr);
	margin: 0 0 12px;
}
.compare .receipt { font-size: 14px; padding: 16px 18px; }
.compare .receipt h3 { margin-bottom: 10px; }
.receipt-winner { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }

/* "Why KeepTier" benefit list (carries over from seed template) */
.why { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.why ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.why li { padding-left: 28px; position: relative; }
.why li::before {
	content: "›"; position: absolute; left: 8px; top: 0;
	color: var(--accent); font-weight: 700;
}

/* Pricing card ─────────────────────────────────────────── */
.pricing {
	display: grid; gap: 12px;
	grid-template-columns: repeat(2, 1fr);
	margin: 32px 0;
}
@media (max-width: 560px) { .pricing { grid-template-columns: 1fr; } }
.plan {
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 20px 22px;
}
.plan h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.plan .price { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; color: var(--muted); }

/* FAQ */
.faq { margin-top: 32px; }
.faq details {
	border-top: 1px solid var(--line);
	padding: 14px 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Waitlist (form rules retained — uncomment in HTML when collector :rw lands) */
.waitlist { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.waitlist input[type=email] {
	flex: 1 1 260px; padding: 14px 16px; background: transparent;
	border: 1px solid var(--line); border-radius: var(--radius);
	color: var(--fg); font: inherit;
}
.waitlist input[type=email]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.waitlist button {
	padding: 14px 22px; background: var(--accent); color: var(--accent-ink);
	border: 0; border-radius: var(--radius); font-weight: 700; cursor: pointer; font: inherit;
}
.waitlist button:hover { filter: brightness(1.06); }
.wl-msg { color: var(--muted); margin: 0; font-size: 14px; }

/* Mailto card — Bug 6 workaround for the waitlist form. Uses --accent as
   the call surface (same emerald token; emerald-on-emerald nav-card style). */
.mailto-card { margin: 0 0 6px 0; }
.mailto-btn {
	display: inline-flex;
	align-items: baseline;
	gap: 14px;
	padding: 14px 22px;
	background: var(--accent);
	color: var(--accent-ink);
	border-radius: var(--radius);
	font-weight: 700;
	text-decoration: none;
	transition: filter 120ms ease;
}
.mailto-btn:hover { filter: brightness(1.06); }
.mailto-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.mailto-btn-label { font-size: 16px; }
.mailto-btn-addr {
	font-family: var(--font-mono);
	font-size: 14px;
	font-weight: 500;
	color: var(--accent-ink);
	opacity: 0.78;
}
@media (max-width: 480px) {
	.mailto-btn { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* Share-card download (branding.md §5) — shown once the calculator
   has rendered. Canvas is drawn client-side on click, no server. */
.share-card-panel {
	margin: 20px 0 8px;
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}
.share-card-btn {
	padding: 12px 18px;
	background: var(--accent);
	color: var(--accent-ink);
	border: 0;
	border-radius: var(--radius);
	font-family: var(--font);
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	letter-spacing: -0.01em;
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
	transition: filter 120ms ease;
}
.share-card-btn:hover { filter: brightness(1.06); }
.share-card-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.share-card-btn-sub {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 500;
	opacity: 0.78;
}
.share-card-hint {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	max-width: 48ch;
	line-height: 1.5;
}

/* Section wrappers add breathing room between the hero / pricing / waitlist / faq */
.section-pricing, .section-waitlist { margin-top: 64px; }
.plan-pro { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-pro h3 { color: var(--accent); }

footer { margin-top: 96px; color: var(--muted); font-size: 14px; text-align: center; }
footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
footer .footnote {
	max-width: 60ch; margin: 16px auto 0;
	font-size: 12px; line-height: 1.6; color: var(--muted); opacity: 0.85;
	text-align: left;
}

.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	h1 { animation: fadeUp .6s ease-out both; }
	.lede { animation: fadeUp .7s ease-out both; animation-delay: .08s; }
	.calculator { animation: fadeUp .8s ease-out both; animation-delay: .14s; }
}
@keyframes fadeUp {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}
