/*
 * Native Portfolio project pages.
 * Loaded only on single project pages. Inherits the theme's fonts and colours;
 * override the --npf-* variables in your theme to adjust.
 */

.npf-project {
	--npf-text: currentColor;
	--npf-muted: color-mix(in srgb, currentColor 62%, transparent);
	--npf-line: color-mix(in srgb, currentColor 14%, transparent);
	--npf-tint: color-mix(in srgb, currentColor 5%, transparent);
	/* Defaults to the theme's main text colour, which always has good contrast. Themes can set their own accent. */
	--npf-accent: var(--wp--preset--color--contrast, currentColor);
	--npf-on-accent: var(--wp--preset--color--base, #fff);
	--npf-radius: 12px;
	--npf-gap: clamp(1rem, 2.5vw, 1.5rem);
	--npf-space: clamp(2.5rem, 6vw, 4.5rem);
	--npf-device-bg: #e9e9ec;
	--npf-dark: #111114;

	box-sizing: border-box;
	margin-block: var(--npf-gap) 0;
}

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
	.npf-project {
		--npf-muted: rgba(127, 127, 127, 0.95);
		--npf-line: rgba(127, 127, 127, 0.28);
		--npf-tint: rgba(127, 127, 127, 0.08);
	}
}

.npf-project *,
.npf-project *::before,
.npf-project *::after {
	box-sizing: inherit;
}

.npf-project img {
	max-width: 100%;
	height: auto;
}

.npf-section {
	margin-block: 0 var(--npf-space);
}

.npf-heading {
	margin: 0 0 1.25rem;
	font-size: clamp(1.25rem, 2.2vw, 1.6rem);
	line-height: 1.25;
}

.npf-prose {
	max-width: 70ch;
}

.npf-prose > :first-child {
	margin-top: 0;
}

.npf-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Links and buttons */
.npf-button {
	display: inline-flex;
	gap: 0.5em;
	align-items: center;
	padding: 0.8em 1.4em;
	border: 2px solid var(--npf-accent);
	border-radius: 999px;
	background: var(--npf-accent);
	color: var(--npf-on-accent);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.npf-button:hover {
	filter: brightness(1.1);
}

.npf-button--outline {
	background: transparent;
	color: inherit;
}

.npf-project a:focus-visible,
.npf-project button:focus-visible {
	outline: 3px solid var(--npf-accent);
	outline-offset: 3px;
}

/* Tags */
.npf-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.npf-tags li {
	margin: 0;
	padding: 0.3em 0.85em;
	border: 1px solid var(--npf-line);
	border-radius: 999px;
	font-size: 0.875em;
	line-height: 1.4;
}

.npf-tags a {
	color: inherit;
	text-decoration: none;
}

/* Introduction */
.npf-intro__types {
	margin-bottom: 1.25rem;
}

.npf-intro__types li {
	border-color: var(--npf-accent);
}

.npf-intro__tagline {
	max-width: 40ch;
	margin: 0 0 1.75rem;
	font-size: clamp(1.25rem, 2.6vw, 1.75rem);
	line-height: 1.35;
}

.npf-intro__action {
	margin: 1.75rem 0 0;
}

/* Facts */
.npf-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
	gap: var(--npf-gap);
	margin: 0;
	padding: 1.25rem 0 0;
	border-top: 1px solid var(--npf-line);
}

