.npg-portfolio {
	--npg-ink: #172033;
	--npg-muted: #687386;
	--npg-line: #e6eaf0;
	--npg-accent: #5b5ce2;
	--npg-surface: #fff;
	--npg-card-radius: 18px;
	--npg-grid-gap: 24px;
	--npg-card-padding: 20px;
	--npg-image-ratio: 1.6;
	color: var(--npg-ink);
	font-family: inherit;
}

.npg-portfolio *,
.npg-posts-page * {
	box-sizing: border-box;
}

.npg-toolbar {
	display: grid;
	grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
	align-items: start;
	gap: 18px;
	margin: 0 0 28px;
}

.npg-search {
	position: relative;
	display: flex;
	min-width: 0;
	min-height: 52px;
	align-items: center;
	gap: 11px;
	padding: 0 12px 0 16px;
	border: 1px solid var(--npg-line);
	border-radius: 14px;
	background: var(--npg-surface);
	box-shadow: 0 3px 12px rgb(23 32 51 / 5%);
	transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.npg-search:focus-within {
	border-color: var(--npg-accent);
	outline: 3px solid rgb(91 92 226 / 13%);
	box-shadow: 0 5px 18px rgb(23 32 51 / 8%);
}

.npg-search .npg-search__icon {
	position: static;
	flex: 0 0 19px;
	width: 19px;
	height: 19px;
	transform: none;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.8;
	color: var(--npg-muted);
	pointer-events: none;
}

.npg-portfolio .npg-search > input[data-npg-search] {
	appearance: none !important;
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	min-height: 50px;
	padding: 10px 0;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	color: var(--npg-ink) !important;
	font: inherit !important;
	font-size: 16px !important;
	box-shadow: none !important;
}

.npg-portfolio .npg-search > input[data-npg-search]:focus,
.npg-portfolio .npg-search > input[data-npg-search]:focus-visible {
	border: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.npg-portfolio .npg-search > input[data-npg-search]::placeholder {
	color: var(--npg-muted);
	opacity: .82;
}

.npg-portfolio .npg-search > input[data-npg-search]::-webkit-search-cancel-button {
	display: none;
}

.npg-search .npg-search__clear {
	display: inline-flex;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--npg-muted);
	cursor: pointer;
	transition: color 160ms ease, background 160ms ease;
}

.npg-search .npg-search__clear:hover {
	background: color-mix(in srgb, var(--npg-accent) 10%, var(--npg-surface));
	color: var(--npg-accent);
}

.npg-search .npg-search__clear:focus-visible {
	outline: 2px solid var(--npg-accent);
	outline-offset: 2px;
}

.npg-search .npg-search__clear[hidden] {
	display: none;
}

.npg-search .npg-search__clear svg {
	position: static;
	width: 16px;
	height: 16px;
	transform: none;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.8;
}

.npg-filters,
.npg-filter-group {
	display: flex;
	min-width: 0;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.npg-filters {
	display: grid;
	align-content: start;
	gap: 10px;
}

.npg-category-filter-rail {
	display: flex;
	min-width: 0;
	max-width: 100%;
	align-items: center;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px 2px 9px;
	overscroll-behavior-inline: contain;
	scrollbar-color: var(--npg-accent) var(--npg-line);
	scrollbar-width: thin;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.npg-category-filter-rail > .npg-filter {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.npg-category-filter-rail:focus-visible {
	border-radius: 9px;
	outline: 2px solid var(--npg-accent);
	outline-offset: 2px;
}

.npg-category-filter-rail::-webkit-scrollbar {
	height: 5px;
}

.npg-category-filter-rail::-webkit-scrollbar-track {
	border-radius: 999px;
	background: var(--npg-line);
}

.npg-category-filter-rail::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: var(--npg-accent);
}

.npg-category-filter-rail--all {
	justify-content: flex-end;
}

.npg-filter-extras {
	display: flex;
	min-width: 0;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
}

.npg-portfolio button.npg-filter {
	appearance: none;
	min-height: 36px;
	padding: 7px 12px;
	border: 1px solid var(--npg-line);
	border-radius: 999px;
	background: var(--npg-surface);
	color: var(--npg-muted);
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.npg-portfolio button.npg-filter:hover {
	border-color: var(--npg-accent);
	color: var(--npg-accent);
	transform: translateY(-1px);
}

.npg-filter:focus-visible,
.npg-button:focus-visible,
.npg-icon-button:focus-visible,
.npg-card__title a:focus-visible {
	outline: 3px solid var(--npg-accent);
	outline-offset: 3px;
}

.npg-portfolio button.npg-filter.is-active {
	border-color: var(--npg-accent);
	background: var(--npg-accent);
	color: #fff;
}

.npg-grid {
	display: grid;
	--npg-column-width: calc((100% - (var(--npg-columns, 3) - 1) * var(--npg-grid-gap)) / var(--npg-columns, 3));
	grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--npg-column-width)), var(--npg-column-width)));
	gap: var(--npg-grid-gap);
}

