/* ==========================================================================
   STUDIO 64 · Le ciel de Bruxelles (bannières des tableaux de bord)
   Dessiné par scene.js (centre d'administration, espace junior, espace
   client), qui pose les couleurs et la position de l'astre chaque minute
   en variables CSS :
     --c-haut, --c-milieu, --c-horizon   le dégradé du ciel
     --ax, --ay                          l'astre (soleil ou lune)
     --nuit, --lumieres, --dore, --jour  de 0 à 1 : étoiles, fenêtres, lueur dorée, clarté
     --ville-loin, --ville-pres, --nuage les silhouettes et les nuages
   Chaque bannière qui l'accueille donne sa couleur de fond en --ciel-voile :
   le texte reste sur un voile de cette couleur, le ciel s'ouvre à droite.
   ========================================================================== */
.hero-illu.ciel {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  border-radius: inherit; container-type: inline-size; contain: paint;
  --c-haut: #9CC6EE; --c-milieu: #CFE0EE; --c-horizon: #F5EBDA;
  --nuit: 0; --lumieres: 0; --dore: 0; --jour: 1; --ax: 70%; --ay: 30%;
  --ville-loin: #8C93A8; --ville-pres: #5D6276; --nuage: rgba(255,255,255,.88);
}
.ciel > * { position: absolute; }
.ciel-fond, .ciel-halo, .ciel-etoiles, .ciel-nuages, .ciel-ombre, .ciel-voile { inset: 0; }
.ciel-fond { background: linear-gradient(180deg, var(--c-haut) 0%, var(--c-milieu) 56%, var(--c-horizon) 100%); }
/* La lumière de l'astre, et la lueur dorée qui s'étale sur l'horizon au lever et au coucher. */
.ciel-halo {
  background:
    radial-gradient(260px 220px at var(--ax) var(--ay), rgba(255,238,196,calc(.6 * var(--jour))), transparent 70%),
    radial-gradient(70% 60% at var(--ax) 105%, rgba(255,164,96,calc(.62 * var(--dore))), transparent 72%),
    radial-gradient(40% 50% at var(--ax) var(--ay), rgba(205,215,255,calc(.18 * var(--nuit))), transparent 70%);
  transition: background-position 60s linear;
}

/* ── Les étoiles, et une étoile filante de temps en temps ── */
.ciel-etoiles { opacity: var(--nuit); }
.ciel-etoiles i { position: absolute; border-radius: 50%; background: #FFF6E2; box-shadow: 0 0 5px rgba(255,246,226,.85); animation: cielScintille 4.2s ease-in-out infinite; }
.ciel-etoiles i:nth-child(3n) { animation-duration: 6.4s; }
.ciel-etoiles i:nth-child(5n) { animation-duration: 3.1s; }
@keyframes cielScintille { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.ciel-filante {
  top: 14%; left: 78%; width: 130px; height: 1.6px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,250,235,.95));
  transform: rotate(-17deg); transform-origin: 100% 50%;
  animation: cielFilante 17s linear infinite 4s;
}
@keyframes cielFilante {
  0%, 86% { opacity: 0; transform: rotate(-17deg) translateX(0) scaleX(.2); }
  88% { opacity: calc(var(--nuit)); transform: rotate(-17deg) translateX(-30px) scaleX(1); }
  94% { opacity: 0; transform: rotate(-17deg) translateX(-260px) scaleX(.6); }
  100% { opacity: 0; }
}