.npf-facts--wide {
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.npf-facts__item--full {
	grid-column: 1 / -1;
}

.npf-facts dt {
	margin: 0 0 0.35rem;
	color: var(--npf-muted);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.npf-facts dd {
	margin: 0;
}

/* Website: device frames */
.npf-devices {
	position: relative;
	padding: clamp(1rem, 4vw, 3rem);
	border-radius: calc(var(--npf-radius) * 1.5);
	background: var(--npf-tint);
}

.npf-devices--both {
	padding-right: clamp(4rem, 18%, 12rem);
	padding-bottom: clamp(2rem, 6vw, 4rem);
}

.npf-browser,
.npf-phone {
	margin: 0;
}

.npf-browser {
	overflow: hidden;
	border-radius: var(--npf-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 20px 50px -20px rgba(0, 0, 0, 0.35);
}

.npf-browser__bar {
	display: flex;
	gap: 1rem;
	align-items: center;
	padding: 0.6rem 0.9rem;
	background: var(--npf-device-bg);
	color: #444;
	font-size: 0.75rem;
}

.npf-browser__dots {
	display: inline-flex;
	gap: 6px;
}

.npf-browser__dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #c4c4c9;
}

.npf-browser__address {
	flex: 1;
	max-width: 22rem;
	padding: 0.2rem 0.75rem;
	overflow: hidden;
	border-radius: 999px;
	background: #fff;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.npf-browser__screen img,
.npf-phone__screen img {
	display: block;
	width: 100%;
}

.npf-phone {
	width: min(42%, 15rem);
	margin-inline: auto;
	padding: 10px;
	border-radius: 2.2rem;
	background: var(--npf-dark);
	box-shadow: 0 25px 50px -20px rgba(0, 0, 0, 0.5);
}

.npf-phone__screen {
	overflow: hidden;
	border-radius: 1.7rem;
	background: #000;
}

.npf-devices--both .npf-phone {
	position: absolute;
	right: clamp(1rem, 4vw, 3rem);
	bottom: clamp(1rem, 3vw, 2rem);
	width: clamp(6rem, 24%, 13rem);
	margin: 0;
}

/* Cards */
.npf-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: var(--npf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: npf-card;
}

.npf-card {
	margin: 0;
	padding: 1.5rem;
	border: 1px solid var(--npf-line);
	border-radius: var(--npf-radius);
	counter-increment: npf-card;
}

.npf-card::before {
	display: block;
	margin-bottom: 0.75rem;
	color: var(--npf-accent);
	font-size: 0.85em;
	font-weight: 700;
	content: counter(npf-card, decimal-leading-zero);
}

.npf-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.1em;
}

.npf-card p {
	margin: 0;
	color: var(--npf-muted);
}

/* Video */
.npf-video {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: var(--npf-radius);
	background: var(--npf-dark);
	color: #fff;
}

.npf-video video,
.npf-video iframe,
.npf-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.npf-video video {
	object-fit: contain;
	background: #000;
}

.npf-video__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.05) 60%);
	color: #fff;
}

.npf-video__icon {
	position: relative;
	width: clamp(3.5rem, 9vw, 5rem);
	aspect-ratio: 1;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease;
}

.npf-video__icon::after {
	position: absolute;
	top: 50%;
	left: 54%;
	border-width: 0.75em 0 0.75em 1.25em;
	border-style: solid;
	border-color: transparent transparent transparent #111;
	content: "";
	transform: translate(-50%, -50%);
}

.npf-video__play:hover .npf-video__icon,
.npf-video__play:focus-visible .npf-video__icon {
	transform: scale(1.08);
}

.npf-video__notice {
	position: absolute;
	right: 0.75rem;
	bottom: 0.5rem;
	margin: 0;
	opacity: 0.85;
	font-size: 0.75rem;
	pointer-events: none;
}

.npf-video.is-playing .npf-video__play,
.npf-video.is-playing .npf-video__poster,
.npf-video.is-playing .npf-video__notice {
	display: none;
}

.npf-player--portrait .npf-video {
	max-width: min(100%, 26rem);
	margin-inline: auto;
}

.npf-video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: var(--npf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.npf-video-grid li {
	margin: 0;
}

.npf-video-grid__title {
	margin: 0.6rem 0 0;
	font-weight: 600;
}

/* Credits */
.npf-credits__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 1rem var(--npf-gap);
	margin: 0;
}

.npf-credits__item {
	padding-top: 0.75rem;
	border-top: 1px solid var(--npf-line);
}

.npf-credits__item dt {
	color: var(--npf-muted);
	font-size: 0.85em;
}

.npf-credits__item dd {
	margin: 0.15rem 0 0;
	font-weight: 600;
}

/* Marketing: results */
.npf-results__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--npf-line);
	border-radius: calc(var(--npf-radius) * 1.5);
	background: var(--npf-line);
	list-style: none;
}

