/* Feuille aussi utilisée par la page d'accueil, dont le haut de page en garde une copie dans index.html :
   après toute modification, lancer « node tools/css-premier-ecran.mjs » (voir ce fichier). */
/* ============================================================
   MPLS — « tapis de lumière »
   Comme la projection lumineuse sous la portière d'une voiture
   de luxe : un faisceau descend, une flaque de lumière s'ouvre
   au sol et le monogramme MPLS s'y dessine.
   1) À l'arrivée sur l'accueil (une fois par visite, environ 5 s :
      le monogramme s'allume dans un éclat, des rayons en sortent,
      des étincelles brillent sur les lettres, puis une grande
      lumière envahit l'écran et s'ouvre sur le site ; un clic ou
      une touche pour passer).
   2) En grand, en haut à droite de « Réservez votre séjour, en
      trois temps » (à la place de l'ancien portrait IA).
   3) En fond, derrière le dernier appel « Prêt à composer… ».
   Aucun fichier vidéo : le logo existant sert de pochoir.
   ============================================================ */

:root {
  --mpls-lumiere: #E9F0F5;           /* blanc froid du faisceau */
  --mpls-halo: rgba(185, 200, 211, 0.55);
  --mpls-acier: rgba(123, 157, 183, 0.45);
}

/* ─── Éléments communs : le sol, la flaque, le monogramme ─── */
.mpls-sol {
  position: absolute;
  left: 50%;
  width: min(92vw, 980px);
  aspect-ratio: 2.2 / 1;
  transform: translateX(-50%);
  pointer-events: none;
}
/* Le « sol » : tout est écrasé en hauteur, comme une projection vue debout à côté de la voiture */
.mpls-plan {
  position: absolute;
  inset: 0;
  transform: scaleY(0.46);
  transform-origin: 50% 50%;
}
.mpls-flaque {
  position: absolute;
  inset: 4% 8%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(233, 240, 245, 0.30) 0%, rgba(185, 200, 211, 0.16) 38%, rgba(123, 157, 183, 0.07) 64%, transparent 100%);
}
.mpls-flaque::after {
  /* anneau fin, comme le bord net d'une projection */
  content: '';
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  border: 1px solid rgba(233, 240, 245, 0.16);
  box-shadow: 0 0 40px rgba(185, 200, 211, 0.12), inset 0 0 40px rgba(185, 200, 211, 0.08);
}
.mpls-halo {
  /* le halo est porté par le parent : le filtre s'applique après le pochoir */
  position: absolute;
  left: 50%; top: 50%;
  width: var(--mpls-taille, 30%);
  aspect-ratio: 584 / 600;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px var(--mpls-halo)) drop-shadow(0 0 22px var(--mpls-acier));
}
.mpls-monogramme {
  width: 100%;
  height: 100%;
  -webkit-mask: url(../../mpl-logo-clair.png) center / contain no-repeat;
          mask: url(../../mpl-logo-clair.png) center / contain no-repeat;
  /* reflet : une bande plus claire qui traverse le monogramme */
  background:
    linear-gradient(105deg, rgba(233, 240, 245, 0.84) 0%, rgba(233, 240, 245, 0.84) 40%, #fff 47%, #fff 53%, rgba(233, 240, 245, 0.84) 60%, rgba(233, 240, 245, 0.84) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
}

/* ─── La lumière qui sort du monogramme : rayons, étincelles, éclat ─── */
/* Les rayons : deux couronnes de traits fins qui tournent lentement en sens contraire */
.mpls-rayons {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--mpls-taille, 30%) * var(--mpls-rayons-k, 2.6));
  aspect-ratio: 1;
  translate: -50% -50%;
  scale: 1 0.62;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: var(--mpls-rayons-o, 0.8);
  -webkit-mask: radial-gradient(closest-side, transparent 14%, #000 24%, rgba(0, 0, 0, 0.55) 52%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 14%, #000 24%, rgba(0, 0, 0, 0.55) 52%, transparent 100%);
}
.mpls-rayons::before,
.mpls-rayons::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(233, 240, 245, 0) 0deg, rgba(233, 240, 245, 0.24) 1.2deg, rgba(233, 240, 245, 0) 3.4deg, rgba(233, 240, 245, 0) 13deg);
  filter: blur(1.2px);
  animation: mpls-tourne 70s linear infinite;
}
.mpls-rayons::after {
  background: repeating-conic-gradient(from 7deg, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0.18) 0.8deg, rgba(255, 255, 255, 0) 2.4deg, rgba(255, 255, 255, 0) 21deg);
  animation-duration: 110s;
  animation-direction: reverse;
}
/* Les étincelles : petites étoiles à quatre branches posées sur les lettres */
.mpls-etincelles {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--mpls-taille, 30%);
  aspect-ratio: 584 / 276;
  translate: -50% -50%;
  pointer-events: none;
}
.mpls-etincelles i {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background:
    radial-gradient(circle, #fff 0, rgba(255, 255, 255, 0.85) 6%, rgba(233, 240, 245, 0.22) 16%, transparent 34%),
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.95) 50%, transparent 100%) center / 100% 1.5px no-repeat,
    linear-gradient(0deg, transparent 0, rgba(255, 255, 255, 0.95) 50%, transparent 100%) center / 1.5px 72% no-repeat;
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px rgba(185, 200, 211, 0.8));
  opacity: 0;
  scale: 0;
}
.mpls-etincelles i:nth-child(1) { left: 8%;  top: 8%; }
.mpls-etincelles i:nth-child(2) { left: 92%; top: 18%; }
.mpls-etincelles i:nth-child(3) { left: 79%; top: 78%; }
.mpls-etincelles i:nth-child(4) { left: 19%; top: 92%; width: 11%; }
.mpls-etincelles i:nth-child(5) { left: 50%; top: 44%; width: 11%; }
@keyframes mpls-tourne { to { rotate: 360deg; } }
@keyframes mpls-scintille {
  0%   { opacity: 0; scale: 0;   rotate: 0deg; }
  40%  { opacity: 1; scale: 1;   rotate: 45deg; }
  100% { opacity: 0; scale: 0;   rotate: 90deg; }
}
@keyframes mpls-scintille-boucle {
  0%, 70%, 100% { opacity: 0; scale: 0;   rotate: 0deg; }
  78%           { opacity: 1; scale: 1;   rotate: 45deg; }
  92%           { opacity: 0; scale: 0.1; rotate: 90deg; }
}
/* Le halo qui rayonne : la lueur autour des lettres gonfle puis retombe */
@keyframes mpls-rayonne {
  0%, 100% { filter: drop-shadow(0 0 6px var(--mpls-halo)) drop-shadow(0 0 22px var(--mpls-acier)); }
  50%      { filter: drop-shadow(0 0 12px rgba(233, 240, 245, 0.9)) drop-shadow(0 0 48px rgba(185, 200, 211, 0.6)); }
}
@keyframes mpls-rayons-respire {
  0%, 100% { opacity: calc(var(--mpls-rayons-o, 0.8) * 0.6); }
  50%      { opacity: var(--mpls-rayons-o, 0.8); }
}

