.layout {
	display: grid;
	grid-template-columns: minmax(300px, 26rem) minmax(0, 1fr);
	min-height: 100vh;
}

.intro {
	position: sticky;
	top: 0;
	align-self: start;
	height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 2rem;
	padding: 1.5rem 1.75rem 1.75rem 2rem;
	border-right: 1px solid var(--line);
	overflow: auto;
}

.intro__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	color: inherit;
	text-decoration: none;
	font-weight: 700;
	letter-spacing: -0.03em;
	font-size: 1.05rem;
}

.intro__copy h1 {
	margin: 0 0 1rem;
	font-size: clamp(2rem, 2.4vw, 2.65rem);
	line-height: 1.02;
	letter-spacing: -0.04em;
	font-weight: 700;
	max-width: 100%;
	text-wrap: balance;
}

.lede {
	margin: 0;
	max-width: 32ch;
	color: var(--muted);
	font-size: 1.05rem;
}

.install {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	width: fit-content;
	margin-top: 1.25rem;
	border: 0;
	border-radius: 999px;
	padding: 0.7rem 1rem;
	background: var(--ink);
	color: var(--bg);
	font-weight: 700;
	cursor: pointer;
}

.install svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.install:hover {
	opacity: 0.88;
}

.install-note {
	margin: 0.7rem 0 0;
	max-width: 32ch;
	color: var(--muted);
	font-size: 0.92rem;
}

.filters {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15rem;
}

.filters button {
	border: 0;
	background: transparent;
	padding: 0.35rem 0;
	color: var(--muted);
	cursor: pointer;
	text-align: left;
}

.filters button[aria-pressed="true"] {
	color: var(--ink);
	font-weight: 700;
}

.count {
	margin: 0.85rem 0 0;
	color: var(--muted);
	font-family: "Pitch Sans", ui-monospace, monospace;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.stage {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 100vh;
}

.catalog {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	align-content: start;
	padding: 1.25rem;
}

.card {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	background: var(--surface);
	color: inherit;
	text-decoration: none;
	border: 1px solid var(--line);
	border-radius: 18px;
	overflow: hidden;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card--lead {
	grid-column: 1 / -1;
	flex-direction: row;
	min-height: 340px;
}

.card:hover {
	border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
	box-shadow: var(--shadow);
}

.card__media {
	position: relative;
	min-height: 190px;
	background: var(--wash);
	overflow: hidden;
}

.card--lead .card__media {
	flex: 1.2;
	min-height: 100%;
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.card:hover .card__media img {
	transform: scale(1.045);
}

.card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wash);
	mix-blend-mode: color;
	opacity: 0.22;
	pointer-events: none;
}

.card__body {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.15rem 1.25rem 1.25rem;
}

.card--lead .card__body {
	flex: 0.9;
	justify-content: flex-end;
	padding: 1.75rem;
}

.card__index {
	font-family: "Pitch Sans", ui-monospace, monospace;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	color: var(--accent);
}

.card h2 {
	margin: 0;
	font-size: 1.65rem;
	letter-spacing: -0.04em;
	line-height: 1.05;
}

.card--lead h2 {
	font-size: clamp(2rem, 3vw, 2.7rem);
}

.card p {
	margin: 0;
	color: var(--muted);
	max-width: 38ch;
}

.card__go {
	margin-top: 0.35rem;
	font-weight: 700;
	color: var(--ink);
}

.card--html {
	--accent: #b86a12;
	--wash: #e39a3a;
}

.card--css {
	--accent: #2a4fe0;
	--wash: #4d6ef5;
}

.card--js {
	--accent: #8a6a00;
	--wash: #e0be1a;
}

.card--php {
	--accent: #2f5d8a;
	--wash: #3f6f9e;
}

.card--git {
	--accent: #d1432c;
	--wash: #ef5a40;
}

html[data-theme="dark"] .card--html { --accent: #f0a04a; }
html[data-theme="dark"] .card--css { --accent: #8aa2ff; }
html[data-theme="dark"] .card--js { --accent: #f0d34a; }
html[data-theme="dark"] .card--php { --accent: #8eb6de; }
html[data-theme="dark"] .card--git { --accent: #ff8b78; }

.colophon {
	padding: 0.25rem 1.5rem 1.4rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.colophon p {
	margin: 0;
}

[hidden] {
	display: none !important;
}

@media (max-width: 960px) {
	.layout {
		display: block;
	}

	.intro {
		position: static;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--line);
		padding: 1.25rem 1.25rem 1.4rem;
		gap: 1.5rem;
	}

	.intro__copy h1 {
		max-width: 14ch;
		font-size: clamp(2.15rem, 8vw, 3rem);
	}

	.stage {
		min-height: 0;
	}

	.filters {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.45rem;
	}

	.filters button {
		border: 1px solid var(--line);
		background: var(--surface);
		border-radius: 999px;
		padding: 0.4rem 0.8rem;
	}

	.filters button[aria-pressed="true"] {
		background: var(--ink);
		color: var(--bg);
		border-color: var(--ink);
	}

	.count {
		flex-basis: 100%;
	}
}

@media (max-width: 720px) {
	.catalog,
	.card--lead {
		grid-template-columns: 1fr;
	}

	.card--lead {
		flex-direction: column;
		min-height: 0;
	}

	.card--lead .card__media {
		min-height: 210px;
		flex: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.card,
	.card__media img {
		transition: none;
	}
}
