/* ==========================================================================
   PADC — LYA : lanceur flottant (robot vert et or, en bas de page, côté fin de
   lecture : à droite en français et en anglais, à gauche en arabe) et bulle
   d'accueil. Seule feuille LYA du chargement initial ; le panneau a la sienne
   (lya.css), chargée au premier clic.
   Animation du lanceur : flottement doux, ondes or et vert, halo pulsé,
   respiration et lueur du robot, anneau en rotation lente, pastille « en ligne ».
   Aucune animation si l'utilisateur réduit les mouvements.
   ========================================================================== */
:root {
  --lya-vert-nuit: #062723;
  --lya-vert-profond: #0b3b33;
  --lya-or: #c9a43a;
  --lya-or-clair: #f0d688;
  --lya-or-pale: #fbf3dc;
}

.lya-zone {
  position: fixed;
  inset-inline-end: max(var(--e-4), env(safe-area-inset-right));
  bottom: max(var(--e-4), env(safe-area-inset-bottom));
  z-index: 70;
}

.lya-lanceur {
  position: relative;
  display: block;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform var(--duree-moyenne) var(--courbe-sortie);
  -webkit-tap-highlight-color: transparent;
}

/* Corps flottant : tout le visuel monte et descend doucement. */
.lya-lanceur__corps {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lya-vert-nuit);
  box-shadow: 0 8px 22px -6px rgba(6, 39, 35, 0.55);
  animation: lya-flotte 4.2s ease-in-out infinite;
  transition: box-shadow var(--duree-moyenne) var(--courbe-standard);
}

.lya-lanceur__cadre {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(240, 214, 136, 0.65);
}

.lya-lanceur__robot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  animation: lya-lueur 5.6s ease-in-out infinite, lya-respire 4.2s ease-in-out infinite;
}

/* Ondes : deux anneaux qui s'élargissent et s'effacent, en alternance or et vert. */
.lya-lanceur__onde {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(240, 214, 136, 0.8);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: lya-onde 3.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.lya-lanceur__onde--2 { border-color: rgba(69, 174, 156, 0.75); animation-delay: 1.8s; }

/* Halo léger, pulsé. */
.lya-lanceur__halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 174, 156, 0.42) 0%, rgba(240, 214, 136, 0.2) 42%, rgba(240, 214, 136, 0) 70%);
  pointer-events: none;
  animation: lya-pouls 3.6s ease-in-out infinite;
}

/* Anneau extérieur : reflets or et vert, rotation lente. */
.lya-lanceur__anneau {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(240, 214, 136, 0), rgba(240, 214, 136, 0.85) 50deg, rgba(240, 214, 136, 0) 110deg, rgba(69, 174, 156, 0) 180deg, rgba(69, 174, 156, 0.7) 235deg, rgba(69, 174, 156, 0) 300deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  pointer-events: none;
  animation: lya-rotation 12s linear infinite;
}

/* Pastille « en ligne ». */
.lya-lanceur__pastille {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2fbf71;
  box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.6);
  animation: lya-pastille 2.4s ease-out infinite;
}

.lya-lanceur:hover,
.lya-lanceur:focus-visible { transform: scale(1.05); }
.lya-lanceur:hover .lya-lanceur__corps,
.lya-lanceur:focus-visible .lya-lanceur__corps { box-shadow: 0 10px 26px -6px rgba(6, 39, 35, 0.6), 0 0 0 3px rgba(240, 214, 136, 0.35); }
.lya-lanceur:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.lya-lanceur:active { transform: scale(0.98); }
.lya-lanceur--chargement .lya-lanceur__anneau { animation-duration: 2.4s; }

