/* Heading. The tag follows the level (h1-h4); the size classes below only change how big it looks. */
.px-page .px-heading {
	color: var(--px-color-heading);
	font-family: var(--px-font-heading);
	font-weight: var(--px-weight-heading);
	line-height: var(--px-leading-tight);
	overflow-wrap: anywhere;
	text-transform: var(--px-heading-case, none);
	letter-spacing: var(--px-heading-tracking, normal);
}
.px-page .px-heading--hero { font-size: clamp(3rem, 1.2rem + 7.5vw, 8.5rem); line-height: .95; }
.px-page .px-heading--display { font-size: var(--px-text-display); }
.px-page .px-heading--l { font-size: var(--px-text-h1); }
.px-page .px-heading--h1 { font-size: var(--px-text-h1); }
.px-page .px-heading--h2 { font-size: var(--px-text-h2); }
.px-page .px-heading--m,
.px-page .px-heading--h3 { font-size: var(--px-text-h3); }
.px-page .px-heading--h4 { font-size: var(--px-text-h4); }
.px-page .px-heading--start { text-align: start; }
.px-page .px-heading--center { text-align: center; }
.px-page .px-heading--end { text-align: end; }

/* Decor: accent colour, or an outline (the fill stays visible where text stroke is not supported). */
.px-page .px-heading--accent { color: var(--px-color-primary-text); }
.px-page .px-heading--outline { color: var(--px-color-heading); }
@supports (-webkit-text-stroke: 1px red) {
	.px-page .px-heading--outline { color: transparent; -webkit-text-stroke: max(1px, .02em) var(--px-color-heading); }
}

