/* Service rail follows the PetShop expanding category composition. */

.home-page .home-service-categories {
	position: relative;
	z-index: 2;
	width: 100vw;
	margin-right: calc(50% - 50vw);
	margin-left: calc(50% - 50vw);
	padding: 26px var(--home-content-rail-gutter) 48px;
	border-radius: 28px 28px 0 0;
	background: #fff;
	color: #fff;
}

.home-service-categories__rail {
	display: flex;
	gap: 14px;
	max-width: 1550px;
	height: clamp(360px, 32vw, 470px);
	margin: 0 auto;
}

.home-service-category {
	position: relative;
	container-type: inline-size;
	isolation: isolate;
	flex: .55 1 0;
	min-width: 64px;
	overflow: hidden;
	border-radius: 20px;
	background: linear-gradient(105deg, #81200e, #b8491f 44%, #dda453);
	cursor: pointer;
	transition: flex .7s cubic-bezier(.22, .8, .25, 1);
}

.home-service-category[data-home-service-category="social"] { background: linear-gradient(105deg, #0c3876, #226ac4 55%, #73b8e3); }
.home-service-category[data-home-service-category="seo"] { background: linear-gradient(105deg, #e7bd35, #f5d65e 55%, #ffeb9e); }
.home-service-category[data-home-service-category="ecommerce"] { background: linear-gradient(105deg, #34383c, #6d7479 55%, #aeb4b8); }
.home-service-category[data-home-service-category="software"] { background: linear-gradient(105deg, #0a513e, #168668 55%, #65c69b); }
.home-service-category[data-home-service-category="design"] { background: linear-gradient(105deg, #44236d, #7650a7 55%, #b49bd4); }

.home-service-category.is-expanded { flex: 3 1 0; }

.home-service-category__image {
	position: absolute;
	top: 0;
	left: 50%;
	bottom: 0;
	z-index: 1;
	width: auto;
	max-width: none;
	height: 100%;
	aspect-ratio: 3 / 2;
	object-fit: contain;
	object-position: right bottom;
	transform: translateX(-74%);
	pointer-events: none;
	transition: left .7s cubic-bezier(.22, .8, .25, 1), transform .7s cubic-bezier(.22, .8, .25, 1);
}

.home-service-category.is-expanded .home-service-category__image {
	left: 100%;
	max-width: 100%;
	transform: translateX(-100%);
}

.home-service-category__word {
	position: absolute;
	top: 18px;
	left: 20px;
	right: 20px;
	background: linear-gradient(rgba(255, 255, 255, .95) 16%, transparent 95%);
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
	font-size: clamp(32px, 18cqw, 120px);
	font-weight: 400;
	letter-spacing: -.07em;
	line-height: .98;
	opacity: 0;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity .4s;
}

.home-service-category__word > span { display: block; }

.home-service-category.is-expanded .home-service-category__word { opacity: 1; }

.home-service-category__closed-name {
	position: absolute;
	z-index: 2;
	bottom: 30px;
	left: 50%;
	font-size: 20px;
	letter-spacing: .02em;
	transform: translateX(-50%) rotate(180deg);
	transition: opacity .25s;
	white-space: nowrap;
	writing-mode: vertical-rl;
	text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
}

.home-service-category.is-expanded .home-service-category__closed-name { opacity: 0; }

.home-service-category__copy {
	position: absolute;
	z-index: 2;
	right: 24px;
	bottom: 26px;
	left: 24px;
	min-width: 180px;
	max-width: 40%;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px);
	transition: opacity .25s, transform .4s;
}

.home-service-category.is-expanded .home-service-category__copy {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	transition-delay: .18s;
}

.home-service-category__tag {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 30px;
	font-size: 10px;
	line-height: 1.2;
	white-space: nowrap;
}

.home-service-category__tag > span { font-size: 16px; }

.home-page .home-service-category h2 {
	margin: 16px 0 0;
	color: #fff;
	font-size: clamp(23px, 2.15vw, 34px);
	font-weight: 400;
	letter-spacing: -.045em;
	line-height: 1.18;
}

.home-page .home-service-category__link {
	display: flex;
	align-items: center;
	gap: 10px;
	width: fit-content;
	margin: 16px 0 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #fff;
	font-size: 11px;
	text-decoration: none;
	white-space: nowrap;
}

.home-service-category:not(.is-expanded) .home-service-category__link { visibility: hidden; }
.home-page .home-service-category[data-home-service-category="seo"] .home-service-category__copy,
.home-page .home-service-category[data-home-service-category="seo"] h2,
.home-page .home-service-category[data-home-service-category="seo"] .home-service-category__link { color: #4e3b10; }
.home-service-category[data-home-service-category="seo"] .home-service-category__tag { border-color: rgba(78, 59, 16, .4); }
.home-service-category:focus-visible { outline: 3px solid #2cbdd8; outline-offset: 4px; }
.home-service-category__link:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }

@media (max-width: 1000px) {
	.home-service-categories__rail { gap: 9px; height: 380px; }
	.home-service-category { min-width: 45px; border-radius: 15px; }
	.home-service-category.is-expanded { flex: 3.7 1 0; }
	.home-service-category__copy { right: 16px; left: 16px; min-width: 180px; }
	.home-service-category__tag { font-size: 9px; }
	.home-service-category__closed-name { font-size: 16px; }
	.home-page .home-service-category h2 { font-size: 24px; }
}

@media (max-width: 700px) {
	.home-page .home-service-categories { overflow-x: auto; padding: 18px 16px 30px; border-radius: 20px 20px 0 0; scrollbar-width: none; }
	.home-page .home-service-categories::-webkit-scrollbar { display: none; }
	.home-service-categories__rail { width: 100%; min-width: 670px; height: 340px; gap: 8px; }
	.home-service-category { min-width: 42px; }
	.home-service-category.is-expanded { flex: 3.4 1 0; }
	.home-service-category__copy { bottom: 20px; left: 14px; min-width: 170px; }
	.home-service-category__word { top: 16px; left: 14px; right: 14px; }
	.home-page .home-service-category h2 { font-size: 23px; }
	.home-service-category__tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.home-service-category,
	.home-service-category__image,
	.home-service-category__word,
	.home-service-category__copy,
	.home-service-category__closed-name { transition: none; }
}