/* Étiquette au survol (bureau) : purement visuelle, le nom accessible est sur le bouton. */
.lya-lanceur__bulle {
  position: absolute;
  top: 50%;
  inset-inline-end: calc(100% + 12px);
  padding: 6px 12px;
  border-radius: var(--r-pilule);
  background: var(--lya-vert-profond);
  color: #fff;
  font-size: var(--taille-xs);
  font-weight: 650;
  white-space: nowrap;
  box-shadow: var(--ombre-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity var(--duree-moyenne) var(--courbe-standard), transform var(--duree-moyenne) var(--courbe-sortie);
}
[dir="rtl"] .lya-lanceur__bulle { transform: translate(-6px, -50%); }
.lya-lanceur:hover .lya-lanceur__bulle,
.lya-lanceur:focus-visible .lya-lanceur__bulle { opacity: 1; transform: translate(0, -50%); }

/* --- Bulle d'accueil ------------------------------------------------------------------ */
.lya-bienvenue {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 16px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--e-3);
  align-items: start;
  width: min(21rem, calc(100vw - 2 * var(--e-4)));
  padding: var(--e-4);
  border: 1px solid rgba(201, 164, 58, 0.45);
  border-radius: var(--r-4);
  background: var(--surface);
  color: var(--encre);
  box-shadow: 0 18px 40px -12px rgba(6, 39, 35, 0.38);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 260ms var(--courbe-standard), transform 480ms var(--courbe-sortie);
}
[dir="rtl"] .lya-bienvenue { transform-origin: bottom left; }
.lya-bienvenue[hidden] { display: none; }
.lya-bienvenue--visible { opacity: 1; transform: none; }
/* Pointe vers le lanceur. */
.lya-bienvenue::after {
  content: "";
  position: absolute;
  bottom: -8px;
  inset-inline-end: 27px;
  width: 14px;
  height: 14px;
  border-inline-end: 1px solid rgba(201, 164, 58, 0.45);
  border-bottom: 1px solid rgba(201, 164, 58, 0.45);
  background: var(--surface);
  transform: rotate(45deg);
}
[dir="rtl"] .lya-bienvenue::after { transform: rotate(-45deg); }
.lya-bienvenue__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--lya-or-clair);
}
.lya-bienvenue--visible .lya-bienvenue__avatar { animation: lya-salut 1.6s var(--courbe-sortie) 0.3s 1; }
.lya-bienvenue__titre { margin: 0; font-weight: 700; color: var(--lya-vert-profond); }
.lya-bienvenue__message { margin: 2px 0 var(--e-3); font-size: var(--taille-s); line-height: 1.45; color: var(--encre-2); }
.lya-bienvenue__ouvrir {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-pilule);
  background: var(--lya-vert-profond);
  color: #fff;
  font: inherit;
  font-size: var(--taille-s);
  font-weight: 650;
  cursor: pointer;
}
.lya-bienvenue__ouvrir:hover { background: var(--lya-vert-nuit); }
.lya-bienvenue__fermer {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--encre-3);
  cursor: pointer;
}
.lya-bienvenue__fermer .icone { width: 18px; height: 18px; }
.lya-bienvenue__fermer:hover { background: var(--fond); color: var(--encre); }
.lya-bienvenue__ouvrir:focus-visible,
.lya-bienvenue__fermer:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Le lanceur ne masque pas les derniers liens du pied de page (bas de la page). */
.pied-site__bas { padding-inline-end: calc(68px + var(--e-6)); }

/* Panneau ouvert : le lanceur et la bulle s'effacent (le panneau a son bouton de fermeture). */
.lya-zone--ouverte .lya-lanceur,
.lya-zone--ouverte .lya-bienvenue { display: none; }

@keyframes lya-flotte {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes lya-onde {
  0% { opacity: 0.75; transform: scale(1); }
  70% { opacity: 0; }
  100% { opacity: 0; transform: scale(1.75); }
}
@keyframes lya-pouls {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes lya-lueur {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}
@keyframes lya-respire {
  0%, 100% { transform: scale(1.08); }
  50% { transform: scale(1.13); }
}
@keyframes lya-rotation { to { transform: rotate(1turn); } }
@keyframes lya-pastille {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.6); }
  80%, 100% { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); }
}
@keyframes lya-salut {
  0% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80%, 100% { transform: rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lya-lanceur__corps, .lya-lanceur__halo, .lya-lanceur__anneau, .lya-lanceur__robot,
  .lya-lanceur__onde, .lya-lanceur__pastille, .lya-bienvenue--visible .lya-bienvenue__avatar { animation: none; }
  .lya-lanceur__onde { display: none; }
  .lya-lanceur:hover, .lya-lanceur:focus-visible, .lya-lanceur:active { transform: none; }
  .lya-bienvenue { transform: none; transition: opacity 120ms linear; }
}
.mouvement-reduit .lya-lanceur__corps,
.mouvement-reduit .lya-lanceur__halo,
.mouvement-reduit .lya-lanceur__anneau,
.mouvement-reduit .lya-lanceur__robot,
.mouvement-reduit .lya-lanceur__pastille,
.mouvement-reduit .lya-bienvenue--visible .lya-bienvenue__avatar { animation: none; }
.mouvement-reduit .lya-lanceur__onde { display: none; }
.mouvement-reduit .lya-lanceur:hover,
.mouvement-reduit .lya-lanceur:focus-visible { transform: none; }
.mouvement-reduit .lya-bienvenue { transform: none; transition: opacity 120ms linear; }

@media (max-width: 40rem) {
  .lya-zone {
    inset-inline-end: max(var(--e-3), env(safe-area-inset-right));
    bottom: max(var(--e-3), env(safe-area-inset-bottom));
  }
  .lya-lanceur { width: 58px; height: 58px; }
  .lya-lanceur__bulle { display: none; }
  .lya-bienvenue { width: min(19.5rem, calc(100vw - 2 * var(--e-3))); }
  .lya-bienvenue::after { inset-inline-end: 22px; }
  .pied-site__bas { padding-inline-end: var(--gouttiere); padding-bottom: calc(58px + var(--e-5)); }
}

@media print { .lya-zone { display: none !important; } }
