/* Shared category card layout for lucky and feng shui phone number category pages. */
.card-category {
	position: relative;
	overflow: visible;
	margin: 2rem 0 3rem;
	padding: clamp(1.5rem, 4vw, 3rem);
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #1e293b;
	box-shadow: none;
}

.card-category:before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
	background-size: 42px 42px;
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
	animation: fengGridDrift 18s linear infinite;
	pointer-events: none;
}

.card-category a {
	color: inherit;
}

.card-category__hero,
.card-category__grid {
	position: relative;
	z-index: 1;
}

.card-category__hero {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
	gap: 2rem;
	align-items: center;
	margin-bottom: 2rem;
}

.card-category__eyebrow,
.card-category__metric-label {
	font-family: "JetBrains Mono", "Courier New", monospace;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: #2563eb;
}

.card-category h1 {
	margin: 0.4rem 0 1rem;
	color: #0f172a;
	font-size: clamp(2.2rem, 6vw, 4rem);
	font-weight: 500;
	line-height: 1.04;
}

.card-category__lead {
	max-width: 46rem;
	color: #475569;
	font-size: 1.05rem;
	line-height: 1.7;
}

.card-category__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	margin-top: 1.4rem;
}

.card-category__button {
	--action-hue: 229;
	--action-saturation: 71%;
	--action-lightness: 62%;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.05rem;
	overflow: hidden;
	padding: 0.45rem 0.78rem;
	border: 1px solid rgb(61, 106, 255);
	border-radius: 7px;
	background: transparent;
	box-shadow: 0 0 0 0 transparent;
	color: hsl(var(--hue), 70%, 32%);
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: 0.08em;
	text-decoration: none;
	transition: color 200ms ease-in, background 200ms ease-in, box-shadow 200ms ease-in, border-color 200ms ease-in;
}

.card-category__button:before {
	content: "";
	display: none;
	width: 0;
	height: 86%;
	position: absolute;
	top: 7%;
	left: 0;
	opacity: 0;
	background: #fff;
	box-shadow: 0 0 50px 30px #fff;
	transform: skewX(-20deg);
}

.card-category__button:hover:before,
.card-category__button:focus:before {
	animation: fengSubcategoryShine 0.5s 0s linear;
}

.card-category__button.is-active {
	background: #0d0d0d;
	color: #fff;
	outline-color: transparent;
}

.card-category__button:hover,
.card-category__button:focus {
	border-color: hsl(var(--action-hue), var(--action-saturation), var(--action-lightness));
	background: hsl(var(--action-hue), var(--action-saturation), var(--action-lightness));
	box-shadow: none;
	color: #fff;
	outline: none;
}

.card-category__button.is-active:not([data-category-filter="all"]) {
	border-color: hsl(var(--action-hue), var(--action-saturation), var(--action-lightness));
	background: hsl(var(--action-hue), var(--action-saturation), var(--action-lightness));
}

.card-category__button:active {
	box-shadow: 0 0 0 0 transparent;
}

