/* ==========================================================================
   Animazioni — loop leggeri e reveal a scaglioni
   ========================================================================== */

@keyframes museo-gradient-flow {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

@keyframes museo-float-y {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}

@keyframes museo-float-y-alt {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-4px) rotate(-1deg); }
}

@keyframes museo-drift {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(12px, -18px) scale(1.04); }
	66% { transform: translate(-8px, 10px) scale(0.97); }
}

@keyframes museo-drift-alt {
	0%, 100% { transform: translate(0, 0) scale(1); }
	40% { transform: translate(-14px, 12px) scale(1.05); }
	70% { transform: translate(10px, -8px) scale(0.96); }
}

@keyframes museo-pulse-soft {
	0%, 100% { box-shadow: 4px 4px 0 var(--color-lilac); }
	50% { box-shadow: 6px 6px 0 var(--color-coral); }
}

@keyframes museo-shimmer {
	0% { transform: translateX(-120%) skewX(-12deg); opacity: 0; }
	30% { opacity: 0.55; }
	100% { transform: translateX(220%) skewX(-12deg); opacity: 0; }
}

@keyframes museo-breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.015); }
}

@keyframes museo-faq-in {
	from {
		opacity: 0;
		transform: translateY(-0.35rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes museo-border-pulse {
	0%, 100% { border-color: var(--color-lilac); }
	50% { border-color: var(--color-coral); }
}

@keyframes museo-footer-glow {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

@keyframes museo-orb-pulse {
	0%, 100% { opacity: 0.35; transform: scale(1); }
	50% { opacity: 0.55; transform: scale(1.08); }
}

@keyframes museo-menu-in {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

/* Ambient blobs */
.museo-ambient {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: hidden;
}

.museo-ambient__blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.4;
	will-change: transform;
}

.museo-ambient__blob--1 {
	width: min(42vw, 22rem);
	height: min(42vw, 22rem);
	top: 8%;
	left: -8%;
	background: rgba(155, 107, 255, 0.45);
}

.museo-ambient__blob--2 {
	width: min(36vw, 18rem);
	height: min(36vw, 18rem);
	top: 42%;
	right: -6%;
	background: rgba(255, 94, 138, 0.35);
}

.museo-ambient__blob--3 {
	width: min(30vw, 14rem);
	height: min(30vw, 14rem);
	bottom: 12%;
	left: 28%;
	background: rgba(71, 181, 255, 0.3);
}

/* Hero shapes — z-index in sections.css (above slides, below overlay) */
.section-hero__shapes span {
	position: absolute;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.25);
	opacity: 0.5;
}

.section-hero__shapes span:nth-child(1) {
	width: 5rem;
	height: 5rem;
	top: 18%;
	right: 12%;
}

.section-hero__shapes span:nth-child(2) {
	width: 3rem;
	height: 3rem;
	top: 55%;
	right: 22%;
	background: rgba(255, 191, 60, 0.25);
	border-color: transparent;
}

.section-hero__shapes span:nth-child(3) {
	width: 2rem;
	height: 2rem;
	bottom: 28%;
	right: 8%;
	background: rgba(155, 107, 255, 0.3);
	border-color: transparent;
}

.section-hero__image,
.section-hero__placeholder {
	transform: scale(1.04);
	will-change: transform;
}

.section-hero__slideshow .section-hero__image {
	transform: scale(1);
	will-change: transform, opacity;
}

/* Titoli gradiente — fallback colore pieno (hero title stays solid ink for slideshow legibility) */
.section-header__title,
.section-consiglia__heading {
	color: var(--color-ink);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.section-header__title,
	.section-consiglia__heading {
		background: var(--gradient-text);
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
	}
}

/* Bottoni primary shimmer */
.btn--primary {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.btn--primary::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		105deg,
		transparent 35%,
		rgba(255, 255, 255, 0.35) 50%,
		transparent 65%
	);
	transform: translateX(-120%) skewX(-12deg);
	pointer-events: none;
}

/* Reveal figli — transition (non confligge con loop su card) */
html.museo-js .reveal:not(.is-visible) .reveal-child {
	opacity: 0;
	transform: translateY(1rem);
}

html.museo-js .reveal.is-visible .reveal-child {
	opacity: 1;
	transform: translateY(0);
	transition:
		opacity 0.55s ease var(--reveal-delay, 0s),
		transform 0.55s ease var(--reveal-delay, 0s);
}

/* Nav underline */
.site-nav__list a {
	background-image: linear-gradient(var(--color-link), var(--color-link));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 2px;
	transition: color var(--transition), background-size 0.35s ease;
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible,
.site-nav__list .current-menu-item > a,
.site-nav__list a.is-current {
	background-size: 100% 2px;
}

.mobile-menu:not([hidden]) .mobile-menu__panel {
	animation: museo-menu-in 0.32s ease;
}

.faq-item[open] .faq-item__answer {
	animation: museo-faq-in 0.35s ease;
}

@media (hover: hover) {
	.reveal.is-visible .card:hover,
	.reveal.is-visible .target-card:hover,
	.reveal.is-visible .consiglia-card:hover,
	.reveal.is-visible .section-tickets .ticket-card--enhanced:hover {
		animation-play-state: paused;
	}

	.site-header__brand:hover .site-header__name {
		animation: museo-float-y-alt 0.6s ease;
	}
}

/* Loop decorativi */
@media (prefers-reduced-motion: no-preference) {
	.museo-ambient__blob--1 {
		animation: museo-drift 18s ease-in-out infinite;
	}

	.museo-ambient__blob--2 {
		animation: museo-drift-alt 22s ease-in-out infinite;
	}

	.museo-ambient__blob--3 {
		animation: museo-drift 26s ease-in-out infinite reverse;
	}

	.section-hero__shapes span:nth-child(1) {
		animation: museo-float-y 5s ease-in-out infinite;
	}

	.section-hero__shapes span:nth-child(2) {
		animation: museo-float-y-alt 6.5s ease-in-out infinite 0.8s;
	}

	.section-hero__shapes span:nth-child(3) {
		animation: museo-float-y 4.5s ease-in-out infinite 1.2s;
	}

	.section-hero__placeholder {
		animation: museo-breathe 10s ease-in-out infinite;
	}

	.section-header__title,
	.section-consiglia__heading,
	.entry__title {
		background-size: 200% 200%;
		animation: museo-gradient-flow 10s ease infinite;
	}

	.section-hero__badge--anniversary {
		animation: museo-pulse-soft 4s ease-in-out infinite;
	}

	.section-hero__target-badge:nth-child(1) { animation: museo-float-y 5.2s ease-in-out infinite; }
	.section-hero__target-badge:nth-child(2) { animation: museo-float-y-alt 5.8s ease-in-out infinite 0.3s; }
	.section-hero__target-badge:nth-child(3) { animation: museo-float-y 6.4s ease-in-out infinite 0.6s; }
	.section-hero__target-badge:nth-child(4) { animation: museo-float-y-alt 5.5s ease-in-out infinite 0.9s; }
	.section-hero__target-badge:nth-child(5) { animation: museo-float-y 6s ease-in-out infinite 1.2s; }

	.btn--primary::after {
		animation: museo-shimmer 4.5s ease-in-out infinite;
	}

	.reveal.is-visible .card,
	.reveal.is-visible .target-card,
	.reveal.is-visible .consiglia-card,
	.reveal.is-visible .section-tickets .ticket-card--enhanced {
		animation: museo-float-y 7s ease-in-out infinite;
	}

	.reveal.is-visible .card:nth-child(3n+2),
	.reveal.is-visible .target-card:nth-child(2n),
	.reveal.is-visible .consiglia-card:nth-child(2n),
	.reveal.is-visible .section-tickets .ticket-card--enhanced:nth-child(2n) {
		animation-name: museo-float-y-alt;
		animation-duration: 8s;
	}

	.reveal.is-visible .card:nth-child(2) { animation-delay: 0.4s; }
	.reveal.is-visible .card:nth-child(3) { animation-delay: 0.8s; }
	.reveal.is-visible .target-card:nth-child(3) { animation-delay: 0.5s; }
	.reveal.is-visible .target-card:nth-child(4) { animation-delay: 1s; }

	.reveal.is-visible .section-text-image__visual,
	.reveal.is-visible .section-experience__image,
	.reveal.is-visible .section-intro__image {
		animation: museo-float-y-alt 9s ease-in-out infinite;
	}

	.reveal.is-visible .section-gallery__item {
		animation: museo-float-y 8s ease-in-out infinite;
	}

	.reveal.is-visible .section-gallery__item:nth-child(2n) {
		animation-name: museo-float-y-alt;
		animation-delay: 0.6s;
	}

	.section-tickets__info {
		animation: museo-border-pulse 5s ease-in-out infinite;
	}

	.site-footer {
		background-size: 200% 200%;
		animation: museo-footer-glow 16s ease infinite;
	}

	.section-final-cta::before {
		animation: museo-orb-pulse 8s ease-in-out infinite;
	}

	.section-final-cta::after {
		animation: museo-orb-pulse 10s ease-in-out infinite 1.5s;
	}
}

@media (max-width: 767px) {
	.museo-ambient__blob {
		animation: none;
		opacity: 0.25;
	}

	.section-hero__slideshow .section-hero__image {
		animation: none !important;
		will-change: auto;
	}

	.section-hero__image,
	.section-hero__placeholder {
		will-change: auto;
	}
}
