/**
 * Cards: services, icon cards, plans and vacancies share one design.
 *
 * Each card in a set takes the next tone from the logo's palette, and its label,
 * icon, arrow and curves all read from these --t-* values, so a new tone only
 * has to be added here. Hover states are in effects.css.
 */

:root {
	--t-solid: #ff6a13;
	--t-ink: #c2410c;
	--t-on: #16130f;
	--t-wash: #ffdcc4;
	--t-tint: #fff7f1;
	--t-line: #f0c3a0;
}

/* Amber */
.px-tones > :nth-child(6n + 1) {
	--t-solid: #ffb000;
	--t-ink: #945700;
	--t-on: #16130f;
	--t-wash: #ffe7b3;
	--t-tint: #fffaf0;
	--t-line: #eccf8f;
}

/* Orange takes the values on :root. */

/* Flame red */
.px-tones > :nth-child(6n + 3) {
	--t-solid: #d7261e;
	--t-ink: #b3201a;
	--t-on: #fff;
	--t-wash: #fbd3cf;
	--t-tint: #fff6f5;
	--t-line: #eeb6b1;
}

/* Honey */
.px-tones > :nth-child(6n + 4) {
	--t-solid: #e89a00;
	--t-ink: #855400;
	--t-on: #16130f;
	--t-wash: #f9e3a8;
	--t-tint: #fffbee;
	--t-line: #e5cd85;
}

/* Coral */
.px-tones > :nth-child(6n + 5) {
	--t-solid: #f2553d;
	--t-ink: #bb3320;
	--t-on: #16130f;
	--t-wash: #ffd9cd;
	--t-tint: #fff7f3;
	--t-line: #f2bfae;
}

/* Charcoal, from the logo's swoosh */
.px-tones > :nth-child(6n + 6) {
	--t-solid: #2c251e;
	--t-ink: #4a3d30;
	--t-on: #ffb000;
	--t-wash: #eadfd2;
	--t-tint: #faf7f2;
	--t-line: #d5c7b4;
}

.px-card,
.px-service {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 320px;
	padding: clamp(24px, 2.4vw, 32px);
	border: 1.5px solid var(--t-line);
	border-radius: 22px;
	background: linear-gradient(135deg, #fff 30%, var(--t-tint));
	box-shadow: 0 14px 32px -26px rgba(44, 30, 12, .4);
	color: var(--px-fg);
	isolation: isolate;
	overflow: hidden;
}

/* The two pale curves: one behind the picture, one rising across its foot. */
.px-card::before,
.px-service::before,
.px-card::after,
.px-service::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: var(--t-wash);
	pointer-events: none;
}

.px-card::before,
.px-service::before {
	top: -22%;
	right: -20%;
	z-index: -3;
	width: 62%;
	aspect-ratio: 1 / 1.35;
	opacity: .5;
}

.px-card::after,
.px-service::after {
	right: -6%;
	bottom: -20%;
	z-index: -1;
	width: 38%;
	aspect-ratio: 1;
	opacity: .55;
}

/* The picture, an oval running off the right edge. */
.px-tile-art {
	position: absolute;
	top: 6%;
	right: -18%;
	bottom: 6%;
	z-index: -2;
	width: 54%;
	border-radius: 50%;
	box-shadow: 0 0 0 12px color-mix(in srgb, var(--t-wash) 60%, transparent);
	background: var(--t-wash);
	overflow: hidden;
}

.px-tile-art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 35% 40%;
}

/* With no picture, the card's own icon, drawn faint in the top corner. */
.px-tile-mark {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: -1;
	color: var(--t-ink);
	font-size: 4.5rem;
	line-height: 1;
	opacity: .2;
	pointer-events: none;
}

.px-card:not(.px-tile--art)::before,
.px-service:not(.px-tile--art)::before {
	top: -70px;
	right: -60px;
	width: 210px;
	aspect-ratio: 1;
}

