/* « Nos services » (2026-09-24). Loaded last of the blue sheets, so it can
   opt #section-services into the shared content frame (blue-content-layout
   .css) and out of the blanket canvas hide (blue-responsive.css) without
   editing either. Nothing here is section-agnostic: every selector is
   scoped to #section-services or to the bar item that opens it. */

/* ── The shared internal-page frame ─────────────────────────────────── */
html[data-blue-style] #section-services .stage-inner {
	width: min(100%, var(--content-frame-width));
	max-width: var(--content-frame-width);
	height: 100%;
	max-height: none;
	margin-inline: auto;
	padding: var(--content-frame-top) var(--grid-margin)
		var(--content-frame-bottom);
	box-sizing: border-box;
}

/* The submenu is open on this section, so the bar is taller — same
   allowance studio and réalisations already make for it. */
html[data-blue-menu="services"] #section-services .stage-inner {
	padding-bottom: 190px;
}

/* ── Copy ───────────────────────────────────────────────────────────── */
#section-services .services-points {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	font-size: clamp(0.82rem, 1.05vw, 0.95rem);
	line-height: 1.5;
	color: var(--ink-soft);
}
#section-services .services-points li {
	position: relative;
	padding-left: 1.05rem;
}
/* A hairline tick rather than a bullet glyph: the same drawn-line language
   the submenu and the particle field use. */
#section-services .services-points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.55rem;
	height: 1px;
	background: currentColor;
	opacity: 0.55;
}
#section-services .services-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.9rem 1.4rem;
	margin: 0;
}
#section-services .services-secondary {
	font-size: 0.82rem;
	letter-spacing: 0.02em;
	color: var(--ink-soft);
	text-decoration: none;
	border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent);
	padding-bottom: 2px;
}
#section-services .services-secondary:hover,
#section-services .services-secondary:focus-visible {
	color: var(--blue-text);
	border-bottom-color: currentColor;
}

/* ── Desktop: copy left, particle figure right ──────────────────────── */
@media (min-width: 900px) {
	html[data-blue-style] #section-services .split-page {
		display: grid !important;
		grid-template-columns: minmax(18rem, 0.8fr) minmax(30rem, 1.2fr);
		grid-template-rows: 1fr;
		column-gap: var(--content-column-gap);
		align-items: center;
		justify-items: stretch;
		text-align: left;
	}
	html[data-blue-style] #section-services .offer-head {
		grid-column: 1;
		grid-row: 1;
		align-self: center;
		width: 100%;
		max-width: var(--content-copy-width);
		margin: 0;
	}
	html[data-blue-style] #section-services .services-figure-zone {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
		width: 100%;
		height: var(--content-visual-height);
		margin: 0;
		display: block !important;
	}

	/* The field is clipped to the visual column and feathered before the
	   clip, so the boundary never reads as a cut. Identical treatment to
	   studio/réalisations/contact (blue-content-layout.css). */
	:root:has(#section-services.is-active) #stage {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		clip-path: inset(0 0 0 42%);
		-webkit-mask-image: linear-gradient(to right, transparent 42%, #000 50%);
		mask-image: linear-gradient(to right, transparent 42%, #000 50%);
	}
}

/* ── Mobile: figure above the copy ──────────────────────────────────── */
@media (max-width: 899px) {
	html[data-blue-style] #section-services .stage-inner {
		display: flex !important;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: clamp(1rem, 2.5dvh, 1.4rem);
		padding: var(--content-frame-top) 1.25rem var(--content-frame-bottom) !important;
		text-align: center;
	}
	html[data-blue-style] #section-services .services-figure-zone {
		order: 1;
		display: block !important;
		width: min(100%, 22rem) !important;
		height: var(--content-visual-height) !important;
		flex: 0 0 var(--content-visual-height) !important;
		margin: 0 auto !important;
	}
	html[data-blue-style] #section-services .offer-head {
		order: 2;
		width: 100%;
		max-width: var(--content-copy-width) !important;
		margin: 0 auto !important;
		text-align: center !important;
	}
	#section-services .services-points {
		text-align: left;
	}
	#section-services .services-actions {
		justify-content: center;
	}

	/* The visible band is the reserved figure zone itself, expressed in the
	   same lengths the layout above uses rather than in guessed percentages:
	   the copy below it can never be crossed by stray particles however the
	   frame tokens change. */
	:root:has(#section-services.is-active) #stage {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		clip-path: inset(
			calc(var(--content-frame-top) - 10px) 0
				calc(
					100dvh -
					var(--content-frame-top) -
					var(--content-visual-height) -
					10px
				)
				0
		);
		-webkit-mask-image: linear-gradient(
			to bottom,
			transparent calc(var(--content-frame-top) - 10px),
			#000 calc(var(--content-frame-top) + 12px),
			#000 calc(var(--content-frame-top) + var(--content-visual-height) - 12px),
			transparent calc(var(--content-frame-top) + var(--content-visual-height))
		);
		mask-image: linear-gradient(
			to bottom,
			transparent calc(var(--content-frame-top) - 10px),
			#000 calc(var(--content-frame-top) + 12px),
			#000 calc(var(--content-frame-top) + var(--content-visual-height) - 12px),
			transparent calc(var(--content-frame-top) + var(--content-visual-height))
		);
	}
}

