/* Card: image + body. below = image over text, overlay = text over the image, side = image left. */
.px-page .px-card {
	position: relative;
	display: grid;
	min-width: 0;
	overflow: hidden;
	background: var(--px-color-surface);
	border: 1px solid var(--px-color-border);
	border-radius: var(--px-radius);
}
/* A card stretched by its row (va-stretch, bento) keeps image and text together; the extra height stays at the foot. */
.px-page :is(.px-card--below, .px-card--frame) { align-content: start; }
.px-page .px-card__media { position: relative; min-width: 0; overflow: hidden; background: var(--px-color-soft); aspect-ratio: 4 / 3; }
.px-page .px-card--r-3x4 .px-card__media { aspect-ratio: 3 / 4; }
.px-page .px-card--r-16x9 .px-card__media { aspect-ratio: 16 / 9; }
.px-page .px-card--r-1x1 .px-card__media { aspect-ratio: 1 / 1; }
.px-page .px-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.px-page .px-card__empty { display: block; width: 100%; height: 100%; min-height: 6rem; }
.px-page .px-card__body { display: grid; gap: var(--px-space-xs); align-content: start; justify-items: start; min-width: 0; padding: var(--px-space-m); }
.px-page .px-card__tag {
	padding: 0 var(--px-space-s);
	background: var(--px-color-primary-soft);
	color: var(--px-color-primary-text);
	border-radius: 999px;
	font-size: var(--px-text-small);
	font-weight: 600;
	line-height: 1.7;
	overflow-wrap: anywhere;
}
.px-page .px-card__title {
	margin: 0;
	color: var(--px-color-heading);
	font-family: var(--px-font-heading);
	font-size: var(--px-text-h4);
	font-weight: var(--px-weight-heading);
	line-height: var(--px-leading-tight);
	overflow-wrap: anywhere;
}
.px-page .px-card__text { margin: 0; color: var(--px-color-muted); font-size: var(--px-text-body); line-height: var(--px-leading-body); white-space: pre-line; overflow-wrap: anywhere; }
.px-page .px-card__arrow { display: inline-grid; place-items: center; font-size: var(--px-text-h4); color: var(--px-color-primary-text); }

/* Link: the title link covers the whole card. */
.px-page .px-card__link { color: inherit; text-decoration: none; }
.px-page .px-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.px-page .px-card--linked:hover .px-card__title { color: var(--px-color-primary-text); }
.px-page .px-card__link:focus-visible { outline: none; }
.px-page .px-card__link:focus-visible::after { outline: 3px solid var(--px-color-primary); outline-offset: -3px; }
.px-page .px-card--linked .px-card__img { transition: transform .4s ease; }
.px-page .px-card--linked:hover .px-card__img { transform: scale(1.04); }

/* overlay: the image fills the card, a dark gradient rises from the bottom, text is white. */
.px-page .px-card--overlay { aspect-ratio: 4 / 3; align-items: end; border: 0; color: rgb(255 255 255); }
.px-page .px-card--overlay.px-card--r-3x4 { aspect-ratio: 3 / 4; }
.px-page .px-card--overlay.px-card--r-16x9 { aspect-ratio: 16 / 9; }
.px-page .px-card--overlay.px-card--r-1x1 { aspect-ratio: 1 / 1; }
.px-page .px-card--overlay.px-card--noimg { background: color-mix(in oklab, var(--px-color-primary) 55%, rgb(0 0 0)); }
.px-page .px-card--overlay .px-card__media { position: absolute; inset: 0; aspect-ratio: auto; }
.px-page .px-card--overlay .px-card__body {
	z-index: 1;
	grid-area: 1 / 1;
	padding-top: var(--px-space-xl);
	background: linear-gradient(to top, rgb(0 0 0 / .8), rgb(0 0 0 / 0));
}
.px-page .px-card--overlay .px-card__media { grid-area: 1 / 1; }
.px-page .px-card--overlay .px-card__title,
.px-page .px-card--overlay .px-card__text,
.px-page .px-card--overlay .px-card__arrow,
.px-page .px-card--overlay.px-card--linked:hover .px-card__title { color: rgb(255 255 255); }
.px-page .px-card--overlay .px-card__tag { background: transparent; color: rgb(255 255 255); border: 1px solid rgb(255 255 255); }
.px-page .px-card--overlay .px-card__arrow { position: absolute; inset-block-end: var(--px-space-m); inset-inline-end: var(--px-space-m); }
/* 1.12 fix: the arrow sits in the bottom corner; the last lines of text keep clear of it instead of running under it. */
.px-page .px-card--overlay:has(.px-card__arrow) .px-card__body > :not(.px-card__arrow) { padding-inline-end: calc(1.25em + var(--px-space-s)); }
.px-page .px-card--overlay .px-card__link:focus-visible::after { outline-color: rgb(255 255 255); }

