@font-face {
	font-family: 'Archivo';
	src: url('/assets/fonts/archivo-variable.woff2') format('woff2');
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
}

:root {
	/* Taken from the app icon: dark faceplate, cream knob, orange lamp. */
	--panel: #131315;
	--panel-raised: #1d1d20;
	--cream: #e9e3d8;
	--cream-high: #fbf8f2;
	--cream-low: #d4cdc0;
	--lamp: #ff6a2b;
	--unlit: #4a4a50;
	--muted: #a8a398;
	--hairline: rgba(233, 227, 216, 0.14);
	--measure: 36rem;
	--gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html {
	background: var(--panel);
	color: var(--cream);
	font-family: 'Archivo', system-ui, sans-serif;
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.6;
}

h1,
h2,
h3,
dt {
	text-wrap: balance;
	font-stretch: 125%;
	font-weight: 620;
	line-height: 1.08;
	letter-spacing: -0.015em;
	margin: 0;
}

h1 {
	font-size: clamp(2.5rem, 6.2vw, 4.75rem);
	line-height: 1;
	letter-spacing: -0.025em;
}

h2 {
	font-size: clamp(1.7rem, 3.2vw, 2.5rem);
}

p {
	margin: 0;
}

a {
	color: inherit;
	text-decoration-color: var(--lamp);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--cream-high);
}

:focus-visible {
	outline: 2px solid var(--lamp);
	outline-offset: 4px;
	border-radius: 4px;
}

.wrap {
	max-width: 76rem;
	margin: 0 auto;
	padding: 0 var(--gutter);
}

/* Masthead and footer */

.masthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	font-stretch: 125%;
	font-weight: 620;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
}

.brand img {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 22%;
	display: block;
}

.masthead nav,
.footer nav {
	display: flex;
	gap: 1.75rem;
	font-size: 1rem;
}

.masthead nav a,
.footer nav a {
	text-decoration: none;
	color: var(--muted);
}

.masthead nav a:hover,
.footer nav a:hover,
.masthead nav a[aria-current='page'] {
	color: var(--cream);
}

.footer {
	position: relative;
	padding-top: 2rem;
	padding-bottom: 3rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	justify-content: space-between;
	color: var(--muted);
	font-size: 1rem;
}

/* Hero */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(2rem, 6vw, 6rem);
	padding-top: clamp(2rem, 6vw, 5rem);
	padding-bottom: clamp(3rem, 8vw, 7rem);
}

.hero-copy {
	max-width: 38rem;
}

.hero-copy p {
	margin-top: 1.75rem;
	font-size: clamp(1.15rem, 1.6vw, 1.4rem);
	line-height: 1.5;
	color: var(--cream);
	max-width: 30rem;
}

.hero-copy .availability {
	margin-top: 2.25rem;
	font-size: 1rem;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 0.7rem;
}

.availability::before {
	content: '';
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background: var(--lamp);
	box-shadow: 0 0 0.9rem rgba(255, 106, 43, 0.7);
	flex: none;
}

/* Phone frame around a screenshot */

.phone {
	--w: min(18rem, 72vw);
	width: var(--w);
	margin: 0;
	padding: calc(var(--w) * 0.03);
	border-radius: calc(var(--w) * 0.17);
	background: #26262a;
	box-shadow:
		inset 0 0 0 1px #3d3d43,
		0 2.5rem 5rem rgba(0, 0, 0, 0.55);
}

.phone img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--w) * 0.14);
}

.hero .phone {
	--w: min(21rem, 72vw);
}

/* The rule instrument */

.section {
	position: relative;
	padding-top: clamp(3rem, 8vw, 7rem);
	padding-bottom: clamp(3rem, 8vw, 7rem);
}

/* Dividers line up with the text, not with the padded edge of the page. */
.section::before,
.footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: var(--gutter);
	right: var(--gutter);
	border-top: 1px solid var(--hairline);
}

.section-intro {
	max-width: 46rem;
}

.section-intro p {
	max-width: var(--measure);
	margin-top: 1.25rem;
	color: var(--muted);
}

.instrument {
	--angle: -27deg;
	--s: min(21rem, 78vw);
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: clamp(2rem, 6vw, 5rem);
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.dial {
	position: relative;
	width: var(--s);
	height: var(--s);
	padding: 0;
	border: 0;
	border-radius: 22%;
	background: linear-gradient(#232326, #0a0a0b);
	cursor: pointer;
	flex: none;
}

.dial .dot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--s) * 0.037);
	height: calc(var(--s) * 0.037);
	margin: calc(var(--s) * -0.0185) 0 0 calc(var(--s) * -0.0185);
	border-radius: 50%;
	background: var(--unlit);
	transform: rotate(calc(-135deg + var(--i) * 27deg))
		translateY(calc(var(--s) * -0.389));
	transition: background-color 0.25s;
}

