/**
 * Motion: the hero, scroll entrances and every hover state.
 *
 * Kept together so the whole feel of the site can be tuned from one file. Hover
 * rules are guarded by `hover: hover`, so a tap on a phone never leaves a card
 * stuck in its hover state. Everything stands down under reduced motion, at the
 * end of this file and in base.css.
 */

/* --------------------------------------------------------- scroll entrance */

/*
 * An animation rather than a transition, with no forwards fill: once it ends it
 * has no further hold on the element, so a card's own hover transition is
 * immediate instead of inheriting the entrance's timing and stagger delay.
 */
.js .px-reveal {
	opacity: 0;
}

.js .px-reveal.is-visible {
	opacity: 1;
	animation: px-reveal .7s var(--px-ease) backwards;
	animation-delay: calc(var(--px-i, 0) * 70ms);
}

@keyframes px-reveal {
	from {
		opacity: 0;
		transform: translateY(26px);
	}
}

/*
 * Photos travel further than text. A picture beside copy comes in from the
 * side it sits on, paired panels meet in the middle, gallery photos rise and
 * grow into place, and a card's oval photo slides in from the card's edge
 * just after the card. Hero and page-head photos keep their own entrance.
 */
:root {
	--px-fly: 90px;
	/* Gentler than --px-ease, so the travel is seen rather than snapped. */
	--px-fly-ease: cubic-bezier(.25, .6, .3, 1);
}

.js .px-reveal--left.is-visible,
.js .px-reveal--right.is-visible {
	animation-duration: 1.1s;
	animation-timing-function: var(--px-fly-ease);
}

.js .px-reveal--left.is-visible {
	animation-name: px-from-left;
}

.js .px-reveal--right.is-visible {
	animation-name: px-from-right;
}

.js .px-reveal--pop.is-visible {
	animation-name: px-pop;
	animation-duration: .95s;
	animation-timing-function: var(--px-fly-ease);
}

.js .px-reveal--settle.is-visible {
	animation: px-settle-in 1.8s var(--px-ease) backwards;
}

.js .px-reveal.is-visible .px-tile-art {
	animation: px-tile-in 1.2s var(--px-fly-ease) backwards;
	animation-delay: calc(var(--px-i, 0) * 70ms + .2s);
}

@keyframes px-from-left {
	from {
		opacity: 0;
		transform: translateX(calc(var(--px-fly) * -1));
	}
}

@keyframes px-from-right {
	from {
		opacity: 0;
		transform: translateX(var(--px-fly));
	}
}

@keyframes px-pop {
	from {
		opacity: 0;
		transform: translateY(40px) scale(.9);
	}
}

@keyframes px-settle-in {
	from {
		opacity: 0;
		transform: scale(1.14);
	}
}

@keyframes px-tile-in {
	from {
		opacity: 0;
		transform: translateX(50%);
	}
}

@media (max-width: 760px) {
	:root {
		--px-fly: 40px;
	}
}

/* -------------------------------------------------------------------- hero */

.px-hero__img,
.px-pagehead__img {
	animation: px-settle 1.1s var(--px-ease) both, px-drift 14s 1.1s ease-in-out infinite alternate;
}

@keyframes px-settle {
	from { transform: scale(1.16); }
	to { transform: scale(1.02); }
}

@keyframes px-drift {
	from { transform: scale(1.02); }
	to { transform: scale(1.1) translateX(-1.5%); }
}

/* Headline words rise out of a mask, one after another. */
.px-word {
	display: inline-block;
	overflow: hidden;
	margin-bottom: -.14em;
	padding-bottom: .14em;
	vertical-align: bottom;
}

.px-word__in {
	display: inline-block;
	animation: px-word .5s var(--px-ease) backwards;
	animation-delay: calc(.05s + var(--w, 0) * 55ms);
}

@keyframes px-word {
	from { transform: translateY(112%); }
}

