/* ==========================================================================
   Couverture de l’accueil, écran de chargement, images de fond des zones.
   Charte : aplats (pas de dégradé), azur seulement sur fond sombre, pas de rebond.
   ========================================================================== */

:root {
	--ese-script: 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', cursive;
	--cover-h: calc(100svh - var(--admin-bar, 0px));
}

/* ---------- Écran de chargement ---------- */
.ese-loader { display: none; }
.ese-loading .ese-loader,
.ese-loader.is-leaving {
	display: grid;
	place-items: center;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--ese-sombre-footer);
	color: #fff;
}
.ese-loader::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2' cy='2' r='1.3' fill='%23fff'/%3E%3C/svg%3E");
	opacity: .06;
}
.ese-loader.is-leaving {
	animation: ese-loader-out 620ms cubic-bezier(.7, 0, .2, 1) forwards;
	pointer-events: none;
}
.ese-loader__inner { position: relative; display: grid; justify-items: center; gap: 18px; }
.ese-loader__logo { width: 72px; height: auto; }
.ese-loader__name {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 9px;
	margin-right: -9px;
	opacity: 0;
	animation: ese-fade-up 600ms var(--ease-out, ease-out) 650ms forwards;
}
.ese-loader__bar { position: relative; display: block; width: 88px; height: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ese-loader__bar span { position: absolute; inset: 0; background: var(--ese-azur); transform-origin: left; transform: scaleX(0); animation: ese-bar 1.2s cubic-bezier(.4, 0, .2, 1) forwards; }
.ese-loading--quick .ese-loader__name { animation-delay: 120ms; animation-duration: 300ms; }
.ese-loading--quick .ese-loader__bar span { animation-duration: .45s; }
.ese-loading { overflow: hidden; }

@keyframes ese-loader-out {
	0% { clip-path: inset(0 0 0 0); }
	100% { clip-path: inset(0 0 100% 0); }
}
@keyframes ese-bar { to { transform: scaleX(1); } }
@keyframes ese-fade-up {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Logo qui se dessine (chargement + couverture) ---------- */
.logo-draw { overflow: visible; }
.logo-draw__drop {
	fill: var(--ese-azur);
	fill-opacity: 0;
	stroke: var(--ese-azur);
	stroke-width: 3;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
}
.logo-draw__cut { fill: var(--ese-sombre-footer); opacity: 0; }
.logo-draw__cut-line { stroke: var(--ese-sombre-footer); stroke-width: 6; stroke-linecap: round; opacity: 0; }
.logo-draw__stand {
	fill: none;
	stroke: #fff;
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
}
/* Séquence : contour de la goutte → remplissage → micro → pied. */
.ese-loader .logo-draw__drop,
.splash.is-ready .logo-draw__drop { animation: ese-draw 700ms cubic-bezier(.6, 0, .2, 1) forwards, ese-fill 400ms ease-out 550ms forwards; }
.ese-loader .logo-draw__cut,
.ese-loader .logo-draw__cut-line,
.splash.is-ready .logo-draw__cut,
.splash.is-ready .logo-draw__cut-line { animation: ese-show 300ms ease-out 800ms forwards; }
.ese-loader .logo-draw__stand,
.splash.is-ready .logo-draw__stand { animation: ese-draw 500ms cubic-bezier(.6, 0, .2, 1) forwards; }
.ese-loader .logo-draw__stand:nth-of-type(2),
.splash.is-ready .logo-draw__stand:nth-of-type(2) { animation-delay: 450ms; }
.ese-loader .logo-draw__stand:nth-of-type(3),
.splash.is-ready .logo-draw__stand:nth-of-type(3) { animation-delay: 750ms; }
.ese-loader .logo-draw__stand:nth-of-type(4),
.splash.is-ready .logo-draw__stand:nth-of-type(4) { animation-delay: 900ms; }
.ese-loading--quick .ese-loader .logo-draw * { animation-duration: 260ms !important; animation-delay: 0ms !important; }

@keyframes ese-draw { to { stroke-dashoffset: 0; } }
@keyframes ese-fill { to { fill-opacity: 1; } }
@keyframes ese-show { to { opacity: 1; } }

/* ---------- Couverture plein écran ---------- */
.splash {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	grid-template-rows: 1fr auto;
	min-height: max(var(--cover-h), 560px);
	color: #fff;
	background: var(--ese-sombre-footer);
}
.splash__media {
	position: absolute;
	inset: 0;
	z-index: -3;
	background: var(--cover-img) 78% 50% / cover no-repeat;
	filter: saturate(.75);
	transform: scale(1.08);
	transition: transform 2.4s cubic-bezier(.2, .7, .2, 1);
	translate: 0 calc(var(--parallax, 0px) * -1);
}
.splash.is-ready .splash__media { transform: scale(1); }
.splash__veil {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: rgba(29, 32, 36, .6);
}
.splash__veil::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2' cy='2' r='1.3' fill='%23fff'/%3E%3C/svg%3E");
	opacity: .07;
}
.splash__waves { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: 22vh; opacity: .5; }

.splash__inner {
	display: grid;
	align-content: center;
	justify-items: center;
	gap: clamp(18px, 3vh, 34px);
	padding: calc(var(--header-h) + 24px) var(--gutter, 24px) 24px;
	text-align: center;
}
.splash__brand { display: grid; justify-items: center; gap: 14px; }
.splash__logo { width: clamp(56px, 7vw, 84px); height: auto; }
.splash__name {
	font-weight: 700;
	font-size: clamp(14px, 1.4vw, 17px);
	letter-spacing: .6em;
	margin-right: -.6em;
	opacity: 0;
}
.splash.is-ready .splash__name { animation: ese-fade-up 700ms var(--ease-out, ease-out) 1000ms forwards; }

.splash__slogan { margin: 0; width: min(1080px, 100%); line-height: 1; }
.splash__script { display: block; width: 100%; height: auto; max-height: 34vh; overflow: visible; }
.splash__ink {
	font-family: var(--ese-script);
	font-size: 170px;
	font-weight: 400;
	fill: #fff;
	fill-opacity: 0;
	stroke: var(--ese-azur);
	stroke-width: 1.4;
	stroke-dasharray: 900;
	stroke-dashoffset: 900;
	paint-order: stroke;
}
.splash__pen { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }

/* Boucle d’écriture (10 s) : la plume avance, le contour se trace, l’encre se pose, la phrase s’efface. */
.splash.is-writing .splash__pen { animation: ese-pen 10s cubic-bezier(.45, .05, .35, 1) infinite; }
.splash.is-writing .splash__ink { animation: ese-ink 10s linear infinite; }
@keyframes ese-pen {
	0% { transform: scaleX(0); }
	30%, 100% { transform: scaleX(1); }
}
@keyframes ese-ink {
	0% { stroke-dashoffset: 900; fill-opacity: 0; opacity: 1; }
	30% { stroke-dashoffset: 0; fill-opacity: 0; }
	42% { fill-opacity: 1; }
	84% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 1; }
	94%, 100% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 0; }
}

