/* NUVÈN trial: the cinematic layer.
   Cards rise in 3D, rows curve like a film strip as they move, cards lean toward the pointer with
   a light sweep, sections rise in and sink away, big photos open like a curtain, the hero folds
   into a frame as you scroll, headings flip up, and pages slide over each other.
   All of it switches off with reduced motion. */

@media (prefers-reduced-motion: no-preference) {

	/* 1. Cards arrive in 3D -------------------------------------------------------------- */
	.nv-cinema li.product[data-reveal] {
		transform-origin: 50% 100%;
		transition:
			opacity 0.9s ease,
			transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
		transition-delay: calc(var(--i, 0) * 110ms);
	}

	.nv-cinema li.product[data-reveal]:not(.is-in) {
		opacity: 0;
		transform: perspective(1100px) translate3d(0, 5rem, -160px) rotateX(22deg);
	}

	.nv-fine li.product[data-reveal] .card-media {
		clip-path: inset(0 round var(--r-card, 1rem));
		transition: clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1);
		transition-delay: calc(var(--i, 0) * 110ms + 80ms);
	}

	.nv-fine li.product[data-reveal]:not(.is-in) .card-media {
		clip-path: inset(34% 6% 0 6% round var(--r-card, 1rem));
	}

	.nv-touch li.product[data-reveal] .card-media > img:first-child {
		transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s;
		transition-delay: calc(var(--i, 0) * 110ms);
	}

	.nv-touch li.product[data-reveal]:not(.is-in) .card-media > img:first-child {
		transform: scale(1.3);
	}

	.nv-cinema li.product[data-reveal] .card__info > * {
		transition: opacity 0.8s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
		transition-delay: calc(var(--i, 0) * 110ms + 320ms);
	}

	.nv-cinema li.product[data-reveal] .card__info > :nth-child(2) { transition-delay: calc(var(--i, 0) * 110ms + 400ms); }
	.nv-cinema li.product[data-reveal] .card__info > :nth-child(3) { transition-delay: calc(var(--i, 0) * 110ms + 480ms); }

	.nv-cinema li.product[data-reveal]:not(.is-in) .card__info > * {
		opacity: 0;
		transform: translateY(1.1rem);
	}

	/* 2. Cards lean in 3D: toward the pointer, and along the curve of a moving row -------- */
	.nv-cinema .nv-row .card__media,
	.nv-fine .card.is-tilting .card__media,
	.nv-fine .newin.is-pinned .card__media {
		transform:
			perspective(1000px)
			rotateX(var(--rx, 0deg))
			rotateY(calc(var(--ry, 0deg) + var(--cf, 0deg)))
			scale(calc(var(--cs, 1) * var(--press, 1)));
		transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.nv-fine .card:not(.is-tilting) .card__media {
		transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.nv-cinema .is-rolling .card__media {
		transition-duration: 0.12s;
	}

	.nv-cinema .nv-row .card__media:active {
		--press: 0.965;
	}

	.nv-cinema .card.is-tilting .card__media {
		transition-duration: 0.12s;
	}

	/* The light that sweeps across the photo. */
	.nv-glare {
		position: absolute;
		inset: 0;
		z-index: 2;
		pointer-events: none;
		background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgb(255 255 255 / 0.38), rgb(255 255 255 / 0) 55%);
		mix-blend-mode: soft-light;
		opacity: 0;
		transition: opacity 0.4s ease;
	}

	.card.is-tilting .nv-glare {
		opacity: 1;
	}

	/* A shadow that grows under a lifted card. */
	.nv-fine .card .card-media {
		box-shadow: 0 0 0 rgb(30 20 10 / 0);
		transition: box-shadow 0.5s ease, clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.nv-fine .card.is-tilting .card-media {
		box-shadow: 0 2.2rem 3rem -1.6rem rgb(40 25 10 / 0.45);
	}

	/* The second photo wipes across instead of fading. */
	@media (hover: hover) {
		.nv-cinema .card-media .card-image-alt {
			opacity: 1;
			clip-path: inset(0 100% 0 0);
			transform: scale(1.12);
			transition: clip-path 0.85s cubic-bezier(0.77, 0, 0.18, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
		}

		.nv-cinema .card__link:hover .card-image-alt,
		.nv-cinema a:hover > .card-media .card-image-alt {
			clip-path: inset(0 0 0 0);
			transform: scale(1);
		}
	}

	/* New in on desktop: the cards ride a curve as the row slides past. */
	@media (min-width: 990px) {
		.nv-cinema .newin.is-pinned .newin__track {
			perspective: 1600px;
		}

		.nv-cinema .newin.is-pinned .newin__track > .card,
		.nv-cinema .newin.is-pinned .newin__track > .newin__end {
			transform: translate3d(0, calc(var(--tilt, 0) * var(--tilt, 0) * 3rem), calc(var(--tilt, 0) * var(--tilt, 0) * -14rem));
		}

		.nv-cinema .newin.is-pinned .card__media {
			--cf: calc(var(--tilt, 0) * 34deg);
		}

		.nv-cinema .newin.is-pinned .newin__end a {
			transform: perspective(1000px) rotateY(calc(var(--tilt, 0) * 34deg));
		}
	}

	/* Speed lean: photos and the ticker lean with how fast you scroll (desktop). */
	.nv-speed .card .card-media,
	.nv-speed .ticker__track {
		transform: skewY(calc(var(--vel, 0) * 2.4deg));
	}

	.nv-speed .card .card-media {
		transition: box-shadow 0.5s ease, clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s ease-out;
	}

	/* 3. Headings flip up out of the line ------------------------------------------------ */
	.nv-cinema .split-word {
		perspective: 700px;
	}

	.nv-cinema .split-word > span {
		transform-origin: 50% 100%;
		transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
		transition-delay: calc(var(--w, 0) * 70ms + var(--i, 0) * 90ms);
	}

	.nv-cinema [data-reveal]:not(.is-in) .split-word > span,
	.nv-cinema .is-split[data-reveal]:not(.is-in) .split-word > span,
	.nv-cinema .hero:not(.is-staged) .split-word > span,
	.nv-cinema .hero__slide:not(.is-active) .split-word > span {
		transform: translateY(115%) rotateX(-80deg);
	}

	/* 4. Rows switching (best sellers tabs, colours): cards deal in like a hand ----------- */
	.nv-cinema .picks__panel:not([hidden]) li.product.is-in,
	.nv-cinema .hues__panel.is-on li.product {
		animation: nv-deal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
		animation-delay: calc(var(--k, 0) * 80ms);
	}

	@keyframes nv-deal {
		from {
			opacity: 0;
			transform: perspective(1000px) translate3d(3rem, 1rem, -200px) rotateY(-28deg);
		}
	}

	/* 5. Page to page: the old page sinks back, the new one slides up over it ------------- */
	::view-transition-old(root) {
		animation: nv-sink-out 0.7s cubic-bezier(0.7, 0, 0.3, 1) both;
	}

	::view-transition-new(root) {
		animation: nv-rise-in 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
	}

	@keyframes nv-sink-out {
		to {
			opacity: 0.2;
			transform: scale(0.9) translateY(-3%);
			border-radius: 2rem;
		}
	}

	@keyframes nv-rise-in {
		from {
			clip-path: inset(100% 0 0 0 round 2.5rem 2.5rem 0 0);
			transform: translateY(18%);
		}
		to {
			clip-path: inset(0 0 0 0 round 0);
			transform: none;
		}
	}

	/* 6. Pointer: a ring that follows and says what a click will do (desktop) ------------ */
	.nv-cursor {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;
		display: grid;
		place-items: center;
		width: 2.5rem;
		height: 2.5rem;
		margin: -1.25rem 0 0 -1.25rem;
		border: 1px solid rgb(var(--ink) / 0.55);
		border-radius: 50%;
		pointer-events: none;
		color: rgb(var(--bone));
		font-size: 0.6875rem;
		font-weight: 600;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), height 0.35s cubic-bezier(0.22, 1, 0.36, 1), margin 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s, border-color 0.3s, opacity 0.3s;
		opacity: 0;
	}

	.nv-cursor.is-on {
		opacity: 1;
	}

	.nv-cursor__label {
		opacity: 0;
		transform: scale(0.6);
		transition: opacity 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.nv-cursor.is-link {
		width: 1rem;
		height: 1rem;
		margin: -0.5rem 0 0 -0.5rem;
		background: rgb(var(--ink));
		border-color: rgb(var(--ink));
	}

	.nv-cursor.is-view,
	.nv-cursor.is-drag {
		width: 5.5rem;
		height: 5.5rem;
		margin: -2.75rem 0 0 -2.75rem;
		background: rgb(var(--ink) / 0.82);
		border-color: transparent;
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
	}

	.nv-cursor.is-view .nv-cursor__label,
	.nv-cursor.is-drag .nv-cursor__label {
		opacity: 1;
		transform: none;
	}

	/* Buttons that pull toward the pointer. */
	.nv-magnet {
		translate: var(--mx, 0) var(--my, 0);
		transition: translate 0.5s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.nv-magnet.is-pulled {
		transition-duration: 0.15s;
	}

	/* 7. Scroll-tied scenes (browsers that tie animation to scroll) --------------------- */
	@supports (animation-timeline: view()) {

		/* The hero folds into a rounded frame and the film pushes in as you leave it. */
		.nv-fine .hero {
			animation: nv-hero-frame linear both;
			animation-timeline: scroll(root);
			animation-range: 0 90vh;
		}

		.nv-fine .hero__media {
			animation: nv-hero-push linear both;
			animation-timeline: scroll(root);
			animation-range: 0 100vh;
		}

		/* Sections rise in from below and sink back as they leave. */
		.nv-fine .nv-rise {
			transform-origin: 50% 0;
			animation: nv-rise linear both, nv-sink linear forwards;
			animation-timeline: view(), view();
			animation-range: entry 0% entry 60vh, exit 20% exit 100%;
		}

		/* Big photos open like a curtain, the picture settling inside. */
		.nv-fine .nv-curtain {
			animation: nv-curtain linear both;
			animation-timeline: view();
			animation-range: entry 0% cover 40%;
		}

		.nv-fine .nv-curtain img,
		.nv-fine .nv-curtain video {
			animation: nv-settle linear both;
			animation-timeline: view();
			animation-range: entry 0% cover 60%;
		}
	}

	/* Phones (and browsers without scroll-tied animation): each scene plays once as it comes
	   into view. Only movement and fading, which the phone hands to its graphics chip. */
	.nv-io .nv-rise {
		transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.nv-io .nv-rise:not(.is-seen) {
		transform: translate3d(0, 4rem, 0);
	}

	.nv-io .nv-curtain {
		overflow: hidden;
		transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
	}

	.nv-io .nv-curtain:not(.is-seen) {
		transform: translate3d(0, 2.5rem, 0) scale(0.86);
		opacity: 0;
	}

	.nv-io .nv-curtain img {
		transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.nv-io .nv-curtain:not(.is-seen) img {
		transform: scale(1.35);
	}

	/* Phones: the hero film pushes in and dims as it scrolls away. */
	.nv-touch .hero__media {
		transition: transform 0.6s ease-out, opacity 0.6s ease-out;
	}

	.nv-touch .hero {
		background: #120d09;
	}

	@keyframes nv-hero-frame {
		to {
			clip-path: inset(4% 3% 0 3% round 2.25rem);
		}
	}

	@keyframes nv-hero-push {
		to {
			transform: scale(1.16) translateY(6%);
			filter: brightness(0.75);
		}
	}

	@keyframes nv-rise {
		from {
			transform: translateY(6rem) scale(0.93);
			border-radius: 2.75rem;
		}
		to {
			transform: none;
			border-radius: 0;
		}
	}

	@keyframes nv-sink {
		to {
			transform: scale(0.94);
			opacity: 0.35;
		}
	}

	@keyframes nv-curtain {
		from {
			clip-path: inset(18% 12% 18% 12% round 2rem);
		}
		to {
			clip-path: inset(0 0 0 0 round 0);
		}
	}

	@keyframes nv-settle {
		from {
			transform: scale(1.35);
		}
		to {
			transform: scale(1);
		}
	}
}