/* The highlighted word burns: the flame gradient runs through it. */
.px-flame-text {
	background: linear-gradient(100deg, #ffb000, #ff6a13, #ff3d1f, #ffb000, #ff6a13) 0 0 / 300% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: px-word .5s var(--px-ease) backwards, px-burn 2.6s linear infinite;
	animation-delay: calc(.05s + var(--w, 0) * 55ms), 0s;
}

.px-heading .px-flame-text {
	animation: px-burn 2.6s linear infinite;
}

@keyframes px-burn {
	to { background-position: -150% 0; }
}

.px-hero__body,
.px-pagehead__intro,
.px-hero .px-actions,
.px-pagehead .px-eyebrow,
.px-hero .px-eyebrow,
.px-breadcrumbs {
	animation: px-rise .5s var(--px-ease) backwards;
}

.px-hero .px-eyebrow,
.px-pagehead .px-eyebrow,
.px-breadcrumbs { animation-delay: 0s; }
.px-hero__body,
.px-pagehead__intro { animation-delay: .28s; }
.px-hero .px-actions { animation-delay: .38s; }

@keyframes px-rise {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
}

/* Highlight cards fly in from the right. */
.px-hero__highlight {
	animation: px-fly .5s var(--px-ease) backwards;
	transition: transform .5s var(--px-ease), border-color .4s, background-color .4s;
}

.px-hero__highlight:nth-child(1) { animation-delay: .25s; }
.px-hero__highlight:nth-child(2) { animation-delay: .35s; }
.px-hero__highlight:nth-child(3) { animation-delay: .45s; }

@keyframes px-fly {
	from {
		opacity: 0;
		transform: translateX(60px);
	}
}

/* The fire itself: three soft flames breathing in the lower corner. */
.px-flames {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	opacity: .38;
	pointer-events: none;
}

.px-pagehead .px-flames {
	opacity: .22;
}

.px-flames span {
	position: absolute;
	bottom: -30%;
	border-radius: 50%;
	animation: px-flame 3.2s ease-in-out infinite alternate;
}

.px-flames span:nth-child(1) {
	right: -8%;
	width: 62vw;
	height: 62vw;
	background: radial-gradient(closest-side, rgba(255, 106, 19, .5), rgba(255, 106, 19, 0));
}

.px-flames span:nth-child(2) {
	right: 22%;
	width: 42vw;
	height: 42vw;
	background: radial-gradient(closest-side, rgba(215, 38, 30, .45), rgba(215, 38, 30, 0));
	animation-duration: 2.4s;
	animation-delay: -1s;
}

.px-flames span:nth-child(3) {
	right: 4%;
	width: 34vw;
	height: 34vw;
	background: radial-gradient(closest-side, rgba(255, 176, 0, .42), rgba(255, 176, 0, 0));
	animation-duration: 1.9s;
	animation-delay: -.5s;
}

@keyframes px-flame {
	from {
		opacity: .55;
		transform: translate3d(0, 6%, 0) scale(.92);
	}
	to {
		opacity: 1;
		transform: translate3d(-3%, -8%, 0) scale(1.1);
	}
}

/* Embers. Each one's position, size and speed comes from px_the_embers(). */
.px-embers {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.px-embers span {
	position: absolute;
	bottom: -14px;
	left: var(--x);
	width: var(--s);
	height: var(--s);
	border-radius: 50%;
	background: #ffd166;
	box-shadow: 0 0 calc(var(--s) * 2) calc(var(--s) * .6) rgba(255, 122, 20, .95);
	animation: px-ember var(--d) linear var(--l) infinite;
	will-change: transform, opacity;
}

@keyframes px-ember {
	0% { opacity: 0; transform: translate3d(0, 0, 0) scale(1); }
	8% { opacity: 1; }
	45% { transform: translate3d(var(--dx), -42vh, 0) scale(.85); }
	70% { opacity: .85; }
	100% { opacity: 0; transform: translate3d(calc(var(--dx) * -.4), -82vh, 0) scale(.3); }
}

/* The curve draws itself in, then a spark keeps running along it. */
.px-arc__line {
	animation: px-arc-draw .9s .1s var(--px-ease) backwards;
}

@keyframes px-arc-draw {
	from { clip-path: inset(0 100% 0 0); }
	to { clip-path: inset(0 0 0 0); }
}

.px-arc__spark {
	fill: #fff3c4;
	filter: drop-shadow(0 0 6px #ffb000) drop-shadow(0 0 14px #ff6a13);
}

.px-hero .px-btn--primary {
	animation: px-beacon 2s ease-out infinite;
}

@keyframes px-beacon {
	0% { box-shadow: 0 0 0 0 rgba(255, 138, 12, .65); }
	100% { box-shadow: 0 0 0 18px rgba(255, 138, 12, 0); }
}

/* ----------------------------------------------------------------- buttons */

.px-btn--primary,
.px-band .px-btn {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.px-btn:is(:disabled, [aria-disabled="true"], .is-disabled)::after {
	display: none;
}

/* A streak of light crosses the button. */
.px-btn--primary::after,
.px-band .px-btn::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -70%;
	z-index: -1;
	width: 50%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
	transform: skewX(-20deg);
}

/* --------------------------------------------------------------- the cards */

/* Slow on purpose: a card should ease into its hover state, never snap. */
.px-card,
.px-service {
	transition: transform .55s var(--px-ease), box-shadow .55s ease, border-color .45s ease;
}

.px-card::before,
.px-service::before,
.px-card::after,
.px-service::after {
	transition: transform .9s var(--px-ease), opacity .6s ease;
}

.px-card__icon,
.px-service__icon,
.px-channel__icon {
	transition: background-color .45s ease, color .45s ease, transform .55s var(--px-ease);
}

.px-card__title,
.px-service__title {
	transition: color .45s ease;
}

.px-arrow {
	transition: transform .55s var(--px-ease), box-shadow .55s ease;
}

.px-tile-art img {
	transition: transform .6s var(--px-ease);
}

.px-quote__avatar {
	transition: transform .55s var(--px-ease), box-shadow .45s ease;
}

.px-tile-mark {
	transition: transform .9s var(--px-ease), opacity .6s ease;
}

/* ------------------------------------------------------------- event tiles */

.px-section--events .px-heading + .px-chips {
	margin-top: var(--px-space-5);
}

.px-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--px-space-2);
	margin-bottom: var(--px-space-6);
}

.px-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 18px;
	border: 1.5px solid var(--px-line);
	border-radius: 999px;
	background: #fff;
	color: var(--px-fg);
	font-family: var(--px-font-display);
	font-size: .925rem;
	font-weight: 600;
	text-decoration: none;
	transition: transform .4s var(--px-ease), border-color .3s, background-color .3s, color .3s, box-shadow .4s;
}