/* side: image 40% on the left, text on the right. */
.px-page .px-card--side { grid-template-columns: 40% minmax(0, 1fr); }
.px-page .px-card--side .px-card__media { aspect-ratio: auto; min-height: 100%; }
.px-page .px-card--side .px-card__img { position: absolute; inset: 0; }
.px-page .px-card--side.px-card--noimg { grid-template-columns: 1fr; }
.px-page .px-card--side .px-card__body { align-content: center; }

@container (max-width: 480px) {
	.px-page .px-card--side { grid-template-columns: 1fr; }
	.px-page .px-card--side .px-card__media { aspect-ratio: 4 / 3; min-height: 0; }
	.px-page .px-card--side.px-card--r-3x4 .px-card__media { aspect-ratio: 3 / 4; }
	.px-page .px-card--side.px-card--r-16x9 .px-card__media { aspect-ratio: 16 / 9; }
	.px-page .px-card--side.px-card--r-1x1 .px-card__media { aspect-ratio: 1 / 1; }
}
@media (prefers-reduced-motion: reduce) {
	.px-page .px-card--linked .px-card__img { transition: none; }
	.px-page .px-card--linked:hover .px-card__img { transform: none; }
}

/* glass: a frosted block, tag / title / text, then the image underneath, uncropped. Alone in a column it fills the row height (below). */
.px-page .px-card--glass {
	overflow: visible;
	padding: clamp(1.25rem, 2.2vw, 1.875rem);
	border: 1px solid color-mix(in oklab, #fff 70%, transparent);
	border-radius: var(--px-radius-panel, 1.75rem);
	background: color-mix(in oklab, var(--px-color-surface) 92%, transparent);
	background: linear-gradient(135deg, color-mix(in oklab, var(--px-color-surface) 68%, transparent), color-mix(in oklab, var(--px-color-surface) 38%, transparent));
	box-shadow: inset 0 1px 0 color-mix(in oklab, #fff 90%, transparent), 0 1px 1px rgb(15 23 42 / .04), 0 8px 24px -8px rgb(15 23 42 / .12), 0 30px 60px -30px rgb(30 27 75 / .25);
	align-content: start;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.px-page .px-card--glass { -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7); }
}
.px-page .px-card--glass .px-card__body { padding: 0; gap: .625rem; }
.px-page .px-card--glass .px-card__title { font-size: 1.375rem; letter-spacing: -.02em; }
/* imagePlace top (glass): the picture sits above the text. */
.px-page .px-card--glass.px-card--img-top .px-card__media { margin-block: 0 var(--px-space-xs); }
.px-page .px-card--glass .px-card__text { color: var(--px-color-muted); max-width: 34ch; }
.px-page .px-card--glass .px-card__media { margin-block-start: var(--px-space-s); max-width: 100%; aspect-ratio: auto; overflow: visible; background: none; }
/* The illustration spans the card's content width (export it at that width; transparent space keeps small art small). */
.px-page .px-card--glass .px-card__media { width: 100%; }
.px-page .px-card--glass .px-card__img { width: 100%; height: auto; object-fit: contain; }
.px-page .px-card--glass .px-card__link::after { border-radius: var(--px-radius-panel, 1.75rem); }
.px-page .px-card--glass.px-card--linked:hover .px-card__img { transform: none; }
/* Glass cards side by side are one grid: same height per row. */
.px-page .px-row:has(> .px-col > .px-card--glass) { align-items: stretch; }
.px-page .px-col:has(> .px-card--glass:only-child) { display: flex; flex-direction: column; }
.px-page .px-col > .px-card--glass:only-child { flex: 1; }

/* frame: a screenshot in a browser-like frame (inset image, three dots), then name / text with a round arrow on the right. */
.px-page .px-card--frame {
	padding: .625rem;
	border: 1px solid color-mix(in oklab, var(--px-color-text) 12%, transparent);
	border-radius: var(--px-radius-panel, 1.625rem);
	background: color-mix(in oklab, var(--px-color-text) 6%, transparent);
	box-shadow: inset 0 1px 0 color-mix(in oklab, var(--px-color-text) 10%, transparent);
	transition: transform .3s ease, background-color .3s ease;
}
.px-page .px-card--frame .px-card__media { position: relative; border-radius: calc(var(--px-radius-panel, 1.625rem) - .5rem); overflow: hidden; }
.px-page .px-card--frame .px-card__media::before {
	content: ""; position: absolute; z-index: 1; inset: 0 0 auto; height: 2rem; pointer-events: none;
	background:
		radial-gradient(circle at 1.05rem 1rem, rgb(255 255 255 / .55) .28rem, transparent .3rem),
		radial-gradient(circle at 1.8rem 1rem, rgb(255 255 255 / .55) .28rem, transparent .3rem),
		radial-gradient(circle at 2.55rem 1rem, rgb(255 255 255 / .55) .28rem, transparent .3rem),
		linear-gradient(rgb(0 0 0 / .35), transparent);
}
.px-page .px-card--frame.px-card--nodots .px-card__media::before { background: linear-gradient(rgb(0 0 0 / .35), transparent); }
.px-page .px-card--frame .px-card__img { object-position: top; }
.px-page .px-card--frame .px-card__body { display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: var(--px-space-s); row-gap: .125rem; padding: 1.125rem .75rem .5rem; }
.px-page .px-card--frame .px-card__body > :not(.px-card__arrow, .px-card__swatches) { grid-column: 1; }
.px-page .px-card--frame .px-card__swatches { grid-column: 2; grid-row: 1 / span 3; }
.px-page .px-card--frame .px-card__title { font-size: 1.1875rem; letter-spacing: -.02em; }
.px-page .px-card--frame .px-card__text { margin: 0; color: var(--px-color-muted); font-size: var(--px-text-small); }
.px-page .px-card--frame .px-card__arrow { grid-column: 3; grid-row: 1 / span 3; position: static; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: var(--px-color-text); font-size: 1rem; background: color-mix(in oklab, var(--px-color-text) 10%, transparent); }
.px-page .px-card--frame.px-card--linked:hover { transform: translateY(-4px); background: color-mix(in oklab, var(--px-color-text) 10%, transparent); }
.px-page .px-card--frame.px-card--linked:hover .px-card__img { transform: none; }
@media (prefers-reduced-motion: reduce) { .px-page .px-card--frame { transition: none; } .px-page .px-card--frame.px-card--linked:hover { transform: none; } }

/* titleSize l: a bigger title (mostly for overlay cards). */
.px-page .px-card--t-l .px-card__title { font-size: calc(var(--px-text-h2) * .75); }
/* overlay: m = h3; l keeps the .75 × h2 step above (≈ 45px, studio project cards); s keeps h4 below. */
.px-page .px-card--overlay .px-card__title { font-size: var(--px-text-h3); }
.px-page .px-card--overlay.px-card--t-l .px-card__title { font-size: calc(var(--px-text-h2) * .75); }
/* titleSize s: the h4 step (after the style rules so it wins on glass / frame). */
.px-page .px-card--t-s .px-card__title,
.px-page .px-card--overlay.px-card--t-s .px-card__title { font-size: var(--px-text-h4); }

/* Swatches (frame): overlapping colour dots between the text and the arrow. */
.px-page .px-card--frame.px-card--swatches .px-card__body { grid-template-columns: 1fr auto auto; }
.px-page .px-card--frame.px-card--swatches .px-card__arrow { grid-column: 3; }
.px-page .px-card__swatches { display: flex; grid-column: 2; grid-row: 1 / span 3; align-self: center; padding-inline-start: 6px; }
.px-page .px-card__swatches i { width: 22px; height: 22px; margin-inline-start: -6px; border-radius: 50%; border: 2px solid var(--px-color-surface); box-sizing: border-box; }

/* chrome none (advanced): no background, border or frame padding. The image takes the radius, the text sits right below it. */
.px-page .px-card--chrome-none:not(.px-card--overlay) { background: none; border: 0; box-shadow: none; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.px-page .px-card--chrome-none .px-card__media { border-radius: var(--px-radius); }
.px-page .px-card--chrome-none .px-card__body { padding: var(--px-space-s) 0 0; }
.px-page .px-card--overlay.px-card--chrome-none .px-card__body { padding: var(--px-space-xl) var(--px-space-m) var(--px-space-m); }
.px-page .px-card--chrome-none.px-card--linked:hover { background: none; transform: none; }

/* textAlign center (advanced). */
.px-page .px-card--ta-center .px-card__body { justify-items: center; text-align: center; }
.px-page .px-card--ta-center .px-card__text { margin-inline: auto; }

/* tagPlace image (advanced): the tag floats on the image's top-left corner. */
.px-page .px-card__media > .px-card__tag {
	position: absolute;
	inset-block-start: var(--px-space-s);
	inset-inline-start: var(--px-space-s);
	z-index: 2;
	background: var(--px-color-surface);
	border: 0;
	color: var(--px-color-primary-text);
}

/* imageTone mono (advanced): the card image in greyscale. */
.px-page .px-card--img-mono .px-card__img { filter: grayscale(1); }

/* titleSize h3 (1.10): the h3 step, between m and l; wins on every style (glass / frame set their own size above). */
.px-page .px-card--t-h3 .px-card__title { font-size: var(--px-text-h3); }

/* Link opens in a new tab: hint for screen readers only. */
.px-page .px-card__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