.splash__sub {
	margin: 0;
	max-width: 46ch;
	font-size: clamp(14px, 1.3vw, 17px);
	letter-spacing: .02em;
	color: var(--ese-gris-dark-text);
	opacity: 0;
}
.splash.is-ready .splash__sub { animation: ese-fade-up 800ms var(--ease-out, ease-out) 1400ms forwards; }

/* Bouton de défilement : il apparaît, puis reste calme ; il réagit au survol. */
.splash__scroll {
	justify-self: center;
	display: grid;
	justify-items: center;
	gap: 12px;
	margin-bottom: clamp(24px, 5vh, 48px);
	padding: 10px 18px;
	min-height: 44px;
	border-radius: 999px;
	color: #fff;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	opacity: 0;
	transition: color var(--dur-sm, .2s);
}
.splash.is-ready .splash__scroll { animation: ese-fade-up 700ms var(--ease-out, ease-out) 1800ms forwards; }
.splash__scroll-mouse {
	position: relative;
	width: 26px;
	height: 40px;
	border: 2px solid currentColor;
	border-radius: 14px;
	transition: border-color var(--dur-sm, .2s), transform var(--dur-md, .35s) var(--ease-out, ease-out);
}
.splash__scroll-mouse span {
	position: absolute;
	left: 50%;
	top: 8px;
	width: 4px;
	height: 8px;
	margin-left: -2px;
	border-radius: 2px;
	background: var(--ese-azur);
	transition: transform var(--dur-md, .35s) var(--ease-out, ease-out);
}
.splash__scroll:hover,
.splash__scroll:focus-visible { color: var(--ese-azur); }
.splash__scroll:hover .splash__scroll-mouse { transform: translateY(4px); }
.splash__scroll:hover .splash__scroll-mouse span,
.splash__scroll:focus-visible .splash__scroll-mouse span { transform: translateY(12px); }
.splash__scroll:focus-visible { outline: 2px solid var(--ese-azur); outline-offset: 4px; }

