/*
 * Front page.
 *
 * The hero is the whole argument: one work, at size, on ink, with the price in
 * reach. Everything below it is a route into the catalogue.
 */

.tfa-context-home .tfa-main {
	padding-top: 0;
}

.tfa-hero {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.tfa-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.tfa-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/*
	 * A slow drift across twenty four seconds. Long enough that it reads as
	 * the room breathing rather than as an animation asking to be noticed.
	 */
	animation: tfa-drift 24s var(--tfa-ease) infinite alternate;
}

@keyframes tfa-drift {
	from {
		transform: scale(1) translate3d(0, 0, 0);
	}

	to {
		transform: scale(1.06) translate3d(-1.2%, -1%, 0);
	}
}

[data-tfa-motion='off'] .tfa-hero__image,
html:not(.tfa-js) .tfa-hero__image {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.tfa-hero__image {
		animation: none;
	}
}

/*
 * The veil is heavier on the reading side than the old one, because the hero
 * now carries a paragraph and a row of figures rather than three words, and
 * type over a painting has to be legible before it is atmospheric.
 */
.tfa-hero__veil {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.78) 38%, rgba(10, 10, 10, 0.18) 72%, rgba(10, 10, 10, 0.42) 100%),
		linear-gradient(0deg, rgba(10, 10, 10, 0.86) 0%, rgba(10, 10, 10, 0) 46%);
}

.tfa-hero__inner {
	display: grid;
	align-content: center;
	min-height: min(84vh, 860px);
	padding-block: clamp(56px, 9vw, 120px);
	color: #F6F2EA;
}

.tfa-hero__eyebrow {
	color: var(--tfa-accent-2);
	text-transform: uppercase;
	letter-spacing: 0.22em;
	margin: 0;
}

.tfa-hero__title {
	font-size: clamp(2.4rem, 5.2vw, 4.6rem);
	line-height: 1.04;
	margin: 14px 0 0;
	max-width: 17ch;
	color: #FFFBF4;
	text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}

.tfa-hero__sub {
	margin: 18px 0 0;
	max-width: 52ch;
	color: rgba(246, 242, 234, 0.86);
	font-size: clamp(1rem, 1.2vw, 1.125rem);
}

.tfa-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tfa-space-2);
	margin-top: var(--tfa-space-5);
}

.tfa-hero__actions .tfa-button--quiet {
	color: #F6F2EA;
	border-color: rgba(246, 242, 234, 0.45);
}

/*
 * The figures are the part a first time visitor reads. They answer how much
 * there is, what it starts at, how long the gallery has been doing this and
 * where it is, which is most of what stops someone bouncing.
 */
.tfa-hero__facts {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	margin: var(--tfa-space-5) 0 0;
	padding: var(--tfa-space-4) 0 0;
	border-top: 1px solid rgba(246, 242, 234, 0.2);
}

.tfa-hero__facts li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-right: clamp(20px, 2.4vw, 36px);
	margin-right: clamp(20px, 2.4vw, 36px);
	border-right: 1px solid rgba(246, 242, 234, 0.2);
}

.tfa-hero__facts li:last-child {
	border-right: 0;
	margin-right: 0;
	padding-right: 0;
}

.tfa-hero__facts b {
	font-family: var(--tfa-font-display);
	font-variation-settings: 'opsz' 36;
	font-size: clamp(1.25rem, 1.8vw, 1.625rem);
	font-weight: 500;
	line-height: 1;
}

.tfa-hero__facts span {
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	color: rgba(246, 242, 234, 0.66);
}

/* The work on show, credited rather than headlined. */

.tfa-hero__credit {
	position: absolute;
	right: var(--tfa-gutter);
	bottom: var(--tfa-gutter);
	z-index: 2;
	display: flex;
	align-items: center;
	gap: var(--tfa-space-3);
	max-width: 380px;
	padding: 12px 16px;
	background: rgba(12, 12, 12, 0.62);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(246, 242, 234, 0.2);
	text-decoration: none;
	color: #F6F2EA;
	transition: background var(--tfa-dur-fast) var(--tfa-ease), transform var(--tfa-dur-fast) var(--tfa-ease);
}

.tfa-hero__credit:hover {
	background: rgba(12, 12, 12, 0.82);
	transform: translateY(-2px);
	color: #F6F2EA;
}

.tfa-hero__credit-thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	flex: none;
}

.tfa-hero__credit-meta {
	display: grid;
	min-width: 0;
}

.tfa-hero__credit-title {
	font-family: var(--tfa-font-display);
	font-size: 1rem;
}

