/* ==========================================================================
   Page d'accueil : mise en page centrée et animations.
   Chargé uniquement sur l'accueil (toutes les langues).
   Tout le contenu reste visible sans JavaScript et avec « réduire les animations ».
   ========================================================================== */

/* ---------- Hero centré ---------- */
body.home .socle-hero {
	justify-items: center;
	text-align: center;
}

body.home .socle-hero__content {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 56rem;
}

body.home .socle-hero__eyebrow,
body.home .o-eyebrow {
	justify-content: center;
}

body.home .socle-rotator {
	margin-inline: auto;
}

body.home .socle-hero__text {
	max-width: 44rem;
}

body.home .socle-hero__actions {
	justify-content: center;
}

@media (min-width: 900px) {
	body.home .socle-hero {
		grid-template-columns: minmax(0, 1fr);
		min-height: min(88vh, 860px);
	}

	/* Les vagues passent derrière le texte, les pastilles flottent de chaque côté. */
	body.home .socle-hero__art {
		position: absolute;
		inset: 0;
		z-index: -1;
		min-height: 0;
		pointer-events: none;
	}

	body.home .socle-hero__art svg {
		position: absolute;
		left: 50%;
		bottom: 6%;
		width: min(62vw, 860px);
		margin-left: calc(min(62vw, 860px) / -2);
		opacity: 0.13;
	}

	body.home .socle-hero__glow {
		width: min(58vw, 760px);
		top: 50%;
		left: 50%;
		margin: calc(min(58vw, 760px) / -2) 0 0 calc(min(58vw, 760px) / -2);
	}

	body.home .socle-hero__chip--1 { top: 16%; left: 1%; right: auto; bottom: auto; }
	body.home .socle-hero__chip--2 { top: 22%; right: 0; left: auto; bottom: auto; }
	body.home .socle-hero__chip--3 { bottom: 26%; left: 5%; right: auto; top: auto; }
	body.home .socle-hero__chip--4 { bottom: 20%; right: 4%; left: auto; top: auto; }
}

/* Entre 900 et 1180 px, les pastilles gêneraient la lecture du titre. */
@media (min-width: 900px) and (max-width: 1180px) {
	body.home .socle-hero__chip {
		display: none;
	}
}

@media (max-width: 899px) {
	body.home .socle-hero__art {
		justify-items: center;
	}

	/* Sur deux lignes, le petit trait devant le sur-titre paraîtrait décalé. */
	body.home .socle-hero__eyebrow::before {
		display: none;
	}
}

/* ---------- Sections centrées ---------- */
body.home .o-section .o-head {
	width: 100%;
	max-width: 48rem;
	margin-inline: auto !important;
	text-align: center;
}

body.home .o-section .o-head > * {
	margin-inline: auto !important;
	text-align: center;
}

body.home .o-head .o-lead {
	margin-inline: auto;
}

/* Bloc « Être premier sur Google » : texte centré, démonstration IA en dessous. */
body.home .o-ai-section .wp-block-columns {
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--60);
}

body.home .o-ai-section .wp-block-column {
	flex: 0 1 auto !important;
	width: 100%;
	max-width: 50rem;
}

body.home .o-ai-section .wp-block-column:first-child {
	text-align: center;
}

/* Cartes : contenu centré. */
body.home .o-card {
	position: relative;
	text-align: center;
}

body.home .o-card:has(> .o-card__more),
body.home .o-card:has(> .o-card__tag) {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: none;
	justify-items: center;
}

body.home .o-card > * {
	grid-column: 1 !important;
	grid-row: auto !important;
}

body.home .o-card > .o-card__tag {
	order: -1;
	margin-bottom: 0.75rem;
}

body.home .o-card > .o-card__more {
	align-self: end;
}

body.home .o-step {
	text-align: center;
}

body.home .o-step__num {
	margin-inline: auto;
}

body.home .socle-related,
body.home .socle-faq {
	margin-inline: auto;
}

