/* ContactFile — shared styles for static marketing pages (privacy, terms,
   alternatives/*, 404). Mirrors the SPA's visual identity (header, footer,
   container widths, slate palette) so these pages feel like the same site.
   Dark mode follows the `html.dark` class set by /theme-init.js. */

:root {
	--bg:           #f8fafc;  /* slate-50 */
	--bg-elevated:  #ffffff;
	--fg:           #0f172a;  /* slate-900 */
	--fg-strong:    #020617;  /* slate-950 */
	--muted:        #334155;  /* slate-700 */
	--subtle:       #64748b;  /* slate-500 */
	--faint:        #94a3b8;  /* slate-400 */
	--rule:         #e2e8f0;  /* slate-200 */
	--code-bg:      #e2e8f0;
	--link:         #0f172a;
	--link-underline: #cbd5e1; /* slate-300 */
	--brand-fg:     #0f172a;
	--brand-bg:     #0f172a;
	--brand-icon:   #ffffff;
	--header-bg:    rgba(255, 255, 255, 0.85);
	--footer-bg:    transparent;
	--beta-fg:      #64748b;
	--success:      #047857;  /* emerald-700 */
}

html.dark {
	--bg:           #020617;  /* slate-950 */
	--bg-elevated:  #0f172a;  /* slate-900 */
	--fg:           #f1f5f9;  /* slate-100 */
	--fg-strong:    #ffffff;
	--muted:        #cbd5e1;  /* slate-300 */
	--subtle:       #94a3b8;  /* slate-400 */
	--faint:        #64748b;  /* slate-500 */
	--rule:         #1e293b;  /* slate-800 */
	--code-bg:      #1e293b;
	--link:         #f1f5f9;
	--link-underline: #475569; /* slate-600 */
	--brand-fg:     #f1f5f9;
	--brand-bg:     #ffffff;
	--brand-icon:   #0f172a;
	--header-bg:    rgba(2, 6, 23, 0.85);
	--footer-bg:    transparent;
	--beta-fg:      #fbbf24;   /* amber-400 */
	--success:      #34d399;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

body > main,
body > .site-main {
	flex: 1;
}

/* ── Container widths ───────────────────────────────────────────────── */

.site-container {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 24px;
}
@media (min-width: 1024px) {
	.site-container {
		padding: 0 32px;
	}
}

/* ── Site header (matches SPA) ──────────────────────────────────────── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--header-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--rule);
}

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 12px;
	padding-bottom: 12px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--brand-fg);
}

.brand-mark {
	display: inline-flex;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--brand-bg);
	color: var(--brand-icon);
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.brand-mark svg { display: block; }

.brand-word {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--brand-fg);
	position: relative;
	display: inline-block;
	line-height: 1;
}
.brand-beta {
	position: absolute;
	right: -36px;
	top: 0;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--beta-fg);
}

.header-spacer { flex: 1; }

.header-back {
	font-size: 13px;
	color: var(--subtle);
	text-decoration: none;
	padding: 4px 10px;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}
.header-back:hover {
	color: var(--fg);
	background: var(--rule);
}

/* ── Main content (prose) ───────────────────────────────────────────── */

.site-main {
	padding: 40px 24px 64px;
}
@media (min-width: 1024px) {
	.site-main {
		padding: 64px 32px 96px;
	}
}

.prose {
	max-width: 680px;
	margin: 0 auto;
}
.prose-wide {
	max-width: 880px;
	margin: 0 auto;
}

.eyebrow {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--subtle);
	margin: 0 0 14px;
}

h1 {
	font-size: clamp(28px, 3.6vw, 36px);
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
	color: var(--fg);
	text-wrap: balance;
}

.lede {
	font-size: 16px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 40px;
	text-wrap: pretty;
}

section { margin: 0 0 32px; }

h2 {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--faint);
	margin: 0 0 10px;
}

h3 {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 24px 0 10px;
	color: var(--fg);
}

p {
	margin: 0 0 14px;
	color: var(--muted);
}
p:last-child { margin-bottom: 0; }

