/*
 * /services/: 02 Inside each practice, the problem finder over six practice
 * cards (VOY-1521, spec KB-552, Round 5 boards Services-Final and
 * Services-Mobile).
 *
 * The title block (eyebrow, H2, lede), then "What is the problem?" over six
 * pill chips, then the cards in a 3 by 2 grid. Each card carries its
 * practice's umbrella style: lockup with an arrow, the practice line, the
 * "from" price in the practice colour, its services with prices (a core/table)
 * and "Inside the work", the old /capabilities/ list, as tags.
 *
 * svc-finder.js turns the chips into a toggle group. Picking one lights its
 * card in the practice colour, dims the other five to 42 percent and bursts
 * once on the lit card; "Show all" appears and clears it. With nothing
 * picked, hovering or focusing a card lights it the same way. This grid is the
 * page's second live dither surface: every card blinks faintly at rest, the
 * lit card densely, magenta until a card is lit and then its colour. Without
 * JavaScript the chips are links to the cards and "Show all" stays visible.
 *
 * Radii follow the design system rather than the board: 6px cards, pills only
 * for the chips and tags.
 */

/* ---- Title ----------------------------------------------------------------------- */

.vy-svc-page .vy-svc-finder__title { max-width: 760px; margin-bottom: 40px; }

.vy-svc-page .vy-svc-finder__lede {
	font-size: 17px;
	line-height: 1.6;
	color: var(--fg-3);
}

/* ---- The chips ------------------------------------------------------------------- */

.vy-svc-page .vy-svc-finder__bar { margin-bottom: 28px; }

.vy-svc-page .vy-svc-finder__ask {
	margin-bottom: 14px;
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-4);
}

.vy-svc-page .vy-svc-finder__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.vy-svc-page .vy-svc-finder__chips li:not(.vy-svc-finder__all) :is(a, button) {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	margin: 0;
	padding: 12px 18px;
	border: 1px solid var(--border-1);
	border-radius: 999px;
	background: color-mix(in oklab, var(--bg-panel) 70%, transparent);
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	color: var(--fg-3);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 260ms var(--svc-ease), background-color 260ms var(--svc-ease), color 260ms var(--svc-ease);
}
/* The dot: grey at rest, the practice colour when pressed. */
.vy-svc-page .vy-svc-finder__chips li:not(.vy-svc-finder__all) :is(a, button)::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--border-strong);
	transition: background-color 260ms var(--svc-ease);
}
.vy-svc-page .vy-svc-finder__chips li:not(.vy-svc-finder__all) :is(a, button):hover { border-color: var(--border-strong); color: var(--fg-2); }
.vy-svc-page .vy-svc-finder__chips :is(a, button):focus-visible {
	outline: 2px solid var(--accent-bright);
	outline-offset: 3px;
}
.vy-svc-page .vy-svc-finder__chips button[aria-pressed="true"] {
	border-color: var(--um-500);
	background: color-mix(in oklab, var(--bg-raised) 95%, transparent);
	color: var(--fg-1);
}
.vy-svc-page .vy-svc-finder__chips button[aria-pressed="true"]::before { background: var(--um-500); }

/* "Show all": quiet mono text, shown once a card is lit (svc-finder.js). */
.vy-svc-page .vy-svc-finder__all :is(a, button) {
	display: inline-block;
	margin: 0;
	padding: 12px 8px;
	border: 0;
	background: transparent;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--fg-4);
	text-decoration: none;
	cursor: pointer;
}
.vy-svc-page .vy-svc-finder__all :is(a, button):hover { color: var(--fg-2); }
.vy-svc-page .vy-svc-finder.is-js:not(.has-pick) .vy-svc-finder__all { display: none; }

/* ---- The cards ----------------------------------------------------------------------- */

.vy-svc-page .vy-svc-pcards {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}
.vy-svc-page .vy-svc-pcards > .vy-dither {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.vy-svc-page .vy-svc-pcard {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 28px;
	scroll-margin-top: 120px;
	border: 1px solid var(--border-hair);
	border-radius: 6px;
	background: color-mix(in oklab, var(--bg-panel) 82%, transparent);
	transition: opacity 320ms var(--svc-ease), border-color 260ms var(--svc-ease), background-color 260ms var(--svc-ease);
}
.vy-svc-page .vy-svc-pcard:focus { outline: none; }
.vy-svc-page .vy-svc-pcard:focus-visible {
	outline: 2px solid var(--um-500);
	outline-offset: 4px;
}

/* The arrow, level with the lockup. */
.vy-svc-page .vy-svc-pcard::after {
	content: "\2192";
	position: absolute;
	top: 28px;
	right: 28px;
	font-family: var(--font-mono);
	font-size: 16px;
	line-height: 20px;
	color: var(--border-strong);
	transition: transform 260ms var(--svc-ease), color 260ms var(--svc-ease);
	pointer-events: none;
}

.vy-svc-page .vy-svc-pcard .vy-lockup {
	margin: 0;
	padding-right: 32px;
	font-size: 17px;
	line-height: 20px;
}

.vy-svc-page .vy-svc-pcard__line {
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--fg-1);
}