body.home .socle-faq {
	max-width: 52rem;
}

body.home .wp-block-query + .wp-block-group,
body.home .o-section .wp-block-buttons {
	justify-content: center;
	text-align: center;
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
	/* Grand titre : un reflet lumineux traverse le texte, très lentement.
	   Sur un <span> posé par home.js, pas sur le h1 : le mot rotatif resterait visible en surimpression. */
	body.home .o-shine {
		color: transparent;
		background: linear-gradient(100deg, #111 0%, #111 42%, #4f93c6 50%, #111 58%, #111 100%) 100% 0 / 300% 100%;
		-webkit-background-clip: text;
		background-clip: text;
		animation: socle-home-shine 9s ease-in-out 1.5s infinite;
	}

	/* Halo qui suit la souris dans le hero (position donnée par home.js). */
	body.home .o-home-spot {
		position: absolute;
		z-index: -1;
		top: 0;
		left: 0;
		width: 620px;
		height: 620px;
		margin: -310px 0 0 -310px;
		border-radius: 50%;
		background: radial-gradient(circle, rgb(90 158 204 / 0.38), transparent 62%);
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.5s ease;
		will-change: transform;
	}

	body.home .socle-hero.is-pointer .o-home-spot {
		opacity: 1;
	}

	/* Halos de couleur qui dérivent derrière toute la page. */
	body.home::before {
		content: "";
		position: fixed;
		z-index: -1;
		inset: -20vh -20vw;
		background:
			radial-gradient(38vw 38vw at 18% 28%, rgb(90 158 204 / 0.16), transparent 70%),
			radial-gradient(34vw 34vw at 82% 62%, rgb(42 87 125 / 0.11), transparent 70%),
			radial-gradient(30vw 30vw at 40% 88%, rgb(90 158 204 / 0.12), transparent 70%);
		pointer-events: none;
		animation: socle-home-aurora 26s ease-in-out infinite alternate;
	}

	/* Titres de section : les mots montent un à un (découpage par home.js). */
	body.home .o-word {
		display: inline-block;
	}

	body.home .o-words-ready .o-word {
		opacity: 0;
		transform: translateY(0.55em);
		transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
		transition-delay: calc(var(--w) * 55ms);
	}

	body.home .o-words-ready.is-in .o-word {
		opacity: 1;
		transform: none;
	}

	/* Cartes : entrée plus franche, en cascade. */
	@supports (animation-timeline: view()) {
		body.home .o-reveal > * {
			animation-name: socle-home-rise;
		}
	}

	body.home .o-card {
		transition: box-shadow 0.35s ease, border-color 0.35s ease, translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	body.home .o-card:hover {
		translate: 0 -6px;
		box-shadow: 0 26px 50px -26px rgb(42 87 125 / 0.5);
	}

	/* Lueur qui suit la souris sur les cartes (position donnée par home.js). */
	body.home .o-card::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: inherit;
		background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgb(90 158 204 / 0.2), transparent 70%);
		opacity: 0;
		transition: opacity 0.3s ease;
		pointer-events: none;
	}

	body.home .o-card:hover::after {
		opacity: 1;
	}

	body.home .o-tilt {
		transition: transform 0.15s linear;
	}

	/* Boutons attirés par la souris. */
	body.home .o-magnet {
		transition: translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
	}
}

/* ==========================================================================
   Animation d'ouverture (inc/intro.php), 3,3 s : les vagues montent, le nom
   s'écrit, l'horizon se trace, puis il s'ouvre et dévoile la page.
   ========================================================================== */
.o-intro__curtain {
	display: none;
}

html.o-intro {
	overflow: hidden;
	scrollbar-gutter: stable;
}

html.o-intro .o-intro__curtain {
	display: block;
	position: fixed;
	z-index: 100000;
	inset: 0;
	overflow: hidden;
	cursor: pointer;
}

