/*
 * Home page only (enqueued on the front page and in the editor).
 * Motion uses transform and opacity only. --p (0 → 1) is the scroll progress
 * of the closest .argento-scene, set by assets/js/home.js.
 */

/* ---------- Shared: flying elements and praline cut-outs ---------- */

.argento-scene {
	--p: 0;
	position: relative;
	overflow: clip;
	isolation: isolate;
}

.argento-fly {
	display: block;
	transform: translate3d(calc(var(--p) * var(--dx, 0px)), calc(var(--p) * var(--dy, 0px)), 0) rotate(calc(var(--p) * var(--rot, 0deg)));
	will-change: transform;
}

.argento-praline {
	display: block;
	width: var(--size, 90px);
	height: var(--size, 90px);
	object-fit: cover;
	animation: argento-bob 7s ease-in-out var(--delay, 0s) infinite alternate;
}

/* JPEG crops from photos: soft round mask, white background melts into the page. */
.argento-praline.is-crop {
	border-radius: 50%;
	-webkit-mask-image: radial-gradient(circle closest-side, #000 72%, transparent 97%);
	mask-image: radial-gradient(circle closest-side, #000 72%, transparent 97%);
	mix-blend-mode: multiply;
}

/* Cocoa beans: photo crops shaped with an ellipse mask (angle per bean). */
.argento-praline.argento-fava {
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	mix-blend-mode: multiply;
}

.argento-fava--1{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='54' ry='28' transform='rotate(8 60 60)' filter='url(%23b)'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='54' ry='28' transform='rotate(8 60 60)' filter='url(%23b)'/%3E%3C/svg%3E")}
.argento-fava--2{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='53' ry='33' transform='rotate(-25 60 60)' filter='url(%23b)'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='53' ry='33' transform='rotate(-25 60 60)' filter='url(%23b)'/%3E%3C/svg%3E")}
.argento-fava--3{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='46' ry='30' transform='rotate(3 60 60)' filter='url(%23b)'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='46' ry='30' transform='rotate(3 60 60)' filter='url(%23b)'/%3E%3C/svg%3E")}
.argento-fava--4{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='40' ry='31' transform='rotate(70 60 60)' filter='url(%23b)'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3C/filter%3E%3Cellipse cx='60' cy='60' rx='40' ry='31' transform='rotate(70 60 60)' filter='url(%23b)'/%3E%3C/svg%3E")}

/* Scenes off screen: pause their CSS animations (class set by home.js). */
.argento-scene.is-paused .argento-praline,
.argento-scene.is-paused .argento-hero__badge,
.argento-scene.is-paused .argento-marquee__track {
	animation-play-state: paused;
}

@keyframes argento-bob {
	from { transform: translate3d(0, 0, 0) rotate(-4deg); }
	to { transform: translate3d(0, -12px, 0) rotate(5deg); }
}

/* ---------- Hero ---------- */

.argento-hero {
	min-height: min(92vh, 900px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.argento-hero > .argento-hero__praline,
.argento-volo > .argento-volo__praline {
	position: absolute;
	inset: 0;
	max-width: none;
	margin: 0;
	z-index: 0;
	pointer-events: none;
}

.argento-hero__praline .argento-fly,
.argento-volo__praline .argento-fly {
	position: absolute;
}

.argento-volo__praline .argento-fly.is-top {
	top: var(--off, 0px);
}

.argento-volo__praline .argento-fly.is-bottom {
	bottom: var(--off, 0px);
}

.argento-hero > .argento-hero__grid {
	position: relative;
	z-index: 1;
}

.argento-hero__title {
	letter-spacing: -0.025em;
	line-height: 1.02;
}

.argento-hero__title em,
.argento-volo__title em {
	font-style: italic;
	font-weight: 400;
	color: var(--wp--preset--color--cacao);
}

.argento-hero__lead {
	max-width: 34em;
}

.argento-hero__stage {
	position: relative;
	width: min(100%, 520px);
	margin-inline: auto;
	aspect-ratio: 4 / 5;
}

.argento-hero__arch {
	position: absolute;
	margin: 0;
	overflow: hidden;
	box-shadow: 0 30px 60px -30px rgba(61, 28, 8, 0.45);
}

.argento-hero__arch {
	inset: 0 8% 4% 8%;
	border-radius: 999px 999px 28px 28px;
}

.argento-hero__arch img,
.argento-gelato__bg img,
.argento-mani__photo img,
.argento-card__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.argento-hero__arch {
	background: #fff;
}

.argento-hero__badge {
	position: absolute;
	right: 0;
	bottom: 14%;
	width: 30%;
	height: auto;
	animation: argento-spin 28s linear infinite;
}

@keyframes argento-spin {
	to { transform: rotate(360deg); }
}

/* Entrance of the hero, once, on load. */
.argento-hero__text > * {
	animation: argento-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.argento-hero__text > :nth-child(2) { animation-delay: 0.08s; }
.argento-hero__text > :nth-child(3) { animation-delay: 0.16s; }
.argento-hero__text > :nth-child(4) { animation-delay: 0.24s; }
.argento-hero__visual { animation: argento-rise 1.1s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes argento-rise {
	from { opacity: 0; transform: translate3d(0, 28px, 0); }
	to { opacity: 1; transform: none; }
}

/* ---------- Manifesto band with flying pralines ---------- */

.argento-volo {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.argento-volo > :not(.argento-volo__praline) {
	position: relative;
	z-index: 1;
}

.argento-volo__title {
	letter-spacing: -0.03em;
}

/* ---------- People ---------- */

.argento-mani__photo {
	margin: 0;
	border-radius: 28px;
	overflow: hidden;
	transform: rotate(-1.5deg);
	box-shadow: 0 30px 60px -30px rgba(61, 28, 8, 0.45);
	aspect-ratio: 3 / 2;
}

/* ---------- Photo cards ---------- */

.argento-card__photo {
	margin: 0 0 var(--wp--preset--spacing--30);
	border-radius: 20px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

/* ---------- Marquee gallery ---------- */

.argento-galleria > .argento-marquee {
	max-width: none;
	margin-top: var(--wp--preset--spacing--50);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.argento-marquee__track {
	display: flex;
	gap: 1.25rem;
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
	animation: argento-marquee 60s linear infinite;
}

.argento-marquee:hover .argento-marquee__track,
.argento-marquee:focus-within .argento-marquee__track {
	animation-play-state: paused;
}

.argento-marquee__track li {
	flex: none;
	height: clamp(220px, 28vw, 340px);
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
}

.argento-marquee__track img {
	display: block;
	height: 100%;
	width: auto;
}

@keyframes argento-marquee {
	to { transform: translate3d(calc(-50% - 0.625rem), 0, 0); }
}

/* ---------- Christmas products strip ---------- */

.argento-natale-marquee {
	overflow-x: auto;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.argento-natale-marquee.is-marquee {
	overflow: hidden;
}

.argento-natale-marquee .wc-block-product-template {
	display: flex !important;
	flex-wrap: nowrap;
	gap: 1.25rem;
	width: max-content;
	margin: 0;
	padding: 0 var(--wp--preset--spacing--40);
}

.argento-natale-marquee.is-marquee .wc-block-product-template {
	padding: 0;
	animation: argento-marquee 45s linear infinite;
}

/* Touch screens: a native scroller the visitor can swipe (advanced by home.js). */
.argento-natale-marquee.is-swipe,
.argento-galleria > .argento-marquee.is-swipe {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.argento-natale-marquee.is-swipe::-webkit-scrollbar,
.argento-galleria > .argento-marquee.is-swipe::-webkit-scrollbar {
	display: none;
}

.argento-natale-marquee.is-swipe .wc-block-product-template {
	padding: 0;
}

.argento-marquee.is-swipe .argento-marquee__track {
	animation: none;
}

/* Pause on mouse hover or keyboard focus only: on touch screens a tap would leave it stuck. */
@media (hover: hover) {
	.argento-natale-marquee:hover .wc-block-product-template {
		animation-play-state: paused;
	}
}

.argento-natale-marquee:has(:focus-visible) .wc-block-product-template,
.argento-natale-marquee.is-paused .wc-block-product-template {
	animation-play-state: paused;
}

.argento-natale-marquee .wc-block-product-template > li {
	flex: none;
	width: clamp(190px, 21vw, 270px);
	max-width: none;
	margin: 0;
}

/* ---------- Gelato band ---------- */

.argento-gelato {
	min-height: min(80vh, 760px);
	display: grid;
	align-items: center;
	padding-inline: var(--wp--preset--spacing--40);
}

.argento-gelato > .argento-gelato__bg {
	position: absolute;
	inset: -12% 0 -12% 0;
	margin: 0;
	z-index: -1;
	max-width: none;
}

.argento-gelato > .argento-gelato__panel {
	max-width: 460px;
	margin: var(--wp--preset--spacing--60) 0 var(--wp--preset--spacing--60) max(0px, calc((100vw - 1200px) / 2));
	box-shadow: 0 30px 60px -30px rgba(61, 28, 8, 0.5);
}

/* ---------- Reveal on scroll (progressive: only where scroll-driven animations exist) ---------- */

@supports (animation-timeline: view()) {
	.argento-reveal {
		animation: argento-rise linear both;
		animation-timeline: view();
		animation-range: entry 0% entry 70%;
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 781px) {
	.argento-hero {
		min-height: 0;
	}

	.argento-hero__stage {
		width: min(86%, 380px);
	}


	.argento-praline {
		width: calc(var(--size, 90px) * 0.62);
		height: calc(var(--size, 90px) * 0.62);
	}

	.argento-volo__praline .argento-fly.is-top {
		top: calc(var(--off, 0px) * 0.62);
	}

	.argento-volo__praline .argento-fly.is-bottom {
		bottom: calc(var(--off, 0px) * 0.62);
	}

	.argento-mani__photo {
		transform: none;
	}

	/* Photo cards become compact rows: small square photo beside the text. */
	.argento-card {
		display: grid;
		grid-template-columns: 34% 1fr;
		column-gap: var(--wp--preset--spacing--30);
		align-items: start;
	}

	.argento-card > .argento-card__photo {
		grid-row: span 2;
		margin: 0;
		aspect-ratio: 1;
		border-radius: 14px;
	}

	.argento-card > h3,
	.argento-card > p {
		margin: 0;
	}

	.argento-card > h3 {
		font-size: var(--wp--preset--font-size--medium);
		margin-bottom: 0.35rem;
	}

	.argento-card > p {
		font-size: var(--wp--preset--font-size--small);
	}

	.argento-gelato > .argento-gelato__panel {
		margin-inline: auto;
	}
}

/* ---------- Reduced motion: everything still, nothing hidden ---------- */

@media (prefers-reduced-motion: reduce) {
	.argento-scene {
		--p: 0 !important;
	}

	.argento-praline,
	.argento-hero__badge,
	.argento-hero__text > *,
	.argento-hero__visual,
	.argento-reveal {
		animation: none !important;
	}

	.argento-marquee__track {
		animation: none;
	}

	.argento-galleria > .argento-marquee {
		overflow-x: auto;
	}

	.argento-card__photo img {
		transition: none;
	}
}