.tfa-hero__credit-sub {
	font-size: 0.8125rem;
	color: rgba(246, 242, 234, 0.66);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tfa-hero__credit-price {
	font-family: var(--tfa-font-display);
	font-size: 1rem;
	color: var(--tfa-accent-2);
	margin-left: auto;
	white-space: nowrap;
}

/*
 * Below 860px the artwork becomes a band rather than a backdrop, and the words
 * sit on solid ground underneath it. Type laid over a full screen painting on a
 * phone is the reason the old hero explained nothing: there was nowhere legible
 * to put more than three words.
 */
@media (max-width: 860px) {
	.tfa-hero__inner {
		min-height: 0;
		padding-block: 0;
	}

	/*
	 * A band rather than a screen. Tall enough that the work still leads, short
	 * enough that the headline, the sentence explaining what this is and the
	 * way in are all above the fold on a phone.
	 */
	.tfa-hero__media {
		position: relative;
		inset: auto;
		z-index: 0;
		aspect-ratio: 5 / 4;
		max-height: 40vh;
	}

	/* Only enough veil to land the band on the page. The type is below it now. */
	.tfa-hero__veil {
		background: linear-gradient(0deg, var(--tfa-bg) 0%, rgba(10, 10, 10, 0) 26%);
	}

	.tfa-hero__body {
		padding-block: var(--tfa-space-4) var(--tfa-space-6);
	}

	.tfa-hero__title {
		font-size: clamp(2.1rem, 8.4vw, 2.9rem);
		max-width: none;
	}

	/* Wide tracking costs a line at phone widths, so it is eased off. */
	.tfa-hero__eyebrow {
		letter-spacing: 0.14em;
	}

	.tfa-hero__actions {
		margin-top: var(--tfa-space-4);
	}

	/*
	 * Side by side rather than stacked. Two short labels fit, and it saves the
	 * sixty pixels that decide whether the figures below are on the first
	 * screen or not.
	 */
	.tfa-hero__actions .tfa-button {
		flex: 1 1 0;
		min-width: 0;
		text-align: center;
		padding: 15px 12px;
		font-size: 0.9375rem;
	}

	.tfa-hero__facts {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--tfa-space-3) var(--tfa-space-4);
		margin-top: var(--tfa-space-4);
	}

	.tfa-hero__facts li {
		border-right: 0;
		padding-right: 0;
		margin-right: 0;
	}

	.tfa-hero__credit {
		position: static;
		max-width: none;
		margin-top: var(--tfa-space-4);
		background: var(--tfa-bg-raised);
		backdrop-filter: none;
	}
}

/* Statement */

.tfa-statement__text {
	font-family: var(--tfa-font-display);
	font-size: clamp(1.5rem, 3vw, 2.4rem);
	line-height: 1.25;
	max-width: 26ch;
	margin: 0;
	text-wrap: balance;
}

/* Featured artist */

.tfa-featured__grid {
	display: grid;
	grid-template-columns: 5fr 7fr;
	gap: clamp(32px, 5vw, 88px);
	align-items: center;
}

@media (max-width: 900px) {
	.tfa-featured__grid {
		grid-template-columns: 1fr;
	}
}

.tfa-featured__portrait img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	outline: 1px solid var(--tfa-line);
}

.tfa-featured__quote {
	margin: 0 0 var(--tfa-space-4);
	padding-left: var(--tfa-space-4);
	border-left: 2px solid var(--tfa-accent);
	font-family: var(--tfa-font-display);
	font-size: 1.375rem;
	line-height: 1.4;
}

.tfa-featured__works {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--tfa-gutter);
	margin-top: clamp(40px, 6vw, 88px);
}

@media (max-width: 900px) {
	.tfa-featured__works {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Collections */

.tfa-collections__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: var(--tfa-gutter);
}

/*
 * A card that names a grouping and shows nothing from it is asking a visitor
 * to guess. Each card leads with three real works from behind the link, set
 * like pieces leaning against a wall, so the purpose of the card is visible
 * before a word of it is read.
 */
.tfa-collection-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-decoration: none;
	color: var(--tfa-fg);
	background: var(--tfa-bg-raised);
	border: 1px solid var(--tfa-line);
	transition: border-color var(--tfa-dur) var(--tfa-ease), transform var(--tfa-dur) var(--tfa-ease);
}

.tfa-collection-card:hover {
	color: var(--tfa-fg);
	border-color: color-mix(in srgb, var(--tfa-accent) 60%, var(--tfa-line));
	transform: translateY(-3px);
}

.tfa-collection-card__stack {
	position: relative;
	display: block;
	height: 216px;
	background:
		radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tfa-accent) 12%, transparent) 0%, transparent 62%),
		var(--tfa-bg);
	border-bottom: 1px solid var(--tfa-line);
	overflow: hidden;
}

/*
 * Every plate is the same shape whatever the work's own proportions. These are
 * thumbnails standing in for a grouping, not the presentation of a piece, and
 * three different silhouettes leaning together read as clutter rather than as a
 * stack. The work itself is never cropped anywhere it is actually being shown.
 */