.npg-grid--single {
	grid-template-columns: minmax(0, min(100%, 520px));
}

.npg-card {
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--npg-line);
	border-radius: var(--npg-card-radius);
	background: var(--npg-surface);
	box-shadow: 0 8px 24px rgb(23 32 51 / 6%);
	transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.npg-card:hover {
	transform: translateY(-5px);
	border-color: #d7d9f8;
	border-color: color-mix(in srgb, var(--npg-accent) 28%, var(--npg-line));
	box-shadow: 0 18px 38px rgb(23 32 51 / 12%);
}

.npg-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: var(--npg-image-ratio);
	background: linear-gradient(135deg, #f1f2ff, #e9f2ff);
}

.npg-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms cubic-bezier(.2, .7, .2, 1);
}

.npg-card:hover .npg-card__image {
	transform: scale(1.055);
}

.npg-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 75% 25%, rgb(91 92 226 / 22%), transparent 32%),
		linear-gradient(135deg, #f3f4ff, #e8f3fa);
	background:
		radial-gradient(circle at 75% 25%, color-mix(in srgb, var(--npg-accent) 22%, transparent), transparent 32%),
		linear-gradient(135deg, #f3f4ff, #e8f3fa);
}

.npg-card__body {
	padding: var(--npg-card-padding);
}

.npg-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 12px;
	font-size: 12px;
}

.npg-card__category {
	padding: 5px 9px;
	border-radius: 999px;
	background: #f0f0ff;
	background: color-mix(in srgb, var(--npg-accent) 10%, #fff);
	color: var(--npg-accent);
	font-weight: 650;
}

.npg-card__date {
	color: var(--npg-muted);
}

.npg-portfolio .npg-card__title {
	margin: 0 0 9px;
	color: var(--npg-ink);
	font-size: var(--npg-title-size, 21px);
	line-height: 1.35;
}

.npg-portfolio .npg-card__title a {
	color: inherit;
	text-decoration: none;
}

.npg-portfolio .npg-card__title a:hover {
	color: var(--npg-accent);
}

.npg-card__excerpt {
	margin: 0;
	color: var(--npg-muted);
	font-size: 14px;
	line-height: 1.65;
}

.npg-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 15px 0 0;
	padding: 0;
	list-style: none;
}

.npg-card__tags li {
	padding: 5px 8px;
	border: 1px solid var(--npg-line);
	border-radius: 7px;
	color: var(--npg-muted);
	font-size: 11px;
	line-height: 1.15;
}

.npg-card__actions {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-top: 19px;
}

.npg-portfolio .npg-button {
	display: inline-flex;
	min-height: 39px;
	align-items: center;
	justify-content: center;
	padding: 9px 14px;
	border: 1px solid transparent;
	border-radius: var(--npg-button-radius, 9px);
	font-size: 13px;
	font-weight: 650;
	line-height: 1.2;
	text-decoration: none;
	transition: background 160ms ease, transform 160ms ease;
}

.npg-portfolio .npg-button--primary {
	background: var(--npg-ink);
	color: #fff;
}

.npg-portfolio .npg-button--primary:hover {
	transform: translateY(-1px);
	background: var(--npg-accent);
	color: #fff;
}

.npg-portfolio .npg-icon-button {
	display: inline-flex;
	width: 39px;
	height: 39px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--npg-line);
	border-radius: var(--npg-button-radius, 9px);
	color: var(--npg-ink);
	transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.npg-portfolio .npg-icon-button:hover {
	border-color: var(--npg-accent);
	background: #f5f5ff;
	background: color-mix(in srgb, var(--npg-accent) 7%, var(--npg-surface));
	color: var(--npg-accent);
}

.npg-portfolio .npg-icon-button svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.npg-empty {
	padding: 28px;
	border: 1px dashed var(--npg-line);
	border-radius: 14px;
	color: var(--npg-muted);
	text-align: center;
}

.npg-card[hidden],
.npg-empty[hidden] {
	display: none !important;
}

