/* ==========================================================================
   Dream Studio — accueil (version par défaut ; l'ancienne : /?accueil=ancien)
   Réutilise les boutons et animations d'entrée de hero.css, et les
   cartes de projets de projets.css. Les @keyframes sont générés par PHP.
   ========================================================================== */

html { scroll-behavior: smooth; }

/* --------------------------------------------------------------------------
   Hero plein écran en pleine largeur
   -------------------------------------------------------------------------- */

.ds-h2 {
	position: relative;
	display: flex;
	align-items: center;
	height: 100vh;
	height: 100svh;
	min-height: 560px;
	overflow: hidden;
	background: #26231f;
	color: #fff;
}

@media (max-width: 1099px) {
	.ds-h2 {
		height: calc(100vh - var(--ds-header-h));
		height: calc(100svh - var(--ds-header-h));
	}
}

/* Diaporama en boucle : chaque image se superpose en fondu à la précédente.
   Les @keyframes ds-h2-fondu-N et ds-h2-zoom sont générés par PHP (inc/accueil.php) ;
   le cycle dure n × pas, variables posées sur .ds-h2__diapos par front-page.php. */
.ds-h2__diapos { position: absolute; inset: 0; overflow: hidden; }
.ds-h2__diapo {
	position: absolute;
	inset: 0;
	z-index: 1;
	animation-duration: calc(var(--n, 5) * var(--ds-pas));
	animation-timing-function: cubic-bezier(.4, 0, .2, 1);
	animation-iteration-count: infinite;
}
.ds-h2__diapo:nth-child(n+2) { opacity: 0; }
.ds-h2__diapo:nth-child(1) { animation-name: ds-h2-fondu-0; }
.ds-h2__diapo:nth-child(2) { animation-name: ds-h2-fondu-1; }
.ds-h2__diapo:nth-child(3) { animation-name: ds-h2-fondu-2; }
.ds-h2__diapo:nth-child(4) { animation-name: ds-h2-fondu-3; }
.ds-h2__diapo:nth-child(5) { animation-name: ds-h2-fondu-4; }
.ds-h2__diapo:nth-child(6) { animation-name: ds-h2-fondu-5; }

.ds-h2__diapo img { width: 100%; height: 100%; object-fit: cover; }

/* Voile supplémentaire côté texte pour les images claires (variable --plus). */
.ds-h2__diapo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, rgba(20, 18, 16, var(--plus, 0)), rgba(20, 18, 16, 0) 78%);
}

/* Zoom lent, calé sur le début du fondu d'entrée de chaque image (--zd). */
.ds-h2__diapo img {
	transform-origin: center;
	animation: ds-h2-zoom calc(var(--n, 5) * var(--ds-pas)) ease-out infinite;
	animation-delay: var(--zd, 0s);
}

/* Pause demandée par l'utilisateur : tout se fige sur l'image affichée. */
.ds-h2--pause .ds-h2__diapo,
.ds-h2--pause .ds-h2__diapo img { animation-play-state: paused; }

/* Voile : même traitement que les heros de page (hero-page.css) — voile uniforme + léger dégradé
   en haut pour l'en-tête transparent ; un dégradé en bas garde le bas du hero lisible. */
.ds-h2__voile {
	position: absolute;
	inset: 0;
	z-index: 2;
	background:
		linear-gradient(to bottom, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 180px),
		linear-gradient(to top, rgba(20, 18, 16, .5), rgba(20, 18, 16, 0) 40%),
		rgba(12, 11, 10, .42);
}