a {
	color: var(--link);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: var(--link-underline);
	transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--link); }

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12.5px;
	background: var(--code-bg);
	padding: 1px 6px;
	border-radius: 4px;
	color: var(--fg);
}

ul {
	margin: 0 0 14px;
	padding-left: 22px;
}
ul li {
	color: var(--muted);
	margin-bottom: 6px;
}
ul li::marker { color: var(--faint); }

/* ── Comparison tables (alternatives pages) ─────────────────────────── */

table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 24px;
	font-size: 14px;
}
th, td {
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--rule);
	vertical-align: top;
	color: var(--muted);
}
th {
	color: var(--fg);
	font-weight: 600;
	font-size: 13px;
	background: var(--bg-elevated);
	border-bottom-width: 2px;
}
tbody tr:hover {
	background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
}

.grade {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12.5px;
	color: var(--success);
	font-weight: 600;
}

/* ── Site footer (matches SPA) ──────────────────────────────────────── */

.site-footer {
	margin-top: 40px;
	border-top: 1px solid var(--rule);
}

.site-footer-inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	padding-top: 24px;
	padding-bottom: 24px;
}
@media (min-width: 1024px) {
	.site-footer-inner {
		flex-direction: row;
		align-items: flex-end;
		gap: 32px;
	}
}

.site-footer-about {
	flex: 1;
	min-width: 0;
}
.site-footer-title {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--muted);
	margin: 0 0 6px;
}
.site-footer-desc {
	font-size: 13px;
	line-height: 1.6;
	color: var(--subtle);
	max-width: 32rem;
	margin: 0;
	text-wrap: pretty;
}

.site-footer-util {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	flex-shrink: 0;
	font-size: 12px;
	color: var(--subtle);
}
@media (min-width: 1024px) {
	.site-footer-util {
		align-items: flex-end;
		margin-left: auto;
	}
}

.site-footer-links {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.site-footer-links a {
	color: var(--subtle);
	text-decoration: none;
	padding: 0 4px;
	border-radius: 3px;
	transition: color 0.15s;
}
.site-footer-links a:hover {
	color: var(--fg);
}

.site-footer-copy {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	color: var(--subtle);
}
.site-footer-copy a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--subtle);
	text-decoration: none;
	transition: color 0.15s;
}
.site-footer-copy a:hover {
	color: var(--fg);
}
.site-footer-copy img {
	opacity: 0.6;
	transition: opacity 0.15s;
}
.site-footer-copy a:hover img {
	opacity: 1;
}

/* ── Accessibility: skip-to-main-content link ───────────────────────── */

.skip-link {
	position: absolute;
	top: -40px;
	left: 12px;
	padding: 8px 14px;
	background: var(--fg);
	color: var(--bg);
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	z-index: 100;
	transition: top 0.15s;
}
.skip-link:focus,
.skip-link:focus-visible {
	top: 12px;
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* ── Consistent focus-visible treatment across links and buttons ────── */

a:focus-visible,
button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.7); /* matches SPA ring-blue-500/70 */
	border-radius: 3px;
}

/* ── Theme toggle (matches SPA ThemeToggle component) ───────────────── */

.theme-toggle {
	display: inline-flex;
	align-items: center;
	padding: 2px;
	gap: 2px;
	border: 1px solid var(--rule);
	border-radius: 9999px;
}
.theme-toggle button {
	background: none;
	border: none;
	padding: 6px;
	border-radius: 9999px;
	color: var(--faint);
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.theme-toggle button:hover {
	color: var(--fg);
}
.theme-toggle button.active {
	background: var(--rule);
	color: var(--fg);
}
.theme-toggle button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.7);
}
.theme-toggle svg { display: block; }

/* ── Reduced motion: honor the user's OS preference ─────────────────── */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── 404 page ───────────────────────────────────────────────────────── */

.center-404 {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	text-align: center;
	padding: 48px 24px;
}
.center-404 h1 {
	font-size: clamp(56px, 10vw, 88px);
	letter-spacing: -0.04em;
	margin-bottom: 4px;
	line-height: 1;
}
.center-404 .lede {
	margin-bottom: 28px;
	max-width: 420px;
}
