/* ==========================================================
   SEAT Opus Global — Energy scene (version raffinée)
   Remplace l'ancien bloc .energy-scene dans services-motion.css
   Hooks JS conservés : data-energy-*, data-phase sur .energy-scene__stage
   ========================================================== */

.energy-scene {
	--energy-ink: #0f3247;
	--energy-muted: #5f7784;
	--energy-blue: #0785bd;
	--energy-orange: #e68a36;
	--energy-line: rgba(18, 74, 109, .09);
	position: relative;
	padding: clamp(60px, 8vw, 110px) 24px;
	overflow: hidden;
	background:
		radial-gradient(ellipse 60% 50% at 88% 8%, rgba(255, 208, 145, .28), transparent 62%),
		radial-gradient(ellipse 50% 45% at 4% 96%, rgba(7, 133, 189, .08), transparent 64%),
		linear-gradient(180deg, #f8fbfc, #eef5f6);
}

/* Fine grille technique en filigrane */
.energy-scene::before {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--energy-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--energy-line) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 72%);
	mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 72%);
	content: "";
	pointer-events: none;
}

.energy-scene__inner {
	position: relative;
	display: grid;
	width: min(1240px, 100%);
	grid-template-columns: minmax(230px, .72fr) minmax(0, 1.5fr);
	align-items: center;
	gap: clamp(30px, 5vw, 80px);
	margin-inline: auto;
}

/* ---------- Colonne texte ---------- */

.energy-scene__heading {
	max-width: 400px;
}

.energy-scene__eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 20px;
	color: #0873a5;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.5;
	text-transform: uppercase;
}

.energy-scene__eyebrow span {
	position: relative;
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--energy-orange);
	box-shadow: 0 0 0 5px rgba(230, 138, 54, .13);
}

.energy-scene__eyebrow span::after {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--energy-orange);
	content: "";
	animation: energy-ping 2.4s ease-out infinite;
}

.energy-scene__heading h2 {
	margin: 0;
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: clamp(40px, 5vw, 64px);
	font-weight: 700;
	letter-spacing: -.058em;
	line-height: 1.02;
}

