/*
 * /services/: the hero and the six-practice index (VOY-1521, spec KB-552
 * "/services/ structure", Round 5 board Services-Final).
 *
 * The hero is two columns: eyebrow and the two-line H1 (the <em> line in
 * fg-4) on the left, the lede and two buttons in a 420px column on the right,
 * both sitting on the same baseline. The index sits 88px under it: six 132px
 * rows of number, practice name, the line with its services in mono beneath,
 * the "from" price and an arrow. Each row carries its practice's umbrella
 * style, so its --um-500 is that practice's colour.
 *
 * This is the page's first live dither surface. svc-pindex.js puts a
 * vy-dither.js field behind the rows: every row blinks faintly in magenta at
 * rest, and hovering or focusing a row densifies the blink under it and turns
 * the whole field that practice's colour. No burst here: the arrow's commit
 * lands on the card below. The field is off on touch and with reduced motion,
 * where the rows stand on their own.
 *
 * The row name is a link to the card without JavaScript; svc-pindex.js turns
 * it into a button stretched over the row. The arrow is drawn, not typed.
 */

/* ---- Page type scale (the board's 44px section heads) ---------------------------- */

.vy-svc-page.vy-svc-sx .vy-svc-h2 {
	max-width: none;
	font-size: 44px;
	line-height: 1.06;
	letter-spacing: -0.03em;
	margin-bottom: 18px;
}

/* ---- Hero ---------------------------------------------------------------------- */

.vy-svc-page > .vy-svc-sxhero {
	position: relative;
	isolation: isolate;
	/* Sideways only: the glow runs down behind the index, as on the board. */
	overflow-x: clip;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 420px;
	gap: 64px;
	align-items: end;
	margin-bottom: 88px;
}
/* svc-base pads the first section 88px; the board's hero sits at 96. */
.vy-svc-page > .vy-svc-sxhero:first-child { padding-top: 96px; }
/* The magenta glow behind the lede, on the section, which has content. */
.vy-svc-page > .vy-svc-sxhero::before {
	content: "";
	position: absolute;
	top: 0;
	right: -160px;
	z-index: -1;
	width: 900px;
	height: 700px;
	border-radius: 50%;
	background: radial-gradient(closest-side, color-mix(in oklab, var(--accent-bright) 12%, transparent), transparent);
	pointer-events: none;
}

.vy-svc-page .vy-svc-sxhero .vy-svc-eyebrow { margin-bottom: 24px; }

.vy-svc-page .vy-svc-sxhero .vy-svc-h1 {
	max-width: none;
	margin-bottom: 0;
	font-size: 88px;
	line-height: 0.95;
	letter-spacing: -0.045em;
}
.vy-svc-page .vy-svc-sxhero .vy-svc-h1 em {
	display: block;
	font-style: normal;
	color: var(--fg-4);
}

.vy-svc-page .vy-svc-sxhero .vy-svc-lede {
	max-width: none;
	margin-bottom: 22px;
	font-size: 17px;
	color: var(--fg-2);
}

/* ---- The index ------------------------------------------------------------------- */

.vy-svc-page .vy-svc-pidx {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid var(--border-hair);
}
.vy-svc-page .vy-svc-pidx > .vy-dither {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.vy-svc-page .vy-svc-prow {
	position: relative;
	display: grid;
	grid-template-columns: 70px 380px minmax(0, 1fr) 240px 40px;
	grid-template-rows: auto auto;
	column-gap: 24px;
	row-gap: 6px;
	align-content: center;
	align-items: center;
	height: 132px;
	box-sizing: border-box;
	padding: 0 24px;
	border-top: 1px solid var(--border-hair);
	transition: background-color 260ms var(--svc-ease);
}

.vy-svc-page .vy-svc-prow__num {
	grid-row: 1 / span 2;
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--fg-4);
	transition: color 260ms var(--svc-ease);
}

.vy-svc-page .vy-svc-prow__name {
	grid-row: 1 / span 2;
	font-family: var(--font-display);
	font-size: 46px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.035em;
	color: var(--fg-1);
	transition: color 260ms var(--svc-ease);
}
/* The link (no JavaScript) and the button (svc-pindex.js) look the same and
   both stretch over the whole row. */
.vy-svc-page .vy-svc-prow__name :is(a, button) {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.vy-svc-page .vy-svc-prow__name :is(a, button)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.vy-svc-page .vy-svc-prow__name :is(a, button):focus-visible { outline: none; }
.vy-svc-page .vy-svc-prow:has(:is(a, button):focus-visible) {
	outline: 2px solid var(--um-500);
	outline-offset: -2px;
}

.vy-svc-page .vy-svc-prow__line {
	grid-column: 3;
	grid-row: 1;
	align-self: end;
	font-size: 16px;
	line-height: 1.45;
	color: var(--fg-2);
}

.vy-svc-page .vy-svc-prow__svcs {
	grid-column: 3;
	grid-row: 2;
	align-self: start;
	font-family: var(--font-mono);
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--fg-4);
	opacity: 0.55;
	transition: opacity 260ms var(--svc-ease);
}

