.vl-portfolio {
	--vl-card-border: #e8e8ed;
	--vl-soft: #f5f5f7;
	--vl-muted: #6e6e73;
	width: 100%;
	padding: 20px 0 40px;
	font-family: var(--vuolia-font);
}

.vl-portfolio-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	width: min(100%, 1180px);
	margin: 0 auto 24px;
}

.vl-filter,
.vl-device-button {
	appearance: none;
	border: 0;
	font-family: inherit;
}

.vl-filter {
	min-height: 36px;
	padding: 8px 17px;
	border-radius: 999px;
	background: #f1f1f3;
	color: #4c4c52;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.vl-filter:hover,
.vl-filter:focus-visible {
	background: #e8e8eb;
	transform: translateY(-1px);
}

.vl-filter.is-active {
	background: var(--vuolia-ink);
	color: #fff;
}

.vl-filter:focus-visible,
.vl-device-button:focus-visible,
.vl-project-link:focus-visible {
	outline: 2px solid var(--vuolia-orange);
	outline-offset: 2px;
}

.vl-project-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	width: min(100%, 1180px);
	margin: 0 auto;
	transition: opacity 100ms ease, transform 100ms ease;
}

.vl-project-grid.is-changing {
	opacity: 0.25;
	transform: translateY(3px);
}

.vl-project-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 18px;
	overflow: hidden;
	border: 1px solid var(--vl-card-border);
	border-radius: 20px;
	background: #fff;
	box-shadow:
		0 1px 2px rgb(0 0 0 / 2%),
		0 8px 24px rgb(0 0 0 / 2.5%);
}

.vl-project-card[hidden],
.vl-project-panel[hidden] {
	display: none !important;
}

.vl-project-heading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 34px;
	margin: 0 4px 14px;
	text-align: center;
}

.vl-project-heading h2 {
	margin: 0;
	color: #36363b;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.vl-project-flag {
	display: block;
	flex: 0 0 auto;
	width: 21px;
	height: 15px;
	border-radius: 2px;
	object-fit: contain;
	box-shadow: 0 0 0 0.5px rgb(0 0 0 / 8%);
}

.vl-device-switch {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	width: 150px;
	margin: 0 auto 14px;
	padding: 3px;
	border-radius: 999px;
	background: #f0f0f2;
}

.vl-device-switch::before {
	position: absolute;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc(50% - 3px);
	border-radius: 999px;
	background: var(--vuolia-ink);
	box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
	content: "";
	transform: translateX(0);
	transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vl-device-switch.is-mobile::before {
	transform: translateX(100%);
}

.vl-device-button {
	position: relative;
	z-index: 1;
	min-height: 28px;
	padding: 6px 12px;
	border-radius: 999px;
	background: transparent;
	color: var(--vl-muted);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: color 160ms ease;
}

.vl-device-button.is-active {
	color: #fff;
}

.vl-project-panels {
	display: grid;
	place-items: stretch;
	height: 220px;
	margin-bottom: 16px;
	overflow: hidden;
	border: 1px solid #eeeef1;
	border-radius: 15px;
	background: var(--vl-soft);
	opacity: 1;
	transform: translateY(0);
	transition: opacity 90ms ease, transform 90ms ease;
}

.vl-project-panels.is-switching {
	opacity: 0;
	transform: translateY(3px);
}

.vl-project-panel,
.vl-project-visual {
	width: 100%;
	height: 100%;
}

.vl-project-visual {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
}

.vl-project-visual img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.vl-project-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin-top: auto;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--vuolia-ink);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background-color 150ms ease, transform 150ms ease;
}

.vl-project-link:hover,
.vl-project-link:focus-visible {
	background: #303034;
	color: #fff;
	transform: translateY(-1px);
}

.vl-project-link svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: var(--vuolia-orange);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 900px) {
	.vl-project-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

@media (max-width: 620px) {
	.vl-portfolio {
		padding: 14px 0 32px;
	}

	.vl-portfolio-filters {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 8px;
		overflow-x: auto;
		margin-bottom: 18px;
		padding: 0 1px 4px;
		scrollbar-width: none;
		scroll-snap-type: x proximity;
	}

	.vl-portfolio-filters::-webkit-scrollbar {
		display: none;
	}

	.vl-filter {
		flex: 0 0 auto;
		min-height: 34px;
		padding-inline: 16px;
		scroll-snap-align: start;
	}

	.vl-project-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.vl-project-card {
		padding: 14px;
		border-radius: 18px;
		box-shadow:
			0 1px 2px rgb(0 0 0 / 2%),
			0 6px 20px rgb(0 0 0 / 2.5%);
	}

	.vl-project-heading {
		min-height: 32px;
		margin: 0 4px 12px;
	}

	.vl-device-switch {
		margin-bottom: 12px;
	}

	.vl-project-panels {
		height: clamp(224px, 64vw, 248px);
		margin-bottom: 14px;
		border-radius: 14px;
	}

	.vl-project-visual {
		padding: 12px;
	}

	.vl-project-link {
		min-height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vl-filter,
	.vl-device-button,
	.vl-device-switch::before,
	.vl-project-grid,
	.vl-project-panels,
	.vl-project-link {
		transition: none;
	}
}
