/* Shared styles for the marketing site, matched to the editor (vis-components:
 * src/styles/tokens.css and the Buttons section of src/styles/components.css). Quicksand for everything; Fraunces 700
 * only for the "Zafiro" wordmark. */

:root {
	color-scheme: light dark;

	/* Editor palette: stone grays + electric-indigo brand. */
	--stone-200: #e9e9e9;
	--stone-300: #d6d3d1;
	--stone-600: #666462;
	--stone-700: #33302e;
	--stone-900: #1a1817;
	--brand-400: #848bfd;
	--brand-500: #4d5bff;
	--brand-600: #3443f7;
	--brand-700: #2335e3;
	--brand-text: #4433ff; /* brand used as text: links */

	--bg: #fafafa;
	--text: var(--stone-900);
	--muted: var(--stone-600);
	--link: var(--brand-text);
	--rule: var(--stone-200);
	--panel: rgba(255, 255, 255, 0.78);
	--panel-border: rgba(26, 24, 23, 0.08);
	--bubble-opacity: 0.16;

	/* Filled brand button (editor's .bg-brand-text-aa, light). */
	--btn-bg: var(--brand-500);
	--btn-edge-top: var(--brand-400);
	--btn-edge-bottom: var(--brand-600);
	--btn-text: #ffffff;

	--font-body: "Quicksand", ui-sans-serif, system-ui, sans-serif;
	--font-brand: "Fraunces", "Quicksand", ui-sans-serif, system-ui, sans-serif;
	--radius-control: 0.5rem;
	--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 3px 6px 0 rgba(0, 0, 0, 0.25), 0 0 3px 0 rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141211;
		--text: #ffffff;
		--muted: #a8a29e;
		--link: var(--brand-400);
		--rule: rgba(255, 255, 255, 0.1);
		--panel: rgba(26, 24, 23, 0.8);
		--panel-border: rgba(255, 255, 255, 0.08);
		--bubble-opacity: 0.08;

		/* Editor's .bg-brand-text-aa under .dark. */
		--btn-bg: var(--brand-600);
		--btn-edge-top: var(--brand-500);
		--btn-edge-bottom: var(--brand-700);
		--btn-text: var(--stone-300);
	}
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font-body);
	font-weight: 450; /* editor UI weight: Quicksand 400 reads too light */
	color: var(--text);
	background: var(--bg);
	position: relative;
	isolation: isolate;
}

/* Bubble wallpaper, faded so text stays readable. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-image: url("/bubbles.svg");
	background-size: 360px 360px;
	opacity: var(--bubble-opacity);
	pointer-events: none;
}

/* Headings are Quicksand bold, as in the editor. */
h1, h2, h3 {
	font-family: var(--font-body);
	font-weight: 700;
}

/* The wordmark is the only Fraunces text. */
.wordmark {
	font-family: var(--font-brand);
	font-weight: 700;
}

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

main {
	flex: 1;
	width: 100%;
	max-width: 40rem;
	margin: 0 auto;
	padding: 3rem 1rem;
}

p, li { line-height: 1.6; }

/* Buttons: the editor's one filled brand style (Button.tsx). There is
 * deliberately no outline variant. .btn-compact is the editor's compact size. */
.btn {
	display: inline-block;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	line-height: 1.25rem;
	padding: 0.5rem 1.5rem;
	border-radius: var(--radius-control);
	border: 0;
	border-top: 1px solid var(--btn-edge-top);
	border-bottom: 1px solid var(--btn-edge-bottom);
	background: var(--btn-bg);
	color: var(--btn-text);
	box-shadow: var(--shadow);
	text-decoration: none;
	cursor: pointer;
	transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
	background: color-mix(in srgb, var(--btn-bg), black 10%);
	border-top-color: color-mix(in srgb, var(--btn-edge-top), black 10%);
	box-shadow: var(--shadow-lg);
}
.btn:active {
	background: color-mix(in srgb, var(--btn-bg), black 20%);
	border-top-color: color-mix(in srgb, var(--btn-edge-top), black 20%);
}
.btn-compact { padding: 0.375rem 0.75rem; }