.vy-svc-page .vy-svc-prow__from {
	grid-column: 4;
	grid-row: 1 / span 2;
	font-family: var(--font-mono);
	font-size: 12px;
	line-height: 1.4;
	color: var(--fg-4);
	text-align: right;
	transition: color 260ms var(--svc-ease);
}

/* The arrow. */
.vy-svc-page .vy-svc-prow::after {
	content: "\2192";
	grid-column: 5;
	grid-row: 1 / span 2;
	justify-self: end;
	font-family: var(--font-mono);
	font-size: 18px;
	color: var(--border-strong);
	transition: transform 260ms var(--svc-ease), color 260ms var(--svc-ease);
}

/* ---- Hover and focus: the practice colour --------------------------------------- */

.vy-svc-page .vy-svc-prow:is(:hover, :focus-within) {
	background: color-mix(in oklab, var(--bg-panel) 35%, transparent);
}
.vy-svc-page .vy-svc-prow:is(:hover, :focus-within, .is-active) :is(.vy-svc-prow__num, .vy-svc-prow__name),
.vy-svc-page .vy-svc-prow:is(:hover, :focus-within, .is-active)::after { color: var(--um-500); }
.vy-svc-page .vy-svc-prow:is(:hover, :focus-within) .vy-svc-prow__svcs { opacity: 1; }
.vy-svc-page .vy-svc-prow:is(:hover, :focus-within) .vy-svc-prow__from { color: var(--fg-1); }
.vy-svc-page .vy-svc-prow:is(:hover, :focus-within)::after { transform: translateX(8px); }

/* ---- Under 1180px: the name column narrows -------------------------------------- */

@media (max-width: 1179px) and (min-width: 768px) {
	.vy-svc-page > .vy-svc-sxhero { grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; }
	.vy-svc-page .vy-svc-sxhero .vy-svc-h1 { font-size: 68px; }
	.vy-svc-page .vy-svc-prow { grid-template-columns: 48px minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 0.8fr) 28px; column-gap: 20px; }
	.vy-svc-page .vy-svc-prow__name { font-size: 36px; }
}

/* ---- Mobile: one column, tappable rows with a down arrow -------------------------- */

@media (max-width: 767px) {
	/* The 44px override above outranks svc-base's phone size, so restate it. */
	.vy-svc-page.vy-svc-sx .vy-svc-h2 { font-size: 32px; line-height: 1.08; }

	.vy-svc-page > .vy-svc-sxhero {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		margin-bottom: 40px;
	}
	.vy-svc-page > .vy-svc-sxhero:first-child { padding-top: 40px; }
	.vy-svc-page > .vy-svc-sxhero::before { top: 0; right: auto; left: -120px; width: 600px; height: 520px; }
	.vy-svc-page .vy-svc-sxhero .vy-svc-eyebrow { margin-bottom: 20px; }
	.vy-svc-page .vy-svc-sxhero .vy-svc-h1 { font-size: 52px; line-height: 0.96; }
	.vy-svc-page .vy-svc-sxhero .vy-svc-lede { margin-bottom: 20px; font-size: 16.5px; }

	.vy-svc-page .vy-svc-prow {
		grid-template-columns: 28px minmax(0, 1fr) 18px;
		grid-template-rows: auto auto auto;
		column-gap: 12px;
		row-gap: 4px;
		height: auto;
		padding: 18px 0;
	}
	.vy-svc-page .vy-svc-prow__num { grid-column: 1; grid-row: 1 / span 3; font-size: 11px; }
	.vy-svc-page .vy-svc-prow__name { grid-column: 2; grid-row: 1; font-size: 28px; letter-spacing: -0.03em; }
	.vy-svc-page .vy-svc-prow__line { grid-column: 2; grid-row: 2; align-self: auto; font-size: 14px; color: var(--fg-3); }
	.vy-svc-page .vy-svc-prow__svcs { display: none; }
	.vy-svc-page .vy-svc-prow__from { grid-column: 2; grid-row: 3; font-size: 11px; text-align: left; }
	.vy-svc-page .vy-svc-prow::after { content: "\2193"; grid-column: 3; grid-row: 1 / span 3; font-size: 16px; }
	.vy-svc-page .vy-svc-prow:is(:hover, :focus-within) { background: none; }
	.vy-svc-page .vy-svc-prow:is(:hover, :focus-within)::after { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.vy-svc-page .vy-svc-prow,
	.vy-svc-page .vy-svc-prow::after,
	.vy-svc-page .vy-svc-prow > * { transition: none; }
}