.px-card:not(.px-tile--art)::after,
.px-service:not(.px-tile--art)::after {
	right: -36px;
	bottom: -56px;
	width: 120px;
	opacity: .45;
}

/* Keep the words clear of the picture: the oval's widest point and its ring
   come to about 64% of the card, less 12px. */
.px-tile--art > :not(.px-tile-art) {
	max-width: calc(64% - 14px);
}

.px-card__icon,
.px-service__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: var(--px-space-4);
	border-radius: 16px;
	background: color-mix(in srgb, var(--t-wash) 75%, #fff);
	color: var(--t-ink);
	font-size: 1.4rem;
}

.px-card__label,
.px-service__label {
	margin-bottom: var(--px-space-2);
	color: var(--t-ink);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.px-card__title,
.px-service__title {
	margin-bottom: var(--px-space-3);
	font-size: clamp(1.2rem, 1.6vw, 1.4rem);
	letter-spacing: -.01em;
}

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

/* The whole card is the link. */
.px-card--linked .px-card__title a::after,
.px-service__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
}

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

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

.px-card__body,
.px-card__meta,
.px-service__text {
	margin: 0;
	color: var(--px-fg-muted);
	font-size: 1rem;
}

.px-card__meta {
	margin-bottom: var(--px-space-2);
	font-size: .9rem;
	font-weight: 600;
}

.px-service__points {
	margin-top: var(--px-space-3);
	color: var(--px-fg-muted);
	font-size: .95rem;
}

.px-service__points li {
	position: relative;
	padding-left: 18px;
}

.px-service__points li::before {
	content: "";
	position: absolute;
	top: .65em;
	left: 0;
	width: 8px;
	height: 3px;
	border-radius: 3px;
	background: var(--t-solid);
}

.px-card__cta,
.px-service__cta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	padding-top: var(--px-space-5);
	color: var(--t-ink);
	font-family: var(--px-font-display);
	font-size: .95rem;
	font-weight: 600;
}

.px-arrow {
	display: grid;
	flex: none;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--t-solid);
	color: var(--t-on);
}

/* Numbered plans */
.px-card__number {
	margin-bottom: var(--px-space-3);
	color: var(--t-ink);
	font-family: var(--px-font-display);
	font-size: 3rem;
	font-weight: 800;
	line-height: 1;
}

.px-card--plan,
.px-card--compact,
.px-card--result {
	min-height: 0;
}

/* Compact list */
.px-card--compact {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: var(--px-space-4);
}

.px-card--compact .px-card__icon {
	grid-row: span 2;
	margin-bottom: 0;
}

.px-card--compact .px-card__body {
	font-size: .975rem;
}

/* Short cards get smaller curves, so they stay in the corners. */
.px-card--compact:not(.px-tile--art)::before {
	top: -60px;
	right: -50px;
	width: 150px;
}

.px-card--compact:not(.px-tile--art)::after {
	right: -28px;
	bottom: -44px;
	width: 90px;
}

/* Over a dark or photo section the cards turn to glass. */
.px-section--dark .px-tones > :nth-child(n),
.px-section--photo .px-tones > :nth-child(n) {
	--t-ink: var(--px-amber);
	--t-wash: rgba(255, 176, 0, .16);
	--t-line: var(--px-line);
	--t-solid: var(--px-amber);
	--t-on: #16130f;
}

.px-section--dark .px-card,
.px-section--dark .px-service,
.px-section--photo .px-card,
.px-section--photo .px-service {
	background: var(--px-surface);
	box-shadow: none;
}

@media (max-width: 620px) {
	.px-card,
	.px-service {
		min-height: 0;
	}

	/* The picture moves up to the corner and the words get the full width. */
	.px-tile-art {
		top: -14px;
		right: -22px;
		bottom: auto;
		width: 130px;
		height: 130px;
	}

	.px-tile--art > :not(.px-tile-art) {
		max-width: none;
	}

	.px-tile--art .px-card__label,
	.px-tile--art .px-service__label {
		max-width: calc(100% - 96px);
	}
}