.px-chip__count {
	display: grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--px-icon-ground);
	color: var(--px-ember);
	font-size: .75rem;
}

.px-chip.is-current {
	border-color: transparent;
	background: var(--px-flame-soft);
	color: var(--px-char);
}

.px-chip.is-current .px-chip__count {
	background: rgba(22, 19, 15, .16);
	color: var(--px-char);
}

/* Same-size tiles: a short last row is centred rather than stretched. */
.px-events-grid {
	display: grid;
	grid-auto-rows: 1fr;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--px-space-4);
}

.px-events-grid > * {
	grid-column: span 2;
}

@media (min-width: 1025px) {
	.px-events-grid > :last-child:nth-child(3n + 1) {
		grid-column: 3 / span 2;
	}

	.px-events-grid > :nth-last-child(2):nth-child(3n + 1) {
		grid-column: 2 / span 2;
	}
}

.px-event-card {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 360px;
	border-radius: var(--px-radius);
	background: var(--px-char);
	color: #fff;
	isolation: isolate;
	overflow: hidden;
}

.px-event-card__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--px-ease);
}

/* Charcoal at the foot, for the text. The flame tint fades in over it on hover. */
.px-event-card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(22, 19, 15, .94) 12%, rgba(22, 19, 15, .55) 45%, rgba(22, 19, 15, .05) 75%);
}

.px-event-card {
	transition: transform .55s var(--px-ease), box-shadow .55s ease;
}

.px-event-card__body {
	width: 100%;
	padding: var(--px-space-5);
}

.px-event-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 var(--px-space-2);
	font-size: .85rem;
}

.px-event-card__cat {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--px-flame-soft);
	color: var(--px-char);
	font-size: .75rem;
	font-weight: 700;
}

.px-event-card__title {
	margin: 0;
	color: #fff;
	font-size: clamp(1.2rem, 1.7vw, 1.45rem);
}

.px-event-card__title a {
	color: inherit;
	text-decoration: none;
}