/* Readable panel behind page content, over the wallpaper. */
.panel {
	background: var(--panel);
	border: 1px solid var(--panel-border);
	border-radius: 1.25rem;
	padding: 2rem 2.25rem;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	box-shadow: 0 10px 30px -18px rgba(26, 24, 23, 0.25);
}
.panel > :last-child { margin-bottom: 0; }
@media (max-width: 480px) {
	.panel { padding: 1.5rem 1.25rem; border-radius: 1rem; }
}

/* Page-top header shared by every page (editor: white, shadow-md stone-200/60). */
.site-header {
	padding: 0 1rem;
	height: 55px;
	display: flex;
	align-items: center;
	background: var(--panel);
	box-shadow: 0 4px 6px -1px rgba(233, 233, 233, 0.6), 0 2px 4px -2px rgba(233, 233, 233, 0.6);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}
@media (prefers-color-scheme: dark) {
	.site-header { box-shadow: 0 4px 6px -1px rgba(12, 10, 9, 0.4), 0 2px 4px -2px rgba(12, 10, 9, 0.4); }
}
.site-header-inner {
	width: 100%;
	max-width: 64rem;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text);
	text-decoration: none;
	font-size: 1.125rem;
	line-height: 1.75rem;
}
.brand img { display: block; }

/* Page-bottom footer shared by every page. */
.site-footer {
	border-top: 1px solid var(--rule);
	padding: 1.25rem 1rem;
	background: var(--panel);
	font-size: 0.875rem;
	color: var(--muted);
}
.site-footer nav {
	max-width: 64rem;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline; /* the Tip Jar emoji has a taller line box */
	justify-content: center;
	gap: 0.4rem 1.25rem;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }
/* Feedback opens a dialog, so it is a <button> dressed as a footer link. */
.footer-link {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}
.footer-link:hover { color: var(--link); text-decoration: underline; }

/* Feedback dialog (feedback.js) */
.feedback-dialog {
	width: min(28rem, calc(100% - 2rem));
	padding: 1.5rem 1.75rem;
	border: 1px solid var(--panel-border);
	border-radius: 1.25rem;
	background: var(--bg);
	color: var(--text);
	box-shadow: var(--shadow-lg);
}
.feedback-dialog::backdrop { background: rgba(26, 24, 23, 0.4); }
.feedback-dialog h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.feedback-form { display: flex; flex-direction: column; }
.feedback-form label { font-size: 0.875rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }
.feedback-form label:first-child { margin-top: 0; }
.feedback-form input,
.feedback-form textarea {
	font: inherit;
	color: inherit;
	background: var(--panel);
	border: 1px solid var(--stone-300);
	border-radius: var(--radius-control);
	padding: 0.5rem 0.75rem;
}
.feedback-form textarea { resize: vertical; }
.feedback-error { color: #b42318; font-size: 0.875rem; min-height: 1.25rem; margin: 0.5rem 0 0; }
.feedback-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.feedback-cancel {
	font: inherit;
	font-weight: 600;
	color: var(--muted);
	background: none;
	border: 0;
	cursor: pointer;
}
.feedback-cancel:hover { color: var(--text); }
.feedback-thanks { margin: 0; outline: none; }

/* Home page */
.home {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.home h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); line-height: 1.1; margin: 0 0 0.75rem; }
.home .choices {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
	margin-top: 1rem;
}
.home .fine { font-size: 0.875rem; color: var(--muted); margin: 1rem 0 0; }

/* Legal pages */
.legal h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.legal .updated { margin: 0; color: var(--muted); font-size: 0.875rem; }
.legal h2 { font-size: 1.125rem; margin: 2rem 0 0.5rem; }
.draft {
	border: 1px solid var(--rule);
	background: var(--panel);
	border-radius: var(--radius-control);
	padding: 0.75rem 1rem;
	margin: 1rem 0 2rem;
	font-size: 0.875rem;
}

/* Tip jar: center the Stripe buy button. The custom element defaults to
 * inline; text-align on the block host inherits into its shadow DOM and
 * centers the inline-block iframe Stripe renders inside. */
.tip-jar stripe-buy-button {
	display: block;
	text-align: center;
	margin-top: 2rem;
}
