/* ==========================================================================
   Portfolio page
   --------------------------------------------------------------------------
   Loaded only on /portfolio/. Uses only the existing type sizes, weights,
   spacing, radii, shadows and colours from main.css. Shared components used
   as-is: .section, .section-head, .status-badge, .pill, .btn.

   1. Header (like About)
   2. The work (filter + staggered grid)
   3. Who we've worked with
   4. Call to action
   5. Reduced motion
   ========================================================================== */


/* 1. Header (laid out like the About page's)
   ========================================================================== */

/* Same top offset as the home hero's headline. */
.pf-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: var(--space-l);
	margin-top: calc(var(--space-xl) + var(--space-xxl));
}

.pf-hero__heading {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	row-gap: var(--space-m);
}

.pf-hero__title {
	color: var(--color-ink);
	font-family: var(--font-sans);
	font-size: var(--size-display);
	font-weight: 500;
	letter-spacing: -0.5px;
	line-height: 1.1;
}

.pf-hero__aside {
	display: flex;
	flex-direction: column;
	row-gap: var(--space-m);
	max-width: 380px;
}

.pf-hero__text {
	color: var(--color-ink);
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: 300;
	letter-spacing: -0.5px;
	line-height: 1.2;
	opacity: 0.6;
}

.pf-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
}

.pf-hero__button {
	padding: 0 var(--space-m);
}

@media (max-width: 1200px) {
	.pf-hero {
		margin-top: calc(var(--space-xl) + var(--space-l));
	}
}

@media (max-width: 810px) {
	.pf-hero {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
		gap: var(--space-m);
	}

	.pf-hero__aside {
		max-width: none;
	}

	.pf-hero__text {
		font-size: 14px;
	}
}

@media (max-width: 478px) {
	.pf-hero {
		margin-top: var(--space-xxl);
	}

	.pf-hero__actions {
		flex-direction: column;
	}

	.pf-hero__button {
		width: 100%;
		height: 45px;
	}
}


/* 2. The work (staggered grid + page numbers)
   ========================================================================== */

/* Page links land with the section line clear of the fixed header. */
.pf-work {
	scroll-margin-top: calc(var(--space-xxl) + var(--space-s));
	font-family: var(--font-sans);
}

/* Two columns; every second card sits lower, so the grid reads like a
   contact sheet rather than a table. */
.pf-work__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: var(--space-xl) var(--space-l);
	width: 100%;
	margin: 0;
	padding: 0 0 var(--space-xxl);
	list-style: none;
}

.pf-card.is-offset {
	translate: 0 var(--space-xxl);
}

.pf-card__link {
	display: flex;
	flex-direction: column;
	gap: var(--space-s);
	color: var(--color-ink);
}

.pf-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	margin-bottom: var(--space-xs);
	overflow: hidden;
	border-radius: var(--radius);
	background-color: var(--color-mist);
	box-shadow: var(--shadow-deep);
	isolation: isolate;
}

.pf-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Darkens a touch on hover so the "View case study" label reads. */
.pf-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--color-ink);
	opacity: 0;
	transition: opacity 0.4s;
}

.pf-card__n {
	position: absolute;
	top: var(--space-s);
	left: var(--space-s);
	z-index: 1;
	padding: var(--space-xs) var(--space-s);
	border-radius: var(--radius-pill);
	background-color: var(--color-paper);
	box-shadow: var(--shadow-soft);
	font-size: 12px;
	font-weight: 500;
}

.pf-card__open {
	position: absolute;
	right: var(--space-s);
	bottom: var(--space-s);
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: var(--space-s);
	height: 40px;
	padding: 0 var(--space-m);
	border-radius: var(--radius-pill);
	background-color: var(--color-orange);
	color: var(--color-ink);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -0.5px;
	text-transform: uppercase;
	opacity: 0;
	translate: 0 10px;
	transition: opacity 0.3s, translate 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-card__link:hover .pf-card__image,
.pf-card__link:focus-visible .pf-card__image {
	scale: 1.04;
}

.pf-card__link:hover .pf-card__media::after,
.pf-card__link:focus-visible .pf-card__media::after {
	opacity: 0.25;
}

.pf-card__link:hover .pf-card__open,
.pf-card__link:focus-visible .pf-card__open {
	opacity: 1;
	translate: 0 0;
}

.pf-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-s);
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
}

.pf-card__type {
	color: var(--color-orange);
}

.pf-card__year {
	opacity: 0.6;
}

.pf-card__title {
	font-size: var(--size-title-md);
	font-weight: 500;
	letter-spacing: -0.5px;
	line-height: 1.1;
}

.pf-card__summary {
	max-width: 560px;
	font-size: 15px;
	font-weight: 300;
	letter-spacing: -0.5px;
	line-height: 1.2;
	opacity: 0.8;
}

.pf-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	margin-top: var(--space-xs);
}