.card-category__telemetry {
	position: relative;
	min-height: 260px;
	padding: 1.25rem;
	border: 1px solid rgba(37, 99, 235, 0.14);
	border-radius: 23px;
	background: rgba(255, 255, 255, 0.68);
	backdrop-filter: blur(14px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.card-category__rings {
	position: absolute;
	inset: 1rem;
	border-radius: 23px;
	background: radial-gradient(circle, transparent 0 26%, rgba(37, 99, 235, 0.1) 27% 28%, transparent 29% 44%, rgba(14, 165, 233, 0.12) 45% 46%, transparent 47%);
	animation: fengPulse 4.8s ease-in-out infinite;
}

.card-category__graph {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
	height: 100%;
	min-height: 220px;
}

.card-category__metric {
	align-self: start;
	padding: 0.9rem;
	border: 1px solid rgba(37, 99, 235, 0.12);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 18px 36px rgba(37, 99, 235, 0.11);
	animation: fengFloat 5s ease-in-out infinite;
}

.card-category__metric:nth-child(2) {
	align-self: center;
	animation-delay: -1.2s;
}

.card-category__metric:nth-child(3) {
	align-self: end;
	animation-delay: -2.4s;
}

.card-category__metric strong {
	display: block;
	margin-top: 0.35rem;
	color: #0f172a;
	font-size: 1.25rem;
	line-height: 1;
}

.card-category__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: start;
	gap: 1rem;
}

.card-category__slot {
	position: relative;
	z-index: 1;
	min-height: 0;
}

.card-category__grid.is-initializing .card-category__slot {
	opacity: 0;
}

.card-category__slot.is-filtered-out {
	display: none;
}

.card-category__slot:before {
	content: "";
	position: absolute;
	top: -0.75rem;
	bottom: -0.75rem;
	left: 0;
	z-index: 1;
	width: 100%;
	pointer-events: none;
}

.card-category__slot:hover,
.card-category__slot:focus-within {
	z-index: 8;
}

.card-category__slot:hover:before,
.card-category__slot:focus-within:before {
	pointer-events: auto;
}

.card-category__slot.is-collapsed:before,
.card-category__slot.is-collapsed:hover:before {
	pointer-events: none;
}

.card-category__slot:nth-child(4n):before {
	right: 0;
	left: auto;
}

.card-category__slot:nth-child(4n) .card-category__card {
	right: 0;
	left: auto;
}

.card-category__card {
	--hue: 210;
	--saturation: 82%;
	--lightness: 52%;
	position: relative;
	top: 0;
	left: 0;
	z-index: 2;
	box-sizing: border-box;
	width: 100%;
	min-height: 13.5rem;
	overflow: hidden;
	padding: 1rem;
	border: 1px solid hsla(var(--hue), var(--saturation), var(--lightness), 0.22);
	border-radius: 15px;
	background: linear-gradient(135deg, hsla(var(--hue), var(--saturation), var(--lightness), 0.1), rgba(255, 255, 255, 0.86) 42%, rgba(255, 255, 255, 0.82));
	color: #1e293b;
	font-family: inherit;
	backdrop-filter: blur(10px);
	transition: width 300ms ease-in-out, transform 300ms ease-in-out, color 300ms ease-in-out, background 300ms ease-in-out, border-color 300ms ease-in-out, box-shadow 300ms ease-in-out, opacity 180ms ease, filter 180ms ease;
}

.card-category__card:after {
	content: "";
	display: none;
	position: absolute;
	top: -40%;
	right: -25%;
	width: 160px;
	height: 160px;
	border-radius: 50%;
	background: hsla(var(--hue), var(--saturation), var(--lightness), 0.18);
	filter: blur(10px);
	transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
}

.card-category__slot.is-expanded .card-category__card,
.card-category__slot:hover .card-category__card,
.card-category__slot:focus-within .card-category__card {
	z-index: 3;
	width: 100%;
	height: auto;
	transform: none;
	border-color: rgba(255, 255, 255, 0.9);
	background: rgba(255, 255, 255, 0.94);
	color: #0d0d0d;
	outline: 1px solid rgb(255, 255, 255);
	box-shadow: none;
}

.card-category__slot:hover .card-category__card {
	--lightness: 80%;
	background: #ffffff80;
	box-shadow: inset 0 0 80px whitesmoke, inset 20px 0 80px rgba(255, 0, 255, 0.747),
		inset -20px 0 80px #0ff, inset 20px 0 300px #f0f, inset -20px 0 300px #0ff,
		0 0 50px #fff, -10px 0 80px #f0f, 10px 0 80px #0ff;
}

.card-category__slot.is-collapsed:hover .card-category__card {
	width: 100%;
	transform: none;
}

.card-category__slot.is-expanded .card-category__card:after,
.card-category__slot:hover .card-category__card:after,
.card-category__slot:focus-within .card-category__card:after {
	opacity: 0.18;
	transform: scale(1.4);
}

.card-category__grid:hover .card-category__card {
	opacity: 0.46;
	filter: saturate(0.65);
}

.card-category__grid:hover .card-category__slot.is-expanded .card-category__card,
.card-category__grid:hover .card-category__slot:hover .card-category__card {
	opacity: 1;
	filter: saturate(1);
}

.card-category__card h2 {
	position: relative;
	z-index: 1;
	margin: 0.35rem 0 0.75rem;
	color: hsl(var(--hue), 68%, 34%);
	font-size: 1.35rem;
	transition: color 300ms ease-in-out;
}

.card-category__slot.is-expanded .card-category__card h2,
.card-category__slot:hover .card-category__card h2,
.card-category__slot:focus-within .card-category__card h2 {
	color: #0d0d0d;
}

.card-category__card p {
	position: relative;
	z-index: 1;
	min-height: 5.2rem;
	margin-bottom: 1rem;
	color: #475569;
	font-size: 0.96rem;
	line-height: 1.65;
	transition: color 300ms ease-in-out;
}

.card-category__slot.is-expanded .card-category__card p,
.card-category__slot:hover .card-category__card p,
.card-category__slot:focus-within .card-category__card p {
	color: rgba(0, 0, 0, 0.76);
}

.card-category__subcategories {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: -0.2rem 0 1rem;
}

.card-category__subcategory {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 2.05rem;
	overflow: hidden;
	padding: 0.45rem 0.78rem;
	border: 1px solid hsl(var(--hue), var(--saturation), var(--lightness));
	border-radius: 7px;
	background: transparent;
	box-shadow: 0 0 0 0 transparent;
	color: hsl(var(--hue), 72%, 36%);
	cursor: pointer;
	font-size: 0.72rem;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: 0.08em;
	transition: color 200ms ease-in, background 200ms ease-in, box-shadow 200ms ease-in, border-color 200ms ease-in;
}

.card-category__subcategory:before {
	content: "";
	display: none;
	width: 0;
	height: 86%;
	position: absolute;
	top: 7%;
	left: 0;
	opacity: 0;
	background: #fff;
	box-shadow: 0 0 50px 30px #fff;
	transform: skewX(-20deg);
}

.card-category__subcategory:hover:before,
.card-category__subcategory:focus:before,
.card-category__subcategory.is-active:before {
	animation: fengSubcategoryShine 0.5s 0s linear;
}

.card-category__subcategory.is-active,
.card-category__subcategory:hover,
.card-category__subcategory:focus {
	border-color: hsl(var(--hue), var(--saturation), var(--lightness));
	background: hsl(var(--hue), var(--saturation), var(--lightness));
	box-shadow: none;
	color: #fff;
	outline: none;
}

.card-category__subcategory:active {
	box-shadow: 0 0 0 0 transparent;
}

.card-category__slot.is-expanded .card-category__card .card-category__subcategory,
.card-category__slot:hover .card-category__card .card-category__subcategory,
.card-category__slot:focus-within .card-category__card .card-category__subcategory {
	border-color: hsl(var(--hue), var(--saturation), var(--lightness));
	background: transparent;
	color: #0d0d0d;
}

.card-category__slot.is-expanded .card-category__card .card-category__subcategory.is-active,
.card-category__slot.is-expanded .card-category__card .card-category__subcategory:hover,
.card-category__slot.is-expanded .card-category__card .card-category__subcategory:focus,
.card-category__slot:hover .card-category__card .card-category__subcategory.is-active,
.card-category__slot:hover .card-category__card .card-category__subcategory:hover,
.card-category__slot:hover .card-category__card .card-category__subcategory:focus,
.card-category__slot:focus-within .card-category__card .card-category__subcategory.is-active,
.card-category__slot:focus-within .card-category__card .card-category__subcategory:hover,
.card-category__slot:focus-within .card-category__card .card-category__subcategory:focus {
	background: hsl(var(--hue), var(--saturation), var(--lightness));
	box-shadow: none;
	color: #fff;
}

.card-category__show-more {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	min-height: 1.7rem;
	margin-bottom: 0.45rem;
	color: hsl(var(--hue), 70%, 32%);
	font-size: 0.78rem;
	font-weight: 700;
	pointer-events: none;
	transition: opacity 180ms ease, transform 180ms ease, color 300ms ease-in-out;
}

.card-category__slot.is-expanded .card-category__card .card-category__show-more,
.card-category__slot:hover .card-category__card .card-category__show-more,
.card-category__slot:focus-within .card-category__card .card-category__show-more {
	opacity: 0;
	transform: translateY(-4px);
}

.card-category__numbers {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.4rem;
	overflow: hidden;
	max-height: 5.6rem;
	margin-bottom: 0.75rem;
	transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-category__slot.is-expanded .card-category__card .card-category__numbers,
.card-category__slot:hover .card-category__card .card-category__numbers,
.card-category__slot:focus-within .card-category__card .card-category__numbers {
	max-height: 18rem;
}

.card-category__slot.is-collapsed:hover .card-category__card .card-category__numbers {
	max-height: 5.6rem;
}

.card-category__number {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.48rem 0.3rem;
	border: 1px solid hsla(var(--hue), var(--saturation), var(--lightness), 0.2);
	border-radius: 14px;
	/* background: hsla(var(--hue), var(--saturation), var(--lightness), 0.08); */
	font-family: inherit;
	color: hsl(var(--hue), 70%, 32%);
	font-size: 0.82rem;
	transition: opacity 260ms ease, transform 320ms ease, color 300ms ease-in-out, background 300ms ease-in-out, border-color 300ms ease-in-out;
}

.card-category__number a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	color: inherit;
	text-decoration: none;
}

.card-category__slot.is-expanded .card-category__card .card-category__number,
.card-category__slot:hover .card-category__card .card-category__number,
.card-category__slot:focus-within .card-category__card .card-category__number {
	border-color: hsla(var(--hue), var(--saturation), var(--lightness), 0.34);
	background: rgba(255, 255, 255, 0.72);
	color: #0d0d0d;
}

.card-category__number:nth-child(n+5) {
	opacity: 0;
	transform: translateY(-8px);
}

.card-category__slot.is-expanded .card-category__card .card-category__number:nth-child(n+5),
.card-category__slot:hover .card-category__card .card-category__number:nth-child(n+5),
.card-category__slot:focus-within .card-category__card .card-category__number:nth-child(n+5) {
	opacity: 1;
	transform: translateY(0);
}

.card-category__slot.is-collapsed:hover .card-category__card .card-category__number:nth-child(n+5) {
	opacity: 0;
	transform: translateY(-8px);
}

.card-category__number span {
	color: #2563eb;
	font-size: 0.76rem;
}

.card-category__show-all {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	margin-top: 0.3rem;
	padding: 0.58rem 0.75rem;
	border-radius: 10px;
	outline: 1px solid hsla(var(--hue), var(--saturation), var(--lightness), 0.32);
	color: hsl(var(--hue), 72%, 36%);
	font-weight: 700;
	text-decoration: none;
	opacity: 0;
	pointer-events: none;
	transform: translateY(6px);
	transition: opacity 220ms ease, transform 220ms ease, color 300ms ease-in-out, background 300ms ease-in-out, outline-color 300ms ease-in-out;
}

.card-category__slot.is-expanded .card-category__card .card-category__show-all,
.card-category__slot:hover .card-category__card .card-category__show-all,
.card-category__slot:focus-within .card-category__card .card-category__show-all {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	outline-color: transparent;
	background: hsl(var(--hue), var(--saturation), var(--lightness));
	color: #fff;
}

.card-category__show-all:after {
	content: "→";
	transition: transform 180ms ease;
}

.card-category__show-all:hover:after {
	transform: translateX(4px);
}


/* Category colour accents. Colours are intentionally shared across page types. */
.card-category__button[data-category-filter="phone-number.lucky-number.general-patterns"] {
	--action-hue: 220;
	--action-saturation: 82%;
	--action-lightness: 52%;
}

.card-category__button[data-category-filter="phone-number.lucky-number.ending"] {
	--action-hue: 165;
	--action-saturation: 82%;
	--action-lightness: 51%;
}

.card-category__button[data-category-filter="phone-number.lucky-number.prefix"] {
	--action-hue: 292;
	--action-saturation: 84%;
	--action-lightness: 62%;
}

.card-category__button[data-category-filter="phone-number.lucky-number.mixed-digits"] {
	--action-hue: 188;
	--action-saturation: 92%;
	--action-lightness: 54%;
}

.card-category__button[data-category-filter="phone-number.lucky-number.pattern"] {
	--action-hue: 42;
	--action-saturation: 96%;
	--action-lightness: 58%;
}

.card-category__slot[data-parent-key="phone-number.lucky-number.general-patterns"] .card-category__card {
	--hue: 220;
	--saturation: 82%;
	--lightness: 52%;
}

.card-category__slot[data-parent-key="phone-number.lucky-number.ending"] .card-category__card {
	--hue: 165;
	--saturation: 82%;
	--lightness: 51%;
}

.card-category__slot[data-parent-key="phone-number.lucky-number.prefix"] .card-category__card {
	--hue: 292;
	--saturation: 84%;
	--lightness: 62%;
}

.card-category__slot[data-parent-key="phone-number.lucky-number.mixed-digits"] .card-category__card {
	--hue: 188;
	--saturation: 92%;
	--lightness: 54%;
}

.card-category__slot[data-parent-key="phone-number.lucky-number.pattern"] .card-category__card {
	--hue: 42;
	--saturation: 96%;
	--lightness: 58%;
}

.card-category__button[data-category-filter="phone-number.feng-shui.san-tin-jin"] {
	--action-hue: 220;
	--action-saturation: 82%;
	--action-lightness: 52%;
}

.card-category__button[data-category-filter="phone-number.feng-shui.five-elements"] {
	--action-hue: 165;
	--action-saturation: 82%;
	--action-lightness: 51%;
}

.card-category__button[data-category-filter="phone-number.feng-shui.hexagram"] {
	--action-hue: 292;
	--action-saturation: 84%;
	--action-lightness: 62%;
}

.card-category__button[data-category-filter="phone-number.feng-shui.zodiac"] {
	--action-hue: 188;
	--action-saturation: 92%;
	--action-lightness: 54%;
}

.card-category__button[data-category-filter="phone-number.feng-shui.horoscope"] {
	--action-hue: 42;
	--action-saturation: 96%;
	--action-lightness: 58%;
}

.card-category__slot[data-parent-key="phone-number.feng-shui.san-tin-jin"] .card-category__card {
	--hue: 220;
	--saturation: 82%;
	--lightness: 52%;
}

.card-category__slot[data-parent-key="phone-number.feng-shui.five-elements"] .card-category__card {
	--hue: 165;
	--saturation: 82%;
	--lightness: 51%;
}

.card-category__slot[data-parent-key="phone-number.feng-shui.hexagram"] .card-category__card {
	--hue: 292;
	--saturation: 84%;
	--lightness: 62%;
}

.card-category__slot[data-parent-key="phone-number.feng-shui.zodiac"] .card-category__card {
	--hue: 188;
	--saturation: 92%;
	--lightness: 54%;
}

.card-category__slot[data-parent-key="phone-number.feng-shui.horoscope"] .card-category__card {
	--hue: 42;
	--saturation: 96%;
	--lightness: 58%;
}

@keyframes fengGridDrift {
	from { background-position: 0 0; }
	to { background-position: 84px 84px; }
}

@keyframes fengPulse {
	0%, 100% { opacity: 0.58; transform: scale(0.98); }
	50% { opacity: 1; transform: scale(1.03); }
}

@keyframes fengFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-12px); }
}

