/**
 * Section Heading — three styles on one set of tokens.
 *
 *   1 Eyebrow    pill eyebrow, swash under highlighted words, description
 *   2 Lined      sub title between fading rules, gradient highlights, a
 *                short accent bar with a travelling shimmer
 *   3 Watermark  title first over a huge outlined watermark, the sub title
 *                as a caption on a little flight route
 *
 * Alignment arrives as classes (gx-sh--left / --t-center / --m-right …)
 * because the rows are flex, and text-align alone cannot place them.
 *
 * Nothing is hidden until goxom-heading.js adds `.gx-sh--js`, so without
 * the script (or an IntersectionObserver) the heading simply shows.
 */

.gx-sh {
	--sh-accent: var(--color-primary, #1273C4);
	--sh-ink: var(--color-black, #0C2338);
	--sh-body: var(--color-body, #5A7387);
	--sh-font: var(--font-title, inherit);
	--sh-ease: cubic-bezier(.22, .61, .36, 1);
	--sh-ta: center;
	--sh-j: center;
	--sh-ml: auto;
	--sh-mr: auto;

	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	align-items: var(--sh-j);
	margin-left: var(--sh-ml);
	margin-right: var(--sh-mr);
	text-align: var(--sh-ta);
}

.gx-sh *,
.gx-sh *::before,
.gx-sh *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------- alignment */

.gx-sh--left   { --sh-ta: left;   --sh-j: flex-start; --sh-ml: 0;    --sh-mr: auto; }
.gx-sh--center { --sh-ta: center; --sh-j: center;     --sh-ml: auto; --sh-mr: auto; }
.gx-sh--right  { --sh-ta: right;  --sh-j: flex-end;   --sh-ml: auto; --sh-mr: 0; }

@media (max-width: 1024px) {
	.gx-sh--t-left   { --sh-ta: left;   --sh-j: flex-start; --sh-ml: 0;    --sh-mr: auto; }
	.gx-sh--t-center { --sh-ta: center; --sh-j: center;     --sh-ml: auto; --sh-mr: auto; }
	.gx-sh--t-right  { --sh-ta: right;  --sh-j: flex-end;   --sh-ml: auto; --sh-mr: 0; }
}

@media (max-width: 767px) {
	.gx-sh--m-left   { --sh-ta: left;   --sh-j: flex-start; --sh-ml: 0;    --sh-mr: auto; }
	.gx-sh--m-center { --sh-ta: center; --sh-j: center;     --sh-ml: auto; --sh-mr: auto; }
	.gx-sh--m-right  { --sh-ta: right;  --sh-j: flex-end;   --sh-ml: auto; --sh-mr: 0; }
}

/* ------------------------------------------------------------ dark mode */

.gx-sh-on-dark .gx-sh {
	--sh-ink: #ffffff;
	--sh-body: rgba(255, 255, 255, .74);
}

/* ------------------------------------------------------------------ title */

.gx-sh__title {
	max-width: 100%;
	margin: 0;
	font-family: var(--sh-font);
	font-size: clamp(30px, 3.9vw, 54px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.025em;
	color: var(--sh-ink);
	text-wrap: balance;
}

.gx-sh__hl {
	position: relative;
	color: var(--sh-accent);
}

/* Hand-drawn underline. */
.gx-sh--hl-swash .gx-sh__hl {
	display: inline-block;
}

.gx-sh--hl-swash .gx-sh__hl::after {
	content: "";
	position: absolute;
	left: -2%;
	right: -2%;
	bottom: -.1em;
	height: .26em;
	z-index: -1;
	background-color: var(--sh-accent-2, #F5B82E);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14C40 5 90 3 197 9' fill='none' stroke='%23000' stroke-width='7' stroke-linecap='round'/%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 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14C40 5 90 3 197 9' fill='none' stroke='%23000' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	transform-origin: left center;
	transition: transform .9s var(--sh-ease) .55s;
}

/* Gradient ink. */
.gx-sh--hl-gradient .gx-sh__hl {
	background-image: linear-gradient(100deg, var(--sh-accent) 0%, var(--sh-accent-2, #18B7C9) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* Marker stroke behind the words; the ink stays dark. */
.gx-sh--hl-marker .gx-sh__hl {
	color: inherit;
	background-image: linear-gradient(color-mix(in srgb, var(--sh-accent-2, var(--sh-accent)) 24%, transparent), color-mix(in srgb, var(--sh-accent-2, var(--sh-accent)) 24%, transparent));
	background-repeat: no-repeat;
	background-position: 0 88%;
	background-size: 100% .38em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: background-size .9s var(--sh-ease) .55s;
}

/* ------------------------------------------------------------ description */

.gx-sh__desc {
	max-width: 640px;
	margin-top: 18px;
	font-size: clamp(15px, 1.1vw, 17px);
	line-height: 1.75;
	color: var(--sh-body);
}

.gx-sh__desc p {
	margin: 0 0 .7em;
}

.gx-sh__desc > :last-child {
	margin-bottom: 0;
}

.gx-sh__shape {
	display: block;
	width: auto;
	max-height: 22px;
}

/* ======================================================== style 1: eyebrow */

.gx-sh__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 18px;
	padding: 7px 16px 7px 12px;
	border: 1px solid color-mix(in srgb, var(--sh-accent) 20%, transparent);
	border-radius: 999px;
	background-color: color-mix(in srgb, var(--sh-accent) 8%, transparent);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--sh-accent);
}

.gx-sh-on-dark .gx-sh__eyebrow {
	border-color: rgba(255, 255, 255, .24);
	background-color: rgba(255, 255, 255, .1);
	color: #ffffff;
}

.gx-sh__dot {
	position: relative;
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: currentColor;
}

.gx-sh__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background-color: currentColor;
	animation: gx-sh-pulse 2.2s ease-out infinite;
}

@keyframes gx-sh-pulse {
	from { transform: scale(1); opacity: .6; }
	to   { transform: scale(2.8); opacity: 0; }
}

/* ========================================================= style 2: lined */

.gx-sh__lined {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--sh-accent);
}

.gx-sh-on-dark .gx-sh__lined {
	color: #ffffff;
}

.gx-sh__rule {
	flex: none;
	width: 44px;
	height: 2px;
	border-radius: 2px;
	background-image: linear-gradient(90deg, transparent, currentColor);
	transition: width .8s var(--sh-ease) .2s;
}

.gx-sh__rule--end {
	background-image: linear-gradient(270deg, transparent, currentColor);
}

/* A rule only on the side facing the open space. */
.gx-sh--left .gx-sh__rule--start,
.gx-sh--right .gx-sh__rule--end {
	display: none;
}

@media (max-width: 1024px) {
	.gx-sh--t-left .gx-sh__rule--start,
	.gx-sh--t-right .gx-sh__rule--end { display: none; }
	.gx-sh--t-center .gx-sh__rule { display: block; }
}

@media (max-width: 767px) {
	.gx-sh--m-left .gx-sh__rule--start,
	.gx-sh--m-right .gx-sh__rule--end { display: none; }
	.gx-sh--m-center .gx-sh__rule { display: block; }

	.gx-sh__rule {
		width: 28px;
	}
}

.gx-sh__bar {
	position: relative;
	display: block;
	width: 72px;
	height: 4px;
	margin-top: 24px;
	overflow: hidden;
	border-radius: 4px;
	background-color: color-mix(in srgb, var(--sh-accent) 16%, transparent);
	transform-origin: var(--sh-ta) center;
	transition: transform .8s var(--sh-ease) .35s;
}

.gx-sh__bar i {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 40%;
	border-radius: inherit;
	background-image: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-2, #18B7C9));
	animation: gx-sh-shimmer 2.6s ease-in-out infinite alternate;
}

@keyframes gx-sh-shimmer {
	to { transform: translateX(150%); }
}

/* ===================================================== style 3: watermark */

.gx-sh--s3 {
	padding-top: clamp(18px, 3vw, 46px);
}

.gx-sh__mark {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: -1;
	overflow: hidden;
	font-family: var(--sh-font);
	font-size: clamp(56px, 10.5vw, 150px);
	font-weight: 800;
	line-height: .9;
	letter-spacing: .02em;
	text-transform: uppercase;
	text-align: var(--sh-ta);
	white-space: nowrap;
	color: transparent;
	-webkit-text-stroke: 1.5px color-mix(in srgb, var(--sh-ink) 11%, transparent);
	pointer-events: none;
	user-select: none;
	transition: opacity 1.2s var(--sh-ease), transform 1.4s var(--sh-ease);
}

.gx-sh-on-dark .gx-sh__mark {
	-webkit-text-stroke-color: rgba(255, 255, 255, .16);
}

.gx-sh__route {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--sh-accent);
}

.gx-sh-on-dark .gx-sh__route {
	color: #ffffff;
}

.gx-sh__path {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.gx-sh__pin {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: currentColor;
}

.gx-sh__dash {
	width: 42px;
	height: 2px;
	background-image: linear-gradient(90deg, currentColor 50%, transparent 50%);
	background-size: 7px 2px;
	opacity: .6;
	transform-origin: left center;
	transition: transform .8s var(--sh-ease) .35s;
}

.gx-sh__plane {
	display: inline-flex;
	animation: gx-sh-nudge 2.4s ease-in-out infinite;
}

.gx-sh__plane svg {
	width: 17px;
	height: 17px;
	fill: currentColor;
	transform: rotate(90deg);
}

@keyframes gx-sh-nudge {
	0%, 100% { transform: translateX(0); }
	50%      { transform: translateX(4px); }
}

/* ----------------------------------------------------------------- reveal */

.gx-sh--js .gx-sh__reveal,
.gx-sh--js .gx-sh__title {
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition: opacity .8s var(--sh-ease), transform .9s var(--sh-ease);
}

.gx-sh--js .gx-sh__title          { transition-delay: .1s; }
.gx-sh--js .gx-sh__route          { transition-delay: .22s; }
.gx-sh--js .gx-sh__desc           { transition-delay: .28s; }

.gx-sh--js.is-in .gx-sh__reveal,
.gx-sh--js.is-in .gx-sh__title {
	opacity: 1;
	transform: none;
}

.gx-sh--js .gx-sh__mark {
	opacity: 0;
	transform: translateY(18px) scale(.96);
}

.gx-sh--js.is-in .gx-sh__mark {
	opacity: 1;
	transform: none;
}

.gx-sh--js.gx-sh--hl-swash .gx-sh__hl::after { transform: scaleX(0); }
.gx-sh--js.gx-sh--hl-swash.is-in .gx-sh__hl::after { transform: none; }

.gx-sh--js.gx-sh--hl-marker .gx-sh__hl { background-size: 0 .38em; }
.gx-sh--js.gx-sh--hl-marker.is-in .gx-sh__hl { background-size: 100% .38em; }

.gx-sh--js .gx-sh__rule { width: 0; }
.gx-sh--js.is-in .gx-sh__rule { width: 44px; }

.gx-sh--js .gx-sh__bar { transform: scaleX(0); }
.gx-sh--js.is-in .gx-sh__bar { transform: none; }

.gx-sh--js .gx-sh__dash { transform: scaleX(0); }
.gx-sh--js.is-in .gx-sh__dash { transform: none; }

@media (max-width: 767px) {
	.gx-sh--js.is-in .gx-sh__rule { width: 28px; }
}

/* color-mix fallbacks. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.gx-sh__eyebrow {
		border-color: rgba(18, 115, 196, .2);
		background-color: rgba(18, 115, 196, .08);
	}

	.gx-sh__bar {
		background-color: rgba(18, 115, 196, .16);
	}

	.gx-sh__mark {
		-webkit-text-stroke-color: rgba(12, 35, 56, .11);
	}

	.gx-sh--hl-marker .gx-sh__hl {
		background-image: linear-gradient(rgba(18, 115, 196, .22), rgba(18, 115, 196, .22));
	}
}

@media (prefers-reduced-motion: reduce) {
	.gx-sh *,
	.gx-sh *::before,
	.gx-sh *::after {
		animation: none !important;
		transition: none !important;
	}
}
