:root {
	--bg: #0e0e14;
	--bg-2: #131318;
	--surface: #181820;
	--surface-2: #1f1f29;
	--surface-3: #272732;
	--text: #eceaea;
	--text-2: #b5b3b6;
	--text-3: #7c7a80;
	--text-4: #56555c;
	--border: #2a2a33;
	--border-strong: #38383f;
	--accent: #4ffcc0;
	--accent-hover: #6fffcd;
	--accent-soft: #163029;
	--accent-fg: #0a1f19;
	--danger: #f08488;

	--font-ui:
		"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
		sans-serif;
	--font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, monospace;

	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 14px;

	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--dur: 160ms;

	--container: 1200px;
	--gutter: 28px;
	--header-h: 64px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
}

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

body {
	min-height: 100vh;
	font-family: var(--font-ui);
	font-size: 15px;
	line-height: 1.55;
	color: var(--text);
	background:
		radial-gradient(
			1200px 700px at 80% -10%,
			rgba(79, 252, 192, 0.06) 0%,
			transparent 55%
		),
		radial-gradient(
			900px 600px at 10% 90%,
			rgba(79, 252, 192, 0.04) 0%,
			transparent 60%
		),
		var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "kern", "liga", "calt", "ss01";
	overflow-x: hidden;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color var(--dur) var(--ease);
}

a:hover {
	color: var(--accent-hover);
}

::selection {
	background: rgba(79, 252, 192, 0.3);
}

img {
	max-width: 100%;
}

/* ============ Fixed site header ============ */

.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 50;
	background: rgba(14, 14, 20, 0.72);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid var(--border);
}

.site-header__inner {
	max-width: var(--container);
	margin: 0 auto;
	height: var(--header-h);
	padding: 0 var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.site-header__brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.site-header__brand img {
	height: 26px;
	width: auto;
	display: block;
	filter: drop-shadow(0 2px 8px rgba(79, 252, 192, 0.18));
}

.site-header__nav {
	display: flex;
	gap: 20px;
	align-items: center;
	font-size: 14px;
}

.site-header__link {
	color: var(--text-2);
	font-weight: 500;
	padding: 8px 4px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.site-header__link:hover {
	color: var(--text);
}

/* ============ Page ============ */

.page {
	max-width: var(--container);
	margin: 0 auto;
	padding: calc(var(--header-h) + 64px) var(--gutter) 96px;
	display: flex;
	flex-direction: column;
	gap: 64px;
}

/* ============ Hero ============ */

.hero {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 720px;
}

.hero__title {
	margin: 0;
	font-size: clamp(34px, 5.2vw, 52px);
	font-weight: 700;
	letter-spacing: -0.028em;
	color: var(--text);
	line-height: 1.02;
}

.hero__subtitle {
	margin: 0;
	font-size: clamp(15px, 1.6vw, 17px);
	color: var(--text-2);
	letter-spacing: -0.005em;
	max-width: 580px;
}

/* ============ Sections ============ */

.sections {
	display: flex;
	flex-direction: column;
	gap: 64px;
}

.sections__loading,
.sections__error {
	margin: 0;
	padding: 40px;
	text-align: center;
	color: var(--text-3);
	font-style: italic;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
}

.sections__error {
	color: var(--danger);
	font-style: normal;
}

.section {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.section__header {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--border);
}

.section__title {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-2);
}

.section__description {
	margin: 0;
	font-size: 13px;
	color: var(--text-3);
}

.section__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

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

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

.section__empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 36px 24px;
	text-align: center;
	color: var(--text-3);
	font-size: 14px;
	background: var(--surface);
	border: 1px dashed var(--border);
	border-radius: var(--radius-lg);
}

/* ============ App card ============ */

.app {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	transition:
		border-color var(--dur) var(--ease),
		background var(--dur) var(--ease);
	min-width: 0;
}

.app:hover {
	border-color: var(--border-strong);
}

.app__top {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	min-width: 0;
}