.npg-posts-page {
	padding: clamp(24px, 5vw, 64px) 20px;
}

.npg-posts-page__inner {
	width: min(100%, 1240px);
	margin-inline: auto;
}

.npg-posts-page__hero {
	position: relative;
	display: flex;
	min-height: clamp(300px, 38vw, 460px);
	align-items: flex-end;
	overflow: hidden;
	margin-bottom: clamp(28px, 4vw, 48px);
	padding: clamp(30px, 7vw, 82px);
	border: 1px solid rgb(255 255 255 / 12%);
	border-radius: clamp(18px, 3vw, 30px);
	background-color: #111827;
	background-image:
		linear-gradient(112deg, rgb(9 12 20 / 86%) 0%, rgb(9 12 20 / 60%) 58%, rgb(9 12 20 / 40%) 100%),
		var(--npg-hero-image, none);
	background-position: center;
	background-size: cover;
	box-shadow: 0 22px 60px rgb(23 32 51 / 16%);
	isolation: isolate;
}

.npg-posts-page__hero::before {
	position: absolute;
	z-index: -1;
	inset: 0;
	background-image:
		linear-gradient(
			112deg,
			color-mix(in srgb, var(--npg-hero-accent, #5b5ce2) 76%, #080b12) 0%,
			color-mix(in srgb, var(--npg-hero-accent, #5b5ce2) 30%, #080b12) 58%,
			rgb(8 11 18 / 48%) 100%
		);
	content: "";
}

.npg-posts-page__hero-content {
	width: min(100%, 760px);
}

.npg-posts-page__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 18px;
	color: rgb(255 255 255 / 82%);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .16em;
	line-height: 1.4;
	text-transform: uppercase;
}

.npg-posts-page__eyebrow::before {
	width: 22px;
	height: 2px;
	background: var(--npg-hero-accent, #5b5ce2);
	content: "";
}

.npg-posts-page .npg-posts-page__hero h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(42px, 8vw, 88px);
	font-weight: 750;
	letter-spacing: -.055em;
	line-height: .98;
	text-wrap: balance;
}

.npg-posts-page__intro {
	max-width: 48ch;
	margin: 20px 0 0;
	color: rgb(255 255 255 / 82%);
	font-size: clamp(15px, 1.8vw, 19px);
	line-height: 1.65;
	text-wrap: pretty;
}

@media (max-width: 980px) {
	.npg-grid {
		--npg-columns: 2;
	}

	.npg-toolbar {
		grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
		gap: 14px;
	}

	.npg-filters {
		justify-content: flex-start;
	}

	.npg-portfolio--columns-1 .npg-grid {
		--npg-columns: 1;
	}
}

@media (max-width: 640px) {
	.npg-posts-page {
		padding: 18px 14px 36px;
	}

	.npg-posts-page__hero {
		min-height: 300px;
		margin-bottom: 28px;
		padding: 28px 24px;
		border-radius: 20px;
		background-position: center;
	}

	.npg-posts-page .npg-posts-page__hero h1 {
		font-size: clamp(40px, 12vw, 62px);
	}

	.npg-posts-page__intro {
		max-width: 36ch;
		margin-top: 14px;
	}

	.npg-toolbar {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
		margin-bottom: 22px;
	}

	.npg-search {
		width: 100%;
	}

	.npg-filters {
		align-items: flex-start;
		justify-content: flex-start;
		gap: 7px;
	}

	.npg-category-filter-rail {
		gap: 7px;
		padding-bottom: 8px;
	}

	.npg-filter-group {
		gap: 7px;
	}

	.npg-grid {
		--npg-columns: 1;
		gap: min(17px, var(--npg-grid-gap));
	}

	.npg-card__body {
		padding: min(18px, var(--npg-card-padding));
	}

	.npg-portfolio .npg-card__title {
		font-size: clamp(18px, 5vw, var(--npg-title-size, 21px));
	}
}

@media (max-width: 380px) {
	.npg-portfolio button.npg-filter {
		min-height: 34px;
		padding: 6px 10px;
		font-size: 12px;
	}

	.npg-card__actions {
		flex-wrap: wrap;
	}
}

@media (hover: none) {
	.npg-card:hover {
		transform: none;
	}

	.npg-card:hover .npg-card__image {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.npg-card,
	.npg-card__image,
	.npg-filter,
	.npg-button,
	.npg-icon-button,
	.npg-search,
	.npg-search__clear {
		transition: none;
	}
}