/* ── Le soleil, la lune ── */
.ciel-astre {
  left: var(--ax); top: var(--ay); width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; overflow: hidden;
  transition: left 60s linear, top 60s linear;
}
.ciel-astre.soleil {
  background: radial-gradient(circle at 40% 38%, #FFFBEE 0%, #FFE6AE 52%, #F9B86C 100%);
  box-shadow: 0 0 0 14px rgba(255,236,190,.16), 0 0 80px 24px rgba(255,212,140,.5);
  overflow: visible; animation: cielRespire 8s ease-in-out infinite;
}
.ciel-astre.soleil i { display: none; }
@keyframes cielRespire { 50% { box-shadow: 0 0 0 22px rgba(255,236,190,.1), 0 0 100px 30px rgba(255,212,140,.6); } }
.ciel-astre.lune {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: radial-gradient(circle at 42% 38%, #FFF9EC, #EFE0C4); box-shadow: 0 0 46px 8px rgba(239,224,196,.28);
}
.ciel-astre.lune i { position: absolute; inset: -2px; border-radius: 50%; background: var(--c-haut); transition: transform 1.2s ease; }

/* ── Les nuages, qui dérivent lentement de droite à gauche ── */
.ciel-nuages { opacity: calc(.18 + .82 * var(--jour)); }
.ciel-nuage { position: absolute; left: 100%; height: auto; fill: var(--nuage); animation: cielDerive linear infinite; filter: drop-shadow(0 6px 10px rgba(30,30,60,.06)); }
.ciel-nuage.n1 { top: 9%; width: 170px; animation-duration: 150s; animation-delay: -40s; }
.ciel-nuage.n2 { top: 27%; width: 110px; animation-duration: 210s; animation-delay: -150s; opacity: .8; }
.ciel-nuage.n3 { top: 3%; width: 230px; animation-duration: 260s; animation-delay: -90s; opacity: .7; }
@keyframes cielDerive { from { transform: translateX(0); } to { transform: translateX(calc(-100cqw - 260px)); } }

/* ── Quelques oiseaux, le matin ── */
.ciel-oiseaux { display: none; top: 16%; left: 100%; width: 92px; }
.ciel.oiseaux .ciel-oiseaux { display: block; animation: cielVol 46s linear infinite; }
.ciel-oiseaux svg { width: 100%; fill: none; stroke: var(--ville-pres); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation: cielBattre .9s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes cielVol { 0% { transform: translate(0, 0); } 50% { transform: translate(calc(-50cqw - 46px), -14px); } 100% { transform: translate(calc(-100cqw - 92px), 6px); } }
@keyframes cielBattre { 50% { transform: scaleY(.55); } }

/* ── Bruxelles en silhouette ── */
.ciel-ville { right: 0; bottom: -1px; width: min(880px, 74%); height: auto; overflow: visible; }
.ciel-loin { fill: var(--ville-loin); opacity: .82; transition: fill 2s; }
.ciel-pres { fill: var(--ville-pres); transition: fill 2s; }
.ciel-atomium circle { fill: var(--ville-loin); }
.ciel-atomium path { fill: none; stroke: var(--ville-loin); stroke-width: 3.4; stroke-linecap: round; }
.ciel-enseigne rect { fill: var(--ville-pres); }
.ciel-enseigne rect:nth-of-type(3) { fill: #9D382A; filter: drop-shadow(0 0 calc(10px * var(--lumieres)) rgba(255,130,80,calc(.9 * var(--lumieres)))); }
.ciel-enseigne text { fill: #FFF1DA; font: 800 12.5px/1 "Montserrat", system-ui, sans-serif; letter-spacing: -.02em; }
.ciel-fen { fill: #FFD98A; opacity: calc(.95 * var(--lumieres)); animation: cielFenetre 11s ease-in-out infinite; animation-delay: calc(var(--k) * -1.7s); }
.ciel-fen:nth-child(4n) { animation-duration: 17s; }
@keyframes cielFenetre { 0%, 70%, 100% { opacity: calc(.95 * var(--lumieres)); } 78% { opacity: calc(.2 * var(--lumieres)); } }

/* Thème sombre : le même ciel, adouci, pour ne pas éblouir. */
.ciel-ombre { display: none; background: rgba(10,10,16,.34); }
html.adm-sombre .ciel-ombre, html[data-theme="dark"] .ciel-ombre, html.ec-sombre .ciel-ombre { display: block; }

/* Le voile : le texte de la bannière reste sur sa couleur de fond, le ciel s'ouvre à droite. */
.ciel-voile {
  background: linear-gradient(90deg,
    var(--ciel-voile, #FFFEFB) 0%, var(--ciel-voile, #FFFEFB) 30%,
    color-mix(in srgb, var(--ciel-voile, #FFFEFB) 84%, transparent) 42%,
    color-mix(in srgb, var(--ciel-voile, #FFFEFB) 34%, transparent) 57%, transparent 72%);
}

.ciel.entree { animation: cielEntre 1.4s ease both; }
@keyframes cielEntre { from { opacity: 0; } }
.ciel.calme *, .ciel.calme { animation: none !important; transition: none !important; }
.ciel.calme .ciel-nuage.n1 { left: 62%; } .ciel.calme .ciel-nuage.n2 { left: 80%; } .ciel.calme .ciel-nuage.n3 { left: 70%; }
@media (prefers-reduced-motion: reduce) { .ciel *, .ciel { animation: none !important; transition: none !important; } }

/* Écran étroit : le ciel en bandeau au-dessus du texte. */
@media (max-width: 720px) {
  .ciel-ville { width: 120%; right: -10%; bottom: auto; top: 66px; }
  .ciel-voile { background: linear-gradient(180deg, transparent 0, transparent 92px, color-mix(in srgb, var(--ciel-voile, #FFFEFB) 88%, transparent) 132px, var(--ciel-voile, #FFFEFB) 160px); }
  .ciel-astre { top: calc(12px + var(--ayn, .3) * 96px); }
  .ciel-astre.soleil { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .ciel-halo { background: radial-gradient(200px 160px at var(--ax) calc(12px + var(--ayn, .3) * 96px), rgba(255,238,196,calc(.6 * var(--jour))), transparent 70%), radial-gradient(70% 120px at var(--ax) 120px, rgba(255,164,96,calc(.62 * var(--dore))), transparent 72%); }
  .ciel-etoiles i { top: auto; }
}

/* ── Les bannières qui l'accueillent ── */
.dash-hero, .hero, .eq-ciel { --ciel-voile: var(--surface); }
/* Centre d'administration, onglet « Espace client » : la bannière à l'encre garde son fond sous le texte clair. */
#view-espace .xjour { --ciel-voile: var(--ink-deep, #1E1D25); }
#view-espace .xjour > .hero-moment {
  position: absolute; z-index: 3; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 99px;
  font: 600 11.5px/1 var(--f-body, system-ui); color: var(--t1, #26252E);
  background: color-mix(in srgb, var(--surface, #FFFEFB) 74%, transparent); border: 1px solid color-mix(in srgb, var(--border, #E8E1D5) 70%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
#view-espace .xjour > .hero-moment::before { content: ""; margin: 0; width: 8px; height: 8px; border-radius: 50%; background: #F2B866; box-shadow: 0 0 0 3px rgba(242,184,102,.25); }
#view-espace .xjour > .hero-moment:empty { display: none; }
/* Espace client : le moment du ciel, en pastille de verre en haut à droite. */
.hero > .hero-moment {
  position: absolute; z-index: 3; display: inline-flex !important; align-items: center; gap: 7px; top: 14px; right: 16px; height: 26px; padding: 0 11px; border-radius: 99px;
  font: 600 11.5px/1 var(--f-b, system-ui); letter-spacing: 0; color: var(--ink, #1E1D25);
  background: color-mix(in srgb, var(--surface, #FFFEFB) 74%, transparent); border: 1px solid color-mix(in srgb, var(--line, #E8E1D5) 70%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 16px -10px rgba(38,37,46,.3);
}
.hero > .hero-moment::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F2B866; box-shadow: 0 0 0 3px rgba(242,184,102,.25); }
.hero[data-ciel="nuit"] > .hero-moment::before, .hero[data-ciel="crepu"] > .hero-moment::before { background: #E9E2F5; box-shadow: 0 0 0 3px rgba(233,226,245,.2); }
/* Écran étroit : le texte de la bannière client commence sous le bandeau du ciel. */
@media (max-width: 720px) {
  .hero:has(> .ciel) { padding-top: 136px; }
  .hero > .hero-moment { top: 10px; right: 10px; height: auto; min-height: 24px; padding: 5px 10px; font-size: 10.5px; line-height: 1.3; max-width: calc(100% - 20px); }
}
