/*
 * Ding Dong — the public website.
 *
 * The palette is the app's own, taken from Utilities/HexColor.swift rather
 * than approximated: DDback #FFFDF7, DDink #0B1A26, DDblue #0075C2. Somebody
 * who taps "Privacy Policy" in Settings should land somewhere that plainly
 * belongs to the same product, because a legal page that looks like a
 * different company reads as one, and these pages exist to be believed.
 *
 * Everything here is deliberately one stylesheet with no build step, no
 * framework and no web fonts. These pages are served by Caddy's file_server
 * straight off disk, and the whole point of a policy page is that it loads on
 * a bad connection on somebody's phone.
 */

:root {
	--back: #FFFDF7;
	--ink: #0B1A26;
	--blue: #0075C2;
	--blue-deep: #00437A;
	--blue-soft: #EDF5FB;
	--blue-line: #D8E7F3;
	--muted: #5A6772;
}

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

body {
	margin: 0;
	background: var(--back);
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	/* text-size-adjust keeps iOS Safari from inflating body text in landscape,
	   which otherwise breaks the measure on exactly the device most of these
	   readers are holding. */
	-webkit-text-size-adjust: 100%;
}

.wrap {
	max-width: 46rem;
	margin: 0 auto;
	/* 20px side gutters rather than 16: these are long documents, and the
	   extra breathing room is what stops a wall of text feeling like one. */
	padding: 0 20px 5rem;
}

/* ---- masthead ---- */

header.top {
	border-bottom: 1px solid var(--blue-line);
	background: var(--blue-soft);
	margin-bottom: 2.5rem;
}

header.top .wrap {
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}

header.top a.home {
	color: var(--blue-deep);
	font-weight: 800;
	font-size: 1.15rem;
	text-decoration: none;
	letter-spacing: -0.01em;
}

header.top a.home:hover {
	text-decoration: underline;
}

/* ---- type ---- */

h1 {
	font-size: 2.1rem;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 0.4rem;
}

h2 {
	font-size: 1.3rem;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 2.75rem 0 0.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--blue-line);
}

h3 {
	font-size: 1.05rem;
	margin: 1.75rem 0 0.5rem;
}

p, li {
	color: var(--ink);
}

.updated {
	color: var(--muted);
	font-size: 0.95rem;
	margin: 0 0 2rem;
}

.lede {
	font-size: 1.1rem;
	color: var(--ink);
}

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

a:hover {
	color: var(--blue-deep);
}

ul {
	padding-left: 1.3rem;
}

li {
	margin-bottom: 0.5rem;
}

strong {
	font-weight: 700;
}

/* ---- the callout, used for the things people most need to actually read ---- */

.note {
	background: var(--blue-soft);
	border: 1px solid var(--blue-line);
	border-left: 4px solid var(--blue);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin: 1.5rem 0;
}

.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

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

footer {
	border-top: 1px solid var(--blue-line);
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	color: var(--muted);
	font-size: 0.95rem;
}

footer a { color: var(--blue); }

/* ---- small screens ----
   The app itself is capped at iPhone sizes, but these pages get opened on
   anything, and a 320px phone is still the narrowest thing that turns up. */

@media (max-width: 30rem) {
	body { font-size: 16px; }
	h1 { font-size: 1.7rem; }
	h2 { font-size: 1.2rem; }
	.wrap { padding-left: 16px; padding-right: 16px; }
}

/* Respect a reader who has asked the OS for less contrast churn or who prints
   the page for a parent to read. Printing a privacy policy is a real thing
   people do, and the cream background wastes ink for no benefit. */
@media print {
	body { background: #fff; font-size: 12pt; }
	header.top { background: #fff; }
	.note { background: #fff; }
}