.ds-h2__contenu {
	position: relative;
	z-index: 3;
	width: min(100%, 1600px);
	margin-inline: auto;
	padding: var(--ds-header-h) var(--ds-gouttiere) 96px;
	text-align: center;
	text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

.ds-h2__surtitre {
	margin-bottom: 22px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: #fff;
}

.ds-h2__titre {
	max-width: 11em;
	margin-inline: auto;
	font: 400 clamp(56px, 7.4vw, 120px)/.96 var(--ds-serif);
	letter-spacing: -.02em;
	color: #fff;
}

.ds-h2__accent { font-style: italic; color: #ee6b66; }

.ds-h2__chapo {
	max-width: 560px;
	margin: 28px auto 0;
	font-size: 18px;
	line-height: 1.65;
	color: rgba(255, 255, 255, .9);
}

.ds-h2__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }

/* Le bouton contour se lit mal sur les motifs très graphiques des images : fond sombre translucide
   (le remplissage blanc au survol, défini dans base.css, reprend le dessus). */
.ds-h2__actions .ds-bouton-contour:not(.ds-bouton-contour--rouge) {
	background: rgba(20, 18, 16, .55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.ds-h2__actions .ds-bouton-contour:not(.ds-bouton-contour--rouge):hover,
.ds-h2__actions .ds-bouton-contour:not(.ds-bouton-contour--rouge):focus-visible { background: #fff; }

/* Bas du hero : invite à défiler, à droite. */
.ds-h2__bas {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 34px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 26px;
	width: min(100%, 1600px);
	margin-inline: auto;
	padding-inline: var(--ds-gouttiere);
}

/* Bouton pause : n'apparaît que si JavaScript est actif (attribut hidden retiré par accueil.js). */
.ds-h2__pause {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 50%;
	color: #fff;
	transition: background-color .2s, color .2s, border-color .2s;
}
.ds-h2__pause[hidden] { display: none; }
.ds-h2__pause:hover { background: #fff; color: var(--ds-encre); border-color: #fff; }
.ds-h2__lecture-icone { display: none; margin-left: 2px; }
.ds-h2__pause[aria-pressed="true"] .ds-h2__pause-icone { display: none; }
.ds-h2__pause[aria-pressed="true"] .ds-h2__lecture-icone { display: block; }

/* Icône de souris centrée en bas du hero, comme sur la fiche projet (contour arrondi, molette qui descend). */
.ds-h2__souris { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); display: block; padding: 8px; }
.ds-h2__souris-icone { position: relative; display: block; width: 24px; height: 38px; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; transition: border-color .25s; }
.ds-h2__souris-icone::after { content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: #fff; animation: ds-h2-molette 1.8s ease-in-out infinite; }
.ds-h2__souris:hover .ds-h2__souris-icone { border-color: #e8a5a1; }

@keyframes ds-h2-molette {
	0% { opacity: 0; transform: translateY(0); }
	25% { opacity: 1; }
	75% { opacity: 1; transform: translateY(10px); }
	100% { opacity: 0; transform: translateY(12px); }
}

@media (max-width: 767px) {
	.ds-h2 { min-height: 520px; }
	.ds-h2__contenu { padding-top: 24px; padding-bottom: 88px; }
	.ds-h2__surtitre { margin-bottom: 16px; font-size: 11px; letter-spacing: .14em; }
	.ds-h2__titre { font-size: clamp(54px, 15vw, 84px); }
	.ds-h2__chapo { margin-top: 20px; font-size: 16px; }
	.ds-h2__actions { margin-top: 26px; }
	.ds-h2__actions .ds-bouton-contour { flex: 1 1 100%; justify-content: center; }
	.ds-h2__bas { bottom: 22px; }
}

/* --------------------------------------------------------------------------
   Projets à la une : mosaïque (1 grande + 4 petites, puis 3 en rang) ; /?apercu=3 à 8 pour simuler un nombre.
   Les cartes sont les tuiles de /projets/ (projets.css : dégradé, typographie, survol) ; ici on ne règle
   que leur placement et leurs tailles de titre.
   -------------------------------------------------------------------------- */

.ds-projets.ds-h2-projets { padding-block: 104px 112px; background: #fff; scroll-margin-top: 0; }
.ds-h2-projets .ds-projets__section-head { margin-bottom: 44px; }

.ds-h2-mosaique {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 16px;
}
.ds-h2-mosaique + .ds-h2-mosaique { margin-top: 16px; }
.ds-h2-mosaique--a { grid-auto-rows: clamp(220px, 19vw, 300px); }
.ds-h2-mosaique--b { grid-auto-rows: clamp(250px, 23vw, 340px); }

.ds-h2-carte { aspect-ratio: auto; min-width: 0; }
.ds-h2-mosaique--a .ds-h2-carte:not(.ds-h2-carte--grande) h3 { font-size: clamp(20px, 1.75vw, 27px); line-height: 1.08; }
.ds-h2-mosaique--b .ds-h2-carte h3 { font-size: clamp(24px, 2.4vw, 34px); }
.ds-h2-carte--grande .ds-projets__tuile-texte { right: 28px; bottom: 28px; left: 30px; gap: 10px; }
.ds-h2-carte--grande h3 { font-size: clamp(34px, 3.8vw, 58px); line-height: 1; }

/* Bande A selon le nombre de projets (1 à 5) : la première carte occupe la moitié gauche sur 2 rangées. */
.ds-h2-mosaique--a[data-n="1"] .ds-h2-carte { grid-column: 1 / -1; grid-row: span 2; }
.ds-h2-mosaique--a[data-n="2"] .ds-h2-carte { grid-column: span 6; grid-row: span 2; }
.ds-h2-mosaique--a[data-n="3"] .ds-h2-carte:nth-child(1),
.ds-h2-mosaique--a[data-n="4"] .ds-h2-carte:nth-child(1),
.ds-h2-mosaique--a[data-n="5"] .ds-h2-carte:nth-child(1) { grid-column: 1 / 7; grid-row: 1 / 3; }
.ds-h2-mosaique--a[data-n="3"] .ds-h2-carte:nth-child(2) { grid-column: 7 / 13; grid-row: 1; }
.ds-h2-mosaique--a[data-n="3"] .ds-h2-carte:nth-child(3) { grid-column: 7 / 13; grid-row: 2; }
.ds-h2-mosaique--a[data-n="4"] .ds-h2-carte:nth-child(2),
.ds-h2-mosaique--a[data-n="5"] .ds-h2-carte:nth-child(2) { grid-column: 7 / 10; grid-row: 1; }
.ds-h2-mosaique--a[data-n="4"] .ds-h2-carte:nth-child(3),
.ds-h2-mosaique--a[data-n="5"] .ds-h2-carte:nth-child(3) { grid-column: 10 / 13; grid-row: 1; }
.ds-h2-mosaique--a[data-n="4"] .ds-h2-carte:nth-child(4) { grid-column: 7 / 13; grid-row: 2; }
.ds-h2-mosaique--a[data-n="5"] .ds-h2-carte:nth-child(4) { grid-column: 7 / 10; grid-row: 2; }
.ds-h2-mosaique--a[data-n="5"] .ds-h2-carte:nth-child(5) { grid-column: 10 / 13; grid-row: 2; }

/* Bande B : 1 (panorama), 2 (moitiés) ou 3 (tiers) projets. */
.ds-h2-mosaique--b[data-n="1"] { grid-auto-rows: clamp(280px, 29vw, 430px); }
.ds-h2-mosaique--b[data-n="1"] .ds-h2-carte { grid-column: 1 / -1; }
.ds-h2-mosaique--b[data-n="2"] .ds-h2-carte { grid-column: span 6; }
.ds-h2-mosaique--b[data-n="3"] .ds-h2-carte { grid-column: span 4; }

/* Bouton « Voir tous les projets » : tablette et mobile uniquement (sur ordinateur, le lien de l'en-tête suffit). */
.ds-h2-tous { display: none; }

/* Tablette : la première carte sur toute la largeur, les autres par deux. 5 cartes au plus :
   la bande B (projets 6 à 8) est masquée et le bouton renvoie vers tous les projets. */
@media (max-width: 1099px) {
	.ds-h2-mosaique--b { display: none; }
	.ds-h2-projets .ds-projets__section-head > a { display: none; }
	.ds-h2-tous {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		height: 56px;
		margin-top: 16px;
		border: 1px solid var(--ds-encre);
		font-size: 14px;
		font-weight: 600;
		letter-spacing: .04em;
		transition: background-color .2s, color .2s;
	}
	.ds-h2-tous:hover, .ds-h2-tous:focus-visible { background: var(--ds-encre); color: #fff; }
	.ds-h2-mosaique--a, .ds-h2-mosaique--b { grid-auto-rows: 250px; }
	.ds-h2-mosaique--a .ds-h2-carte { grid-column: span 6 !important; grid-row: auto !important; }
	.ds-h2-mosaique--a .ds-h2-carte:nth-child(1) { grid-column: 1 / -1 !important; grid-row: span 2 !important; }
	.ds-h2-mosaique--a .ds-h2-carte:last-child:nth-child(even) { grid-column: 1 / -1 !important; }
	.ds-h2-mosaique--b[data-n="3"] .ds-h2-carte { grid-column: span 6; }
	.ds-h2-mosaique--b[data-n="3"] .ds-h2-carte:last-child { grid-column: 1 / -1; }
	.ds-h2-mosaique--b[data-n="1"] { grid-auto-rows: 300px; }
}

/* Mobile : une colonne, la première carte plus haute. */
@media (max-width: 767px) {
	.ds-projets.ds-h2-projets { padding-block: 70px 76px; }
	.ds-h2-mosaique { display: flex; flex-direction: column; gap: 12px; }
	.ds-h2-mosaique + .ds-h2-mosaique { margin-top: 12px; }
	.ds-h2-mosaique--b { display: none; } /* 5 cartes au plus sur mobile */
	.ds-h2-carte { height: 250px; flex: none; }
	.ds-h2-mosaique--a .ds-h2-carte:nth-child(1) { height: 340px; }
	.ds-h2-carte--grande h3 { font-size: 34px; }
	.ds-h2-carte .ds-projets__tuile-texte, .ds-h2-carte--grande .ds-projets__tuile-texte { right: 16px; bottom: 16px; left: 18px; }
	.ds-h2-mosaique--a .ds-h2-carte:not(.ds-h2-carte--grande) h3 { font-size: clamp(22px, 6vw, 26px); }
}

/* --------------------------------------------------------------------------
   Domaine d'expertise : aperçu des six activités
   -------------------------------------------------------------------------- */

.ds-h2-eyebrow { color: var(--ds-rouge); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }

.ds-h2-lien {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	width: fit-content;
	padding-bottom: 7px;
	border-bottom: 1px solid var(--ds-rouge);
	font-size: 14px;
	font-weight: 600;
	transition: gap .2s, color .2s;
}
.ds-h2-lien:hover { gap: 16px; color: var(--ds-rouge); }
.ds-h2-lien span { font-size: 19px; line-height: 1; }

.ds-h2-expertise { padding-block: clamp(64px, 7vw, 96px); background: var(--ds-fond); }

.ds-h2-expertise__inner {
	display: grid;
	grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
	gap: clamp(48px, 7vw, 110px);
	align-items: center;
	width: min(100%, 1600px);
	margin-inline: auto;
	padding-inline: var(--ds-gouttiere);
}

.ds-h2-expertise__intro .ds-h2-eyebrow { margin-bottom: 14px; }
.ds-h2-expertise h2 { font: 400 clamp(46px, 5.2vw, 76px)/.98 var(--ds-serif); letter-spacing: -.015em; }
.ds-h2-expertise h2 em { font-weight: 400; color: var(--ds-rouge); }
.ds-h2-expertise__intro > p:not(.ds-h2-eyebrow) { max-width: 420px; margin: 24px 0 32px; color: var(--ds-gris); font-size: 17px; line-height: 1.7; }

/* Six entrées en 3 × 2 : pictogramme et titre, chacune menant à sa carte sur la page Domaine d'expertise */
.ds-h2-expertise__liste { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; list-style: none; margin: 0; padding: 0; }
.ds-h2-expertise__liste li { border-top: 1px solid var(--ds-filet); }
.ds-h2-expertise__liste li:nth-last-child(-n + 3) { border-bottom: 1px solid var(--ds-filet); }
.ds-h2-expertise__liste a { display: flex; flex-direction: column; gap: 18px; height: 100%; padding: 28px 0 30px; transition: color .2s; }
.ds-h2-expertise__icone { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--ds-filet-fort); border-radius: 50%; color: var(--ds-rouge); transition: background .3s, color .3s, border-color .3s; }
.ds-h2-expertise__titre { font: 400 clamp(22px, 1.9vw, 28px)/1.15 var(--ds-serif); }
.ds-h2-expertise__liste a:hover { color: var(--ds-rouge); }
.ds-h2-expertise__liste a:hover .ds-h2-expertise__icone,
.ds-h2-expertise__liste a:focus-visible .ds-h2-expertise__icone { border-color: var(--ds-rouge); background: var(--ds-rouge); color: #fff; }

@media (max-width: 1099px) {
	.ds-h2-expertise__inner { grid-template-columns: 1fr; gap: 44px; }
	.ds-h2-expertise__intro > p:not(.ds-h2-eyebrow) { max-width: 560px; }
}
@media (max-width: 640px) {
	.ds-h2-expertise__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
	.ds-h2-expertise__liste li:nth-last-child(-n + 3) { border-bottom: 0; }
	.ds-h2-expertise__liste li:nth-last-child(-n + 2) { border-bottom: 1px solid var(--ds-filet); }
	.ds-h2-expertise__liste a { padding: 22px 0 24px; gap: 14px; }
	.ds-h2-expertise__icone { width: 48px; height: 48px; }
	.ds-h2-expertise__titre { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .ds-h2-expertise__liste a, .ds-h2-expertise__icone { transition: none; } }

/* --------------------------------------------------------------------------
   Invitation à contacter l'agence (même bandeau que Domaine d'expertise)
   -------------------------------------------------------------------------- */

.ds-h2-cta { padding-block: 83px 86px; background: #eeeae3; }
.ds-h2-cta__inner {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 30px;
	width: min(100%, 1600px);
	margin-inline: auto;
	padding-inline: var(--ds-gouttiere);
}
.ds-h2-cta h2 { margin-top: 12px; font: 400 clamp(45px, 6vw, 80px)/.98 var(--ds-serif); }
.ds-h2-cta h2 em { font-weight: 400; color: var(--ds-rouge); }

@media (max-width: 767px) {
	.ds-h2-cta { padding-block: 60px 65px; }
	.ds-h2-cta__inner { display: block; }
	.ds-h2-cta h2 { margin-bottom: 28px; font-size: 53px; }
}

/* --------------------------------------------------------------------------
   Mouvement réduit
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.ds-h2__souris-icone::after { animation: none !important; opacity: 1; }
	.ds-h2__pause { display: none !important; }
}