/* En-tête posé sur la couverture : transparent, en blanc ; il reprend sa forme après la couverture. */
.has-cover .site-header { margin-bottom: calc(var(--header-h) * -1 - 1px); }
.has-cover .site-header:not(.is-past-cover) {
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	border-bottom-color: rgba(255, 255, 255, .12);
	box-shadow: none;
}
.has-cover .site-header:not(.is-past-cover) .brand__name { color: #fff; }
.has-cover .site-header:not(.is-past-cover) .ese-mark__drop { fill: var(--ese-azur); }
.has-cover .site-header:not(.is-past-cover) .ese-mark__cut { fill: var(--ese-sombre-footer); }
.has-cover .site-header:not(.is-past-cover) .ese-mark__cut-line { stroke: var(--ese-sombre-footer); }
.has-cover .site-header:not(.is-past-cover) .ese-mark__stand { stroke: #fff; }
.has-cover .site-header:not(.is-past-cover) .site-nav__list > li > a,
.has-cover .site-header:not(.is-past-cover) .head-icon,
.has-cover .site-header:not(.is-past-cover) .cart-link { color: #fff; }
.has-cover .site-header:not(.is-past-cover) .burger span { background: #fff; }
#accueil-suite { scroll-margin-top: 0; }

@media (max-width: 860px) {
	.has-cover .site-header:not(.is-past-cover) .site-nav.is-open .site-nav__list > li > a { color: var(--ese-texte); }
	.splash__ink { stroke-width: 2; }
}

/* ---------- Images de fond des zones (en-têtes de page) ---------- */
.zone-bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: var(--zone-img) right center / cover no-repeat;
	pointer-events: none;
	translate: 0 calc(var(--parallax, 0px) * .4);
}
/* Illustration par défaut : traits ton sur ton. */
.zone-bg--light { opacity: .09; }
.zone-bg--dark { opacity: .2; filter: brightness(0) invert(1); }
/* Photo choisie dans le Personnaliseur : bichromie aux couleurs de la charte. */
.zone-bg--photo.zone-bg--light { opacity: .1; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; }
.zone-bg--photo.zone-bg--dark { opacity: .14; filter: grayscale(1); mix-blend-mode: luminosity; }

@media (prefers-reduced-motion: reduce) {
	.ese-loader.is-leaving { animation: none; opacity: 0; }
	.splash__media { transform: none; transition: none; }
	.splash .logo-draw *, .splash.is-ready .logo-draw * { animation: none !important; stroke-dashoffset: 0; opacity: 1; fill-opacity: 1; }
	.splash__name, .splash__sub, .splash__scroll { opacity: 1; animation: none !important; }
	.splash__pen { transform: none; animation: none !important; }
	.splash__ink { animation: none !important; stroke-dashoffset: 0; fill-opacity: 1; }
}
