/*
 * Mockbooth legal pages (privacy.html, terms.html) — a quiet, readable variant of
 * the landing page's "Atelier" theme.
 *
 * Deliberately self-contained: no web fonts, no JS, no shared import from
 * ../landing/styles.css. A privacy policy that phones a font CDN on load is a
 * data flow the policy would then have to disclose, so these pages use the
 * system font stack and ship zero third-party requests. Tokens below are the
 * same values as apps/web/src/index.css / landing/styles.css, copied (the app
 * is the source of truth — re-sync this :root block manually if it re-themes).
 */
:root {
	--radius: 0.625rem;

	--background: oklch(0.145 0.008 255);
	--foreground: oklch(0.96 0.004 250);

	--card: oklch(0.175 0.008 255);
	--primary: oklch(0.8 0.09 255);
	--muted-foreground: oklch(0.68 0.012 255);

	--border: oklch(0.3 0.01 255 / 70%);
	--hairline: oklch(0.32 0.01 255 / 55%);
	--ring: oklch(0.8 0.09 255 / 65%);

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

	--maxw: 760px;
}

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

body {
	margin: 0;
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
	font-size: 1rem; /* 16px floor */
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

/* Base link styling lives up here, before any component rule that narrows it
 * (.brand, .legal-header__links a, .toc a, .legal-footer a). Keeping the plain
 * `a` selectors first means specificity ascends down the file. */
a {
	color: var(--primary);
	text-underline-offset: 3px;
}
a:hover {
	color: var(--foreground);
}

/* Cool bloom behind the page — one static layer, no animation. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: radial-gradient(
		60% 40% at 50% -10%,
		oklch(0.66 0.13 263 / 22%) 0%,
		transparent 62%
	);
}

.wrap {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--maxw);
	margin-inline: auto;
	padding: 40px 24px 80px;
}

/* ----------------------------------------------------------------------------
 * Header — brand lockup + back link.
 * ------------------------------------------------------------------------- */
.legal-header {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--hairline);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}
.brand__word {
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}
.brand__a {
	color: var(--primary);
}
.tag {
	font-family: var(--font-mono);
	font-size: 0.875rem; /* mono eyebrow — the documented 14px exception */
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--muted-foreground);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 3px 9px;
}

.legal-header__links {
	display: flex;
	gap: 20px;
	margin-left: auto;
}
.legal-header__links a {
	color: var(--muted-foreground);
	text-decoration: none;
	padding: 4px 0;
}
.legal-header__links a:hover {
	color: var(--foreground);
}
.legal-header__links a[aria-current="page"] {
	color: var(--foreground);
}

/* ----------------------------------------------------------------------------
 * Document body.
 * ------------------------------------------------------------------------- */
h1 {
	margin: 40px 0 10px;
	font-size: clamp(2rem, 5vw, 2.6rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.updated {
	margin: 0 0 8px;
	font-family: var(--font-mono);
	font-size: 0.875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted-foreground);
}

.lede {
	margin: 20px 0 0;
	font-size: 1.125rem;
	color: var(--muted-foreground);
}

h2 {
	margin: 46px 0 12px;
	font-size: 1.375rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.25;
	scroll-margin-top: 20px;
}

h3 {
	margin: 28px 0 8px;
	font-size: 1.0625rem;
	font-weight: 600;
}

p {
	margin: 12px 0;
}

ul,
ol {
	margin: 12px 0;
	padding-left: 22px;
}
li {
	margin: 8px 0;
}

strong {
	color: var(--foreground);
	font-weight: 600;
}

code {
	font-family: var(--font-mono);
	background: oklch(1 0 0 / 5%);
	border: 1px solid var(--hairline);
	border-radius: 5px;
	padding: 1px 6px;
}

/* A callout for the things people most need to see (local-only, opt-in). */
.note {
	margin: 22px 0;
	padding: 18px 20px;
	background: var(--card);
	border: 1px solid var(--hairline);
	border-left: 2px solid var(--primary);
	border-radius: var(--radius);
	color: var(--muted-foreground);
}
.note strong {
	color: var(--foreground);
}

/* Table of contents. */
.toc {
	margin: 28px 0 0;
	padding: 18px 20px;
	background: oklch(1 0 0 / 3%);
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
}
.toc h2 {
	margin: 0 0 8px;
	font-family: var(--font-mono);
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--muted-foreground);
}
.toc ol {
	margin: 0;
	padding-left: 20px;
	color: var(--muted-foreground);
}
.toc a {
	color: var(--muted-foreground);
	text-decoration: none;
}
.toc a:hover {
	color: var(--foreground);
	text-decoration: underline;
}

/* Data tables (cookies / local storage). Scroll horizontally on narrow screens
 * rather than forcing the page to scroll sideways. */
.table-scroll {
	overflow-x: auto;
	margin: 18px 0;
	border: 1px solid var(--hairline);
	border-radius: var(--radius);
}
table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
}
caption {
	text-align: left;
	padding: 12px 16px 0;
	color: var(--muted-foreground);
}
th,
td {
	text-align: left;
	vertical-align: top;
	padding: 12px 16px;
	border-bottom: 1px solid var(--hairline);
}
th {
	color: var(--foreground);
	font-weight: 600;
}
td {
	color: var(--muted-foreground);
}
tbody tr:last-child th,
tbody tr:last-child td {
	border-bottom: 0;
}
td code,
th code {
	white-space: nowrap;
}

/* ----------------------------------------------------------------------------
 * Footer.
 * ------------------------------------------------------------------------- */
.legal-footer {
	margin-top: 64px;
	padding-top: 26px;
	border-top: 1px solid var(--hairline);
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	color: var(--muted-foreground);
}
.legal-footer nav {
	display: flex;
	gap: 20px;
	margin-left: auto;
}
.legal-footer a {
	color: var(--muted-foreground);
	text-decoration: none;
	padding: 4px 0;
}
.legal-footer a:hover {
	color: var(--foreground);
}

/* ----------------------------------------------------------------------------
 * A11y primitives — mirrored from the landing page.
 * ------------------------------------------------------------------------- */
:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 2px var(--background),
		0 0 0 4px var(--ring);
	border-radius: var(--radius);
}
.skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	transform: translateY(-150%);
	background: var(--card);
	color: var(--foreground);
	padding: 10px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
}
.skip-link:focus {
	transform: translateY(0);
}

/* No prefers-reduced-motion block here on purpose: unlike the landing page and
 * the app, these documents declare zero animations and zero transitions, so
 * there is nothing to neutralise. Add one alongside any motion introduced later. */