.npf-results__item {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0;
	padding: clamp(1.5rem, 3.5vw, 2.5rem);
	background: var(--wp--preset--color--base, #fff);
}

.npf-results__value {
	color: var(--npf-accent);
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1;
}

.npf-results__label {
	font-weight: 600;
}

.npf-results__note {
	color: var(--npf-muted);
	font-size: 0.875em;
}

.npf-brief__grid {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: calc(var(--npf-gap) * 2);
	align-items: start;
}

.npf-brief__objective {
	margin: 0;
	font-size: 1.15em;
	line-height: 1.6;
}

/* Branding */
.npf-logo__stage {
	display: grid;
	place-items: center;
	min-height: clamp(14rem, 35vw, 24rem);
	margin: 0;
	padding: clamp(2rem, 6vw, 4rem);
	border-radius: calc(var(--npf-radius) * 1.5);
	background: var(--npf-tint);
}

.npf-logo__image {
	max-height: 12rem;
	width: auto;
	object-fit: contain;
}

.npf-palette__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
	gap: var(--npf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.npf-palette__swatch {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.15rem;
	aspect-ratio: 4 / 5;
	margin: 0;
	padding: 1rem;
	border: 1px solid var(--npf-line);
	border-radius: var(--npf-radius);
	background: var(--npf-swatch);
	color: var(--npf-swatch-text);
}

.npf-palette__name {
	font-weight: 600;
}

.npf-palette__hex {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
	opacity: 0.85;
}

.npf-typefaces {
	margin: 0;
	padding: 0;
	list-style: none;
}

.npf-typefaces li {
	margin: 0 0 0.25rem;
	font-size: 1.35em;
	font-weight: 600;
}

.npf-download__meta {
	opacity: 0.7;
	font-weight: 400;
}

/* Gallery */
.npf-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
	gap: var(--npf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.npf-gallery__grid--single {
	grid-template-columns: 1fr;
}

.npf-gallery__grid--pair {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.npf-gallery__item {
	margin: 0;
}

.npf-gallery__item figure {
	margin: 0;
}

.npf-gallery__link {
	display: block;
	overflow: hidden;
	border-radius: var(--npf-radius);
	background: var(--npf-tint);
}

.npf-gallery__image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.npf-gallery__grid--single .npf-gallery__image {
	aspect-ratio: auto;
}

.npf-gallery__link:hover .npf-gallery__image {
	transform: scale(1.03);
}

.npf-gallery__item figcaption {
	margin-top: 0.5rem;
	color: var(--npf-muted);
	font-size: 0.875em;
}

/* Lightbox (a native <dialog> created by project.js) */
.npf-lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(10, 10, 12, 0.94);
	color: #fff;
}

.npf-lightbox::backdrop {
	background: rgba(10, 10, 12, 0.94);
}

.npf-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 4rem 4.5rem 2rem;
}

.npf-lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 8rem);
	object-fit: contain;
}

.npf-lightbox__caption {
	margin-top: 0.75rem;
	font-size: 0.9rem;
	text-align: center;
}

