/* Legal pages — privacy, terms, data deletion.
 *
 * A SEPARATE SHEET, on purpose. main.css is the marketing surface and was being
 * rewritten while these were written; a merge conflict in a compliance page is
 * a worse outcome than one extra request, and these pages are rarely visited so
 * the request is rarely paid.
 *
 * It layers on top of main.css and inherits its tokens (--bg, --fg, --blue …).
 * Every custom property below is written with a fallback so the pages still
 * render correctly if a token is renamed upstream — a legal page that turns
 * unreadable because a marketing variable moved is not an acceptable failure.
 *
 * Measure is capped near 68ch: these are documents to be READ, and the default
 * full-width line on a desktop monitor is roughly twice the length at which
 * people stop reading carefully.
 */

.legal {
	background: var(--bg, #070b14);
	color: var(--fg, #e9eefb);
	font-family: var(--body, "Inter", system-ui, sans-serif);
	line-height: 1.65;
	margin: 0;
	/* Fluid gutters: no horizontal overflow at 320px, generous at 1440. */
	padding: 0 clamp(1.1rem, 5vw, 2.5rem);
}

.legal__skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--blue, #2570fb);
	color: #fff;
	padding: .7rem 1.1rem;
	border-radius: 0 0 8px 0;
	z-index: 10;
}
.legal__skip:focus { left: 0; }

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

.legal__top {
	display: flex;
	flex-wrap: wrap;                 /* the whole reason mobile does not break */
	align-items: center;
	justify-content: space-between;
	gap: .8rem 1.4rem;
	max-width: 74rem;
	margin: 0 auto;
	padding: 1.6rem 0 1.2rem;
	border-bottom: 1px solid var(--rule, rgb(233 238 251 / 11%));
}

.legal__brand { display: inline-flex; flex: 0 0 auto; }
.legal__brand img {
	display: block;
	width: clamp(120px, 30vw, 150px);
	height: auto;                    /* never distort the wordmark */
}

.legal__nav {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 1.3rem;
	font-size: .88rem;
}
.legal__nav a {
	color: var(--fg-dim, #9aa8c6);
	text-decoration: none;
	/* 44px minimum tap target, met with padding rather than a fixed height so
	   the text can wrap without the box growing away from its label. */
	padding: .6rem 0;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.legal__nav a:hover,
.legal__nav a:focus-visible { color: var(--fg, #e9eefb); }

/* ---------- document ---------- */

.legal__doc {
	max-width: 68ch;
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 3.5rem) 0 4rem;
}

.legal__kicker {
	font-family: var(--display, "Archivo", system-ui, sans-serif);
	font-size: .72rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--sky, #3b9cfc);
	margin: 0 0 .6rem;
}

.legal__doc h1 {
	font-family: var(--display, "Archivo", system-ui, sans-serif);
	/* Fluid, so a long title cannot overflow a 320px viewport. */
	font-size: clamp(1.9rem, 6vw, 2.9rem);
	line-height: 1.1;
	letter-spacing: -.02em;
	margin: 0 0 .9rem;
}

.legal__lede {
	font-size: clamp(1rem, 2.4vw, 1.14rem);
	color: var(--fg-dim, #9aa8c6);
	margin: 0 0 1.1rem;
}

.legal__meta {
	font-size: .82rem;
	color: var(--fg-faint, #6f7d9c);
	margin: 0 0 2.4rem;
	padding-bottom: 1.6rem;
	border-bottom: 1px solid var(--rule-soft, rgb(233 238 251 / 6%));
}

.legal__doc h2 {
	font-family: var(--display, "Archivo", system-ui, sans-serif);
	font-size: clamp(1.05rem, 2.8vw, 1.3rem);
	line-height: 1.25;
	margin: 2.6rem 0 .7rem;
	scroll-margin-top: 1.5rem;       /* anchor links land clear of the top */
}

.legal__doc p { margin: 0 0 1rem; }
.legal__doc ul { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.legal__doc li { margin-bottom: .55rem; }
.legal__doc strong { color: var(--fg, #e9eefb); font-weight: 600; }

.legal__doc a {
	color: var(--sky, #3b9cfc);
	/* Wrap long addresses instead of forcing a horizontal scrollbar — the
	   specific defect that makes legal pages unreadable on a phone. */
	overflow-wrap: anywhere;
}

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

.legal__foot {
	max-width: 68ch;
	margin: 0 auto;
	padding: 1.8rem 0 3rem;
	border-top: 1px solid var(--rule, rgb(233 238 251 / 11%));
	font-size: .84rem;
	color: var(--fg-faint, #6f7d9c);
}
.legal__foot p { margin: 0 0 .6rem; }
.legal__foot strong { color: var(--fg-dim, #9aa8c6); }
.legal__foot a { color: var(--fg-dim, #9aa8c6); overflow-wrap: anywhere; }

/* ---------- light scheme ---------- */
/* main.css drives the palette; these are the fallbacks for the case where the
   tokens are absent, so the pages never render dark-on-dark. */
@media (prefers-color-scheme: light) {
	.legal {
		background: var(--bg, #f3f6fc);
		color: var(--fg, #101828);
	}
}

@media print {
	.legal__top, .legal__nav, .legal__skip { display: none; }
	.legal { background: #fff; color: #000; padding: 0; }
	.legal__doc { max-width: none; }
}
