/* CleanedIn landing page: one screen, the hero only. Light and dark follow the visitor's system setting. */

:root {
	--bg: #f6f7f9;
	--ink: #0e1116;
	--muted: #63666a;
	--line: color-mix(in oklab, var(--ink) 12%, transparent);
	--line-strong: color-mix(in oklab, var(--ink) 22%, transparent);
	--action: #0a5ad6;
	--action-ink: #ffffff;
	--frame: #c6d3df; /* the ground behind the demo window */

	--nav: 72px;
	--gut: 80px;
	--font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e1116;
		--ink: #eef0f3;
		--muted: #9a9ea4;
		--action: #2b6fe6;
		--frame: #1c2633;
		color-scheme: dark;
	}
}

@media (max-width: 1023px) {
	:root {
		--gut: 48px;
	}
}

@media (max-width: 639px) {
	:root {
		--nav: 56px;
		--gut: 24px;
	}
}

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

html,
body {
	margin: 0;
}

body {
	background: var(--bg);
	color: var(--ink);
	font: 400 16px/1.6 var(--font);
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

img,
video,
svg {
	display: block;
}

.wrap {
	width: min(100% - 2 * var(--gut), 1280px);
	margin-inline: auto;
}

:focus-visible {
	outline: 2px solid var(--action);
	outline-offset: 3px;
}

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

.skip-link {
	position: absolute;
	left: var(--gut);
	top: 12px;
	z-index: 20;
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--ink);
	color: var(--bg);
	font-weight: 500;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.nav {
	position: fixed;
	inset: 0 0 auto;
	z-index: 10;
	height: var(--nav);
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.nav .wrap {
	height: 100%;
	display: flex;
	align-items: center;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: var(--ink);
	font-size: 20px;
	font-weight: 500;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.logo img {
	width: 28px;
	height: 28px;
	border-radius: 7px;
}

/* ------------------------------------------------------------------ hero */

.hero {
	height: 100svh;
	min-height: 560px;
	padding: calc(var(--nav) + 48px) 0 64px;
	display: flex;
}

.hero > .wrap {
	display: flex;
	flex-direction: column;
}

.hero__text {
	display: grid;
	justify-items: center;
	gap: 16px;
	max-width: 880px;
	margin-inline: auto;
	text-align: center;
}

h1 {
	margin: 0;
	max-width: 16ch;
	font-size: clamp(40px, 3.048vw + 28.11px, 72px);
	font-weight: 500;
	line-height: 1.02;
	letter-spacing: -0.045em;
	text-wrap: balance;
}

.nowrap {
	white-space: nowrap;
}

.lead {
	margin: 0;
	max-width: 52ch;
	font-size: clamp(17px, 0.4vw + 15.5px, 20px);
	line-height: 1.5;
	text-wrap: pretty;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 12px;
}

/* ------------------------------------------------------------------ buttons: one shape, one hover, one press */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 999px;
	font: 500 16px/1 var(--font);
	white-space: nowrap;
	text-decoration: none;
	transition:
		background-color 160ms var(--ease),
		border-color 160ms var(--ease),
		transform 120ms var(--ease);
}

.btn img {
	width: 20px;
	height: 20px;
	flex: none;
}

.btn--primary {
	background: var(--action);
	color: var(--action-ink);
}

.btn--primary:hover {
	background: color-mix(in oklab, var(--action) 84%, var(--bg));
}

.btn--secondary {
	background: var(--bg);
	color: var(--ink);
	border-color: var(--line-strong);
}

.btn--secondary:hover {
	background: color-mix(in oklab, var(--bg) 92%, var(--ink));
	border-color: color-mix(in oklab, var(--ink) 32%, transparent);
}

@media (hover: hover) and (pointer: fine) {
	.btn:hover {
		transform: translateY(-1px);
	}
}

.btn:active {
	transform: translateY(1px) scale(0.985);
}

/* ------------------------------------------------------------------ the demo window */

.demo {
	position: relative;
	flex: 1 1 0;
	min-height: clamp(220px, 32svh, 340px);
	margin-top: 32px;
	overflow: hidden;
	border-radius: 24px;
	background: var(--frame);
	/* a short fade at the foot only, so the recording stays readable */
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
}

.browser {
	position: absolute;
	top: 32px;
	bottom: 0;
	left: 50%;
	width: min(880px, 100% - 64px);
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px 12px 0 0;
	background: #1b1d21;
	box-shadow:
		0 0 0 1px rgb(0 0 0 / 0.1),
		0 30px 70px -30px rgb(14 17 22 / 0.55);
}

.browser__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 36px;
	flex: none;
	padding: 0 14px;
	color: #c9cdd2;
	font-size: 12px;
	line-height: 1;
}

.browser__dots {
	display: flex;
	gap: 6px;
}

.browser__dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #3a3e43;
}

.browser__url {
	flex: 0 1 340px;
	height: 22px;
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-radius: 6px;
	background: #2a2d32;
}

.browser__url img {
	width: 12px;
	height: 12px;
}

.browser video {
	width: 100%;
	flex: 1 1 0;
	min-height: 0;
	object-fit: cover;
	object-position: top center;
	background: #1b1d21 url("media/poster.webp") top center / cover no-repeat;
}

.pause {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: var(--bg);
	color: var(--ink);
	cursor: pointer;
	box-shadow:
		0 1px 2px rgb(0 0 0 / 0.12),
		0 4px 12px -4px rgb(0 0 0 / 0.28);
}

/* a 44px hit area round the 32px disc */
.pause::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
}

.pause svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* ------------------------------------------------------------------ the hero's one entrance on load */

@media (prefers-reduced-motion: no-preference) {
	.hero__text > * {
		animation: enter 700ms var(--ease) both;
	}

	.hero__text > :nth-child(2) {
		animation-delay: 80ms;
	}

	.hero__text > :nth-child(3) {
		animation-delay: 160ms;
	}
}

@keyframes enter {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.btn {
		transition:
			background-color 160ms,
			border-color 160ms;
	}

	.btn:hover,
	.btn:active {
		transform: none;
	}
}

/* ------------------------------------------------------------------ phone: stacked, full-width buttons */

@media (max-width: 639px) {
	.hero {
		padding: calc(var(--nav) + 40px) 0 24px;
	}

	.actions {
		flex-direction: column;
		justify-self: stretch;
	}

	/* the pause disc sits over the bar's right end, so the address stops short of it */
	.browser__bar {
		padding-right: 44px;
	}

	.demo {
		min-height: 240px;
	}

	.browser {
		top: 16px;
		left: 16px;
		width: calc(100% - 32px);
		transform: none;
	}
}