/* ── 2nd brain scenario overlay ─────────────────────────────────────── */
/* Viewport-fixed because its coordinates come straight from the engine's
   projectWorldPoint(), which reports canvas pixels. */
.brain-layer {
	position: fixed;
	inset: 0;
	/* Above #bar (z-index 5): the replay control sits between the figure and
	   the submenu strip, and the strip's own full-width band would otherwise
	   take the click. */
	z-index: 6;
	pointer-events: none;
	font-size: 0.72rem;
	line-height: 1.3;
	color: var(--ink-soft);
}
.brain-layer[hidden] {
	display: none;
}
.brain-edges {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.brain-edge {
	stroke: currentColor;
	stroke-width: 1;
	stroke-opacity: 0.12;
	transition:
		stroke-opacity 420ms ease,
		stroke-width 420ms ease;
}
.brain-edge[data-state="lit"] {
	stroke-opacity: 0.85;
	stroke-width: 1.6;
}
.brain-node {
	position: absolute;
	margin: 0;
	transform: translate(-50%, -50%);
	max-width: 11rem;
	padding: 0.2rem 0.45rem;
	text-align: center;
	text-wrap: balance;
	opacity: 0.32;
	transition: opacity 420ms ease;
}
.brain-node[data-state="lit"],
.brain-node[data-state="pulse"] {
	opacity: 1;
	color: var(--blue-text);
}
.brain-node[data-state="pulse"] {
	animation: brain-pulse 900ms ease-in-out 2;
}
@keyframes brain-pulse {
	0%,
	100% {
		opacity: 0.55;
	}
	50% {
		opacity: 1;
	}
}
.brain-card {
	position: absolute;
	transform: translate(-50%, -100%);
	width: min(23rem, 78vw);
	box-sizing: border-box;
	padding: 0.75rem 0.9rem;
	text-align: left;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	border: 1px solid color-mix(in srgb, var(--blue-text) 22%, transparent);
	backdrop-filter: blur(10px);
	animation: brain-card-in 420ms ease both;
}
.brain-card[hidden] {
	display: none;
}
@keyframes brain-card-in {
	from {
		opacity: 0;
		transform: translate(-50%, calc(-100% + 8px));
	}
}
.brain-card-title {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.35;
	color: var(--blue-text);
}
.brain-card-label {
	margin: 0.55rem 0 0.2rem;
	font-size: 0.6rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.7;
}
.brain-card-sources {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.75rem;
	font-size: 0.68rem;
}
.brain-replay {
	/* Placed from the figure zone's own rect (blue-services-brain.js), like
	   the card: both belong to the scene's visual box, not to the page frame. */
	position: absolute;
	transform: translate(-100%, 0);
	/* Anchored by its right edge: without an intrinsic width it would shrink
	   to whatever space is left of the viewport edge. */
	width: max-content;
	white-space: nowrap;
	pointer-events: auto;
	padding: 0.35rem 0.8rem;
	font: inherit;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: inherit;
	background: transparent;
	border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
	cursor: pointer;
}
.brain-replay:hover,
.brain-replay:focus-visible {
	color: var(--blue-text);
	border-color: currentColor;
}
@media (max-width: 899px) {
	.brain-layer {
		font-size: 0.62rem;
	}
	.brain-node {
		max-width: 7.5rem;
	}
	.brain-card {
		padding: 0.6rem 0.7rem;
	}
	.brain-card-sources {
		gap: 0.15rem 0.5rem;
		font-size: 0.6rem;
	}
	.brain-replay {
		right: 1.25rem;
	}
}
@media (prefers-reduced-motion: reduce) {
	.brain-edge,
	.brain-node,
	.brain-card {
		transition: none;
		animation: none;
	}
}

/* Four choices in one narrow row: the shared mobile submenu size leaves this
   group about seven pixels of margin, so it gets its own. */
@media (max-width: 760px) {
	/* The scene's figure band is short here: seven labels around it collide
	   with each other and with the card. The three story beats stay named,
	   and the four memories are read from the card's own source list. */
	.brain-node[data-node="client"],
	.brain-node[data-node="contrat"],
	.brain-node[data-node="devis"],
	.brain-node[data-node="whatsapp"] {
		display: none;
	}
	.brain-node {
		font-size: 0.66rem;
		max-width: 8.5rem;
	}
	html[data-blue-style] #blue-section-menu [data-blue-group="services"] button {
		font-size: 15px !important;
		padding: 6px 4px !important;
	}
}

/* The scroll-site experiment renames its own réalisations item "Services"
   (blue-scroll-navigation.js); it must not also carry this one. */
html[data-scroll-site="true"] #bar [data-menu="services"] {
	display: none !important;
}
