/* The app's own palette, not a website palette: Dawn by day, Night by lamp. The two were chosen
   together, so the site and the app are recognisably the same thing. */
:root {
	--ground: #FAF7F1;
	--surface: #FFFFFF;
	--sunken: #F0EBE2;
	--ink: #1B1814;
	--ink2: #5E574E;
	--ink3: #8B8377;
	--line: #E4DED3;
	--accent: #9B5A00;
	--shadow: rgba(58, 42, 16, 0.10);
	--bar: rgba(250, 247, 241, 0.86);

	--night: #2B2F5C;
	--dawn: #D98A2B;
	--day: #F2DFB0;
	--dusk: #C46A3D;

	--woke: #C08500;
	--coffee: #944D24;
	--ate: #25984D;
	--out: #006F76;
	--meds: #8E6AC7;
	--bed: #224FA7;

	--serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
	--sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
	--radius: 20px;
	--inner: 12px;
	--bar-h: 56px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ground: #0F1220; --surface: #1A1E32; --sunken: #232842;
		--ink: #F2F0EA; --ink2: #A6A8BC; --ink3: #7C7F96; --line: #2C3150;
		--accent: #F1B65C; --shadow: rgba(0, 0, 0, 0); --bar: rgba(15, 18, 32, 0.86);
		--night: #393F68; --day: #E9D7A8;
		--woke: #E1AF4A; --coffee: #B76849; --ate: #65C67D;
		--out: #009BA3; --meds: #B396E8; --bed: #4C7DD9;
	}
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16.5px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

a { color: var(--accent); text-underline-offset: 3px; }

/* ------------------------------------------------------- the bar that stays */
.bar {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--bar-h);
	background: var(--bar);
	backdrop-filter: saturate(180%) blur(18px);
	-webkit-backdrop-filter: saturate(180%) blur(18px);
	border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; gap: 18px; height: 100%; }

.brand {
	display: inline-flex; align-items: center; gap: 9px;
	font-weight: 600; font-size: 15.5px;
	color: var(--ink); text-decoration: none;
	margin-right: auto;
	white-space: nowrap;
}
/* The Dial, small enough to be a mark: the day as a ring. */
.ring {
	width: 20px; height: 20px; border-radius: 50%; flex: none;
	background: conic-gradient(from 180deg,
		var(--night) 0deg, var(--night) 75deg, var(--dawn) 97deg,
		var(--day) 135deg, var(--day) 225deg, var(--dusk) 277deg,
		var(--night) 307deg, var(--night) 360deg);
	mask: radial-gradient(circle, transparent 0 5.5px, #000 6px);
	-webkit-mask: radial-gradient(circle, transparent 0 5.5px, #000 6px);
}

.bar nav { display: flex; gap: 4px; }
.bar nav a {
	padding: 7px 13px;
	border-radius: var(--inner);
	font-size: 15px;
	color: var(--ink2);
	text-decoration: none;
	white-space: nowrap;
}
.bar nav a:hover { background: var(--sunken); color: var(--ink); }
.bar nav a[aria-current="page"] { background: var(--sunken); color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------- headings and blocks */
h1 {
	margin: 0 0 12px;
	font-size: clamp(31px, 5.6vw, 46px);
	line-height: 1.05;
	letter-spacing: -0.025em;
	font-weight: 700;
}
h2 {
	margin: 0 0 8px;
	font-size: clamp(21px, 3.2vw, 26px);
	letter-spacing: -0.02em;
	line-height: 1.2;
}
h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
p.lede { font-size: clamp(17.5px, 2.6vw, 20px); line-height: 1.45; color: var(--ink2); }
p.sub { color: var(--ink2); }
.updated { font-size: 13.5px; color: var(--ink3); }

section { padding: 40px 0; }
section + section { border-top: 1px solid var(--line); }

/* The number is the one serif in the app, so it is the one serif here. */
.figure {
	display: block;
	font-family: var(--serif);
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--accent);
	font-size: clamp(34px, 5vw, 46px);
	line-height: 1.05;
}

.card {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 18px 20px;
	box-shadow: 0 12px 30px var(--shadow);
}
.echo-card .when { font-size: 12.5px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; }
.echo-card p { margin: 5px 0 0; font-size: 16px; }
.echo-card .aside {
	margin-top: 9px; padding-left: 10px;
	border-left: 2px solid var(--coffee);
	font-size: 13.5px; color: var(--ink2);
}

/* ------------------------------------------------------- layout that saves scrolling */
.split {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 34px;
	align-items: center;
}
.pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}
.trio {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
}

ul { padding-left: 0; list-style: none; margin: 0; }
ul li { position: relative; padding-left: 19px; margin-bottom: 8px; color: var(--ink2); font-size: 15.5px; }
ul li::before {
	content: ""; position: absolute; left: 2px; top: 9px;
	width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
ul li strong { color: var(--ink); }

.dots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.dots span {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 6px 12px; border-radius: var(--inner);
	font-size: 13.5px; color: var(--ink); background: var(--sunken);
}
.dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }

.shots figure { margin: 0; }
.shots img {
	width: 100%; height: auto; display: block;
	border-radius: 16px;
	box-shadow: 0 10px 26px var(--shadow);
	border: 1px solid var(--line);
}
.shots figcaption { margin-top: 8px; font-size: 13.5px; color: var(--ink3); }

/* ------------------------------------------------------- privacy: contents beside the text */
.doc { display: grid; grid-template-columns: 210px 1fr; gap: 42px; align-items: start; }
.toc {
	position: sticky;
	top: calc(var(--bar-h) + 22px);
	font-size: 14.5px;
}
.toc strong { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); margin-bottom: 10px; }
.toc a { display: block; padding: 5px 0; color: var(--ink2); text-decoration: none; border-left: 2px solid var(--line); padding-left: 12px; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }

.doc section { padding: 26px 0; }
.doc section:first-of-type { padding-top: 0; }

.facts { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 15px; }
.facts th, .facts td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { font-weight: 600; width: 34%; color: var(--ink); }
.facts td { color: var(--ink2); }
code { font-size: 0.92em; background: var(--sunken); padding: 1px 5px; border-radius: 5px; }

.note {
	background: var(--sunken);
	border-radius: var(--radius);
	padding: 16px 18px;
	margin: 16px 0 4px;
	font-size: 15px;
	color: var(--ink2);
}
.note strong { color: var(--ink); }

/* ------------------------------------------------------- support: answers folded away */
details {
	border-bottom: 1px solid var(--line);
	padding: 2px 0;
}
details summary {
	cursor: pointer;
	list-style: none;
	padding: 13px 28px 13px 0;
	font-weight: 600;
	font-size: 16px;
	position: relative;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
	content: "";
	position: absolute; right: 6px; top: 50%;
	width: 8px; height: 8px;
	border-right: 2px solid var(--ink3);
	border-bottom: 2px solid var(--ink3);
	transform: translateY(-70%) rotate(45deg);
	transition: transform 180ms ease;
}
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details p { margin: 0 0 14px; color: var(--ink2); font-size: 15.5px; }

/* ------------------------------------------------------- footer */
footer { border-top: 1px solid var(--line); padding: 24px 0 36px; font-size: 14px; color: var(--ink3); }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
footer a { color: var(--ink2); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ------------------------------------------------------- narrow screens */
@media (max-width: 860px) {
	.split, .pair { grid-template-columns: 1fr; gap: 24px; }
	.doc { grid-template-columns: 1fr; gap: 20px; }
	.toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
	.toc strong { width: 100%; margin-bottom: 4px; }
	.toc a { border-left: 0; background: var(--sunken); border-radius: var(--inner); padding: 6px 11px; font-size: 13.5px; }
	.trio { grid-template-columns: 1fr; }
	.shots.trio { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	section { padding: 30px 0; }
	.bar nav a { padding: 7px 10px; font-size: 14.5px; }
	.shots.trio { grid-template-columns: 1fr; }
	.facts th { width: auto; display: block; padding-bottom: 2px; border: 0; }
	.facts td { display: block; padding-top: 0; }
	.facts tr { display: block; border-bottom: 1px solid var(--line); padding: 9px 0; }
	.facts th, .facts td { border-bottom: 0; }
}