.energy-scene__heading h2 em {
	background: linear-gradient(100deg, #0785bd, #29a8d6 60%, #e68a36);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 400;
	letter-spacing: -.03em;
}

.energy-scene__heading > p:not(.energy-scene__eyebrow, .energy-scene__note) {
	margin: 22px 0 0;
	color: var(--energy-muted);
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 15.5px;
	line-height: 1.78;
}

/* Indicateurs pilotés par la phase du jour (CSS seul) */
.energy-scene__metrics {
	display: grid;
	gap: 15px;
	margin: 30px 0 0;
	padding: 0;
	list-style: none;
}

.energy-scene__metric {
	--level: 50%;
	--bar: var(--energy-blue);
	display: grid;
	gap: 7px;
}

.energy-scene__metric--solar { --bar: #f0a63a; }
.energy-scene__metric--battery { --bar: #0785bd; }
.energy-scene__metric--home { --bar: #4fbf8b; }

.energy-scene__metric-name {
	display: flex;
	justify-content: space-between;
	color: #4b6772;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.energy-scene__metric-name::after {
	color: #8ba0a9;
	font-weight: 500;
	letter-spacing: .02em;
	text-transform: none;
}

.energy-scene__metric--solar .energy-scene__metric-name::after { content: "En hausse"; }
.energy-scene__metric--battery .energy-scene__metric-name::after { content: "Se recharge"; }
.energy-scene__metric--home .energy-scene__metric-name::after { content: "Alimentée"; }

.energy-scene__metric-bar {
	display: block;
	height: 5px;
	overflow: hidden;
	border-radius: 99px;
	background: rgba(18, 74, 109, .09);
}

.energy-scene__metric-bar i {
	display: block;
	width: var(--level);
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, color-mix(in srgb, var(--bar) 70%, #fff), var(--bar));
	transition: width .7s cubic-bezier(.3, .7, .2, 1);
}

.energy-scene__note {
	margin: 28px 0 0;
	padding-left: 13px;
	border-left: 2px solid rgba(230, 138, 54, .7);
	color: #7a8d96;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	line-height: 1.65;
}

/* ---------- Scène ---------- */

.energy-scene__stage {
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .9);
	border-radius: 28px;
	background: #fff;
	box-shadow:
		0 0 0 1px rgba(37, 84, 103, .08),
		0 2px 6px rgba(28, 66, 81, .05),
		0 34px 80px -12px rgba(28, 66, 81, .22);
}

.energy-scene__sky {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #bfe6f6 0%, #e9f6f6 70%, #d9eae3 100%);
}

/* Couches de ciel : crépuscule et nuit en fondu */
.energy-scene__sky::before,
.energy-scene__sky::after {
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0;
	content: "";
	pointer-events: none;
	transition: opacity 1s ease;
}

.energy-scene__sky::before {
	background: linear-gradient(180deg, #f6c79d 0%, #f7dfc9 45%, #cddbe9 100%);
}

.energy-scene__sky::after {
	background: linear-gradient(180deg, #0f2740 0%, #213f5f 62%, #2f5472 100%);
}

.energy-scene__stage[data-phase="morning"] .energy-scene__sky::before,
.energy-scene__stage[data-phase="evening"] .energy-scene__sky::before {
	opacity: .85;
}

.energy-scene__stage[data-phase="night"] .energy-scene__sky::after {
	opacity: 1;
}

.energy-scene__sky-glow {
	position: absolute;
	top: -38%;
	right: -8%;
	z-index: 1;
	width: 58%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 245, 204, .72), rgba(255, 228, 165, .2) 42%, transparent 72%);
	pointer-events: none;
	transition: opacity .8s ease;
}

.energy-scene__stage[data-phase="night"] .energy-scene__sky-glow {
	opacity: 0;
}

.energy-scene__cloud {
	position: absolute;
	z-index: 1;
	width: 74px;
	height: 20px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .55);
	animation: energy-cloud-drift 34s linear infinite alternate;
	pointer-events: none;
	transition: opacity .8s ease;
}

.energy-scene__cloud::before,
.energy-scene__cloud::after {
	position: absolute;
	bottom: 7px;
	border-radius: 50%;
	background: inherit;
	content: "";
}

.energy-scene__cloud::before { left: 13px; width: 29px; height: 29px; }
.energy-scene__cloud::after { right: 13px; width: 22px; height: 22px; }

.energy-scene__cloud--one { top: 24%; left: 13%; }

.energy-scene__cloud--two {
	top: 38%;
	left: 47%;
	transform: scale(.7);
	animation-delay: -12s;
	animation-duration: 43s;
	opacity: .65;
}

.energy-scene__stage[data-phase="night"] .energy-scene__cloud {
	opacity: .14;
}

.energy-scene__drawing {
	position: relative;
	z-index: 2;
	display: block;
	width: 100%;
	height: auto;
}

/* Étoiles */
.energy-scene__stars circle {
	fill: #fff;
	opacity: 0;
	transition: opacity 1s ease;
}

.energy-scene__stage[data-phase="night"] .energy-scene__stars circle {
	opacity: .9;
	animation: energy-twinkle 3.2s ease-in-out infinite;
}

.energy-scene__stars circle:nth-child(2n) { animation-delay: -1.1s; }
.energy-scene__stars circle:nth-child(3n) { animation-delay: -2.2s; }

/* Soleil */
.energy-scene__sun-path {
	fill: none;
	stroke: rgba(255, 255, 255, .55);
	stroke-dasharray: 3 10;
	stroke-linecap: round;
	stroke-width: 2;
}

.energy-scene__sun {
	--sun-light: #ffd56a;
}

.energy-scene__sun-aura {
	animation: energy-breathe 5s ease-in-out infinite;
	transform-box: fill-box;
	transform-origin: center;
}

.energy-scene__sun-halo {
	fill: var(--sun-light);
	opacity: .22;
	filter: blur(2px);
	transition: opacity .4s ease;
}

.energy-scene__sun-core {
	fill: #ffc34d;
	stroke: rgba(255, 255, 255, .85);
	stroke-width: 3;
}

.energy-scene__sun-rays {
	fill: none;
	stroke: #efa831;
	stroke-linecap: round;
	stroke-width: 3;
	transform-box: fill-box;
	transform-origin: center;
	animation: energy-spin 40s linear infinite;
}

.energy-scene__sunbeam {
	fill: none;
	stroke: rgba(255, 194, 77, .46);
	stroke-dasharray: 7 8;
	stroke-linecap: round;
	stroke-width: 3;
	animation: energy-sunbeam 2.8s linear infinite;
	transition: opacity .4s ease;
}

/* Décor : s'assombrit la nuit */
.energy-scene__ground,
.energy-scene__panel {
	transition: filter 1s ease;
}

.energy-scene__stage[data-phase="night"] .energy-scene__ground {
	filter: brightness(.5) saturate(.8) hue-rotate(8deg);
}

.energy-scene__stage[data-phase="night"] .energy-scene__panel {
	filter: brightness(.82) drop-shadow(0 7px 8px rgba(33, 65, 75, .12));
}

.energy-scene__stage[data-phase="morning"] .energy-scene__ground,
.energy-scene__stage[data-phase="evening"] .energy-scene__ground {
	filter: brightness(.94) sepia(.12);
}

/* Reflet qui balaie les panneaux */
.energy-scene__shine {
	opacity: 0;
}

.energy-scene__stage[data-phase="day"] .energy-scene__shine,
.energy-scene__stage[data-phase="morning"] .energy-scene__shine,
.energy-scene__stage[data-phase="evening"] .energy-scene__shine {
	opacity: 1;
	animation: energy-shine 4.6s ease-in-out infinite;
}

/* Câbles et flux */
.energy-scene__wire {
	fill: none;
	stroke: #8aa1ab;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 5;
}

.energy-scene__pulse {
	fill: none;
	stroke: #ffc34d;
	stroke-dasharray: 2 15;
	stroke-linecap: round;
	stroke-width: 6;
	opacity: 0;
	filter: drop-shadow(0 0 4px rgba(255, 195, 77, .9));
}

.energy-scene__panel,
.energy-scene__battery,
.energy-scene__home,
.energy-scene__inverter {
	filter: drop-shadow(0 8px 9px rgba(33, 65, 75, .13));
}

.energy-scene__inverter-light,
.energy-scene__battery-light {
	fill: #a5b8bd;
	transition: fill .35s ease, filter .35s ease;
}

.energy-scene__battery-fill {
	fill: #a9c0c4;
	transition: y .5s ease, height .5s ease, fill .4s ease;
}

.energy-scene__window,
.energy-scene__attic {
	fill: #c3e4ed;
	transition: fill .45s ease, filter .45s ease;
}

/* Étiquettes */
.energy-scene__label rect {
	fill: rgba(255, 255, 255, .88);
	stroke: rgba(65, 101, 114, .14);
	stroke-width: 1;
	filter: drop-shadow(0 4px 8px rgba(33, 65, 75, .08));
}

.energy-scene__label text {
	fill: #3f5b67;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .09em;
}

/* Barre de lumière du jour */
.energy-scene__daylight {
	position: absolute;
	inset: 0 auto 0 0;
	z-index: 3;
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, .45);
	pointer-events: none;
}

.energy-scene__daylight span {
	display: block;
	width: var(--daylight-progress, 50%);
	height: 100%;
	background: linear-gradient(90deg, #e68a36, #ffd36c);
	box-shadow: 0 0 14px rgba(255, 195, 77, .75);
	transition: width .3s ease;
}

/* ---------- Contrôles ---------- */

.energy-scene__controls {
	padding: 24px clamp(18px, 3vw, 34px) 22px;
}

.energy-scene__time-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.energy-scene__time-readout {
	display: grid;
	gap: 3px;
}

.energy-scene__time-readout > span:first-child {
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -.045em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.energy-scene__state {
	color: #5d7480;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12.5px;
	line-height: 1.45;
}

.energy-scene__play {
	display: inline-flex;
	min-height: 46px;
	flex: 0 0 auto;
	align-items: center;
	gap: 9px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 999px;
	color: #fff;
	background: linear-gradient(135deg, #0a93cf, #076a9a);
	box-shadow: 0 10px 22px -8px rgba(7, 106, 154, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.energy-scene__play:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 26px -10px rgba(7, 106, 154, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
	filter: brightness(1.05);
}

.energy-scene__play:active {
	transform: translateY(0);
}

.energy-scene__play:focus-visible,
.energy-scene__range:focus-visible {
	outline: 3px solid rgba(0, 147, 217, .32);
	outline-offset: 3px;
}

.energy-scene__play svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.energy-scene__pause-icon,
.energy-scene__play[aria-pressed="true"] .energy-scene__play-icon,
.energy-scene__play[aria-pressed="false"] .energy-scene__pause-icon {
	display: none;
}

.energy-scene__play[aria-pressed="true"] .energy-scene__pause-icon {
	display: block;
}

.energy-scene__range-label {
	display: block;
	margin: 24px 0 8px;
	color: #385663;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
}

.energy-scene__range {
	display: block;
	width: 100%;
	height: 26px;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	cursor: pointer;
}

.energy-scene__range::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 99px;
	background: linear-gradient(90deg, #2d4a66, #f0a979 18%, #f3c169 50%, #f0a979 82%, #2d4a66);
}

.energy-scene__range::-moz-range-track {
	height: 6px;
	border-radius: 99px;
	background: linear-gradient(90deg, #2d4a66, #f0a979 18%, #f3c169 50%, #f0a979 82%, #2d4a66);
}

.energy-scene__range::-webkit-slider-thumb {
	width: 22px;
	height: 22px;
	margin-top: -8px;
	appearance: none;
	-webkit-appearance: none;
	border: 4px solid #fff;
	border-radius: 50%;
	background: #e68a36;
	box-shadow: 0 2px 10px rgba(36, 66, 77, .35), 0 0 0 6px rgba(230, 138, 54, .14);
	transition: transform .15s ease;
}

.energy-scene__range:active::-webkit-slider-thumb {
	transform: scale(1.12);
}

.energy-scene__range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 4px solid #fff;
	border-radius: 50%;
	background: #e68a36;
	box-shadow: 0 2px 10px rgba(36, 66, 77, .35), 0 0 0 6px rgba(230, 138, 54, .14);
}

.energy-scene__range-ends {
	display: flex;
	justify-content: space-between;
	margin-top: 2px;
	color: #7a8e98;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10px;
}

.energy-scene__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin: 18px 0 0;
	padding-top: 15px;
	border-top: 1px solid #e8eef0;
	color: #617681;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10.5px;
}

.energy-scene__legend span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.energy-scene__legend i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ffc34d;
	box-shadow: 0 0 0 3px rgba(255, 195, 77, .22);
}

.energy-scene__legend span + span i {
	background: #0785bd;
	box-shadow: 0 0 0 3px rgba(7, 133, 189, .18);
}

/* ---------- Phases du jour ---------- */

.energy-scene__stage[data-phase="day"] .energy-scene__pulse--solar,
.energy-scene__stage[data-phase="morning"] .energy-scene__pulse--solar,
.energy-scene__stage[data-phase="evening"] .energy-scene__pulse--solar {
	opacity: .95;
	animation: energy-flow 1.2s linear infinite;
}

.energy-scene__stage[data-phase="day"] .energy-scene__pulse--battery {
	opacity: .95;
	animation: energy-flow 1.6s linear infinite;
}

.energy-scene__stage[data-phase="day"] .energy-scene__pulse--home,
.energy-scene__stage[data-phase="morning"] .energy-scene__pulse--home,
.energy-scene__stage[data-phase="evening"] .energy-scene__pulse--home {
	opacity: .9;
	animation: energy-flow 1.4s linear infinite;
}

.energy-scene__stage[data-phase="night"] .energy-scene__pulse--battery {
	opacity: .95;
	stroke: #29b0ea;
	filter: drop-shadow(0 0 5px rgba(41, 176, 234, .9));
	animation: energy-flow 1.6s linear infinite reverse;
}

.energy-scene__stage[data-phase="night"] .energy-scene__pulse--home {
	opacity: .9;
	stroke: #29b0ea;
	filter: drop-shadow(0 0 5px rgba(41, 176, 234, .9));
	animation: energy-flow 1.3s linear infinite;
}

.energy-scene__stage[data-phase="day"] .energy-scene__inverter-light,
.energy-scene__stage[data-phase="morning"] .energy-scene__inverter-light,
.energy-scene__stage[data-phase="evening"] .energy-scene__inverter-light {
	fill: #5aca93;
	filter: drop-shadow(0 0 4px rgba(90, 202, 147, .8));
}

.energy-scene__stage[data-phase="night"] .energy-scene__battery-light {
	fill: #29b0ea;
	filter: drop-shadow(0 0 5px rgba(41, 176, 234, .85));
}

.energy-scene__stage[data-phase="day"] .energy-scene__window,
.energy-scene__stage[data-phase="morning"] .energy-scene__window,
.energy-scene__stage[data-phase="evening"] .energy-scene__window {
	fill: #ffdc88;
	filter: drop-shadow(0 0 5px rgba(255, 204, 105, .7));
}

.energy-scene__stage[data-phase="night"] .energy-scene__window,
.energy-scene__stage[data-phase="night"] .energy-scene__attic {
	fill: #ffe6a1;
	filter: drop-shadow(0 0 9px rgba(255, 210, 111, .95));
}

.energy-scene__stage[data-phase="night"] .energy-scene__sun-aura,
.energy-scene__stage[data-phase="night"] .energy-scene__sun-halo,
.energy-scene__stage[data-phase="night"] .energy-scene__sun-core,
.energy-scene__stage[data-phase="night"] .energy-scene__sun-rays,
.energy-scene__stage[data-phase="night"] .energy-scene__sunbeam {
	opacity: .22;
}

/* Indicateurs selon la phase */
.energy-scene:has([data-phase="morning"]) .energy-scene__metric--solar { --level: 42%; }
.energy-scene:has([data-phase="morning"]) .energy-scene__metric--battery { --level: 28%; }
.energy-scene:has([data-phase="morning"]) .energy-scene__metric--home { --level: 55%; }

.energy-scene:has([data-phase="day"]) .energy-scene__metric--solar { --level: 100%; }
.energy-scene:has([data-phase="day"]) .energy-scene__metric--battery { --level: 74%; }
.energy-scene:has([data-phase="day"]) .energy-scene__metric--home { --level: 62%; }

.energy-scene:has([data-phase="evening"]) .energy-scene__metric--solar { --level: 30%; }
.energy-scene:has([data-phase="evening"]) .energy-scene__metric--battery { --level: 92%; }
.energy-scene:has([data-phase="evening"]) .energy-scene__metric--home { --level: 70%; }

.energy-scene:has([data-phase="night"]) .energy-scene__metric--solar { --level: 0%; }
.energy-scene:has([data-phase="night"]) .energy-scene__metric--battery { --level: 58%; }
.energy-scene:has([data-phase="night"]) .energy-scene__metric--home { --level: 48%; }

.energy-scene:has([data-phase="night"]) .energy-scene__metric--solar .energy-scene__metric-name::after { content: "À l’arrêt"; }
.energy-scene:has([data-phase="night"]) .energy-scene__metric--battery .energy-scene__metric-name::after { content: "Se décharge"; }
.energy-scene:has([data-phase="night"]) .energy-scene__metric--home .energy-scene__metric-name::after { content: "Alimentée par la batterie"; }
.energy-scene:has([data-phase="evening"]) .energy-scene__metric--solar .energy-scene__metric-name::after { content: "En baisse"; }
.energy-scene:has([data-phase="day"]) .energy-scene__metric--solar .energy-scene__metric-name::after { content: "Maximale"; }
.energy-scene:has([data-phase="day"]) .energy-scene__metric--battery .energy-scene__metric-name::after { content: "Se recharge"; }

/* ---------- Keyframes ---------- */

@keyframes energy-flow { to { stroke-dashoffset: -34; } }
@keyframes energy-sunbeam { to { stroke-dashoffset: -30; } }
@keyframes energy-cloud-drift { from { translate: -12px 0; } to { translate: 28px 0; } }
@keyframes energy-spin { to { rotate: 360deg; } }
@keyframes energy-breathe { 0%, 100% { scale: 1; opacity: .85; } 50% { scale: 1.12; opacity: 1; } }
@keyframes energy-twinkle { 0%, 100% { opacity: .95; } 50% { opacity: .3; } }
@keyframes energy-ping { from { transform: scale(1); opacity: .6; } to { transform: scale(3.2); opacity: 0; } }
@keyframes energy-shine {
	0%, 55% { translate: -60px 0; }
	100% { translate: 420px 0; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.energy-scene__inner { grid-template-columns: 1fr; gap: 30px; }
	.energy-scene__heading { max-width: 680px; }
	.energy-scene__heading h2 br { display: none; }
	.energy-scene__heading h2 { max-width: 700px; }
	.energy-scene__heading > p:not(.energy-scene__eyebrow, .energy-scene__note) { max-width: 680px; }
	.energy-scene__metrics { max-width: 520px; }
	.energy-scene__note { max-width: 600px; }
}

@media (max-width: 600px) {
	.energy-scene { padding: 50px 16px; }
	.energy-scene__inner { gap: 24px; }
	.energy-scene__heading h2 { font-size: clamp(36px, 10vw, 48px); }
	.energy-scene__heading > p:not(.energy-scene__eyebrow, .energy-scene__note) { margin-top: 14px; font-size: 14px; }
	.energy-scene__metrics { margin-top: 22px; gap: 12px; }
	.energy-scene__note { margin-top: 18px; }
	.energy-scene__stage { border-radius: 20px; }
	.energy-scene__controls { padding: 18px 16px 16px; }
	.energy-scene__time-row { align-items: flex-start; gap: 10px; }
	.energy-scene__time-readout { min-width: 0; }
	.energy-scene__time-readout > span:first-child { font-size: 26px; }
	.energy-scene__state { max-width: 200px; font-size: 10.5px; }
	.energy-scene__play { min-height: 42px; gap: 6px; padding: 0 14px 0 11px; font-size: 10.5px; }
	.energy-scene__play svg { width: 14px; height: 14px; }
	.energy-scene__range-label { margin-top: 18px; }
	.energy-scene__range-ends { font-size: 9px; }
	.energy-scene__legend { gap: 8px 12px; font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.energy-scene *,
	.energy-scene *::before,
	.energy-scene *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}

	.energy-scene__sky-glow,
	.energy-scene__sky::before,
	.energy-scene__sky::after,
	.energy-scene__battery-fill,
	.energy-scene__window,
	.energy-scene__daylight span,
	.energy-scene__metric-bar i {
		transition: none !important;
	}
}

/* ==========================================================
   Compteur kWh + flux proportionnels (piloté par energy-scene-extra.js)
   ========================================================== */

.energy-scene__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	border-top: 1px solid #e8eef0;
}

.energy-scene__stat {
	display: grid;
	gap: 6px;
	padding: 18px clamp(14px, 2vw, 26px);
}

.energy-scene__stat + .energy-scene__stat {
	border-left: 1px solid #eef3f5;
}

.energy-scene__stat-label {
	color: #7a8e98;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.energy-scene__stat-value {
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 700;
	letter-spacing: -.045em;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.energy-scene__stat-value small {
	margin-left: 2px;
	color: #7a8e98;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0;
}

.energy-scene__stat--solar .energy-scene__stat-value b { color: #d98a1f; }
.energy-scene__stat--battery .energy-scene__stat-value b { color: #0785bd; }

/* Flux : épaisseur, opacité et vitesse suivent l'ensoleillement exact */
.energy-scene .energy-scene__stage:not([data-phase="night"]) .energy-scene__pulse--solar {
	stroke-width: calc(3px + var(--flow-solar, .5) * 5px);
	opacity: calc(var(--flow-solar, .5) * 1.4);
	animation-duration: calc(2.4s - var(--flow-solar, .5) * 1.5s);
}

.energy-scene .energy-scene__stage[data-battery] .energy-scene__pulse--battery {
	stroke-width: calc(3px + var(--flow-battery, .5) * 4px);
	animation-duration: calc(2.4s - var(--flow-battery, .5) * 1.4s);
}

.energy-scene .energy-scene__stage[data-battery="charging"] .energy-scene__pulse--battery {
	stroke: #ffc34d;
	filter: drop-shadow(0 0 4px rgba(255, 195, 77, .9));
	opacity: calc(.35 + var(--flow-battery, .5) * .65);
	animation-name: energy-flow;
	animation-direction: normal;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

.energy-scene .energy-scene__stage[data-battery="discharging"] .energy-scene__pulse--battery {
	stroke: #29b0ea;
	filter: drop-shadow(0 0 5px rgba(41, 176, 234, .9));
	opacity: calc(.35 + var(--flow-battery, .5) * .65);
	animation-name: energy-flow;
	animation-direction: reverse;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

.energy-scene .energy-scene__stage[data-battery="idle"] .energy-scene__pulse--battery {
	opacity: 0;
	animation: none;
}

/* Maison : jaune si alimentée par le solaire, bleu si par la batterie */
.energy-scene .energy-scene__stage[data-battery] .energy-scene__pulse--home {
	stroke-width: calc(3px + var(--flow-home, .5) * 4px);
	opacity: calc(.4 + var(--flow-home, .5) * .6);
	animation: energy-flow calc(2.2s - var(--flow-home, .5) * 1.2s) linear infinite;
}

.energy-scene .energy-scene__stage[data-battery="discharging"] .energy-scene__pulse--home {
	stroke: #29b0ea;
	filter: drop-shadow(0 0 5px rgba(41, 176, 234, .9));
}

.energy-scene .energy-scene__stage[data-battery="charging"] .energy-scene__pulse--home,
.energy-scene .energy-scene__stage[data-battery="idle"] .energy-scene__pulse--home {
	stroke: #ffc34d;
	filter: drop-shadow(0 0 4px rgba(255, 195, 77, .9));
}

/* Lumière : l'ambiance suit l'ensoleillement */
.energy-scene__stage .energy-scene__sky-glow {
	opacity: calc(.2 + var(--sun, .5) * .8);
}

.energy-scene__stage .energy-scene__sunbeam {
	opacity: calc(.1 + var(--sun, .5) * .9);
}

@media (max-width: 600px) {
	.energy-scene__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.energy-scene__stat { padding: 14px 16px; }
	.energy-scene__stat:nth-child(odd) { border-left: 0; }
	.energy-scene__stat:nth-child(n + 3) { border-top: 1px solid #eef3f5; }
}

/* Nuit avec batterie au minimum : plus d'énergie à envoyer vers la maison */
.energy-scene .energy-scene__stage[data-phase="night"][data-battery="idle"] .energy-scene__pulse--home {
	opacity: 0;
	animation: none;
}

/* ==========================================================
   Scénarios, météo, graphique, infobulles, simulateur
   ========================================================== */

/* ---------- Onglets de scénario ---------- */
.energy-scene__tabs {
	display: flex;
	gap: 6px;
	padding: 12px 14px;
	overflow-x: auto;
	background: #fbfdfd;
	border-bottom: 1px solid #e8eef0;
	scrollbar-width: none;
}

.energy-scene__tabs::-webkit-scrollbar { display: none; }

.energy-scene__tab {
	flex: 0 0 auto;
	padding: 9px 17px;
	border: 0;
	border-radius: 999px;
	color: #5d7480;
	background: transparent;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background .2s ease, color .2s ease;
}

.energy-scene__tab:hover { background: #eef6f9; }

.energy-scene__tab[aria-selected="true"] {
	color: #fff;
	background: var(--energy-ink);
}

.energy-scene__tab:focus-visible {
	outline: 3px solid rgba(0, 147, 217, .3);
	outline-offset: 2px;
}

/* Décors selon le scénario */
.energy-scene__pump,
.energy-scene__shop { display: none; }

.energy-scene__stage[data-scenario="pump"] .energy-scene__home,
.energy-scene__stage[data-scenario="shop"] .energy-scene__home { display: none; }

.energy-scene__stage[data-scenario="pump"] .energy-scene__pump,
.energy-scene__stage[data-scenario="shop"] .energy-scene__shop {
	display: inline;
	animation: energy-fade .5s ease both;
}

.energy-scene__pump,
.energy-scene__shop { filter: drop-shadow(0 8px 9px rgba(33, 65, 75, .13)); }

.energy-scene__tank-fill {
	fill: #6cc3ec;
	transition: y .5s ease, height .5s ease;
}

.energy-scene__water {
	fill: none;
	stroke: #4ab3e3;
	stroke-dasharray: 2 12;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 4;
	opacity: 0;
}

.energy-scene__stage[data-pump="on"] .energy-scene__water {
	opacity: .95;
	animation: energy-flow 1s linear infinite;
}

/* ---------- Éléments cliquables ---------- */
.energy-scene .energy-scene__part {
	cursor: pointer;
	outline: none;
	transition: filter .25s ease;
}

.energy-scene .energy-scene__part:hover,
.energy-scene .energy-scene__part:focus-visible {
	filter: drop-shadow(0 0 9px rgba(7, 133, 189, .6)) drop-shadow(0 8px 9px rgba(33, 65, 75, .13));
}

.energy-scene__info {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 5;
	max-width: min(330px, calc(100% - 32px));
	padding: 14px 40px 14px 16px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 16px 40px -10px rgba(18, 54, 75, .35);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	animation: energy-fade .25s ease both;
}

.energy-scene__info[hidden] { display: none; }

.energy-scene__info strong {
	display: block;
	margin-bottom: 4px;
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: 14px;
}

.energy-scene__info p {
	margin: 0;
	color: #4f6772;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12.5px;
	line-height: 1.6;
}

.energy-scene__info-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	color: #5d7480;
	background: #eef4f6;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}

.energy-scene__hint {
	color: #8aa0aa;
	font-style: italic;
}

/* ---------- Météo ---------- */
.energy-scene .energy-scene__weather {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	min-width: 0;
	margin: 18px 0 0;
	padding: 0;
	border: 0;
}

.energy-scene .energy-scene__weather legend {
	float: left;
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	color: #385663;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
}

.energy-scene__seg {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 3px;
	border-radius: 999px;
	background: #eef4f6;
}

.energy-scene .energy-scene__seg label {
	position: relative;
	display: block;
	margin: 0;
	max-width: none;
	cursor: pointer;
}

.energy-scene .energy-scene__seg input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.energy-scene__seg span {
	display: block;
	padding: 7px 14px;
	border-radius: 999px;
	color: #5d7480;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11.5px;
	font-weight: 700;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.energy-scene__seg input:checked + span {
	color: var(--energy-ink);
	background: #fff;
	box-shadow: 0 2px 8px rgba(28, 66, 81, .14);
}

.energy-scene__seg input:focus-visible + span {
	outline: 3px solid rgba(0, 147, 217, .3);
	outline-offset: 1px;
}

.energy-scene__cloud--three { top: 14%; left: 30%; transform: scale(1.1); animation-duration: 37s; animation-delay: -6s; opacity: 0; }
.energy-scene__cloud--four { top: 30%; left: 72%; transform: scale(.9); animation-duration: 29s; animation-delay: -18s; opacity: 0; }

.energy-scene__veil {
	position: absolute;
	inset: 0;
	z-index: 3;
	background: linear-gradient(180deg, rgba(94, 112, 122, .6), rgba(150, 168, 176, .2));
	opacity: 0;
	pointer-events: none;
	transition: opacity .8s ease;
}

.energy-scene__stage[data-weather="overcast"] .energy-scene__veil { opacity: .6; }
.energy-scene__stage[data-weather="variable"] .energy-scene__veil { opacity: calc((1 - var(--weather, 1)) * .55); }

.energy-scene__stage[data-weather="variable"] .energy-scene__cloud,
.energy-scene__stage[data-weather="overcast"] .energy-scene__cloud {
	opacity: .9;
	background: rgba(232, 239, 242, .96);
}

.energy-scene__stage[data-weather="variable"] .energy-scene__cloud { animation-duration: 14s; }

.energy-scene__stage[data-phase][data-weather] .energy-scene__cloud { transition: opacity .8s ease; }

.energy-scene .energy-scene__stage[data-phase="night"][data-weather] .energy-scene__cloud { opacity: .12; }

.energy-scene__sun { opacity: calc(.3 + var(--weather, 1) * .7); }

/* ---------- Graphique ---------- */
.energy-scene__chart {
	padding: 14px clamp(14px, 2.2vw, 28px) 20px;
	border-top: 1px solid #e8eef0;
}

.energy-scene__chart-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
	margin-bottom: 8px;
	color: #385663;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11.5px;
	font-weight: 700;
}

.energy-scene__chart-head span + span {
	color: #8aa0aa;
	font-style: italic;
	font-weight: 500;
}

.energy-scene__chart svg {
	display: block;
	width: 100%;
	height: auto;
	cursor: ew-resize;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}

.energy-scene__c-grid { stroke: #e8eef0; stroke-width: 1; }
.energy-scene__c-tick { fill: #7a8e98; font-family: "DM Sans", Arial, sans-serif; font-size: 10px; }
.energy-scene__c-prod { fill: rgba(240, 166, 58, .24); }
.energy-scene__c-prod-line { fill: none; stroke: #e68a36; stroke-width: 2.2; stroke-linejoin: round; }
.energy-scene__c-load { fill: none; stroke: #0785bd; stroke-width: 2.2; stroke-linejoin: round; }
.energy-scene__c-soc { fill: none; stroke: #4fbf8b; stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.energy-scene__c-cursor { stroke: var(--energy-ink); stroke-opacity: .35; stroke-width: 1.5; }
.energy-scene__c-dot { stroke: #fff; stroke-width: 2; }

.energy-scene__chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 10px 0 0;
	color: #617681;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10.5px;
}

.energy-scene__chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.energy-scene__chart-legend i { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Simulateur ---------- */
.energy-scene__lab {
	position: relative;
	width: min(1240px, 100%);
	margin: clamp(36px, 5vw, 64px) auto 0;
	padding: clamp(22px, 3.4vw, 46px);
	border-radius: 28px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(37, 84, 103, .07), 0 34px 80px -16px rgba(28, 66, 81, .2);
}

.energy-scene__lab-head { max-width: 640px; margin-bottom: 28px; }

.energy-scene__lab-head h3 {
	margin: 0;
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: clamp(28px, 3.4vw, 42px);
	font-weight: 700;
	letter-spacing: -.05em;
	line-height: 1.06;
}

.energy-scene__lab-head h3 em {
	background: linear-gradient(100deg, #0785bd, #29a8d6 60%, #e68a36);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 400;
}

.energy-scene__lab-head > p:last-child {
	margin: 14px 0 0;
	color: var(--energy-muted);
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.7;
}

.energy-scene__lab-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: clamp(24px, 4vw, 52px);
	align-items: start;
}

.energy-scene .energy-scene__appliances {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.energy-scene .energy-scene__appliance {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	max-width: none;
	margin: 0;
	padding: 15px 16px;
	border-radius: 16px;
	background: #f3f8f9;
	cursor: pointer;
	font-weight: 400;
	transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.energy-scene__appliance:hover { transform: translateY(-1px); background: #ecf4f7; }

.energy-scene .energy-scene__appliance input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.energy-scene__appliance-body { display: grid; gap: 3px; min-width: 0; }

.energy-scene__appliance-body b {
	color: var(--energy-ink);
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}

.energy-scene__appliance-body small {
	color: #7a8e98;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	line-height: 1.4;
}

.energy-scene__appliance-check {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #dbe7ec;
	transition: background .2s ease;
}

.energy-scene__appliance-check::after {
	position: absolute;
	top: 5px;
	left: 7px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	content: "";
	opacity: 0;
	transform: rotate(40deg);
}

.energy-scene__appliance:has(input:checked) {
	background: #e8f5fb;
	box-shadow: inset 0 0 0 1.5px #0785bd;
}

.energy-scene__appliance:has(input:checked) .energy-scene__appliance-check { background: #0785bd; }
.energy-scene__appliance:has(input:checked) .energy-scene__appliance-check::after { opacity: 1; }
.energy-scene__appliance:has(input:focus-visible) { outline: 3px solid rgba(0, 147, 217, .3); outline-offset: 2px; }

.energy-scene__res-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
}

.energy-scene__res {
	display: grid;
	gap: 4px;
	padding: 16px;
	border-radius: 16px;
	background: #f3f8f9;
}

.energy-scene__res span,
.energy-scene__savings span {
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.energy-scene__res span { color: #7a8e98; }

.energy-scene__res b {
	color: var(--energy-ink);
	font-family: Manrope, Arial, sans-serif;
	font-size: clamp(20px, 2vw, 26px);
	font-weight: 700;
	letter-spacing: -.04em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.energy-scene__res small,
.energy-scene__savings small {
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	line-height: 1.4;
}

.energy-scene__res small { color: #7a8e98; }

.energy-scene__savings {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-top: 12px;
	padding: 20px 22px;
	border-radius: 18px;
	color: #fff;
	background: linear-gradient(135deg, #0f3247, #0d5a7d);
}

.energy-scene__savings > div { display: grid; gap: 4px; }
.energy-scene__savings span { color: rgba(255, 255, 255, .62); }

.energy-scene__savings b {
	font-family: Manrope, Arial, sans-serif;
	font-size: clamp(17px, 1.8vw, 24px);
	font-weight: 700;
	letter-spacing: -.035em;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.energy-scene__savings small { color: rgba(255, 255, 255, .6); }

.energy-scene__assumptions {
	margin: 14px 0 0;
	color: #7a8e98;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 11px;
	line-height: 1.65;
}

.energy-scene__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.energy-scene__btn {
	min-height: 46px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.energy-scene__btn:hover { transform: translateY(-2px); }
.energy-scene__btn:focus-visible { outline: 3px solid rgba(0, 147, 217, .32); outline-offset: 3px; }

.energy-scene__btn--primary {
	color: #fff;
	background: linear-gradient(135deg, #0a93cf, #076a9a);
	box-shadow: 0 10px 22px -8px rgba(7, 106, 154, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.energy-scene__btn--ghost { color: #07577f; background: #eef4f6; }

/* ---------- Performance : animations en pause hors écran ---------- */
.energy-scene.is-offscreen *,
.energy-scene.is-offscreen *::before,
.energy-scene.is-offscreen *::after { animation-play-state: paused !important; }

@keyframes energy-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
	.energy-scene__lab-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
	.energy-scene__lab { border-radius: 20px; }
	.energy-scene .energy-scene__appliances { grid-template-columns: 1fr; }
	.energy-scene__savings { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
	.energy-scene__info { top: 10px; left: 10px; max-width: calc(100% - 20px); }
	.energy-scene__btn { flex: 1 1 100%; }
}

/* Texte d'introduction aligné en haut de sa colonne (plus de vide au-dessus) */
.energy-scene__inner {
	align-items: start;
}

.energy-scene__heading {
	padding-top: clamp(4px, 1vw, 14px);
}

@media (max-width: 900px) {
	.energy-scene__heading { padding-top: 0; }
}