/* Eyebrow: the root is a div holding the small label and the h tag. */
.px-page .px-heading__title { margin: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.px-page .px-heading__eyebrow {
	margin: 0 0 var(--px-space-xs);
	color: var(--px-color-primary-text);
	font: 600 var(--px-text-small) / 1.3 var(--px-font-body);
	letter-spacing: .12em;
	text-transform: uppercase;
	-webkit-text-stroke: 0;
}
.px-page .px-heading__eyebrow--pill {
	display: block; width: fit-content; max-width: 100%;
	padding: .25em var(--px-space-s);
	border-radius: 999px;
	background: var(--px-color-primary-soft);
}
.px-page :is(.px-section--bg-soft, .px-section--bgs-tint) .px-heading__eyebrow--pill { background: var(--px-color-surface); }
.px-page .px-heading__eyebrow--line { display: flex; align-items: center; gap: var(--px-space-s); }
.px-page .px-heading__eyebrow--line::before,
.px-page .px-heading__eyebrow--line::after { content: ""; flex: none; width: 2em; height: 1px; background: currentColor; }
.px-page .px-heading__eyebrow--line::after { display: none; }
.px-page .px-heading--center .px-heading__eyebrow--line,
.px-page .px-section--al-center .px-heading--eyebrow:not(.px-heading--start) .px-heading__eyebrow--line { justify-content: center; }
.px-page .px-heading--center .px-heading__eyebrow--line::after,
.px-page .px-section--al-center .px-heading--eyebrow:not(.px-heading--start) .px-heading__eyebrow--line::after { display: block; }

/* Narrow columns (a third of the row and less): one step down so long words still fit. */
@container (max-width: 22rem) {
	.px-page .px-heading--hero,
	.px-page .px-heading--display { font-size: var(--px-text-h1); }
	.px-page .px-heading--l,
	.px-page .px-heading--h1 { font-size: var(--px-text-h2); }
}

/* Decor gradient: the last word is filled with a primary-to-pink gradient (plain accent colour where clipping is not supported). */
.px-page .px-heading__grad { color: var(--px-color-primary-text); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.px-page .px-heading--gradient .px-heading__grad {
		background: linear-gradient(100deg, var(--px-color-primary) 10%, color-mix(in oklab, var(--px-color-primary) 45%, #db2777) 90%);
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
		-webkit-text-fill-color: transparent;
	}
}

/* Large sizes sit a little tighter than the pair's tracking. */
.px-page :is(.px-heading--display, .px-heading--hero):is(h1, h2, h3, h4),
.px-page :is(.px-heading--display, .px-heading--hero) > .px-heading__title { letter-spacing: calc(var(--px-heading-tracking, 0em) + var(--px-display-tighten, 0em)); }

/* Eyebrow plain / line / script on a dark, primary or image band: heading colour, not the dimmed primary text. */
.px-page :is(.px-inv-image, .px-inv-dark, .px-inv-primary, .px-col--tone-dark, .px-col--tone-primary) :is(.px-heading__eyebrow--plain, .px-heading__eyebrow--line, .px-heading__eyebrow--script) {
	color: color-mix(in oklab, var(--px-color-heading) 90%, transparent);
}

/* Eyebrow is a block of its own (never inline in the root's display-size line box); aligned with the heading. */
.px-page .px-heading__eyebrow--plain,
.px-page .px-heading__eyebrow--script { display: block; width: fit-content; max-width: 34rem; }
.px-page .px-heading--center > .px-heading__eyebrow,
.px-page .px-section--al-center .px-heading--eyebrow:not(.px-heading--start, .px-heading--end) > .px-heading__eyebrow { margin-inline: auto; }
.px-page .px-heading--end > .px-heading__eyebrow { margin-inline-start: auto; }

/* Eyebrow "script": italic, lead size, no capitals. */
.px-page .px-heading__eyebrow--script { font-size: var(--px-text-lead); font-weight: 400; font-style: italic; letter-spacing: normal; text-transform: none; }

/* Eyebrow "badge": a glass pill with a gradient badge and a short text. */
.px-page .px-heading__eyebrow--badge {
	display: flex; width: fit-content; align-items: center; gap: 10px; max-width: 100%;
	padding: 6px 14px 6px 6px; border-radius: 999px;
	background: linear-gradient(135deg, color-mix(in oklab, var(--px-color-surface) 68%, transparent), color-mix(in oklab, var(--px-color-surface) 38%, transparent));
	border: 1px solid rgb(255 255 255 / .7);
	box-shadow: 0 2px 10px color-mix(in oklab, var(--px-color-text) 8%, transparent);
	color: var(--px-color-muted); font-size: 13.5px; font-weight: 400; letter-spacing: normal; text-transform: none;
}
.px-page .px-heading__badge {
	flex: none; white-space: nowrap; padding: 3px 10px; border-radius: 999px;
	background: linear-gradient(135deg, var(--px-color-primary), color-mix(in oklab, var(--px-color-primary) 55%, #8b5cf6));
	color: var(--px-color-on-primary); font-size: 12px; font-weight: 600;
}

/* decorPart "last" / "last2": the accent colour / outline sits on the last word only. */
.px-page .px-heading--part-accent .px-heading__part { color: var(--px-color-primary-text); }
@supports (-webkit-text-stroke: 1px red) {
	.px-page .px-heading--part-outline .px-heading__part { color: transparent; -webkit-text-stroke: max(1px, .02em) var(--px-color-heading); }
}

/* xl (hero size only). */
.px-page .px-heading--hero.px-heading--xl { font-size: clamp(3.5rem, 15vw, 14.5rem); line-height: .9; }
@container (max-width: 22rem) {
	.px-page .px-heading--hero.px-heading--xl { font-size: 3.5rem; }
}

/* Decor flank: a short rule ending in a small diamond on both sides of a centred title. */
.px-page .px-heading--flank { text-align: center; }
.px-page .px-heading--flank:is(h1, h2, h3, h4)::before,
.px-page .px-heading--flank:is(h1, h2, h3, h4)::after,
.px-page .px-heading--flank > .px-heading__title::before,
.px-page .px-heading--flank > .px-heading__title::after {
	content: ""; display: inline-block; width: min(.9em, 2.875rem); height: .18em; vertical-align: middle;
	background: var(--px-color-primary-text);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8'%3E%3Crect y='3.5' width='33' height='1'/%3E%3Cpath d='M36 0l4 4-4 4-4-4z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8'%3E%3Crect y='3.5' width='33' height='1'/%3E%3Cpath d='M36 0l4 4-4 4-4-4z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.px-page .px-heading--flank:is(h1, h2, h3, h4)::before,
.px-page .px-heading--flank > .px-heading__title::before { margin-inline-end: .35em; }
.px-page .px-heading--flank:is(h1, h2, h3, h4)::after,
.px-page .px-heading--flank > .px-heading__title::after { margin-inline-start: .35em; transform: scaleX(-1); }
@container (max-width: 22rem) {
	.px-page .px-heading--flank:is(h1, h2, h3, h4)::before,
	.px-page .px-heading--flank:is(h1, h2, h3, h4)::after,
	.px-page .px-heading--flank > .px-heading__title::before,
	.px-page .px-heading--flank > .px-heading__title::after { display: none; }
}

/* eyebrowSoft (advanced): no capitals, no tracking, a 6px dot in the primary text colour before the words (plain and pill). */
.px-page .px-heading__eyebrow--soft { display: flex; align-items: center; gap: .5em; letter-spacing: normal; text-transform: none; }
.px-page .px-heading__eyebrow--soft::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--px-color-primary-text); }
.px-page .px-heading__eyebrow--pill.px-heading__eyebrow--soft { display: flex; width: fit-content; }

/* decorItalic (advanced): italic on the accent word(s); -all (decorPart all, or no decor) italicises the whole heading. */
.px-page .px-heading--decor-italic .px-heading__part,
.px-page .px-heading--decor-italic .px-heading__grad { font-style: italic; }
.px-page .px-heading--decor-italic-all:is(h1, h2, h3, h4),
.px-page .px-heading--decor-italic-all > .px-heading__title { font-style: italic; }

/* eyebrowTone muted (1.10): the eyebrow in the muted colour, weight 500, for every style (line / pill keep their rule / border in that colour). */
.px-page .px-heading__eyebrow.px-heading__eyebrow--muted { color: var(--px-color-muted); font-weight: 500; }
