/* Hero « terrain » : maquette 3D (photo en calques posés à des profondeurs différentes, CSS 3D) pilotée par hero.js :
   inclinaison à la souris, vue éclatée au scroll, entrée en profondeur, reflet de lumière. */
.hero-terrain {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	overflow: hidden;
	perspective: 1700px;
	perspective-origin: 75% 28%;
	opacity: .7; /* sur le conteneur de la perspective (pas sur la scène 3D) : le texte central reste lisible */
}
.hero-terrain__stage {
	position: absolute;
	left: 75%;
	top: -14px;
	width: clamp(760px, 53%, 1060px);
	aspect-ratio: 1584 / 672;
	--tx: -50%;
	transform-origin: 80% 50%;
	--rx: 10deg;
	--ry: 0deg;
	transform: translateX(var(--tx)) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--sc, 1));
	transform-style: preserve-3d;
	will-change: transform;
}
.hero-terrain__layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	will-change: transform, opacity;
	user-select: none;
}
/* étalonnages : filtre CSS sur les calques de photo uniquement (tranche, golfeurs et lumière restent intacts) */
.hero-terrain--emeraude :is(.hero-terrain__ground, .hero-terrain__river, .hero-terrain__bunkers, .hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: hue-rotate(26deg) saturate(.9) brightness(.94) contrast(1.1); }
.hero-terrain--dore :is(.hero-terrain__ground, .hero-terrain__river, .hero-terrain__bunkers, .hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: sepia(.2) saturate(1.1) brightness(1.04) contrast(1.05); }
.hero-terrain--ivoire :is(.hero-terrain__ground, .hero-terrain__river, .hero-terrain__bunkers, .hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: saturate(.4) brightness(1.1) contrast(1.02); }
/* ombre portée sur la "table" : silhouette noircie et floutée, loin sous la maquette */
/* arbres fondus dans le terrain (contraste réduit, plus clairs) (les 3 plans de couronnes) */
.hero-terrain--emeraude :is(.hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: hue-rotate(26deg) saturate(.92) brightness(1.38) contrast(.82); }
.hero-terrain--dore :is(.hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: sepia(.2) saturate(1.05) brightness(1.32) contrast(.84); }
.hero-terrain--ivoire :is(.hero-terrain__crowns-far, .hero-terrain__crowns-mid, .hero-terrain__crowns-near) { filter: saturate(.4) brightness(1.42) contrast(.82); }
.hero-terrain__cast { filter: brightness(0) blur(26px); opacity: .5; }
/* reflet de lumière qui balaie le terrain (masqué par la forme du terrain) */
.hero-terrain__sheen {
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	background: linear-gradient(105deg, rgba(255, 244, 205, 0) 38%, rgba(255, 244, 205, .34) 50%, rgba(255, 244, 205, 0) 62%) no-repeat;
	background-size: 320% 100%;
	background-position: 130% 0;
	animation: hero-terrain-sheen 6s ease-in-out 1.2s infinite;
	animation-play-state: paused; /* démarre quand toutes les images sont chargées */
}
/* rien n'est visible tant que toutes les images ne sont pas chargées (hero.js ajoute is-ready) */
.hero-terrain:not(.is-ready) .hero-terrain__layer { opacity: 0 !important; }
.hero-terrain.is-ready .hero-terrain__sheen { animation-play-state: running; }
@keyframes hero-terrain-sheen { 0% { background-position: 130% 0; } 45%, 100% { background-position: -30% 0; } }
/* voile discret derrière le titre */
.hero-terrain::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 46% 30% at 50% 36%, rgba(1, 24, 16, .34), rgba(1, 24, 16, 0) 100%);
	pointer-events: none;
}
@media (max-width: 968px) {
	/* mobile : terrain entier visible (un peu décentré à droite), plus sombre et plus transparent pour garder le texte lisible */
	.hero-terrain { perspective: 1200px; perspective-origin: 66% 20%; opacity: .65; filter: brightness(.72); }
	.hero-terrain__stage { left: 66%; top: 6px; width: 155%; --tx: -50%; transform-origin: 50% 50%; }
	.hero-terrain::after { background: radial-gradient(ellipse 80% 38% at 50% 38%, rgba(1, 24, 16, .5), rgba(1, 24, 16, 0) 100%); }
}
@media (prefers-reduced-motion: reduce) {
	.hero-terrain__sheen { animation: none; background-position: -30% 0; opacity: 0; }
	.hero-terrain__layer { will-change: auto; }
}
