:root {
	--background: #141415;
	--foreground: #d0cecd;
	--muted: #979592;
	--border: #212121;
	--surface: #1c1c1d;
	--surface-hover: #272728;
	--primary: #d0cecd;
	--primary-foreground: #141415;

	--sans: "Work Sans", ui-sans-serif, system-ui, sans-serif;
	--logo: "Funnel Display", var(--sans);
	--mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root {
		--background: #fff;
		--foreground: #141415;
		--muted: #676665;
		--border: #e6e6e6;
		--surface: #f4f4f4;
		--surface-hover: #e8e8e8;
		--primary: #141415;
		--primary-foreground: #fff;

		color-scheme: light;
	}
}

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

html {
	height: 100%;
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--background);
	color: var(--foreground);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

ul,
ol {
	list-style: none;
}

h1,
h2,
h3 {
	font-weight: 400;
	font-size: inherit;
}

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

::selection {
	background: var(--primary);
	color: var(--primary-foreground);
}

.wrap {
	width: 100%;
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: 1.5rem;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* links */

.link {
	color: var(--muted);
	text-decoration-color: var(--border);
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.link:hover {
	color: var(--foreground);
	text-decoration-line: underline;
	text-decoration-color: var(--muted);
}

/* buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.25rem;
	padding-inline: 0.875rem;
	border: 1px solid var(--primary);
	background: var(--primary);
	color: var(--primary-foreground);
	user-select: none;
	white-space: nowrap;
	transition: opacity 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn:hover {
	opacity: 0.88;
}

.btn.ghost {
	border-color: var(--surface);
	background: var(--surface);
	color: var(--foreground);
}

.btn.ghost:hover {
	opacity: 1;
	border-color: var(--surface-hover);
	background: var(--surface-hover);
}

.btn.lg {
	height: 2.5rem;
	padding-inline: 1.25rem;
}

/* header */

header {
	position: sticky;
	top: 0;
	z-index: 10;
	border-bottom: 1px solid var(--border);
	background: var(--background);
}

header .wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

header .logo {
	margin-right: auto;
}

header .logo,
header .btn {
	margin-block: 0.625rem;
}

.logo {
	font-family: var(--logo);
	font-weight: 500;
	letter-spacing: -0.025em;
}

header nav:not(.sheet) {
	display: none;
	flex: 1;
	align-items: center;
	gap: 1.25rem;
}

/* phones: a menu button in the pinned bar opens the section links */

.menu summary {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	background: var(--surface);
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition: background-color 0.15s;
}

.menu summary::-webkit-details-marker {
	display: none;
}

.menu[open] summary {
	background: var(--surface-hover);
}

.menu .bars {
	display: grid;
	gap: 5px;
	width: 1rem;
}

.menu .bars::before,
.menu .bars::after {
	content: "";
	height: 1.5px;
	background: var(--foreground);
	transition: transform 0.15s;
}

.menu[open] .bars::before {
	transform: translateY(3.25px) rotate(45deg);
}

.menu[open] .bars::after {
	transform: translateY(-3.25px) rotate(-45deg);
}

.menu .sheet {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	display: grid;
	padding-inline: 1.5rem;
	border-block: 1px solid var(--border);
	background: var(--background);
}

.menu .sheet a {
	display: flex;
	align-items: center;
	height: 3rem;
}

.menu .sheet a + a {
	border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
	header .wrap {
		gap: 1.5rem;
	}

	header .logo {
		margin-right: 0;
	}

	header nav:not(.sheet) {
		display: flex;
	}

	.menu {
		display: none;
	}
}

/* page */

main {
	flex: 1;
	padding-block: 4rem;
}

section + section {
	margin-top: 5rem;
}

section[id] {
	scroll-margin-top: 5.5rem;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 3rem;
}

@media (min-width: 768px) {
	.hero {
		grid-template-columns: minmax(0, 1fr) 21rem;
		align-items: center;
		gap: 2.5rem;
	}
}

@media (min-width: 1024px) {
	.hero {
		grid-template-columns: minmax(0, 1fr) 24rem;
		gap: 4rem;
		padding-block: 2rem;
	}
}

.hero h1 {
	max-width: 48rem;
	font-size: clamp(1.875rem, 1rem + 3.2vw, 3rem);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.hero-text > p {
	max-width: 42rem;
	margin-top: 1.5rem;
	line-height: 1.75rem;
	color: var(--muted);
}

.hero .actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 2rem;
}

@media (max-width: 479.98px) {
	.hero .actions .btn {
		flex: 1 1 auto;
	}
}

.section-head {
	margin-bottom: 1rem;
}

.section-head p {
	margin-top: 0.5rem;
	color: var(--muted);
}

.idx {
	margin-right: 0.75rem;
	font-family: var(--mono);
	font-size: 0.75rem;
	color: var(--muted);
}

/* hero preview: a mock of the case card the bot posts */

.preview {
	width: 100%;
	border: 1px solid var(--border);
	pointer-events: none;
	user-select: none;
	font-size: 0.875rem;
	line-height: 1.5rem;
}

.preview .cmdline {
	padding: 0.75rem 1.25rem;
	border-bottom: 1px solid var(--border);
	font-family: var(--mono);
	font-size: 0.8125rem;
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.preview .cmdline span {
	color: var(--foreground);
}

.preview .card {
	margin: 1.25rem;
	border: 1px solid var(--border);
	background: var(--surface);
}

.preview .card > * {
	padding: 1rem 1.25rem;
}

.preview .card > * + * {
	border-top: 1px solid var(--border);
}

.preview .who {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.preview .title {
	font-weight: 500;
}

.preview .small,
.preview dt {
	font-size: 0.75rem;
	line-height: 1.25rem;
	color: var(--muted);
}

.preview .avatar {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	flex: none;
	background: var(--surface-hover);
	font-family: var(--logo);
	font-size: 1.25rem;
	color: var(--muted);
}

.preview .fields {
	display: grid;
	gap: 0.75rem;
}

/* wide and stacked: the three fields sit in a row so the card isn't mostly empty */
@media (min-width: 520px) and (max-width: 767.98px) {
	.preview .fields {
		grid-template-columns: 1fr 1.5fr 1fr;
		gap: 1.5rem;
	}
}

.preview .row {
	display: flex;
	gap: 0.5rem;
}

.preview .row .btn {
	height: 2rem;
	border-color: var(--surface-hover);
	background: var(--surface-hover);
	font-size: 0.8125rem;
	cursor: default;
}

/* hairline grid */

.grid {
	display: grid;
	border-top: 1px solid var(--border);
	border-left: 1px solid var(--border);
}

.grid > * {
	min-width: 0;
	padding: 1.5rem;
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
	.grid.cols-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.grid.cols-3 {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* three steps: one column on phones, three across from there, never two plus a gap */
@media (min-width: 640px) {
	.grid.steps {
		grid-template-columns: repeat(3, 1fr);
	}
}

.cell {
	transition: background-color 0.15s;
}

@media (hover: hover) {
	.cell:hover {
		background: var(--surface);
	}
}

.cell p {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.5rem;
	color: var(--muted);
}

.step .num {
	margin: 0;
	color: var(--foreground);
	font-size: 1.5rem;
	line-height: 2.25rem;
	letter-spacing: -0.025em;
	font-variant-numeric: tabular-nums;
}

.step h3 {
	margin-top: 1rem;
}

code {
	font-family: var(--mono);
	font-size: 0.92em;
	color: var(--foreground);
}

/* commands */

.commands {
	border: 1px solid var(--border);
}

.tabs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	min-width: 0;
	border: 0;
	border-bottom: 1px solid var(--border);
	background: var(--border);
}

.tabs label {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 2.5rem;
	padding-inline: 0.875rem;
	background: var(--background);
	font-size: 0.875rem;
	color: var(--muted);
	cursor: pointer;
	user-select: none;
	transition: color 0.15s, background-color 0.15s;
}

.tabs label:hover {
	color: var(--foreground);
}

.tabs label:has(:checked) {
	background: var(--surface);
	color: var(--foreground);
	box-shadow: inset 0 0 0 1px var(--foreground);
}

.tabs label:has(:focus-visible) {
	outline: 2px solid var(--primary);
	outline-offset: -1px;
}

@media (min-width: 640px) {
	.tabs {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.tabs {
		grid-template-columns: repeat(6, 1fr);
	}
}

.panel {
	padding: 1.5rem;
}

/* without :has() the tabs can't switch, so hide them and show every list */
.panel + .panel {
	border-top: 1px solid var(--border);
}

@supports not selector(:has(*)) {
	.tabs {
		display: none;
	}
}

@supports selector(:has(*)) {
	.commands .panel {
		display: none;
		border-top: 0;
	}

	.commands:has(#tab-moderation:checked) .panel[data-tab="moderation"],
	.commands:has(#tab-security:checked) .panel[data-tab="security"],
	.commands:has(#tab-community:checked) .panel[data-tab="community"],
	.commands:has(#tab-config:checked) .panel[data-tab="config"],
	.commands:has(#tab-voice:checked) .panel[data-tab="voice"],
	.commands:has(#tab-general:checked) .panel[data-tab="general"] {
		display: block;
	}
}

.cmd-list {
	display: grid;
	gap: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5rem;
}

.cmd-list li {
	display: grid;
	gap: 0 1.5rem;
}

.cmd-list .name {
	font-family: var(--mono);
}

.cmd-list .desc {
	color: var(--muted);
	transition: color 0.15s;
}

@media (hover: hover) {
	.cmd-list li:hover .desc {
		color: var(--foreground);
	}
}

@media (min-width: 640px) {
	.cmd-list {
		grid-template-columns: max-content 1fr;
		gap: 0.5rem 1.5rem;
	}

	.cmd-list li {
		grid-column: span 2;
		grid-template-columns: subgrid;
		align-items: baseline;
	}
}

/* wide screens: long lists flow into two columns so the box isn't half empty */
@media (min-width: 1024px) {
	.cmd-list.split {
		display: block;
		columns: 2;
		column-gap: 3rem;
	}

	.cmd-list.split li {
		grid-template-columns: 8.5rem 1fr;
		break-inside: avoid;
	}

	.cmd-list.split li + li {
		margin-top: 0.5rem;
	}
}

/* faq */

.faq {
	border-top: 1px solid var(--border);
}

.faq > div {
	display: grid;
	gap: 0.5rem;
	padding-block: 1.25rem;
	border-bottom: 1px solid var(--border);
}

.faq dt,
.faq dd {
	line-height: 1.75rem;
}

.faq dd {
	color: var(--muted);
}

/* phones: answers drop to the same small size as the feature blurbs */
@media (max-width: 639.98px) {
	.faq > div {
		gap: 0.25rem;
		padding-block: 1rem;
	}

	.faq dt,
	.faq dd {
		line-height: 1.5rem;
	}

	.faq dd {
		font-size: 0.875rem;
	}
}

@media (min-width: 640px) {
	.faq > div {
		grid-template-columns: minmax(0, 14rem) 1fr;
		gap: 2rem;
	}
}

/* closing band */

.cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 2rem 1.5rem;
	border: 1px solid var(--border);
}

.cta h2 {
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: -0.025em;
}

.cta p {
	margin-top: 0.25rem;
	font-size: 0.875rem;
	color: var(--muted);
}

/* footer */

footer {
	margin-top: auto;
	border-top: 1px solid var(--border);
}

footer .top {
	display: flex;
	flex-direction: column;
	gap: 3rem;
	padding-block: 4rem 3rem;
}

footer .brand {
	max-width: 20rem;
}

footer .brand .logo {
	font-size: 1.5rem;
	line-height: 2rem;
}

footer .brand p {
	margin-top: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5rem;
	color: var(--muted);
}

footer .cols {
	display: grid;
	grid-template-columns: repeat(2, max-content);
	gap: 2.5rem 5rem;
}

footer ul {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1rem;
}

footer .bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.5rem;
	border-top: 1px solid var(--border);
	font-size: 0.875rem;
	color: var(--muted);
}

@media (min-width: 640px) {
	footer .top {
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
	}
}

/* motion */

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(0.75rem);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.hero h1,
	.hero-text > p,
	.hero .actions,
	.preview {
		animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}

	.hero-text > p {
		animation-delay: 0.08s;
	}

	.hero .actions {
		animation-delay: 0.16s;
	}

	.preview {
		animation-delay: 0.24s;
	}

	/* sections fade up as they scroll in; browsers without scroll timelines just show them */
	@supports (animation-timeline: view()) {
		main > section:not(.hero) {
			animation: rise linear both;
			animation-timeline: view();
			animation-range: entry 0px entry 160px;
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		transition: none !important;
	}
}

/* print: everything visible, nothing pinned */

@media print {
	header {
		position: static;
	}

	.menu,
	.hero .actions,
	.cta {
		display: none;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
	}

	.commands .panel {
		display: block !important;
	}

	.tabs {
		display: none;
	}
}