@keyframes fengSubcategoryShine {
	from {
		opacity: 0;
		left: 0;
	}

	50% {
		opacity: 1;
	}

	to {
		opacity: 0;
		left: 100%;
	}
}

@media screen and (max-width: 980px) {
	.card-category__hero {
		grid-template-columns: 1fr;
	}

	.card-category__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.card-category__slot:nth-child(4n):before {
		right: auto;
		left: 0;
	}

	.card-category__slot:nth-child(4n) .card-category__card {
		right: auto;
		left: 0;
	}

	.card-category__slot:nth-child(2n) .card-category__card {
		right: 0;
		left: auto;
	}

	.card-category__slot:nth-child(2n):before {
		right: 0;
		left: auto;
	}

	.card-category__card p {
		min-height: 0;
	}
}

@media (hover: none), (pointer: coarse) {
	.card-category__slot:hover .card-category__card,
	.card-category__slot:focus-within .card-category__card {
		width: 100%;
		transform: none;
		border-color: rgba(37, 99, 235, 0.12);
		background: rgba(255, 255, 255, 0.82);
		color: #1e293b;
		outline: none;
		box-shadow: none;
	}

	.card-category__slot.is-expanded .card-category__card {
		width: 100%;
		transform: none;
		border-color: rgba(255, 255, 255, 0.9);
		background: rgba(255, 255, 255, 0.94);
		color: #0d0d0d;
		outline: 1px solid rgb(255, 255, 255);
		box-shadow: inset 0 0 80px whitesmoke, inset 20px 0 80px rgba(255, 0, 255, 0.747),
			inset -20px 0 80px #0ff, inset 20px 0 300px #f0f, inset -20px 0 300px #0ff,
			0 0 50px #fff, -10px 0 80px #f0f, 10px 0 80px #0ff;
	}

	.card-category__slot:hover .card-category__card .card-category__numbers,
	.card-category__slot:focus-within .card-category__card .card-category__numbers {
		max-height: 5.2rem;
	}

	.card-category__slot.is-expanded .card-category__card .card-category__numbers {
		max-height: 18rem;
	}

	.card-category__slot:hover .card-category__card .card-category__number:nth-child(n+5),
	.card-category__slot:focus-within .card-category__card .card-category__number:nth-child(n+5) {
		opacity: 0;
		transform: translateY(-8px);
	}

	.card-category__slot.is-expanded .card-category__card .card-category__number:nth-child(n+5) {
		opacity: 1;
		transform: translateY(0);
	}
}