.o-intro__panel {
	position: absolute;
	left: 0;
	width: 100%;
	height: 50.5%;
	overflow: hidden;
	background: #17344d;
	animation: 0.85s cubic-bezier(0.76, 0, 0.24, 1) 2.45s both;
}

.o-intro__panel--top {
	top: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: linear-gradient(180deg, #17344d 0%, #2a577d 100%);
	animation-name: o-intro-up;
}

.o-intro__panel--bottom {
	bottom: 0;
	background: linear-gradient(180deg, #2a577d 0%, #17344d 100%);
	animation-name: o-intro-down;
}

.o-intro__logo {
	display: block;
	width: min(84vw, 780px);
	height: auto;
	margin-bottom: 14px;
	overflow: visible;
	fill: #fff;
}

.o-intro__wave {
	fill: #8cc4e8;
	animation: o-intro-wave 0.8s cubic-bezier(0.25, 1.4, 0.5, 1) both;
	animation-delay: calc(0.15s + var(--i) * 0.11s);
}

.o-intro__letter {
	animation: o-intro-letter 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
	animation-delay: calc(0.8s + var(--i) * 0.06s);
}

/* L'horizon se trace d'un bord à l'autre, puis brille au moment de s'ouvrir. */
.o-intro__line {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	margin-top: -1px;
	background: linear-gradient(90deg, transparent, #cfe6f6 18%, #fff 50%, #cfe6f6 82%, transparent);
	box-shadow: 0 0 22px 3px rgb(140 196 232 / 0.75);
	transform-origin: center;
	animation: o-intro-line 0.75s cubic-bezier(0.7, 0, 0.2, 1) 1.45s both, o-intro-line-out 0.45s ease-in 2.45s forwards;
}

/* Ondes sur la « mer », sous l'horizon. */
.o-intro__panel--bottom span {
	position: absolute;
	top: 0;
	left: 50%;
	width: 150vw;
	height: 34vh;
	margin: -17vh 0 0 -75vw;
	border: 1px solid rgb(140 196 232 / 0.5);
	border-radius: 50%;
	opacity: 0;
	animation: o-intro-ripple 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.o-intro__panel--bottom span:nth-child(1) { animation-delay: 1.5s; }
.o-intro__panel--bottom span:nth-child(2) { animation-delay: 1.72s; }
.o-intro__panel--bottom span:nth-child(3) { animation-delay: 1.94s; }

/* Le haut de page démarre ses propres animations quand l'horizon s'ouvre. */
html.o-intro-seen body.home .socle-hero__content > * {
	animation-delay: 2.75s;
}

html.o-intro-seen body.home .socle-hero__wave {
	animation-delay: calc(2.8s + var(--i) * 0.09s);
}

html.o-intro-seen body.home .socle-hero__chip {
	animation-delay: calc(3.1s + var(--i) * 0.15s), calc(3.8s + var(--i) * -1.7s);
}

@keyframes o-intro-up { to { transform: translateY(-101%); } }
@keyframes o-intro-down { to { transform: translateY(101%); } }

@keyframes o-intro-wave {
	from {
		opacity: 0;
		translate: 0 70px;
	}
}

@keyframes o-intro-letter {
	from {
		opacity: 0;
		translate: 0 46px;
	}
}

@keyframes o-intro-line {
	from { transform: scaleX(0); }
}

@keyframes o-intro-line-out {
	to {
		opacity: 0;
		transform: scaleY(5);
	}
}

@keyframes o-intro-ripple {
	0% {
		opacity: 0;
		transform: scale(0.08);
	}
	25% { opacity: 1; }
	100% {
		opacity: 0;
		transform: scale(1);
	}
}

@keyframes socle-home-shine {
	0%, 62% { background-position: 100% 0; }
	100% { background-position: 0% 0; }
}

@keyframes socle-home-aurora {
	to { transform: translate(6vw, -5vh) scale(1.12); }
}

@keyframes socle-home-rise {
	from {
		opacity: 0;
		transform: translateY(46px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