.px-event-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}

.px-event-card__title a:focus-visible {
	outline: 0;
}

.px-event-card:focus-within {
	outline: 3px solid var(--px-orange);
	outline-offset: 3px;
}

.px-event-card__summary {
	margin: var(--px-space-2) 0 0;
	color: #eadfd0;
	font-size: .975rem;
}

.px-event-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: var(--px-space-3);
	color: var(--px-amber);
	font-family: var(--px-font-display);
	font-size: .925rem;
	font-weight: 600;
}

.px-event__facts {
	margin-bottom: var(--px-space-5);
	color: var(--px-fg-muted);
	font-weight: 600;
}

.px-event__text {
	max-width: 760px;
	margin-bottom: var(--px-space-7);
}

@media (max-width: 1024px) {
	.px-events-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Tablet only: on a phone the grid has one column (see components.css). */
@media (min-width: 621px) and (max-width: 1024px) {
	.px-events-grid > :last-child:nth-child(odd) {
		grid-column: 2 / span 2;
	}
}

@media (max-width: 620px) {
	.px-events-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.px-events-grid > :nth-child(n) {
		grid-column: auto;
	}

	.px-event-card {
		min-height: 320px;
	}
}

/* ------------------------------------------------------------ hover states */

@media (hover: hover) {
	.px-btn--primary:hover::after,
	.px-band .px-btn:hover::after {
		left: 120%;
		transition: left .9s ease;
	}

	.px-btn:hover {
		transform: translateY(-2px);
		background-position: 100% 0;
	}

	/* The arrow leads the way. */
	.px-btn:hover .px-btn__icon--end {
		transform: translateX(4px);
	}

	.px-btn--text:hover {
		transform: none;
	}

	.px-btn:is(:disabled, [aria-disabled="true"], .is-disabled):hover {
		transform: none;
		background-position: 0 0;
	}

	.px-btn:is(:disabled, [aria-disabled="true"], .is-disabled):hover .px-btn__icon--end {
		transform: none;
	}

	.px-hero .px-btn--primary:hover {
		animation: none;
		box-shadow: var(--px-shadow-ember);
	}

	.px-hero__highlight:hover {
		border-color: var(--px-amber);
		background-color: rgba(44, 37, 30, .85);
		transform: translateX(-6px);
	}

	/* Cards lift a little, the edge takes the card's colour and the curves grow. */
	.px-card:hover,
	.px-service:hover {
		border-color: var(--t-solid);
		transform: translateY(-5px);
		box-shadow: 0 28px 48px -30px color-mix(in srgb, var(--t-solid) 75%, transparent);
	}

	.px-card:hover::before,
	.px-service:hover::before {
		opacity: .8;
		transform: scale(1.12);
	}

	.px-card:hover::after,
	.px-service:hover::after {
		transform: scale(1.18);
	}

	.px-card:hover .px-card__title,
	.px-service:hover .px-service__title {
		color: var(--t-ink);
	}

	.px-card:hover .px-card__icon,
	.px-service:hover .px-service__icon,
	.px-channel:hover .px-channel__icon {
		background: var(--t-solid);
		color: var(--t-on);
	}

	.px-card:hover .px-arrow,
	.px-service:hover .px-arrow {
		box-shadow: 0 10px 20px -10px var(--t-solid);
		transform: translateX(6px);
	}

	.px-card:hover .px-tile-art img,
	.px-service:hover .px-tile-art img {
		transform: scale(1.08);
	}

	/* Quote cards: the badge tips and the face lifts with the card. */
	.px-quote:hover .px-quote__mark {
		transform: rotate(-8deg) scale(1.06);
	}

	.px-quote:hover .px-quote__avatar {
		box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--t-solid);
		transform: scale(1.06);
	}

	.px-card:hover .px-tile-mark,
	.px-service:hover .px-tile-mark {
		opacity: .22;
		transform: scale(1.08);
	}

	.px-event-card:hover {
		transform: translateY(-5px);
		box-shadow: 0 0 34px 8px rgba(255, 176, 0, .7);
	}

	/* Event tiles: the photo pushes in and the flame rises from the foot. */
	.px-event-card:hover .px-event-card__img {
		transform: scale(1.1);
	}

	/* The description stays folded away until hover or keyboard focus. */
	.px-event-card__reveal {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows .55s var(--px-ease);
	}

	.px-event-card__reveal-inner {
		min-height: 0;
		overflow: hidden;
		opacity: 0;
		transition: opacity .5s ease;
	}

	.px-event-card:is(:hover, :focus-within) .px-event-card__reveal {
		grid-template-rows: 1fr;
	}

	.px-event-card:is(:hover, :focus-within) .px-event-card__reveal-inner {
		opacity: 1;
	}

	.px-event-card:hover .px-event-card__cta .px-icon {
		transform: translateX(6px);
	}

	.px-event-card__cta .px-icon {
		transition: transform .5s var(--px-ease);
	}

	.px-chip:hover {
		border-color: var(--px-orange);
		color: var(--px-ember);
		transform: translateY(-2px);
		box-shadow: 0 10px 20px -12px rgba(255, 106, 19, .7);
	}

	.px-chip.is-current:hover {
		border-color: transparent;
		color: var(--px-char);
	}

	/* Photos glow with a warm yellow shadow all the way round on hover. */
	.px-gallery__item,
	.px-panel,
	.px-person__portrait {
		transition: box-shadow .6s ease;
	}

	.px-media-text__img {
		transition: transform .6s var(--px-ease), box-shadow .6s ease;
	}

	.px-media-text__media::after {
		transition: transform .6s var(--px-ease);
	}

	.px-media-text__media:hover .px-media-text__img,
	.px-gallery__item:hover,
	.px-panel:hover,
	.px-person:hover .px-person__portrait {
		box-shadow: 0 0 34px 8px rgba(255, 176, 0, .7);
	}

	/* Above their neighbours, so the shadow is not cut off by them. */
	.px-gallery__item:hover,
	.px-event-card:hover,
	.px-panel:hover {
		z-index: 1;
	}

	/* Photos beside text: the picture and the flame behind it move apart. */
	.px-media-text__media:hover .px-media-text__img {
		z-index: 2;
		transform: translate(-8px, -8px);
	}

	.px-media-text__media:hover::after {
		transform: translate(8px, 8px);
	}

	.px-gallery__item img {
		transition: transform .6s var(--px-ease);
	}

	.px-gallery__item:hover img {
		transform: scale(1.08);
	}

	.px-panel__img {
		transition: transform .6s var(--px-ease);
	}

	.px-panel:hover .px-panel__img {
		transform: scale(1.08);
	}

	.px-stat {
		transition: transform .55s var(--px-ease), border-color .45s;
	}

	.px-stat:hover {
		border-color: var(--px-amber);
		transform: translateY(-4px);
	}

	.px-logos__item img {
		transition: transform .6s var(--px-ease);
	}

	.px-logos__item:hover img {
		transform: scale(1.08);
	}

	.px-footer__menu a {
		display: inline-block;
		transition: color .35s, transform .4s var(--px-ease);
	}

	.px-footer__menu a:hover {
		transform: translateX(5px);
	}
}

/* No hover pointer: the description is simply there, and a tap gives feedback. */
@media (hover: none) {
	.px-card:active,
	.px-service:active,
	.px-event-card:active {
		transform: scale(.98);
	}
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	.px-flames,
	.px-embers,
	.px-arc__spark {
		display: none;
	}

	.js .px-reveal {
		opacity: 1;
	}

	.js .px-reveal.is-visible,
	.js .px-reveal.is-visible .px-tile-art {
		animation: none;
	}

	.px-btn:hover,
	.px-btn:hover .px-btn__icon--end {
		transform: none;
	}

	.px-hero__img,
	.px-pagehead__img {
		animation: none;
	}

	.px-card:hover,
	.px-service:hover,
	.px-event-card:hover,
	.px-stat:hover,
	.px-quote:hover .px-quote__mark,
	.px-quote:hover .px-quote__avatar,
	.px-media-text__media:hover .px-media-text__img,
	.px-media-text__media:hover::after,
	.px-event-card:hover .px-event-card__img,
	.px-gallery__item:hover img,
	.px-panel:hover .px-panel__img,
	.px-card:hover .px-tile-art img,
	.px-service:hover .px-tile-art img {
		transform: none;
	}
}