.vy-svc-page .vy-svc-pcard__from {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--um-500);
}

/* Services with prices: a core/table, drawn as ruled rows. */
.vy-svc-page .vy-svc-pcard__svcs table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
}
.vy-svc-page .vy-svc-pcard__svcs td {
	padding: 9px 0;
	border: 0;
	border-top: 1px solid var(--border-hair);
	font-size: 14.5px;
	line-height: 1.35;
	vertical-align: baseline;
	word-break: normal;
	overflow-wrap: normal;
	color: var(--fg-2);
}
.vy-svc-page .vy-svc-pcard__svcs td:last-child {
	padding-left: 12px;
	font-family: var(--font-mono);
	font-size: 12px;
	white-space: nowrap;
	text-align: right;
	color: var(--fg-3);
}
/* A service not sold yet: the name dims and its state is a small tag. */
.vy-svc-page .vy-svc-pcard__svcs tr:has(em) td:first-child { color: var(--fg-4); }
.vy-svc-page .vy-svc-pcard__svcs td em {
	display: inline-block;
	padding: 2px 7px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	font-size: 8.5px;
	font-style: normal;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-3);
}
.vy-svc-page .vy-svc-pcard__svcs td a {
	color: inherit;
	text-decoration: none;
}
.vy-svc-page .vy-svc-pcard__svcs td a:is(:hover, :focus-visible) {
	color: var(--um-500);
	text-decoration: underline;
}

.vy-svc-page .vy-svc-pcard__inside {
	font-family: var(--font-mono);
	font-size: 9px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--um-500);
}

/* Inside the work: tags. The card's 18px gap is 10px here, as on the board. */
.vy-svc-page .vy-svc-pcard__caps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: -8px;
	padding: 0;
	list-style: none;
}
.vy-svc-page .vy-svc-pcard__caps > li {
	padding: 5px 10px;
	border: 1px solid var(--border-1);
	border-radius: 999px;
	font-size: 12.5px;
	line-height: 1.3;
	color: var(--fg-3);
}

/* ---- Lit and dimmed ---------------------------------------------------------------- */

.vy-svc-page .vy-svc-pcards.has-lit .vy-svc-pcard:not(.is-lit) { opacity: 0.42; }
.vy-svc-page .vy-svc-pcard.is-lit {
	border-color: var(--um-500);
	background: color-mix(in oklab, var(--bg-raised) 94%, transparent);
}
.vy-svc-page .vy-svc-pcard.is-lit::after {
	color: var(--um-500);
	transform: translateX(6px);
}

/* ---- Tablet and mobile ------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.vy-svc-page .vy-svc-pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.vy-svc-page .vy-svc-finder__title { margin-bottom: 28px; }
	.vy-svc-page .vy-svc-finder__lede { font-size: 16px; }
	.vy-svc-page .vy-svc-finder__ask { margin-bottom: 12px; }
	.vy-svc-page .vy-svc-finder__chips { gap: 8px; }
	.vy-svc-page .vy-svc-finder__chips li:not(.vy-svc-finder__all) :is(a, button) {
		gap: 8px;
		min-height: 44px;
		padding: 11px 14px;
		font-size: 14px;
	}
	.vy-svc-page .vy-svc-finder__all :is(a, button) { min-height: 44px; padding: 11px 6px; }

	.vy-svc-page .vy-svc-pcards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.vy-svc-page .vy-svc-pcard { gap: 14px; padding: 22px 20px; scroll-margin-top: 88px; }
	.vy-svc-page .vy-svc-pcard::after { display: none; }
	.vy-svc-page .vy-svc-pcard .vy-lockup { padding-right: 0; font-size: 16px; }
	.vy-svc-page .vy-svc-pcard__line { font-size: 20px; line-height: 1.22; }
	.vy-svc-page .vy-svc-pcard__caps { margin-top: -4px; }
}

@media (prefers-reduced-motion: reduce) {
	.vy-svc-page .vy-svc-pcard,
	.vy-svc-page .vy-svc-pcard::after,
	.vy-svc-page .vy-svc-finder__chips :is(a, button),
	.vy-svc-page .vy-svc-finder__chips :is(a, button)::before { transition: none; }
}