.npf-lightbox button {
	position: absolute;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.npf-lightbox button:hover {
	background: rgba(255, 255, 255, 0.24);
}

.npf-lightbox button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.npf-lightbox__close {
	top: 1rem;
	right: 1rem;
}

.npf-lightbox__prev,
.npf-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.npf-lightbox__prev {
	left: 1rem;
}

.npf-lightbox__next {
	right: 1rem;
}

.npf-lightbox__count {
	position: absolute;
	top: 1.6rem;
	left: 1.25rem;
	font-size: 0.85rem;
	opacity: 0.8;
}

/* Navigation */
.npf-nav {
	display: flex;
	justify-content: center;
	padding-top: 1.5rem;
	border-top: 1px solid var(--npf-line);
}

.npf-nav a {
	display: inline-flex;
	gap: 0.5em;
	align-items: center;
	padding: 0.7em 1.4em;
	border: 1px solid var(--npf-line);
	border-radius: 999px;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.npf-nav a:hover {
	border-color: currentColor;
}

/* Small screens */
@media (max-width: 720px) {
	.npf-brief__grid {
		grid-template-columns: 1fr;
	}

	.npf-devices--both {
		padding-right: clamp(1rem, 4vw, 3rem);
	}

	.npf-devices--both .npf-phone {
		position: relative;
		right: auto;
		bottom: auto;
		width: 45%;
		margin: -3rem 0 0 auto;
	}

	.npf-lightbox__figure {
		padding: 4rem 1rem 5rem;
	}

	.npf-lightbox__prev,
	.npf-lightbox__next {
		top: auto;
		bottom: 1rem;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.npf-project *,
	.npf-lightbox * {
		transition: none !important;
	}
}

@media print {
	.npf-video__play,
	.npf-nav {
		display: none;
	}
}

/* Cover hero (Settings > Project pages > Header: cover image). */

.npf-hero {
	--npf-hero-clear: clamp(5.5rem, 11vw, 9rem); /* Room for a transparent header above the text. */

	position: relative;
	box-sizing: border-box;
	display: flex;
	align-items: flex-end;
	min-height: clamp(22rem, 72vh, 46rem);
	padding: var(--npf-hero-clear) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 6vw, 4.5rem);
	overflow: hidden;
	color: #fff;
	background: #111114;
	isolation: isolate;
}

/* In the content area: break out of the theme's content width to full width.
   !important (and a stronger selector) because block layouts centre every child
   with "margin: auto !important", which would otherwise win on WordPress 6.5–6.6. */
body .npf-hero.npf-hero--content {
	width: 100vw;
	max-width: none !important;
	margin-top: 0 !important;
	margin-right: calc(50% - 50vw) !important;
	margin-bottom: var(--npf-gap, 1.5rem) !important;
	margin-left: calc(50% - 50vw) !important;
}

body.npf-cover-header {
	overflow-x: clip; /* Full-width hero without a horizontal scrollbar; does not affect sticky headers. */
}

.npf-hero--plain {
	min-height: clamp(18rem, 50vh, 30rem);
	background: linear-gradient(135deg, #1b1b22, #2e2e3a);
}

.npf-hero__media,
.npf-hero__media::after {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.npf-hero__media::after {
	content: "";
	/* Keeps white text readable on any image, and the header readable at the top. */
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 32%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0.78) 100%);
}

.npf-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.npf-hero__inner {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

.npf-hero__types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.npf-hero__types li {
	margin: 0;
}

.npf-hero__types a,
.npf-hero__types li {
	color: #fff;
}

.npf-hero__types a {
	display: inline-block;
	padding: 0.3em 0.9em;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 999px;
	font-size: 0.875rem;
	line-height: 1.4;
	text-decoration: none;
	background: rgba(0, 0, 0, 0.2);
}

.npf-hero__types a:hover,
.npf-hero__types a:focus-visible {
	background: #fff;
	color: #111114;
}

.npf-hero__types a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.npf-hero__title {
	max-width: 22ch;
	margin: 0 0 0.75rem;
	color: #fff;
	font-size: clamp(2.25rem, 6vw, 4.5rem);
	line-height: 1.05;
	text-wrap: balance;
}

.npf-hero__tagline {
	max-width: 46ch;
	margin: 0;
	color: rgba(255, 255, 255, 0.92);
	font-size: clamp(1.05rem, 2vw, 1.375rem);
	line-height: 1.45;
}

/* Block themes (Single Project template): lay the site header over the hero. */
body.npf-header-over .wp-site-blocks {
	position: relative;
}

body.npf-header-over .wp-site-blocks > header.wp-block-template-part {
	position: absolute;
	inset: 0 0 auto;
	z-index: 20;
	color: #fff;
	background: transparent;
}

body.npf-header-over .wp-site-blocks > header.wp-block-template-part > *,
body.npf-header-over .wp-site-blocks > header.wp-block-template-part .has-background {
	background: transparent !important;
}

body.npf-header-over .wp-site-blocks > header.wp-block-template-part a,
body.npf-header-over .wp-site-blocks > header.wp-block-template-part .wp-block-navigation__responsive-container-open,
body.npf-header-over .wp-site-blocks > header.wp-block-template-part .wp-block-site-title {
	color: #fff;
}

/* The mobile menu opens on its own background; keep the theme's colours there. */
body.npf-header-over .wp-site-blocks > header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open a {
	color: inherit;
}

body.npf-header-over .npf-main > .wp-block-post-content > .npf-hero--content:first-child {
	margin-top: 0;
}

/* Block layouts add a gap above the first block; the hero sits flush under the header. */
body.npf-header-over .npf-main,
body.npf-header-over .npf-main > .wp-block-post-content {
	margin-block-start: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.npf-hero__types a {
		transition: background-color 0.15s ease, color 0.15s ease;
	}
}
