@layer base, prose, components;

/* Base: tokens, reset, typography defaults. Light/dark follows the system. */
@layer base {
	:root {
		--gray-50: oklch(98.5% .003 60);
		--gray-100: oklch(97.1% .003 60);
		--gray-200: oklch(93.2% .003 60);
		--gray-300: oklch(87% .003 60);
		--gray-400: oklch(71.1% .003 60);
		--gray-500: oklch(54% .003 60);
		--gray-600: oklch(44.5% .003 60);
		--gray-700: oklch(37% .003 60);
		--gray-800: oklch(27.4% .003 60);
		--gray-900: oklch(23.2% .003 60);
		--gray-950: oklch(18.8% .003 60);
		--primary-50: oklch(97% .015 40);
		--primary-200: oklch(89% .06 40);
		--primary-300: oklch(82% .1 40);
		--primary-400: oklch(75% .14 40);
		--primary-500: oklch(68% .16 38);
		--primary-600: oklch(61% .17 36);
		--primary-700: oklch(54% .16 34);
		--amber-600: oklch(66.6% .179 58.318);
		--primary-text: light-dark(var(--gray-900), #fff);
		--body-text: light-dark(var(--gray-700), var(--gray-300));
		--secondary-text: light-dark(var(--gray-500), var(--gray-400));
		--link: light-dark(var(--primary-600), var(--primary-400));
		--separator: light-dark(color-mix(in oklch, var(--gray-200), var(--gray-100) 50%), var(--gray-800));
		--page-background: light-dark(#fff, oklch(15% .004 60));
		--card: light-dark(rgb(0 0 0 / 3.5%), rgb(255 255 255 / 6.5%));
		--card-hover: light-dark(color-mix(in oklab, var(--primary-500) 6%, transparent), rgb(255 255 255 / 9.5%));
		/* The site is always dark; light-dark() values resolve to their dark side. */
		color-scheme: dark;
		interpolate-size: allow-keywords;
		@media (prefers-contrast: more) {
			--body-text: light-dark(var(--gray-800), var(--gray-200));
			--secondary-text: light-dark(var(--gray-700), var(--gray-300));
			--link: light-dark(var(--primary-700), var(--primary-300));
			--separator: light-dark(var(--gray-500), var(--gray-400));
		}
	}
	*, ::before, ::after {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
		border: 0 solid;
	}
	html {
		line-height: 1.5;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
		-webkit-text-size-adjust: 100%;
		-webkit-tap-highlight-color: transparent;
		scroll-padding-top: 4.5rem;
		scrollbar-gutter: stable;
		font-size: clamp(1rem, .875rem + .15625vw, 1.0625rem);
		@media (prefers-reduced-motion: no-preference) {
			scroll-behavior: smooth;
		}
	}
	:focus-visible {
		outline: none;
	}
	body {
		color: light-dark(var(--gray-900), var(--gray-300));
		background-color: var(--page-background);
		overflow-x: clip;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
	h1, h2, h3, h4, h5, h6 {
		font-size: inherit;
		font-weight: inherit;
		text-wrap: balance;
	}
	p, li, dd, blockquote {
		text-wrap: pretty;
	}
	::selection {
		background-color: light-dark(color-mix(in oklab, var(--accent, var(--primary-500)) 22%, transparent), color-mix(in oklab, var(--accent, var(--primary-400)) 35%, transparent));
	}
	a {
		color: inherit;
		text-decoration: inherit;
	}
	b, strong {
		font-weight: bolder;
	}
	ol, ul, menu {
		list-style: none;
	}
	img, svg, video, canvas {
		display: block;
		vertical-align: middle;
	}
	img, video {
		height: auto;
		max-width: 100%;
	}
	button, input, select, optgroup, textarea {
		font: inherit;
		color: inherit;
		background-color: transparent;
	}
	button, label[for] {
		cursor: pointer;
	}
	[hidden] {
		display: none !important;
	}
}

/* Prose: the long-form part of an app page (notes, tips, FAQ, older versions) and simple pages. */
@layer prose {
	@scope (.prose) {
		:scope {
			max-width: 46.5rem;
			margin-inline: auto;
			padding-inline: 1.5rem;
			width: 100%;
			font-size: 1.125rem;
			line-height: 1.65;
			overflow-wrap: break-word;
			color: var(--body-text);
			:where(p, ul, ol) {
				margin: 1em 0;
			}
			:where(a) {
				color: var(--primary-text);
				font-weight: 500;
				text-decoration: underline;
				text-decoration-thickness: 2px;
				text-decoration-color: light-dark(color-mix(in oklab, oklch(from var(--accent, var(--primary-500)) min(l, 0.65) c h) 50%, transparent), color-mix(in oklab, var(--accent, var(--primary-400)) 55%, transparent));
				text-underline-offset: 4px;
				transition: text-decoration-color .15s;
				@media (hover: hover) {
					&:hover {
						text-decoration-color: light-dark(oklch(from var(--accent, var(--primary-500)) min(l, 0.6) c h), var(--accent, var(--primary-400)));
					}
				}
			}
			:where(strong) {
				color: var(--primary-text);
				font-weight: 600;
			}
			:where(h1, h2, h3, h4, h5, h6) {
				color: var(--primary-text);
				font-weight: 600;
			}
			:where(h1) {
				margin: 0 0 2.5rem;
				font-size: clamp(2.5rem, 6vw, 3.75rem);
				line-height: 1.04;
				font-weight: 700;
			}
			:where(h1:has(+ p)) {
				margin-bottom: .5rem;
			}
			:where(h1 + p) {
				margin: .5rem 0 2.5rem;
				font-size: 1.125rem;
				line-height: 1.55;
				color: var(--secondary-text);
			}
			:where(h2) {
				margin: 5rem 0 1.5rem;
				font-size: 1.6667em;
				line-height: 1.15;
				font-weight: 700;
			}
			:where(h3) {
				margin: 2.5rem 0 1rem;
				font-size: 1.2222em;
				line-height: 1.3;
			}
			:where(ul, ol) {
				padding-inline-start: 1.5556em;
			}
			:where(ul) {
				list-style-type: disc;
			}
			:where(ol) {
				list-style-type: decimal;
			}
			:where(li, li > :is(p, ul, ol)) {
				margin: .375em 0;
			}
			:where(li) {
				padding-inline-start: .4444em;
			}
			:where(ol > li)::marker {
				color: var(--gray-500);
			}
			:where(ul > li)::marker {
				color: light-dark(var(--gray-300), var(--gray-600));
			}
			:where(code) {
				font-size: .8889em;
				font-weight: 600;
				color: var(--primary-text);
				hyphens: none;
			}
			:where(:is(hr, h2, h3, h4, h5, h6) + *) {
				margin-top: 0;
			}
			& > :where(:first-child) {
				margin-top: 0;
			}
			& > :where(:last-child) {
				margin-bottom: 0;
			}
			kbd {
				font-family: inherit;
				font-size: .8em;
				background-color: light-dark(var(--gray-50), rgb(255 255 255 / 6%));
				color: var(--body-text);
				border: 1px solid light-dark(var(--gray-300), rgb(255 255 255 / 15%));
				box-shadow: inset 0 -1px 0 0 light-dark(var(--gray-300), rgb(255 255 255 / 15%));
				border-radius: 5px;
				padding: .1em .45em;
				margin-inline: .15em;
			}
		}
	}
	@scope (.prose-collapsible-sections) {
		:scope {
			display: flex;
			flex-direction: column;
			gap: .625rem;
			@media (width >= 48rem) {
				width: min(52rem, calc(100vw - 3rem));
				margin-inline: calc((100% - min(52rem, calc(100vw - 3rem))) * .5);
			}
			@media (width < 40rem) {
				gap: .2rem;
				margin-inline: -1.5rem;
			}
		}
	}
	@scope (.prose-collapsible-section) {
		:scope {
			background-color: rgb(255 255 255 / 5%);
			box-shadow: inset 0 0 0 1px light-dark(rgb(0 0 0 / 4%), rgb(255 255 255 / 6%));
			border-radius: 1.25rem;
			@supports (interpolate-size: allow-keywords) {
				&::details-content {
					overflow: hidden;
					height: 0;
					transition: height .25s, content-visibility .25s allow-discrete;
				}
				&:open {
					&::details-content {
						height: auto;
					}
				}
			}
			@media (width < 40rem) {
				border-radius: 0;
			}
			&:target {
				animation: prose-target-highlight 2s ease-out;
			}
		}
	}
	@scope (.prose-collapsible-summary) {
		:scope {
			padding: 1rem 1.5rem;
			border-radius: 1.25rem;
			display: flex;
			align-items: center;
			position: relative;
			font-weight: 600;
			color: var(--primary-text);
			cursor: pointer;
			-webkit-user-select: none;
			user-select: none;
			list-style: none;
			transition: background-color .15s;
			&::-webkit-details-marker {
				display: none;
			}
			@media (width < 40rem) {
				border-radius: 0;
			}
			@media (hover: hover) {
				&:hover {
					background-color: var(--card-hover);
				}
			}
		}
	}
	@scope (.prose-collapsible-title) {
		:scope {
			flex: 1;
			min-width: 0;
			margin: 0;
			font: inherit;
			color: inherit;
			text-wrap: inherit;
			translate: 0 -1px;
		}
	}
	@scope (.prose-collapsible-chevron) {
		:scope {
			display: inline-flex;
			align-items: center;
			flex-shrink: 0;
			margin-inline-start: .5rem;
			&::after {
				content: "";
				width: .5rem;
				height: .5rem;
				border-bottom: 2px solid light-dark(var(--gray-400), var(--gray-500));
				border-inline-end: 2px solid light-dark(var(--gray-400), var(--gray-500));
				rotate: -45deg;
				transition: rotate .2s;
			}
			details:open > * > &::after {
				rotate: 45deg;
			}
		}
	}
	@scope (.prose-collapsible-content) {
		:scope {
			padding: .625rem 1.5rem 1.25rem;
			& > :first-child {
				margin-top: 0;
			}
			& > :last-child {
				margin-bottom: 0;
			}
		}
	}
	@scope (.prose-collapsible-more-link) {
		:scope {
			padding: 1rem 1.5rem;
			border-radius: 1.25rem;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: .625rem;
			box-shadow: inset 0 0 0 1px var(--separator);
			font-weight: 500;
			color: var(--secondary-text);
			text-decoration: none;
			transition: color .15s, background-color .15s;
			@media (width < 40rem) {
				border-radius: 0;
			}
			&::after {
				content: "→";
			}
			@media (hover: hover) {
				&:hover {
					background-color: var(--card);
					color: var(--primary-text);
				}
			}
		}
	}
	@scope (.prose-anchored-heading) {
		:scope {
			position: relative;
			&:target {
				animation: prose-target-highlight 2s ease-out;
			}
		}
	}
	@scope (.prose-anchored-section) {
		:scope {
			position: relative;
			& > .prose-heading-anchor {
				bottom: auto;
				height: calc(1lh + 2rem);
				@media (width < 40rem) {
					inset-inline-start: 0;
				}
			}
		}
	}
	@scope (.prose-heading-anchor) {
		:scope {
			position: absolute;
			top: 0;
			bottom: 0;
			inset-inline-start: -28px;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 24px;
			opacity: 0;
			color: var(--gray-400);
			pointer-events: none;
			transition: opacity .15s, color .15s;
			@media (width < 40rem) {
				inset-inline-start: -24px;
			}
			&::before {
				content: "";
				position: absolute;
				inset: -8px;
			}
			@media (hover: hover) {
				:where(.prose-anchored-heading:hover, .prose-anchored-section:hover) > & {
					opacity: .6;
				}
				:is(.prose-anchored-heading, .prose-anchored-section):hover > & {
					pointer-events: auto;
				}
				&:hover {
					opacity: 1;
					color: var(--primary-500);
				}
			}
			&:focus-visible {
				opacity: 1;
				pointer-events: auto;
				color: var(--primary-500);
			}
			&[data-state="copied"] {
				opacity: 1;
				color: var(--primary-500);
				pointer-events: none;
				.prose-heading-anchor-link-icon {
					display: none;
				}
				.prose-heading-anchor-check-icon {
					display: block;
				}
			}
			&[data-state="hidden"] {
				opacity: 0;
				pointer-events: none;
			}
		}
	}
	@scope (.prose-heading-anchor-check-icon) {
		:scope {
			display: none;
		}
	}
	@keyframes prose-target-highlight {
		from {
			background-color: color-mix(in oklab, var(--accent, var(--primary-400)) 22%, transparent);
		}
	}
}

@layer components {
	.visually-hidden {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip-path: inset(50%);
		text-wrap: nowrap;
		border: 0;
	}

	/* Buttons */
	.button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: .5rem;
		border-radius: .625rem;
		text-align: center;
		text-wrap: nowrap;
		-webkit-user-select: none;
		user-select: none;
		color: #fff;
		text-decoration: none;
		transition: background-color .15s, box-shadow .15s;
	}
	/* Primary: off-white on graphite. The page's one accent stays for state, not buttons. */
	.button-primary {
		border: 1px solid transparent;
		color: var(--gray-950);
		background-color: var(--gray-100);
		box-shadow: inset 0 -1px 0 rgb(0 0 0 / 12%);
		transition: background-color .15s, translate .15s;
		@media (hover: hover) {
			&:hover {
				background-color: #fff;
			}
		}
		&:active {
			translate: 0 1px;
		}
	}
	/* Secondary: clear with a hairline outline. */
	.button-secondary {
		border: 1px solid rgb(255 255 255 / 18%);
		color: var(--primary-text);
		background-color: transparent;
		@media (hover: hover) {
			&:hover {
				background-color: rgb(255 255 255 / 6%);
				border-color: rgb(255 255 255 / 28%);
			}
		}
	}
	.button-small {
		padding: .4375rem 1.125rem;
		font-size: .875rem;
		line-height: 1.5;
		font-weight: 600;
	}

	/* App page */
	.app-page {
		padding-block: 2rem 4rem;
		@media (width >= 64rem) {
			padding-top: 3.5rem;
		}
	}
	.app-page-article {
		& > * + * {
			margin-top: 6rem;
			@media (width >= 48rem) {
				margin-top: 8rem;
			}
		}
	}
	/* Section headings outside running prose: Tips, FAQ. */
	.app-section-title {
		margin: 0 0 2rem;
		font-size: clamp(1.75rem, 3.5vw, 2.25rem);
		line-height: 1.15;
		font-weight: 700;
		color: var(--primary-text);
	}
	@keyframes app-rise {
		from {
			opacity: 0;
			translate: 0 1.25rem;
		}
	}

	/* Site header: a floating glass pill that fills in once the page scrolls */
	.site-header {
		display: contents;
	}
	.site-header-header {
		anchor-name: --site-header;
		position: sticky;
		top: .5rem;
		z-index: 40;
		width: min(100% - 1rem, 72rem);
		margin: .5rem auto 0;
		border-radius: 1rem;
		background-color: color-mix(in oklab, var(--page-background) 80%, transparent);
		backdrop-filter: blur(20px) saturate(1.6);
		box-shadow: 0 0 0 1px light-dark(rgb(0 0 0 / 6%), rgb(255 255 255 / 8%)), 0 8px 24px -12px light-dark(oklch(25% .05 264 / 25%), rgb(0 0 0 / 60%));
		@supports (animation-timeline: scroll()) {
			animation: site-header-fill linear both;
			animation-timeline: scroll();
			animation-range: 0 3rem;
		}
		@media (prefers-reduced-transparency: reduce) {
			background-color: var(--page-background);
			backdrop-filter: none;
		}
	}
	@keyframes site-header-fill {
		from {
			background-color: transparent;
			backdrop-filter: blur(0) saturate(1);
			box-shadow: 0 0 0 1px transparent, 0 8px 24px -12px transparent;
		}
	}
	.site-header-navigation {
		max-width: 72rem;
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
		height: 3.25rem;
		padding-inline: .5rem;
		@media (width >= 48rem) {
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
		}
	}
	.site-header-navigation-replaced-by-app {
		@media (width >= 48rem) {
			visibility: hidden;
		}
	}
	.site-header-top {
		display: flex;
		justify-content: space-between;
	}
	.site-header-brand {
		display: flex;
		align-items: center;
		gap: .625rem;
		margin-inline-start: .25rem;
		font-size: 1.0625rem;
		line-height: 1.5;
		font-weight: 650;
		text-wrap: nowrap;
		color: var(--primary-text);
	}
	.site-header-menu-toggle {
		display: inline-flex;
		align-items: center;
		padding: .375rem;
		border-radius: 9999px;
		color: var(--secondary-text);
		transition: background-color .15s, color .15s;
		margin-inline-start: .375rem;
		@media (pointer: coarse) {
			padding: .75rem;
			margin: -.125rem;
		}
		@media (hover: hover) {
			&:hover {
				background-color: var(--card);
				color: var(--primary-text);
			}
		}
		@media (width >= 48rem) {
			display: none;
		}
	}
	.site-header-menu-icon {
		display: flex;
		.site-header-navigation:has(.site-header-menu:popover-open) & {
			display: none;
		}
	}
	.site-header-close-icon {
		display: none;
		.site-header-navigation:has(.site-header-menu:popover-open) & {
			display: flex;
		}
	}
	.site-header-menu {
		align-items: flex-start;
		inset: auto;
		margin: 0;
		padding-inline: 1rem;
		padding-bottom: .75rem;
		color: var(--secondary-text);
		background-color: var(--page-background);
		&:popover-open {
			display: flex;
			position: fixed;
			inset: 0;
			top: anchor(--site-header bottom);
			width: auto;
			height: auto;
		}
		@media (width >= 48rem) {
			display: flex;
			align-items: center;
			position: static;
			padding: 0;
			background-color: transparent;
			overflow: visible;
		}
	}
	.site-header-links {
		display: flex;
		flex-direction: column;
		gap: .5rem;
		width: 100%;
		padding-top: 2rem;
		font-size: 2.25rem;
		line-height: 1.1111;
		@media (width >= 48rem) {
			flex-direction: row;
			align-self: center;
			gap: .25rem;
			width: auto;
			padding-top: 0;
			font-size: .875rem;
			line-height: 1.5;
		}
	}
	.site-header-link {
		display: flex;
		align-items: center;
		padding: .75rem .5rem;
		font-weight: 500;
		transition: color .15s, background-color .15s;
		@media (hover: hover) {
			&:hover {
				color: var(--primary-text);
			}
		}
		&[aria-current] {
			color: var(--primary-text);
		}
		@media (width >= 48rem) {
			padding: .375rem .75rem;
			border-radius: .5rem;
			@media (hover: hover) {
				&:hover {
					color: var(--primary-text);
					background-color: var(--card);
				}
			}
			&[aria-current] {
				color: var(--primary-text);
				background-color: var(--card-hover);
			}
		}
	}
	.site-header-mobile-only {
		@media (width >= 48rem) {
			display: none;
		}
	}
	.site-header-icon-links {
		display: flex;
		align-items: center;
		align-self: center;
		margin-inline-start: .5rem;
		@media (width < 48rem) {
			display: none;
		}
	}
	.icon-link {
		display: inline-flex;
		align-items: center;
		padding: .375rem;
		border-radius: 9999px;
		color: var(--secondary-text);
		transition: background-color .15s, color .15s;
		@media (pointer: coarse) {
			padding: .75rem;
			margin: -.125rem;
		}
		@media (hover: hover) {
			&:hover {
				background-color: var(--card);
				color: var(--primary-text);
			}
		}
		&[aria-current] {
			background-color: var(--card-hover);
			color: var(--primary-text);
		}
	}

	/* App navigation, shown in place of the site navigation on app pages */
	.app-secondary-navigation {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		max-width: 72rem;
		margin: 0 auto;
		padding: .375rem .5rem .375rem .75rem;
		color: light-dark(var(--gray-600), var(--gray-200));
		@media (width < 48rem) {
			justify-content: flex-end;
			padding-inline-end: 4.25rem;
			pointer-events: none;
		}
	}
	.app-secondary-navigation-identity {
		display: flex;
		align-items: center;
		gap: .625rem;
		flex-shrink: 0;
		@media (width < 48rem) {
			display: none;
		}
	}
	.app-secondary-navigation-name {
		display: inline;
		font-size: 1.0625rem;
		line-height: 1.5;
		font-weight: 650;
		text-wrap: nowrap;
		color: var(--primary-text);
		@media (width >= 48rem) and (width < 64rem) {
			display: none;
		}
	}
	.app-secondary-navigation-links {
		display: flex;
		align-items: center;
		gap: .25rem;
	}
	.app-secondary-navigation-link {
		display: flex;
		align-items: center;
		text-wrap: nowrap;
		padding: .375rem .75rem;
		border-radius: .5rem;
		font-weight: 500;
		transition: color .15s, background-color .15s;
		@media (hover: hover) {
			&:hover {
				color: var(--primary-text);
				background-color: var(--card);
			}
		}
		&[aria-current] {
			color: var(--primary-text);
			background-color: color-mix(in oklab, var(--accent, var(--primary-500)) 16%, transparent);
		}
		@media (width < 48rem) {
			display: none;
		}
	}
	.app-secondary-navigation-overflow {
		display: flex;
		padding-inline: 1rem;
		--overflow-menu-color: light-dark(var(--gray-600), var(--gray-200));
		@media (width < 48rem) {
			display: none;
		}
	}
	.app-secondary-navigation-get-button {
		position: relative;
		z-index: 10;
		margin-inline-start: 1rem;
		pointer-events: auto;
	}

	/* App icon */
	.app-icon {
		display: inline-block;
		vertical-align: top;
	}
	.app-icon-image {
		display: block;
		height: auto;
		max-width: 100%;
		margin: 0;
		clip-path: inset(1.2% round 22.5%);
	}

	/* Overflow menu: an icon button that opens a popover menu */
	.overflow-menu {
		display: contents;
	}
	.overflow-menu-container {
		position: relative;
		display: flex;
		align-items: center;
		padding-top: 2px;
		border-radius: .625rem;
		.icon {
			pointer-events: none;
			color: var(--overflow-menu-color, var(--link));
		}
		@media (pointer: coarse) {
			padding: .75rem;
			margin: -.75rem;
		}
	}
	.overflow-menu-button {
		display: flex;
		align-items: center;
		padding: 0;
		border: 0;
		border-radius: inherit;
		background: none;
		cursor: pointer;
		color: inherit;
	}
	.overflow-menu-popover {
		position: fixed;
		inset: auto;
		margin: 0;
		min-width: 12rem;
		padding: .375rem;
		border: 0;
		border-radius: .75rem;
		background-color: light-dark(#fff, var(--gray-900));
		box-shadow: 0 16px 40px -16px light-dark(oklch(25% .05 264 / 30%), rgb(0 0 0 / 70%)), 0 0 0 1px light-dark(rgb(0 0 0 / 8%), rgb(255 255 255 / 10%));
		font-size: .875rem;
		line-height: 1.5;
		font-weight: 500;
		text-align: start;
		&:popover-open {
			display: flex;
			flex-direction: column;
		}
	}
	.overflow-menu-item {
		display: block;
		padding: .375rem .75rem;
		border: 0;
		border-radius: .5rem;
		background: none;
		font: inherit;
		text-align: inherit;
		text-decoration: none;
		cursor: pointer;
		color: var(--primary-text);
		&:hover, &:focus-visible {
			outline: none;
			background-color: var(--card-hover);
		}
	}
	.overflow-menu-separator {
		margin: .25rem .75rem;
		border: 0;
		border-top: 1px solid var(--separator);
	}

	/* Hero: copy on the left, the app on the right running off the window edge */
	.app-hero {
		display: grid;
		gap: 3rem;
		align-items: center;
		max-width: 72rem;
		margin-inline: auto;
		padding-inline: 1.5rem;
		@media (width >= 64rem) {
			grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
			gap: 4rem;
		}
	}
	.app-hero-text {
		@media (prefers-reduced-motion: no-preference) {
			animation: app-rise .7s cubic-bezier(.16, 1, .3, 1) both;
		}
	}
	.app-hero-identity {
		display: flex;
		align-items: center;
		gap: .625rem;
		margin-bottom: 1.5rem;
		font-size: .9375rem;
		line-height: 1.5;
		font-weight: 600;
		color: var(--secondary-text);
		.app-icon {
			width: 2rem;
			height: 2rem;
		}
	}
	.app-hero-title {
		/* Two lines beside the screenshot on desktop. */
		font-size: clamp(2.125rem, 5vw, 2.5rem);
		line-height: 1.05;
		font-weight: 700;
		color: var(--primary-text);
		text-wrap: balance;
	}
	.app-hero-introduction {
		max-width: 30rem;
		margin-top: 1.25rem;
		font-size: 1.125rem;
		line-height: 1.55;
		color: var(--secondary-text);
		text-wrap: pretty;
	}
	.app-hero-actions {
		display: flex;
		align-items: center;
		gap: 1rem;
		margin-top: 2rem;
	}
	.app-hero-price {
		font-size: .9375rem;
		line-height: 1.5;
		color: var(--secondary-text);
	}
	.app-hero-media {
		margin: 0;
		@media (prefers-reduced-motion: no-preference) {
			animation: app-rise .9s .12s cubic-bezier(.16, 1, .3, 1) both;
		}
	}
	.app-hero-image {
		display: block;
		width: 100%;
		height: auto;
		border-radius: 1rem;
		box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), 0 30px 60px -30px rgb(0 0 0 / 80%);
	}
	.app-hero-dialog {
		margin: auto;
		max-width: 18rem;
		padding: 1.5rem;
		border-radius: 1rem;
		background-color: var(--gray-900);
		box-shadow: 0 16px 40px -16px rgb(0 0 0 / 70%), 0 0 0 1px rgb(255 255 255 / 10%);
		font-size: .875rem;
		line-height: 1.5;
		color: var(--secondary-text);
		text-align: center;
		&:popover-open {
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: 1rem;
		}
		&::backdrop {
			background-color: rgb(0 0 0 / 40%);
		}
	}
	.app-hero-share-title {
		font-weight: 600;
		color: var(--primary-text);
	}
	.app-hero-share-buttons {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: .5rem;
	}

	/* App Store badge, shown as Apple supplies it */
	.download-options-badge {
		display: block;
		flex-shrink: 0;
		-webkit-user-select: none;
		user-select: none;
		transition: scale .2s, filter .2s;
		@media (hover: hover) {
			&:hover {
				filter: brightness(1.15);
			}
		}
		&:active {
			scale: .985;
		}
	}
	.download-options-badge-image {
		display: block;
		height: 52px;
		width: auto;
		-webkit-user-select: none;
		user-select: none;
	}

	/* Copy button */
	.copy-button-labels {
		display: grid;
	}
	.copy-button-label {
		grid-area: 1 / 1;
		transition: opacity .15s;
		[data-state="copied"] & {
			opacity: 0;
		}
	}
	.copy-button-checkmark {
		grid-area: 1 / 1;
		display: flex;
		align-items: center;
		justify-content: center;
		opacity: 0;
		scale: .5;
		transition: opacity .25s cubic-bezier(.34, 1.56, .64, 1), scale .25s cubic-bezier(.34, 1.56, .64, 1);
		svg {
			stroke-width: 2.75;
		}
		[data-state="copied"] & {
			opacity: 1;
			scale: 1;
		}
	}

	/* Feature tiles: two half-width tiles, then a full-width banner */
	.app-features {
		display: grid;
		gap: 1rem;
		max-width: 72rem;
		margin-inline: auto;
		padding-inline: 1.5rem;
		@media (width >= 48rem) {
			grid-template-columns: repeat(12, minmax(0, 1fr));
		}
	}
	.app-feature {
		display: flex;
		flex-direction: column;
		margin: 0;
		overflow: hidden;
		border-radius: 1rem;
		background-color: rgb(255 255 255 / 4%);
		box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%);
		@supports (animation-timeline: view()) {
			@media (prefers-reduced-motion: no-preference) {
				animation: app-rise linear both;
				animation-timeline: view();
				animation-range: entry 0% entry 45%;
			}
		}
		@media (width >= 48rem) {
			grid-column: span 12;
		}
	}
	.app-feature-wide, .app-feature-narrow {
		@media (width >= 48rem) {
			grid-column: span 6;
		}
	}
	.app-feature-text {
		padding: 1.75rem;
	}
	.app-feature-title {
		font-size: 1.25rem;
		line-height: 1.3;
		font-weight: 600;
		color: var(--primary-text);
	}
	.app-feature-description {
		max-width: 32rem;
		margin-top: .5rem;
		font-size: 1rem;
		line-height: 1.55;
		color: var(--secondary-text);
		text-wrap: pretty;
	}
	.app-feature-image {
		display: block;
		/* Tucked into the bottom-right corner of the tile, whole: the screenshots come cropped to the panel. */
		width: calc(100% - 1.75rem);
		height: auto;
		margin: auto 0 0 auto;
		border-start-start-radius: .75rem;
		box-shadow: 0 0 0 1px rgb(255 255 255 / 8%);
	}
	.app-feature-banner {
		@media (width >= 48rem) {
			flex-direction: row;
			.app-feature-text {
				display: flex;
				flex-direction: column;
				justify-content: center;
				flex: 0 0 36%;
				padding: 2.5rem;
			}
			.app-feature-image {
				flex: 1;
				align-self: flex-end;
				width: auto;
				min-width: 0;
				margin-top: 2.5rem;
			}
		}
	}

	/* Tips: a shortcut sheet led by the keys */
	.app-tips, .app-faq {
		max-width: 72rem;
		padding-inline: 1.5rem;
	}
	.app-tips-grid {
		display: grid;
		gap: 2rem;
		margin: 0;
		@media (width >= 48rem) {
			grid-template-columns: repeat(2, minmax(0, 1fr));
			gap: 2.5rem 4rem;
		}
	}
	.app-tip {
		display: grid;
		grid-template-columns: 6.5rem minmax(0, 1fr);
		gap: 1.25rem;
		align-items: start;
	}
	.app-tip-keys {
		display: flex;
		gap: .375rem;
		margin: 0;
	}
	.app-tip-key {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 2.75rem;
		height: 2.75rem;
		margin: 0;
		padding: 0 .75rem;
		border: 1px solid rgb(255 255 255 / 12%);
		border-radius: .625rem;
		font: inherit;
		font-size: .9375rem;
		font-weight: 500;
		line-height: 1;
		color: var(--primary-text);
		background-color: rgb(255 255 255 / 5%);
		box-shadow: inset 0 -2px 0 rgb(255 255 255 / 6%), 0 1px 0 rgb(0 0 0 / 40%);
	}
	.app-tip-text {
		margin: 0;
		font-size: 1rem;
		line-height: 1.55;
		color: var(--secondary-text);
	}
	.app-tip-label {
		display: block;
		margin-bottom: .25rem;
		font-weight: 600;
		color: var(--primary-text);
	}
	.app-tips-note {
		max-width: 46rem;
		margin: 2.5rem 0 0;
		font-size: 1rem;
		line-height: 1.55;
		color: var(--secondary-text);
		strong {
			color: var(--primary-text);
		}
	}

	/* FAQ: the heading holds its column while the questions run as a hairline list */
	.app-faq {
		@media (width >= 64rem) {
			display: grid;
			grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
			gap: 4rem;
			align-items: start;
		}
	}
	.app-faq-title {
		@media (width >= 64rem) {
			position: sticky;
			top: 6rem;
			margin: 0;
		}
	}
	.app-faq-list {
		gap: 0;
		width: auto;
		margin: 0;
		border-top: 1px solid var(--separator);
		@media (width >= 48rem) {
			width: auto;
			margin-inline: 0;
		}
		.prose-collapsible-section {
			border-bottom: 1px solid var(--separator);
			border-radius: 0;
			background-color: transparent;
			box-shadow: none;
		}
		.prose-collapsible-summary {
			padding: 1.25rem 0;
			border-radius: 0;
			@media (hover: hover) {
				&:hover {
					background-color: transparent;
					color: var(--accent, var(--primary-400));
				}
			}
		}
		/* A plus that turns into a minus. */
		.prose-collapsible-chevron {
			position: relative;
			width: .875rem;
			height: .875rem;
			margin-inline-start: 1rem;
			&::before, &::after {
				content: "";
				position: absolute;
				inset: 50% 0 auto;
				height: 1.5px;
				width: auto;
				margin-top: -.75px;
				border: 0;
				background-color: var(--secondary-text);
				rotate: 0deg;
				transition: rotate .2s;
			}
			&::after {
				rotate: 90deg;
			}
		}
		details:open > * > .prose-collapsible-chevron::after {
			rotate: 0deg;
		}
		.prose-collapsible-content {
			padding: 0 0 1.5rem;
			color: var(--secondary-text);
		}
	}

	/* Reviews */
	.section-label {
		margin-bottom: 1.5rem;
		font-size: 1.125rem;
		line-height: 1.55;
		color: var(--secondary-text);
		font-weight: 600;
		text-align: center;
	}
	.app-reviews {
		max-width: 48rem;
		margin-inline: auto;
		padding-inline: 1.5rem;
	}
	.app-reviews-more-link {
		margin-top: 1.5rem;
		text-align: center;
		font-weight: 600;
		color: var(--link);
	}
	.quote-grid {
		display: grid;
		gap: 1.25rem;
		@media (width >= 40rem) {
			&:has(> :nth-child(2)) {
				grid-template-columns: repeat(2, minmax(0, 1fr));
			}
			& > :last-child:nth-child(odd):not(:first-child) {
				grid-column: span 2 / span 2;
				width: calc((100% - 1.25rem) * .5);
				margin-inline: auto;
			}
		}
	}
	.quote-figure {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: .75rem;
		margin: 0;
		padding: 1.5rem;
		background-color: var(--card);
		border-radius: 1.5rem;
		box-shadow: inset 0 0 0 1px light-dark(rgb(0 0 0 / 4%), rgb(255 255 255 / 6%));
		overflow-wrap: anywhere;
		p, img, figcaption {
			margin: 0;
		}
	}
	.quote-figure-text {
		margin: 0;
		padding: 0;
		border: none;
		font-style: normal;
		quotes: none;
		font-size: 1rem;
		line-height: 1.55;
		color: var(--primary-text);
	}
	.quote-figure-review-title {
		margin-bottom: .25rem;
		font-weight: 600;
	}
	.quote-figure-review-text {
		white-space: pre-line;
	}
	.quote-figure-source {
		font-size: .8125rem;
		line-height: 1.5;
		font-weight: 500;
		color: var(--secondary-text);
	}
	.star-rating {
		display: flex;
		gap: .125rem;
		color: light-dark(var(--amber-600), #ff9500);
	}

	/* Closing call to action: one band, words left, badge right */
	.app-call-to-action {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 1.5rem 2rem;
		width: min(100% - 3rem, 69rem);
		margin-inline: auto;
		padding: 2.5rem;
		border-radius: 1rem;
		background-color: rgb(255 255 255 / 4%);
		box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%);
		@media (width < 40rem) {
			padding: 2rem 1.5rem;
		}
	}
	.app-call-to-action-title {
		font-size: clamp(1.75rem, 3.5vw, 2.25rem);
		line-height: 1.15;
		font-weight: 700;
		color: var(--primary-text);
	}
	.app-call-to-action-subtitle {
		margin-top: .375rem;
		font-size: 1rem;
		line-height: 1.5;
		color: var(--secondary-text);
	}

	/* Simple pages: privacy policy, 404 */
	.prose-page {
		max-width: 46.5rem;
		margin-inline: auto;
		padding-block: 2rem 6rem;
		@media (width >= 40rem) {
			padding-block: 4rem 8rem;
		}
		@media (width >= 64rem) {
			padding-block: 5rem 9rem;
		}
		@media (width >= 48rem) {
			min-height: 100svh;
		}
	}
	.prose-page-header {
		margin-bottom: 2.5rem;
		padding-inline: 1.5rem;
	}
	.prose-page-back-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 1lh;
		margin-bottom: 1.5rem;
	}
	.page-header-title {
		font-size: clamp(2.5rem, 6vw, 3.75rem);
		line-height: 1.04;
		font-weight: 700;
		color: var(--primary-text);
	}
	.back-link {
		font-size: .875rem;
		line-height: 1.5;
		color: var(--secondary-text);
		font-weight: 500;
		transition: color .15s;
		@media (hover: hover) {
			&:hover {
				color: var(--primary-text);
			}
		}
	}
	.privacy-policy-page-contact {
		padding-top: 5rem;
		font-size: .875rem;
		line-height: 1.5;
	}

	/* Contact page: a paint swatch whose color follows the pointer */
	.contact-page {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 2.5rem;
		min-height: calc(100dvh - 4rem);
		padding: 4rem 1rem 6rem;
		text-align: center;
		@media (width >= 48rem) {
			padding-top: 6rem;
		}
	}
	.contact-page-intro {
		max-width: 32rem;
	}
	.contact-page-title {
		margin-bottom: .75rem;
		font-size: clamp(2rem, 6vw, 3rem);
		line-height: 1.1;
		font-weight: 700;
		color: var(--primary-text);
	}
	.contact-page-lede {
		font-size: 1.0625rem;
		line-height: 1.55;
		color: var(--secondary-text);
		text-wrap: pretty;
	}
	.contact-page-swatch {
		width: min(100%, 22rem);
		margin: 0;
		overflow: hidden;
		border-radius: 1.25rem;
		background-color: light-dark(#fff, var(--gray-900));
		box-shadow: 0 24px 48px -20px light-dark(oklch(25% .05 264 / 35%), rgb(0 0 0 / 75%)), 0 0 0 1px light-dark(rgb(0 0 0 / 8%), rgb(255 255 255 / 10%));
		text-align: start;
		rotate: -2deg;
		--swatch: #F0866A;
	}
	.contact-page-swatch-color {
		aspect-ratio: 4 / 3;
		background-color: var(--swatch);
		@media (prefers-reduced-motion: no-preference) {
			transition: background-color .25s;
		}
	}
	.contact-page-swatch-label {
		display: grid;
		gap: .125rem;
		padding: 1rem 1.25rem 1.25rem;
	}
	.contact-page-swatch-brand {
		font-size: .75rem;
		line-height: 1.3333;
		font-weight: 600;
		color: var(--secondary-text);
	}
	.contact-page-swatch-email {
		font-size: 1.125rem;
		line-height: 1.4;
		font-weight: 600;
		overflow-wrap: anywhere;
		color: var(--primary-text);
		text-decoration: none;
		@media (hover: hover) {
			&:hover {
				text-decoration: underline;
				text-decoration-color: var(--swatch);
				text-decoration-thickness: 2px;
				text-underline-offset: 4px;
			}
		}
	}
	.contact-page-swatch-code {
		font-family: ui-monospace, "SF Mono", Menlo, monospace;
		font-size: .8125rem;
		line-height: 1.5;
		color: var(--secondary-text);
		font-variant-numeric: tabular-nums;
	}
	.contact-page-actions {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: .75rem;
	}
	.contact-page-notes {
		display: flex;
		flex-direction: column;
		gap: .25rem;
		font-size: .875rem;
		line-height: 1.5;
		color: var(--secondary-text);
	}
	.contact-page-notes-link {
		color: var(--primary-text);
		font-weight: 500;
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: 3px;
	}

	/* Site footer: one slim row */
	.site-footer {
		border-top: 1px solid var(--separator);
	}
	.site-footer-content {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 1rem 2rem;
		max-width: 72rem;
		margin: 0 auto;
		padding: 2rem 1.5rem;
	}
	.site-footer-brand {
		display: flex;
		align-items: center;
		gap: .5rem;
		font-size: .9375rem;
		line-height: 1.5;
		font-weight: 600;
		color: var(--primary-text);
		.app-icon {
			width: 1.25rem;
			height: 1.25rem;
		}
	}
	.site-footer-links {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: .5rem 1.5rem;
	}
	.site-footer-link {
		display: inline-flex;
		align-items: center;
		gap: .375rem;
		font-size: .875rem;
		line-height: 1.5;
		color: var(--secondary-text);
		transition: color .15s;
		@media (hover: hover) {
			&:hover {
				color: var(--primary-text);
			}
		}
	}
	.site-footer-quote {
		flex-basis: 100%;
		font-size: .75rem;
		line-height: 1.3333;
		color: var(--secondary-text);
	}
}