.dial .knob {
	position: absolute;
	inset: 22.5%;
	border-radius: 50%;
	background: linear-gradient(var(--cream-high), var(--cream-low));
	box-shadow: 0 calc(var(--s) * 0.02) calc(var(--s) * 0.05)
		rgba(0, 0, 0, 0.6);
}

.dial .pointer {
	position: absolute;
	inset: 0;
	transform: rotate(var(--angle));
	transition: transform 0.45s cubic-bezier(0.3, 1.25, 0.5, 1);
}

.dial .pointer::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 12%;
	width: 8.2%;
	height: 17%;
	margin-left: -4.1%;
	border-radius: 999px;
	background: var(--lamp);
}

.instrument:has(#rule-latest1:checked) {
	--angle: -81deg;
}
.instrument:has(#rule-latest3:checked) {
	--angle: -27deg;
}
.instrument:has(#rule-everything:checked) {
	--angle: 27deg;
}
.instrument:has(#rule-in-order:checked) {
	--angle: 81deg;
}

.instrument:has(#rule-latest1:checked) .dot:nth-child(-n + 3),
.instrument:has(#rule-latest3:checked) .dot:nth-child(-n + 5),
.instrument:has(#rule-everything:checked) .dot:nth-child(-n + 7),
.instrument:has(#rule-in-order:checked) .dot:nth-child(-n + 9) {
	background: var(--lamp);
}

.rules {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.rules legend {
	padding: 0;
	color: var(--muted);
	font-size: 1rem;
}

.rule-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.6rem;
	margin-top: 0.9rem;
}

.rule-options label {
	position: relative;
	cursor: pointer;
}

.rule-options input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.rule-options span {
	display: block;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--hairline);
	color: var(--muted);
	font-stretch: 112%;
	font-weight: 520;
	font-size: 1rem;
	line-height: 1.3;
}

.rule-options input:checked + span {
	background: var(--cream);
	border-color: var(--cream);
	color: var(--panel);
}

.rule-options input:focus-visible + span {
	outline: 2px solid var(--lamp);
	outline-offset: 3px;
}

.readout {
	margin-top: 2rem;
	min-height: 17.5rem;
}

.readout > div {
	display: none;
}

.instrument:has(#rule-latest1:checked) .readout [data-rule='latest1'],
.instrument:has(#rule-latest3:checked) .readout [data-rule='latest3'],
.instrument:has(#rule-everything:checked) .readout [data-rule='everything'],
.instrument:has(#rule-in-order:checked) .readout [data-rule='in-order'] {
	display: block;
}

.readout p {
	max-width: 30rem;
}

.readout ol {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	max-width: 30rem;
	border-top: 1px solid var(--hairline);
}

.readout li {
	display: grid;
	grid-template-columns: 3.25rem 1fr;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--hairline);
}

.readout li b {
	font-weight: 400;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

/* Two more screens */

.screens {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(2.5rem, 6vw, 5rem);
	justify-items: center;
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.screens figure {
	margin: 0;
	display: grid;
	justify-items: center;
	gap: 1.75rem;
}

.screens figcaption {
	max-width: 22rem;
	text-align: center;
	color: var(--muted);
}

/* Plain facts */

.facts {
	margin: clamp(2.5rem, 5vw, 4rem) 0 0;
	border-top: 1px solid var(--hairline);
}

.facts > div {
	display: grid;
	grid-template-columns: minmax(0, 18rem) minmax(0, var(--measure));
	gap: 0.5rem 3rem;
	padding: 1.6rem 0;
	border-bottom: 1px solid var(--hairline);
}

.facts dt {
	font-size: 1.3rem;
}

.facts dd {
	margin: 0;
	color: var(--muted);
}

/* Privacy and support pages */

.prose {
	max-width: var(--measure);
	padding-top: clamp(2rem, 6vw, 5rem);
}

.prose h1 {
	font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.prose .updated {
	margin-top: 1rem;
	color: var(--muted);
	font-size: 1rem;
}

.prose h2 {
	font-size: 1.4rem;
	margin-top: 2.75rem;
}

.prose p {
	margin-top: 1rem;
}

.prose .lead {
	margin-top: 2rem;
	font-size: 1.3rem;
	line-height: 1.5;
}

@media (max-width: 52rem) {
	.hero {
		grid-template-columns: 1fr;
		justify-items: center;
	}

	.hero-copy {
		justify-self: start;
	}

	.instrument {
		grid-template-columns: 1fr;
		justify-items: start;
	}

	.dial {
		justify-self: center;
	}

	.screens {
		grid-template-columns: 1fr;
	}

	.facts > div {
		grid-template-columns: 1fr;
	}

	.readout {
		min-height: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dial .pointer,
	.dial .dot {
		transition: none;
	}
}