/* Touch screens: no hover, so the label always shows. */
@media (hover: none) {
	.pf-card__open {
		opacity: 1;
		translate: 0 0;
	}
}

@media (max-width: 810px) {
	.pf-work__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-l);
		padding-bottom: 0;
	}

	.pf-card.is-offset {
		translate: none;
	}

	.pf-card__summary {
		font-size: 14px;
	}

	.pf-card__open {
		height: 35px;
		padding: 0 var(--space-s);
		font-size: 12px;
	}
}


/* Page numbers: Previous · 01 02 03 · Next, in one soft pill. */
.pf-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	align-self: center;
	gap: var(--space-xs);
	padding: var(--space-xs);
	border-radius: var(--radius-pill);
	background-color: var(--color-mist);
	box-shadow: var(--shadow-soft);
}

.pf-pages__list {
	display: flex;
	gap: var(--space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pf-pages__n,
.pf-pages__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-s);
	min-width: 40px;
	height: 40px;
	padding: 0 var(--space-s);
	border-radius: var(--radius-pill);
	color: var(--color-ink);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -0.5px;
	text-transform: uppercase;
	transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.pf-pages__step {
	padding: 0 var(--space-m);
}

.pf-pages__step--prev .icon {
	rotate: 180deg;
}

a.pf-pages__n:hover,
.pf-pages__step:hover {
	background-color: var(--color-paper);
}

.pf-pages__n.is-current {
	background-color: var(--color-ink);
	box-shadow: var(--shadow-deep);
	color: var(--color-paper);
}

@media (max-width: 478px) {
	.pf-pages__step {
		padding: 0 var(--space-s);
	}
}


/* 3. Who we've worked with
   ========================================================================== */

.pf-clients__wall {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: var(--space-s);
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-sans);
}

.pf-clients__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-s);
	aspect-ratio: 1;
	padding: var(--space-m);
	border-radius: var(--radius);
	background-color: var(--color-paper);
	box-shadow: var(--shadow-soft);
	transition: translate 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}

.pf-clients__item:hover {
	box-shadow: var(--shadow-deep);
	translate: 0 -5px;
}

.pf-clients__logo {
	/* The same area in every tile: trimmed logos fill it to whichever side
	   reaches first (wide wordmarks the width, round marks the height), so
	   they look evenly sized and sit at the same height. */
	width: 72%;
	height: 44%;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.8;
	transition: filter 0.4s, opacity 0.4s;
}

.pf-clients__item:hover .pf-clients__logo {
	filter: none;
	opacity: 1;
}

.pf-clients__name {
	color: var(--color-ink);
	font-size: 12px;
	font-weight: 500;
	text-align: center;
	text-transform: uppercase;
	opacity: 0.6;
}

/* Fewer per row: wrap, with a short last row centred. */
@media (max-width: 1200px) {
	.pf-clients__wall {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	.pf-clients__item {
		width: calc((100% - 3 * var(--space-s)) / 4);
	}
}

@media (max-width: 810px) {
	.pf-clients__item {
		width: calc((100% - 2 * var(--space-s)) / 3);
		padding: var(--space-s);
	}
}

@media (max-width: 478px) {
	.pf-clients__item {
		width: calc((100% - var(--space-s)) / 2);
	}
}


/* 4. Call to action
   ========================================================================== */

.pf-cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	row-gap: var(--space-m);
	width: 100%;
	margin-top: var(--space-l);
	padding: var(--space-xxl) var(--space-l);
	border-radius: var(--radius);
	background-color: var(--color-night);
	background-image: url("../images/ui/dark-light-rays.webp");
	background-position: right top;
	background-blend-mode: soft-light;
	box-shadow: var(--shadow-deep);
}

.pf-cta__title {
	color: var(--color-paper);
	font-family: var(--font-sans);
	font-size: var(--size-title-lg);
	font-weight: 500;
	letter-spacing: -0.5px;
	line-height: 1.1;
}

.pf-cta__text {
	max-width: 520px;
	color: var(--color-paper);
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: 300;
	letter-spacing: -0.5px;
	line-height: 1.2;
	opacity: 0.6;
}

.pf-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
	margin-top: var(--space-s);
}

.pf-cta__button {
	padding: 0 var(--space-m);
}

@media (max-width: 810px) {
	.pf-cta {
		padding: var(--space-l) var(--space-m);
	}

	.pf-cta__text {
		font-size: 14px;
	}
}

@media (max-width: 478px) {
	.pf-cta {
		padding: var(--space-l) var(--space-s);
	}

	.pf-cta__actions {
		width: 100%;
	}

	.pf-cta__button {
		width: 100%;
		height: 45px;
	}
}


/* 5. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.pf-clients__item:hover {
		translate: none;
	}

	.pf-card__image,
	.pf-card__open {
		transition: none;
	}
}