.app__icon {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.app__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.app__heading {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.app__name {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.012em;
	color: var(--text);
	line-height: 1.22;
	overflow-wrap: anywhere;
}

.app__badges {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.app__version {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	background: var(--accent-soft);
	color: var(--accent);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	font-family: var(--font-mono);
	letter-spacing: 0.01em;
}

.app__version--missing {
	background: rgba(240, 132, 136, 0.12);
	color: var(--danger);
}

.app__version--menu {
	position: relative;
	padding: 0;
	background: transparent;
	border-radius: 0;
	overflow: visible;
}

.app__version-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 8px 2px 10px;
	background: var(--accent-soft);
	color: var(--accent);
	border: none;
	border-radius: 999px;
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background var(--dur) var(--ease);
}

.app__version-trigger:hover {
	background: rgba(79, 252, 192, 0.18);
}

.app__version-trigger:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.app__version-chevron {
	width: 11px;
	height: 11px;
	flex-shrink: 0;
	opacity: 0.85;
	transition: transform var(--dur) var(--ease);
}

.app__version--menu.is-open .app__version-chevron {
	transform: rotate(180deg);
}

.app__version-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 180px;
	max-height: 280px;
	overflow-y: auto;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	display: none;
	flex-direction: column;
	z-index: 30;
}

.app__version--menu.is-open .app__version-menu {
	display: flex;
}

.app__version-menu-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	background: transparent;
	color: var(--text);
	border: none;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition:
		background var(--dur) var(--ease),
		color var(--dur) var(--ease);
}

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

.app__version-menu-item:hover,
.app__version-menu-item:focus-visible {
	background: var(--surface-2);
	color: var(--accent);
	outline: none;
}

.app__version-menu-item.is-current {
	color: var(--accent);
}

.app__date {
	font-size: 12px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
}

.app__tagline {
	margin: 0;
	font-size: 13px;
	color: var(--text-2);
	font-style: italic;
}

.app__description {
	margin: 0;
	font-size: 13px;
	color: var(--text-2);
	line-height: 1.55;
	flex: 1;
}

.app__downloads {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.app__download {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	min-height: 48px;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition:
		background var(--dur) var(--ease),
		border-color var(--dur) var(--ease),
		color var(--dur) var(--ease),
		transform var(--dur) var(--ease);
}

.app__download:hover {
	background: var(--surface-3);
	border-color: var(--border-strong);
	color: var(--text);
}

.app__download:active {
	transform: translateY(1px);
}

.app__download--primary {
	background: var(--accent);
	color: var(--accent-fg);
	border-color: var(--accent);
}

.app__download--primary:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: var(--accent-fg);
}

.app__download--disabled {
	pointer-events: none;
	opacity: 0.45;
	color: var(--text-3);
}

.app__download-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: currentColor;
}

.app__download-icon svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.app__download-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.app__download-platform {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app__download-compat {
	font-size: 11px;
	line-height: 1.2;
	opacity: 0.6;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app__download-meta {
	font-size: 11px;
	opacity: 0.7;
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

.app__download--primary .app__download-meta {
	opacity: 0.85;
}

.app__download--primary .app__download-compat {
	opacity: 0.75;
}

/* ============ Mac arch dropdown ============ */

.app__download--menu {
	position: relative;
	overflow: visible;
}

.app__download-trigger {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 0;
	min-height: 48px;
	background: transparent;
	color: inherit;
	border: none;
	font: inherit;
	text-align: left;
	cursor: pointer;
	border-radius: var(--radius-sm);
}

.app__download-trigger:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.app__download-chevron {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	opacity: 0.7;
	transition: transform var(--dur) var(--ease);
}

.app__download--menu.is-open .app__download-chevron {
	transform: rotate(180deg);
}

.app__download-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	display: none;
	flex-direction: column;
	z-index: 30;
	overflow: hidden;
}

.app__download--menu.is-open .app__download-menu {
	display: flex;
}

.app__download-menu-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 14px;
	color: var(--text);
	text-decoration: none;
	font-size: 13px;
	background: transparent;
	transition:
		background var(--dur) var(--ease),
		color var(--dur) var(--ease);
}

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

.app__download-menu-item:hover,
.app__download-menu-item:focus-visible {
	background: var(--surface-2);
	color: var(--accent);
	outline: none;
}

.app__download-menu-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.app__download-menu-arch {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.2;
}

.app__download-menu-sub {
	font-size: 11px;
	color: var(--text-3);
	line-height: 1.2;
}

.app__download-menu-size {
	font-size: 11px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

/* ============ Placeholder card ============ */

.app--placeholder {
	display: none;
	background: transparent;
	border-style: dashed;
	border-color: var(--border);
	min-height: 220px;
}

.app--placeholder:hover {
	border-color: var(--border);
}

@media (max-width: 639px) {
	.app--placeholder.ph-show-mobile {
		display: block;
	}
}

@media (min-width: 640px) and (max-width: 1023px) {
	.app--placeholder.ph-show-tablet {
		display: block;
	}
}

@media (min-width: 1024px) {
	.app--placeholder.ph-show-desktop {
		display: block;
	}
}

/* ============ Site footer ============ */

.site-footer {
	margin-top: 48px;
	border-top: 1px solid var(--border);
	background: var(--bg-2);
}

.site-footer__top {
	max-width: var(--container);
	margin: 0 auto;
	padding: 64px var(--gutter) 40px;
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 48px;
}

.site-footer__brand p {
	margin: 14px 0 18px;
	font-size: 14px;
	color: var(--text-3);
	max-width: 360px;
}

.site-footer__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	min-height: 40px;
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition:
		background var(--dur) var(--ease),
		border-color var(--dur) var(--ease),
		color var(--dur) var(--ease),
		transform var(--dur) var(--ease);
}

.site-footer__cta:hover {
	background: var(--surface-2);
	border-color: var(--accent);
	color: var(--accent);
}

.site-footer__cta:active {
	transform: translateY(1px);
}

.site-footer__cta svg {
	transition: transform var(--dur) var(--ease);
}

.site-footer__cta:hover svg {
	transform: translate(2px, -2px);
}

.site-footer__logo {
	height: 28px;
	width: auto;
	display: block;
	filter: drop-shadow(0 4px 16px rgba(79, 252, 192, 0.18));
}

.site-footer__heading {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-3);
}