/* ═══════ 1) L'ARRIVÉE SUR LE SITE ═══════ */
/* Intro courte (18/11/2026, règle d'Elsa) : 1re visite seulement, partie à 1,95 s, un toucher la passe, le site se charge derrière.
   Pour la montrer à nouveau (démonstration) : ajouter ?intro à l'adresse. */
.mpls-accueil { display: none; }
.mpls-intro .mpls-accueil {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: radial-gradient(120% 90% at 50% 100%, #131B21 0%, #0E1317 55%, #080B0E 100%);
  cursor: pointer;
  /* la grande lumière se dissout lentement dans le site, sans couper */
  animation: mpls-sortie 0.5s cubic-bezier(0.45, 0, 0.25, 1) 1.45s forwards;
}
.mpls-intro body { overflow: hidden; }
.mpls-intro.mpls-fini body { overflow: auto; }

/* Le faisceau qui descend de la portière */
.mpls-faisceau {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(70vw, 760px);
  height: 66%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(233, 240, 245, 0) 0%, rgba(233, 240, 245, 0.06) 40%, rgba(233, 240, 245, 0.13) 100%);
  clip-path: polygon(47% 0, 53% 0, 88% 100%, 12% 100%);
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 35%, #000 75%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0%, #000 35%, #000 75%, transparent 100%);
  filter: blur(16px);
  opacity: 0;
  animation: mpls-faisceau 0.95s ease 0.05s forwards, mpls-eteint 0.4s ease-in-out 1.15s forwards;
}
.mpls-accueil .mpls-sol {
  top: 56%;
  transform: translate(-50%, -50%);
  animation: mpls-envol 0.45s cubic-bezier(0.45, 0, 0.25, 1) 1.15s forwards;
}
.mpls-accueil .mpls-flaque {
  opacity: 0;
  transform: scale(0.25);
  animation: mpls-flaque 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.mpls-accueil .mpls-halo {
  opacity: 0;
  animation: mpls-allumage 0.45s ease-out 0.3s forwards;
}
.mpls-accueil .mpls-monogramme {
  animation: mpls-reflet 0.6s cubic-bezier(0.45, 0, 0.2, 1) 0.5s forwards;
}
.mpls-nom {
  position: absolute;
  left: 0; right: 0;
  top: calc(56% + min(92vw, 980px) / 2.2 * 0.46 / 2 + 28px);
  text-align: center;
  font-family: 'Cormorant Garamond', Garamond, serif;
  font-weight: 400;
  font-size: clamp(13px, 1.25vw, 17px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(233, 240, 245, 0.86);
  opacity: 0;
  animation: mpls-nom 0.55s ease 0.5s forwards, mpls-envol 0.45s cubic-bezier(0.45, 0, 0.25, 1) 1.15s forwards;
}
.mpls-nom em { font-style: italic; letter-spacing: 0; text-transform: none; color: #B9C8D3; }

/* L'éclat d'allumage : un flash rond et un trait de lumière horizontal */
.mpls-eclat {
  position: absolute;
  left: 50%; top: 50%;
  width: 90%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95) 0%, rgba(233, 240, 245, 0.55) 10%, rgba(185, 200, 211, 0.18) 32%, transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  scale: 0.2;
  animation: mpls-eclat 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}
.mpls-trait {
  position: absolute;
  left: 50%; top: 50%;
  width: 150%;
  height: 3px;
  translate: -50% -50%;
  background: linear-gradient(90deg, transparent 0%, rgba(233, 240, 245, 0.5) 30%, #fff 50%, rgba(233, 240, 245, 0.5) 70%, transparent 100%);
  filter: blur(0.6px) drop-shadow(0 0 6px #fff) drop-shadow(0 0 18px rgba(185, 200, 211, 0.9));
  pointer-events: none;
  opacity: 0;
  scale: 0 1;
  animation: mpls-trait 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.32s forwards;
}
.mpls-accueil .mpls-rayons {
  opacity: 0;
  animation: mpls-rayons-intro 1s ease-out 0.32s forwards;
}
.mpls-accueil .mpls-etincelles i { animation: mpls-scintille 0.45s ease-in-out forwards; }
.mpls-accueil .mpls-etincelles i:nth-child(1) { animation-delay: 0.38s; }
.mpls-accueil .mpls-etincelles i:nth-child(2) { animation-delay: 0.5s; }
.mpls-accueil .mpls-etincelles i:nth-child(3) { animation-delay: 0.62s; }
.mpls-accueil .mpls-etincelles i:nth-child(4) { animation-delay: 0.74s; }
.mpls-accueil .mpls-etincelles i:nth-child(5) { animation-delay: 0.86s; }
/* La grande lumière finale : elle part du monogramme, remplit l'écran,
   puis se dissout dans le haut de page clair */
.mpls-aube {
  position: absolute;
  left: 50%; top: 56%;
  width: 60vmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0%, rgba(250, 250, 248, 0.97) 34%, rgba(244, 244, 241, 0.62) 56%, rgba(233, 240, 245, 0.24) 78%, rgba(233, 240, 245, 0) 100%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  scale: 0.05;
  animation: mpls-aube 0.55s cubic-bezier(0.55, 0, 0.2, 1) 1.05s forwards;
}
@keyframes mpls-eclat {
  0%   { opacity: 0; scale: 0.2; }
  14%  { opacity: 1; scale: 0.75; }
  100% { opacity: 0; scale: 1.5; }
}
@keyframes mpls-trait {
  0%   { opacity: 0; scale: 0 1; }
  22%  { opacity: 1; scale: 1 1; }
  100% { opacity: 0; scale: 1.25 1; }
}
@keyframes mpls-rayons-intro {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  60%  { opacity: 0.7; }
  100% { opacity: 1; }
}
@keyframes mpls-aube {
  0%   { opacity: 0; scale: 0.05; }
  25%  { opacity: 1; }
  100% { opacity: 1; scale: 7.5; }
}

/* On passe l'intro (clic, touche, molette) */
.mpls-intro.mpls-passe .mpls-accueil { animation: mpls-sortie 0.35s ease forwards; }
.mpls-intro.mpls-fini .mpls-accueil { display: none; }

@keyframes mpls-faisceau {
  0% { opacity: 0; }
  25% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0.55; }
}
@keyframes mpls-flaque {
  to { opacity: 1; transform: scale(1); }
}
@keyframes mpls-allumage {
  0% { opacity: 0; filter: blur(10px) drop-shadow(0 0 6px var(--mpls-halo)) drop-shadow(0 0 22px var(--mpls-acier)); }
  30% { opacity: 1; filter: blur(0) drop-shadow(0 0 20px #fff) drop-shadow(0 0 80px rgba(233, 240, 245, 0.85)); }
  100% { opacity: 1; filter: blur(0) drop-shadow(0 0 8px rgba(233, 240, 245, 0.8)) drop-shadow(0 0 30px var(--mpls-acier)); }
}
@keyframes mpls-reflet {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
@keyframes mpls-nom {
  from { opacity: 0; letter-spacing: 0.62em; }
  to { opacity: 1; letter-spacing: 0.42em; }
}
@keyframes mpls-sortie {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
/* la lumière s'éteint : le monogramme et le nom montent un peu, se voilent et disparaissent */
@keyframes mpls-envol {
  to { opacity: 0; translate: 0 -18px; filter: blur(4px) brightness(1.6); }
}
@keyframes mpls-eteint {
  to { opacity: 0; }
}

/* ═══════ 2) EN GRAND, SECTION « EN TROIS TEMPS » ═══════ */
/* Le portrait IA du concierge s'en va : seul le dégradé de fond reste */
.svc-how-wrapper::before {
  background:
    linear-gradient(90deg, rgba(5,7,8,0.86) 0%, rgba(5,7,8,0.68) 42%, rgba(5,7,8,0.30) 74%, rgba(5,7,8,0.04) 100%),
    radial-gradient(circle at 15% 16%, rgba(123,157,183,0.12), transparent 34%);
}
.mpls-grand {
  --mpls-x: 71%;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.mpls-grand .mpls-sol {
  --mpls-taille: 40%;
  --mpls-rayons-k: 2.1;
  --mpls-rayons-o: 0.85;
  left: var(--mpls-x);
  top: 30%;
  width: min(66vw, 940px);
  transform: translate(-50%, -50%);
}
.mpls-grand .mpls-halo {
  animation: mpls-respire-grand 7s ease-in-out infinite, mpls-rayonne 5s ease-in-out infinite;
}
.mpls-grand .mpls-monogramme { animation: mpls-reflet-lent 9s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
/* Le faisceau flou qui descend sur le monogramme */
/* le flou est porté par le parent : il adoucit les bords après la découpe */
.mpls-grand-faisceau {
  position: absolute;
  left: var(--mpls-x);
  top: 0;
  width: min(36vw, 500px);
  height: 31%;
  transform: translateX(-50%);
  filter: blur(18px);
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 30%, #000 82%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0%, #000 30%, #000 82%, transparent 100%);
}
.mpls-grand-faisceau::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(233, 240, 245, 0.02) 0%, rgba(233, 240, 245, 0.07) 45%, rgba(233, 240, 245, 0.13) 100%);
  clip-path: polygon(40% 0, 60% 0, 92% 100%, 8% 100%);
}
/* rayons qui respirent et étincelles qui s'allument tour à tour */
.mpls-grand .mpls-rayons,
.mpl-final-cta .mpls-rayons { animation: mpls-rayons-respire 7s ease-in-out infinite; }
.mpls-grand .mpls-etincelles i,
.mpl-final-cta .mpls-etincelles i { animation: mpls-scintille-boucle 6s ease-in-out infinite; }
.mpls-grand .mpls-etincelles i:nth-child(2), .mpl-final-cta .mpls-etincelles i:nth-child(2) { animation-delay: 1.3s; }
.mpls-grand .mpls-etincelles i:nth-child(3), .mpl-final-cta .mpls-etincelles i:nth-child(3) { animation-delay: 2.5s; }
.mpls-grand .mpls-etincelles i:nth-child(4), .mpl-final-cta .mpls-etincelles i:nth-child(4) { animation-delay: 3.6s; }
.mpls-grand .mpls-etincelles i:nth-child(5), .mpl-final-cta .mpls-etincelles i:nth-child(5) { animation-delay: 4.7s; }
@keyframes mpls-respire-grand {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
/* Écran moyen : un peu plus petit et plus à droite, pour laisser le texte libre */
@media (max-width: 1280px) {
  .mpls-grand { --mpls-x: 76%; }
  .mpls-grand .mpls-sol { width: 56vw; }
  .mpls-grand-faisceau { width: 30vw; }
}
/* Arabe (lecture de droite à gauche) : le sigle passe à gauche, sans être retourné */
html[dir="rtl"] .mpls-grand { --mpls-x: 29%; }
@media (max-width: 1280px) { html[dir="rtl"] .mpls-grand { --mpls-x: 24%; } }
/* Tablette et téléphone : le texte prend toute la largeur, le sigle se retire (comme l'ancien portrait) */
@media (max-width: 960px) {
  .mpls-grand { display: none; }
}

/* ═══════ 3) EN FOND, DERRIÈRE LE DERNIER APPEL ═══════ */
/* La projection se pose sous les boutons, au pied de la section */
.mpl-final-cta { --mpls-l: min(92vw, 980px); padding-bottom: calc(var(--mpls-l) / 2.2 * 0.46 + 96px) !important; }
.mpl-final-cta .mpls-sol {
  --mpls-rayons-k: 2.2;
  --mpls-rayons-o: 0.7;
  bottom: calc(var(--mpls-l) / 2.2 * -0.27 + 28px);
  opacity: 0.9;
  z-index: 0;
}
.mpl-final-cta .mpls-halo { animation: mpls-respire 6s ease-in-out infinite, mpls-rayonne 5s ease-in-out infinite; }
.mpl-final-cta .mpls-monogramme { animation: mpls-reflet-lent 9s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
@keyframes mpls-respire {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.85; }
}
@keyframes mpls-reflet-lent {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: 0% 0; }
}

/* Téléphone : la projection plus grande, au bas de l'écran */
@media (max-width: 760px) {
  .mpls-sol { width: 150vw; --mpls-taille: 40%; }
  .mpls-accueil .mpls-sol { top: 52%; }
  .mpls-faisceau { width: 120vw; height: 70%; }
  .mpls-nom { top: calc(52% + 150vw / 2.2 * 0.46 / 2 + 8px); font-size: 11px; letter-spacing: 0.2em; padding: 0 16px; white-space: nowrap; }
  .mpl-final-cta { --mpls-l: 150vw; }
  @keyframes mpls-nom { from { opacity: 0; letter-spacing: 0.34em; } to { opacity: 1; letter-spacing: 0.2em; } }
}

/* Mouvement réduit : pas d'intro, projection fixe */
@media (prefers-reduced-motion: reduce) {
  .mpls-intro .mpls-accueil { display: none; }
  .mpl-final-cta .mpls-halo, .mpl-final-cta .mpls-monogramme,
  .mpls-grand .mpls-halo, .mpls-grand .mpls-monogramme,
  .mpls-rayons, .mpls-rayons::before, .mpls-rayons::after { animation: none; }
  .mpls-etincelles { display: none; }
}

