/*
 * Accueil : prénom et nom en grand, accroche qui défile, texte.
 * Animations de chargement reprises du site en ligne. La page tient dans
 * l'écran à toutes les tailles : body, main et contenu prennent toute la
 * hauteur. Au-dessus de 850 px elle ne défile pas ; en dessous, elle
 * s'allonge si le texte ne tient pas, sans rien cacher.
 */

body:has(.accueil) {
	height: 100%;
}

@media (min-width: 851px) {
	body:has(.accueil) {
		overflow: hidden;
	}
}

main.site-main:has(.accueil),
main.site-main:has(.accueil) .wp-block-post-content {
	height: 100%;
}

main:has(.accueil) {
	padding-top: 0;
}

.accueil {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	align-items: flex-start;
	gap: 20px;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	margin-bottom: 150px;
}

/* Titre : prénom, deux filets, nom */

.accueil__titre {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 7px;
	width: 100%;
	margin-top: 150px;
}

/* La police et l'interligne du grand titre, que le H1 par défaut n'a plus. */
.accueil__nom-complet {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 7px;
	width: 100%;
	height: auto;
	margin: 0;
	font-family: var(--ys-police-titre);
	font-size: 100px;
	font-weight: 400;
	line-height: 1.1;
	text-shadow: none;
}

.accueil__prenom,
.accueil__nom {
	display: block;
	font-family: var(--ys-police-titre);
	font-size: 100px;
	font-weight: 400;
	line-height: 1;
	text-shadow: var(--ys-ombre-texte);
	opacity: 0;
	filter: blur(10px);
}

.accueil__prenom {
	color: var(--ys-blanc);
	transform: translateY(30px);
	animation: accueil-prenom 1s var(--ys-courbe) 0.7s forwards;
}

.accueil__nom {
	color: var(--ys-orange);
	transform: translateY(-30px);
	animation: accueil-nom 1s var(--ys-courbe) 0.7s forwards;
}

.accueil__ligne {
	display: block;
	width: 40%;
	height: 4px;
	border-radius: 1px;
	background-color: var(--ys-blanc);
	box-shadow: 5px 5px 7px #000;
	opacity: 0;
	filter: blur(10px);
}

.accueil__ligne--haut {
	transform: translateX(-40px);
	animation: accueil-ligne-haut 1.5s var(--ys-courbe) forwards;
}

.accueil__ligne--bas {
	transform: translateX(40px);
	animation: accueil-ligne-bas 1.5s var(--ys-courbe) forwards;
}

/* Présentation : accroche, mots qui défilent, texte */

.accueil__presentation {
	width: 600px;
	margin-left: 50px;
	color: var(--ys-blanc);
}

.accueil__accroche {
	margin: 0 0 30px;
	font-size: 35px;
	font-weight: 400;
	color: var(--ys-blanc);
	text-shadow: var(--ys-ombre-texte);
	opacity: 0;
	transform: translateY(30px);
	filter: blur(10px);
	animation: accueil-entree 1s var(--ys-courbe) 1s forwards;
}

.accueil__mots {
	position: relative;
	display: inline-block;
	vertical-align: top;
	text-align: left;
	color: var(--ys-orange);
}

.accueil__mots b {
	position: absolute;
	top: 0;
	left: 0;
	display: inline-block;
	white-space: nowrap;
	opacity: 0;
}

.accueil__mots b.is-visible {
	position: relative;
	opacity: 1;
	animation: accueil-mot-entre 0.6s;
}

.accueil__mots b.is-hidden {
	animation: accueil-mot-sort 0.6s;
}

.accueil__texte p {
	opacity: 0;
	transform: translateY(30px);
	text-shadow: var(--ys-ombre-texte);
	animation: accueil-entree 1s var(--ys-courbe) 1.3s forwards;
}

/* Images de l'écran : titre plus petit sur les écrans moyens */

@media (max-width: 1120px) {
	.accueil__titre {
		margin-top: 70px;
	}

	.accueil__prenom,
	.accueil__nom {
		font-size: 70px;
	}

	.accueil__nom-complet {
		font-size: 70px;
	}

	.accueil__ligne {
		width: 60%;
	}

	.accueil__presentation {
		width: 90%;
		margin-left: 20px;
	}

	.accueil__accroche {
		margin-bottom: 15px;
	}
}

/* Mobile : comme en production, l'accueil garde la hauteur de l'écran (le
   padding bas du main laisse la place au menu fixé en bas) et l'accroche
   passe à 20 px pour tenir sur une ligne. */

@media (max-width: 850px) {
	.accueil__accroche {
		font-size: 20px;
	}
}

@keyframes accueil-prenom {
	to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes accueil-nom {
	to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes accueil-ligne-haut {
	to { opacity: 1; filter: blur(0); transform: translateX(25px); }
}

@keyframes accueil-ligne-bas {
	to { opacity: 1; filter: blur(0); transform: translateX(-25px); }
}

@keyframes accueil-entree {
	to { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes accueil-mot-entre {
	0% { opacity: 0; transform: translateX(-100%); }
	60% { opacity: 1; transform: translateX(10%); }
	100% { opacity: 1; transform: translateX(0); }
}

@keyframes accueil-mot-sort {
	0% { opacity: 1; transform: translateX(0); }
	60% { opacity: 0; transform: translateX(110%); }
	100% { opacity: 0; transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.accueil__prenom,
	.accueil__nom,
	.accueil__ligne,
	.accueil__accroche,
	.accueil__texte p {
		opacity: 1;
		filter: none;
		transform: none;
		animation: none;
	}

	.accueil__ligne--haut {
		transform: translateX(25px);
	}

	.accueil__ligne--bas {
		transform: translateX(-25px);
	}

	.accueil__mots b {
		animation: none;
	}
}