.site-footer__col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
	color: var(--text-2);
}

.site-footer__col a {
	color: var(--text-2);
}

.site-footer__col a:hover {
	color: var(--text);
}

.site-footer__bottom {
	max-width: var(--container);
	margin: 0 auto;
	padding: 24px var(--gutter) 32px;
	border-top: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-4);
}

.site-footer__bottom p {
	margin: 0;
}

/* ============ Responsive ============ */

@media (max-width: 1023px) {
	.site-footer__top {
		grid-template-columns: 1fr 1fr;
		gap: 40px;
	}

	.site-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 639px) {
	:root {
		--header-h: 56px;
		--gutter: 20px;
	}

	.page {
		padding: calc(var(--header-h) + 32px) var(--gutter) 64px;
		gap: 48px;
	}

	.site-header__brand img {
		height: 22px;
	}

	.site-header__nav {
		gap: 12px;
	}

	.site-header__link {
		font-size: 13px;
		padding: 8px 4px;
	}

	.sections {
		gap: 48px;
	}

	.section {
		gap: 18px;
	}

	.section__body {
		gap: 16px;
	}

	.app {
		padding: 18px;
		gap: 12px;
	}

	.app__icon {
		width: 44px;
		height: 44px;
	}

	.app__name {
		font-size: 16px;
	}

	.app__tagline,
	.app__description {
		font-size: 13px;
	}

	.app__download {
		padding: 10px 12px;
		min-height: 44px;
	}

	.app__download-platform {
		font-size: 13px;
	}

	.site-footer__top {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 40px var(--gutter) 28px;
	}

	.site-footer__bottom {
		padding: 20px var(--gutter) 28px;
		text-align: center;
	}
}

/* ============ Light theme ============ */

@media (prefers-color-scheme: light) {
	:root {
		--bg: #faf8f3;
		--bg-2: #ffffff;
		--surface: #ffffff;
		--surface-2: #f4f1e9;
		--surface-3: #eae6d9;
		--text: #1a1a1f;
		--text-2: #4a4a52;
		--text-3: #7a7a82;
		--text-4: #a8a6a4;
		--border: #e6e0d2;
		--border-strong: #d2cab6;
		--accent: #10c896;
		--accent-hover: #0eb385;
		--accent-soft: #daf6ec;
		--accent-fg: #0a2a22;
		--danger: #c24a50;
	}

	body {
		background:
			radial-gradient(
				1200px 700px at 80% -10%,
				rgba(16, 200, 150, 0.12) 0%,
				transparent 55%
			),
			radial-gradient(
				900px 600px at 10% 90%,
				rgba(16, 200, 150, 0.08) 0%,
				transparent 60%
			),
			var(--bg);
	}

	.site-header {
		background: rgba(250, 248, 243, 0.78);
	}

	.site-header__brand img,
	.site-footer__logo {
		filter: drop-shadow(0 4px 16px rgba(16, 200, 150, 0.12));
	}
}