.tfa-collection-card__plate {
	position: absolute;
	bottom: -10px;
	display: block;
	height: 74%;
	aspect-ratio: 3 / 4;
	width: auto;
	transform-origin: bottom center;
	transition: transform var(--tfa-dur-slow) var(--tfa-ease-spring);
}

.tfa-collection-card__plate img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
	outline: 1px solid rgba(243, 239, 231, 0.16);
}

/* Leaning, with the middle piece upright and in front. */

.tfa-collection-card__plate--1 {
	left: 6%;
	z-index: 1;
	transform: rotate(-7deg) translateY(8px) scale(0.92);
}

.tfa-collection-card__plate--2 {
	left: 50%;
	z-index: 3;
	height: 84%;
	transform: translateX(-50%);
}

.tfa-collection-card__plate--3 {
	right: 6%;
	z-index: 2;
	transform: rotate(7deg) translateY(8px) scale(0.92);
}

/* On hover they fan out, the way someone flicking through a rack would. */

.tfa-collection-card:hover .tfa-collection-card__plate--1 {
	transform: rotate(-12deg) translate3d(-10px, 0, 0) scale(0.96);
}

.tfa-collection-card:hover .tfa-collection-card__plate--2 {
	transform: translateX(-50%) translateY(-8px) scale(1.02);
}

.tfa-collection-card:hover .tfa-collection-card__plate--3 {
	transform: rotate(12deg) translate3d(10px, 0, 0) scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
	.tfa-collection-card:hover .tfa-collection-card__plate--1,
	.tfa-collection-card:hover .tfa-collection-card__plate--2,
	.tfa-collection-card:hover .tfa-collection-card__plate--3 {
		transform: none;
	}

	.tfa-collection-card__plate--2 {
		transform: translateX(-50%);
	}
}

.tfa-collection-card__body {
	display: grid;
	gap: var(--tfa-space-2);
	align-content: start;
	padding: var(--tfa-space-4) var(--tfa-space-4) var(--tfa-space-5);
	flex: 1;
}

.tfa-collection-card__title {
	font-family: var(--tfa-font-display);
	font-size: 1.5rem;
	line-height: 1.15;
}

.tfa-collection-card__text {
	color: var(--tfa-fg-muted);
	font-size: 0.9375rem;
}

/* An explicit way through, because a card that is a link should look like one. */

.tfa-collection-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: var(--tfa-space-2);
	color: var(--tfa-accent-2);
	font-size: 0.9375rem;
	font-weight: 600;
}

.tfa-collection-card__cta svg {
	width: 18px;
	height: 18px;
	transition: transform var(--tfa-dur-fast) var(--tfa-ease);
}

.tfa-collection-card:hover .tfa-collection-card__cta svg {
	transform: translateX(4px);
}

@media (max-width: 560px) {
	.tfa-collection-card__stack {
		height: 192px;
	}

	.tfa-collection-card__plate {
		height: 70%;
	}
}

/* Exhibitions */

.tfa-shows__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	gap: var(--tfa-gutter);
}

.tfa-show__link {
	display: grid;
	gap: var(--tfa-space-2);
	text-decoration: none;
}

.tfa-show__media img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	margin-bottom: var(--tfa-space-2);
	transition: transform var(--tfa-dur-slow) var(--tfa-ease);
}

.tfa-show__link:hover .tfa-show__media img {
	transform: scale(1.03);
}

.tfa-show__title {
	margin: 0;
	font-size: 1.25rem;
}

.tfa-show__venue {
	color: var(--tfa-fg-muted);
	font-size: 0.9375rem;
}

/* Promise */

.tfa-promise__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	gap: clamp(28px, 4vw, 72px);
	padding-top: var(--tfa-space-6);
	border-top: 1px solid var(--tfa-line);
}

.tfa-promise__title {
	font-size: 1.375rem;
	margin-bottom: var(--tfa-space-3);
}

.tfa-promise__item p {
	color: var(--tfa-fg-muted);
}

/* Signup */

.tfa-signup {
	background: var(--tfa-bg-raised);
}

.tfa-signup__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(32px, 5vw, 80px);
	align-items: center;
}

@media (max-width: 900px) {
	.tfa-signup__inner {
		grid-template-columns: 1fr;
	}
}

.tfa-signup__taste {
	border: 0;
	padding: 0;
	margin: 0 0 var(--tfa-space-4);
}

.tfa-signup__taste legend {
	padding: 0;
	margin-bottom: var(--tfa-space-3);
}

.tfa-signup__choices {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tfa-space-2);
}

.tfa-signup__form .tfa-field {
	display: flex;
	gap: var(--tfa-space-2);
	margin: 0;
}

@media (max-width: 520px) {
	.tfa-signup__form .tfa-field {
		flex-direction: column;
	}
}

.tfa-signup__note {
	margin-top: var(--tfa-space-3);
}
