/* BESA Apps — « Contacte ton député ». Charte BESA (Violet Studios) :
 * Tofu #FFF0E1, Peach #EF9D65, Seaweed #549E90, Dark Green #002820 ;
 * titres Bebas Neue, texte Roboto (polices déjà chargées par le site).
 * Tout est préfixé .ba pour ne pas entrer en conflit avec Elementor. */

.ba {
  --ba-tofu: #FFF0E1;
  --ba-peach: #EF9D65;
  --ba-seaweed: #549E90;
  --ba-seaweed-dark: #2F6B60; /* Seaweed assombri : texte lisible sur blanc (AA) */
  --ba-green: #002820;
  --ba-ink: #1D1D1D;
  --ba-muted: #4D4D4D;
  --ba-line: #E3D6C8;
  --ba-white: #FFFFFF;
  --ba-radius: 6px;
  --ba-title: "Bebas Neue", "Bebas Neue Pro", "Oswald", "Arial Narrow", Impact, sans-serif;
  --ba-text: "Roboto", "Helvetica Neue", Arial, sans-serif;

  /* Pleine largeur même si le conteneur du thème est étroit (sans effet dans une section Elementor déjà étirée). */
  width: 100%;
  max-width: none;
  font-family: var(--ba-text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ba-ink);
  text-align: left;
}
.ba *, .ba *::before, .ba *::after { box-sizing: border-box; }
.ba [hidden] { display: none !important; }
.ba p { margin: 0 0 .9em; }
.ba a { color: var(--ba-seaweed-dark); }

/* Scène : fond en dégradé tofu (la carte vient par-dessus), panneau blanc translucide. */
.ba-stage {
  scroll-margin-top: 90px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 65% 30%, #FFF8F0 0%, var(--ba-tofu) 55%, #F6DCC4 100%);
}
.ba-map { position: relative; height: 50vh; min-height: 320px; }
.ba-sheet {
  position: relative; z-index: 4;
  margin: -36px 12px 16px;
  padding: clamp(18px, 5vw, 28px);
  background: rgba(255, 255, 255, .96);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 40, 32, .18);
}
.ba-finder, .ba-result { background: none; border-radius: 0; padding: 0; }
@media (min-width: 768px) {
  /* Moins la barre du site (~90 px), pour que le panneau ne passe pas sous l'entête fixe. */
  .ba-stage { display: block; min-height: 640px; height: calc(100vh - 90px); max-height: 900px; }
  .ba-map { position: absolute; inset: 0; height: auto; min-height: 0; }
  .ba-sheet {
    position: absolute; left: max(24px, 5vw, calc(50% - 760px)); top: 50%; transform: translateY(-50%);
    width: min(440px, 90vw); max-height: calc(100% - 48px); overflow-y: auto; margin: 0;
  }
}
.ba-result:focus { outline: none; }

.ba-kicker {
  font-family: var(--ba-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--ba-seaweed-dark);
  margin: 0 0 .3em !important;
}
.besa-app.ba .ba-title {
  font-family: var(--ba-title);
  font-weight: 400;
  font-size: clamp(36px, 9vw, 52px);
  line-height: 1;
  letter-spacing: .5px;
  color: var(--ba-green);
  margin: 0 0 .35em;
  text-transform: none;
}
.ba-lede { font-size: 17px; color: var(--ba-ink); }
.ba-asks { background: var(--ba-tofu, #f6efe4); border-left: 4px solid var(--ba-peach, #f2a07b); border-radius: 0 var(--ba-radius) var(--ba-radius) 0; padding: 10px 14px 4px; margin: 0 0 1em; }
.besa-app.ba .ba-asks__title { font-weight: 700; color: var(--ba-green); margin: 0 0 .3em !important; font-size: 15px; letter-spacing: .3px; }
.besa-app.ba .ba-asks__list { margin: 0 0 .4em 1.2em !important; padding: 0 !important; font-size: 15px; line-height: 1.4; color: var(--ba-ink); }
.besa-app.ba .ba-asks__list li { margin: 0 0 .35em; }
.ba-tips { margin-top: .6em !important; }
.ba-brackets { margin: 0 0 10px !important; }
.besa-app.ba .ba-subtitle {
  font-family: var(--ba-title);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  color: var(--ba-green);
  margin: 0 0 .3em;
}

.ba-label { display: block; font-weight: 500; color: var(--ba-green); margin-bottom: 6px; }
.ba-note { font-size: 14px; color: var(--ba-muted); }
.ba-note--strong { color: var(--ba-ink); font-weight: 500; margin-top: 1.4em !important; }
.ba-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ba-status { min-height: 1.2em; font-weight: 500; color: #8A3B12; }
.ba-warn { background: var(--ba-white); border-left: 4px solid var(--ba-peach); padding: 10px 14px; border-radius: var(--ba-radius); }

.ba-row { display: flex; gap: 10px; align-items: center; }
.ba-row--wrap { flex-wrap: wrap; }
.ba-row--between { justify-content: space-between; flex-wrap: wrap; }

.besa-app.ba .ba-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--ba-ink);
  background: var(--ba-white);
  border: 2px solid var(--ba-line);
  border-radius: var(--ba-radius);
  box-shadow: none;
}
.besa-app.ba .ba-input:focus { border-color: var(--ba-seaweed); outline: none; box-shadow: 0 0 0 3px rgba(84, 158, 144, .25); }
.besa-app.ba .ba-input--cp { max-width: 11em; font-size: 20px; letter-spacing: 2px; text-transform: uppercase; }
.besa-app.ba .ba-textarea { min-height: 18em; resize: vertical; line-height: 1.5; }

/* Boutons : sélecteurs renforcés pour passer devant les styles de bouton du thème */
.besa-app.ba .ba-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 10px 20px;
  font-family: var(--ba-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  border: 2px solid transparent;
  border-radius: var(--ba-radius);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.besa-app.ba .ba-btn:focus-visible, .besa-app.ba .ba-tab:focus-visible, .besa-app.ba .ba-choice:focus-visible, .besa-app.ba .ba-link:focus-visible, .ba a:focus-visible, .ba summary:focus-visible {
  outline: 3px solid var(--ba-peach);
  outline-offset: 2px;
}
.besa-app.ba .ba-btn--primary { background: var(--ba-green); color: var(--ba-white); }
.besa-app.ba .ba-btn--primary:hover { background: #0B4236; color: var(--ba-white); }
.besa-app.ba .ba-btn--secondary { background: var(--ba-peach); color: var(--ba-green); }
.besa-app.ba .ba-btn--secondary:hover { background: #F4B488; color: var(--ba-green); }
.besa-app.ba .ba-btn--ghost { background: var(--ba-white); color: var(--ba-green); border-color: var(--ba-seaweed); }
.besa-app.ba .ba-btn--ghost:hover { background: var(--ba-seaweed); color: var(--ba-green); }
.besa-app.ba .ba-btn--small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.besa-app.ba .ba-btn--big { width: 100%; padding: 14px 20px; font-size: 18px; margin-bottom: 1em; }
.besa-app.ba .ba-btn__sub { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.besa-app.ba .ba-btn.is-done { background: var(--ba-seaweed); color: var(--ba-green); border-color: var(--ba-seaweed); }

.besa-app.ba .ba-link {
  background: none; border: 0; padding: 4px 0; margin: 0;
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ba-seaweed-dark); text-decoration: underline; cursor: pointer;
}

/* Résultats et choix */
.ba-results, .ba-choice-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ba-results__none { color: var(--ba-muted); font-size: 14px; }
.besa-app.ba .ba-choice {
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 16px;
  font: inherit; text-align: left; text-transform: none; letter-spacing: 0;
  color: var(--ba-ink);
  background: var(--ba-white);
  border: 2px solid var(--ba-line);
  border-radius: var(--ba-radius);
  cursor: pointer;
}
.besa-app.ba .ba-choice:hover { border-color: var(--ba-seaweed); background: var(--ba-white); color: var(--ba-ink); }
.ba-choice__circo { font-weight: 700; color: var(--ba-green); }
.ba-choice__name { font-size: 14px; color: var(--ba-muted); }
.ba-choices { margin-top: 1.2em; }

/* Fiche du député */
.ba-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--ba-white);
  border-radius: var(--ba-radius);
  padding: 18px;
  border-top: 6px solid var(--ba-seaweed);
  animation: ba-in .45s ease-out both;
}
.ba-avatar {
  flex: 0 0 auto;
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ba-peach); color: var(--ba-green);
  font-family: var(--ba-title); font-size: 34px; line-height: 1;
}
.besa-app.ba .ba-avatar { overflow: hidden; }
.besa-app.ba .ba-avatar img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 20%; }
.ba-card__body p { margin: 0; }
.ba-result > .ba-credit { margin: 6px 0 0; font-size: 12px; color: var(--ba-muted); }
.ba-card__label { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ba-seaweed-dark); }
.besa-app.ba .ba-card__name { font-family: var(--ba-title); font-weight: 400; font-size: 34px; line-height: 1.05; color: var(--ba-green); margin: 2px 0 4px; }
.ba-card__meta { font-size: 15px; color: var(--ba-muted); }
.ba-card__meta--role { font-size: 13px; margin-top: 4px !important; }
.ba-result > .ba-link { margin: 8px 0 18px; }

@keyframes ba-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Onglets : deux grandes tuiles avec icône animée (téléphone vert foncé, courriel pêche). */
.ba-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.besa-app.ba .ba-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 48px;
  padding: 14px 8px 10px;
  font-family: var(--ba-title); font-size: 24px; font-weight: 400; line-height: 1; letter-spacing: .5px; text-transform: none;
  border: 0; border-radius: 8px 8px 0 0;
  cursor: pointer;
  opacity: .72;
  transition: opacity .2s ease;
}
.besa-app.ba .ba-tab--tel, .besa-app.ba .ba-tab--tel:hover, .besa-app.ba .ba-tab--tel[aria-selected="true"] { background: var(--ba-green); color: #fff; }
.besa-app.ba .ba-tab--mail, .besa-app.ba .ba-tab--mail:hover, .besa-app.ba .ba-tab--mail[aria-selected="true"] { background: var(--ba-peach); color: var(--ba-green); }
.besa-app.ba .ba-tab:hover { opacity: .9; }
.besa-app.ba .ba-tab[aria-selected="true"] { opacity: 1; box-shadow: inset 0 -5px 0 var(--ba-seaweed); }
.ba-tab__icon { display: block; width: 46px; height: 46px; }
.besa-app.ba .ba-tab__icon svg, .besa-app.ba .ba-mini svg { display: block; width: 100%; height: 100%; max-width: none; overflow: visible; }
.ba-tab__label { display: block; }
.besa-app.ba .ba-btn__main { display: inline-flex; align-items: center; gap: 8px; }
.ba-mini { display: inline-block; width: 22px; height: 22px; }

/* Téléphone : trois secousses puis une pause (~3,2 s), avec des ondes. Se tait après le premier clic sur l'onglet. */
.ba-ring { transform-origin: 50% 60%; animation: ba-ring 3.2s ease-in-out infinite; }
.ba-waves path { opacity: 0; animation: ba-waves 3.2s ease-out infinite; }
.ba-waves path:nth-child(2) { animation-delay: .12s; }
.ba-tab.is-quiet .ba-ring, .ba-tab.is-quiet .ba-waves path { animation: none; }
.ba-mini .ba-waves { display: none; }
.ba-mini .ba-ring { animation-duration: 4s; }
@keyframes ba-ring { 0%, 22%, 100% { transform: rotate(0); } 3%, 11% { transform: rotate(-14deg); } 7%, 15% { transform: rotate(14deg); } 19% { transform: rotate(-6deg); } }
@keyframes ba-waves { 0% { opacity: 0; } 4% { opacity: 1; } 24% { opacity: 0; } }
/* Enveloppe : la lettre sort puis rentre (~4 s). */
.ba-letter { animation: ba-letter 4s ease-in-out infinite; }
@keyframes ba-letter { 0%, 55%, 100% { transform: translateY(0); } 25%, 40% { transform: translateY(-11px); } }
.ba-plane { opacity: 0; }
/* « J'ai envoyé un courriel » : la lettre se plie en avion en papier et s'envole. */
.ba-tab.is-sent .ba-letter { animation: ba-letter-out .5s ease-in forwards; }
.ba-tab.is-sent .ba-plane { animation: ba-plane 2s ease-in .35s both; }
@keyframes ba-letter-out { to { opacity: 0; transform: translateY(-14px) scale(.7); } }
@keyframes ba-plane { 0% { opacity: 0; transform: translate(0, 4px) scale(.5); } 15% { opacity: 1; transform: translate(0, 0) scale(.9); } 100% { opacity: 0; transform: translate(34px, -44px) scale(1.1) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) {
  .ba-ring, .ba-waves path, .ba-letter, .ba-tab.is-sent .ba-letter, .ba-tab.is-sent .ba-plane { animation: none !important; }
}

.ba-panel { background: var(--ba-white); padding: 20px; border-radius: 0 0 var(--ba-radius) var(--ba-radius); }
.ba-panel:focus { outline: none; }

.ba-field { margin-bottom: 14px; }
.ba-copyrow { display: flex; gap: 8px; align-items: center; }
.besa-app.ba .ba-copyrow .ba-input { flex: 1 1 auto; min-width: 0; }
.besa-app.ba .ba-copyrow .ba-btn { flex: 0 0 auto; }
.besa-app.ba .ba-btn--done { margin-top: 18px; }
.ba-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.ba-actions .ba-btn { flex: 1 1 200px; }
.ba-openers { gap: 8px; margin: 0; }
.ba-openers .ba-note { margin: 0; }

.ba-details { border: 2px solid var(--ba-line); border-radius: var(--ba-radius); padding: 0 14px; margin-bottom: 12px; }
.ba-details summary { cursor: pointer; padding: 12px 0; font-weight: 500; color: var(--ba-green); }
.ba-details[open] summary { border-bottom: 1px solid var(--ba-line); margin-bottom: 10px; }
.ba-script { white-space: pre-line; }

/* Remerciement */
.ba-thanks {
  margin-top: 18px; padding: 18px;
  background: var(--ba-green); color: var(--ba-white);
  border-radius: var(--ba-radius);
  animation: ba-in .45s ease-out both;
}
.ba-thanks p { color: var(--ba-white); }
.besa-app.ba .ba-thanks__title { font-family: var(--ba-title); font-size: 32px; line-height: 1; color: var(--ba-peach); margin-bottom: .3em; }
.besa-app.ba .ba-thanks .ba-btn--primary { background: var(--ba-peach); color: var(--ba-green); }
.besa-app.ba .ba-thanks .ba-btn--primary:hover { background: #F4B488; color: var(--ba-green); }

@media (max-width: 480px) {
  .ba-card { flex-direction: column; align-items: flex-start; }
  .ba-row:not(.ba-row--wrap):not(.ba-row--between) { flex-direction: column; align-items: stretch; }
  .besa-app.ba .ba-input--cp { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ba-card, .ba-thanks { animation: none; }
  .besa-app.ba .ba-btn { transition: none; }
}

/* Carte 2.5D (carte.js). Le thème stylise parfois svg et img : tailles imposées ici. */
.besa-app.ba .ba-map svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
.ba-map .circo { fill: var(--ba-seaweed); stroke: var(--ba-tofu); stroke-width: .7; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .6s; cursor: pointer; }
.ba-map .circo:hover { fill: #63AE9F; }
.ba-map.is-focus .circo { fill: #A9CFC6; }
.ba-map.is-focus .circo.is-near { fill: #7DB8AC; }
.ba-map.has-detail .circo.is-near { stroke: none; }
.ba-map .slab use { fill: var(--ba-seaweed-dark); }
.ba-map .slab use:first-child { fill: #1F4D45; }
/* vector-effect ne traverse pas <use> : il va sur les tracés de <defs>, et le dessus du bloc est un vrai <path>. */
.ba-map defs path { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ba-map .walls use { fill: #C9733A; stroke: none; }
.ba-map .walls use:first-child { fill: #8E4A1E; }
.ba-map .top { fill: var(--ba-peach); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ba-map .detail path { fill: #A9CFC6; stroke: var(--ba-tofu); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ba-map .detail path.is-near { fill: #7DB8AC; }
.ba-fog { position: absolute; inset: 0 0 auto 0; height: 8%; pointer-events: none; background: linear-gradient(var(--ba-tofu), rgba(255, 240, 225, 0)); }

.ba-pin { position: absolute; left: 0; top: 0; z-index: 3; transform: translate(-50%, -100%); pointer-events: none; opacity: 0; transition: opacity .4s; }
.ba-pin.is-on { opacity: 1; }
.ba-pin__face {
  width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff;
  background: var(--ba-peach) center 20% / cover; box-shadow: 0 8px 20px rgba(0, 40, 32, .35);
  display: grid; place-items: center; font: 30px/1 var(--ba-title); color: var(--ba-green);
}
.ba-pin.is-on .ba-pin__face { animation: ba-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.ba-pin__stem { width: 3px; height: 26px; margin: -2px auto 0; background: #fff; border-radius: 2px; }
.ba-pin__label {
  position: absolute; left: 50%; top: -34px; transform: translateX(-50%); white-space: nowrap;
  background: var(--ba-green); color: #fff; font: 15px/1 var(--ba-title); letter-spacing: .5px; padding: 6px 10px 5px; border-radius: 4px;
}
@keyframes ba-pop { from { transform: scale(.2) translateY(30px); opacity: 0; } }
@media (max-width: 767px) { .ba-pin__face { width: 58px; height: 58px; font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .ba-pin.is-on .ba-pin__face { animation: none; } .ba-map .circo { transition: none; } }

/* Indicateur d'étapes et transitions */
.ba-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 16px; padding: 0; font-size: 13px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase; color: var(--ba-muted); }
.ba-step { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; padding-top: 8px; border-top: 3px solid var(--ba-line); transition: border-color .4s, color .4s; }
.ba-step__dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ba-line); display: grid; place-items: center; font-size: 11px; line-height: 1; transition: background .3s, border-color .3s; }
.ba-step.is-current { color: var(--ba-green); border-top-color: var(--ba-peach); }
.ba-step.is-current .ba-step__dot { border-color: var(--ba-peach); background: var(--ba-peach); }
.ba-step.is-done { color: var(--ba-seaweed-dark); border-top-color: var(--ba-seaweed); }
.ba-step.is-done .ba-step__dot { border-color: var(--ba-seaweed-dark); background: var(--ba-seaweed-dark); color: #fff; }
.ba-step.is-done .ba-step__dot::after { content: "\2713"; }
.ba-enter { animation: ba-in .45s ease-out both; }
.ba-cross { margin: 0 0 16px; padding: 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--ba-radius); }
.ba-cross p { margin: 0 0 .5em; }
.besa-app.ba .ba-cross__title { font-family: var(--ba-title); font-size: 24px; line-height: 1; color: var(--ba-peach); }
.besa-app.ba .ba-thanks .ba-cross .ba-btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.besa-app.ba .ba-thanks .ba-cross .ba-btn--ghost:hover { background: rgba(255, 255, 255, .15); color: #fff; }
@media (prefers-reduced-motion: reduce) { .ba-enter, .ba-step, .ba-step__dot { animation: none; transition: none; } }

/* Illustration animée (scene.js) : calques animés autour d'un pivot, ancrée en bas à droite. */
.ba-map { overflow: hidden; }
.ba-artwrap { position: absolute; inset: 0; z-index: 2; pointer-events: none; isolation: isolate; contain: strict; will-change: transform; }
.ba-art { --mx: 0; position: absolute; right: 0; bottom: -2px; width: min(58%, 1000px); }
.ba-l { position: absolute; transform-origin: 50% 100%; }
.besa-app.ba .ba-l img { display: block; width: 100%; height: 100%; max-width: none; }
.ba-l--vallon { translate: calc(var(--mx) * 5px) 0; }
@media (max-width: 767px) {
  .ba-art { width: 120%; right: -20%; transition: transform .8s ease; }
  /* Sur téléphone, les animaux s'écartent pendant le zoom, puis reviennent au remerciement. */
  .ba-stage.is-focus .ba-art { transform: translateY(55%); }
  .ba-stage.is-focus.is-thanks .ba-art { transform: none; }
}

/* Au repos, discret et en boucle. */
.ba-l--poule { transform-origin: 55% 95%; animation: ba-peck 6s ease-in-out infinite; }
.ba-l--cochon { transform-origin: 50% 95%; }
.ba-l--vache { transform-origin: 55% 100%; }
.ba-l--omble1 { transform-origin: 50% 70%; animation: ba-leap 5s linear infinite; }
.ba-l--eau { transform-origin: 50% 100%; animation: ba-splash 5s linear infinite; }
/* Seconde omble, plus grande et au premier plan (la première, agrandie) : saute en alternance, son arc part de sous le bord bas de la scène.
   La grande omble du dessin, coupée net, ne bouge pas. */
.ba-l--omble3 { transform-origin: 50% 70%; animation: ba-leap 5s linear -2.5s infinite; }
.ba-l--eau2 { transform-origin: 50% 100%; animation: ba-splash 5s linear -2.5s infinite; }
@keyframes ba-peck { 0%, 58%, 100% { transform: rotate(0); } 62%, 72% { transform: rotate(10deg); } 67%, 77% { transform: rotate(1deg); } 82% { transform: rotate(0); } }
@keyframes ba-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.01); } }
@keyframes ba-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
/* L'omble sort de l'eau, fait un saut complet en arc, replonge ; les gouttes accompagnent le départ et l'arrivée. */
@keyframes ba-leap {
  0%, 36% { opacity: 0; transform: translate(-25%, 95%) rotate(-28deg); animation-timing-function: ease-out; }
  40% { opacity: 1; transform: translate(-10%, 40%) rotate(-22deg); animation-timing-function: ease-out; }
  52% { opacity: 1; transform: translate(40%, -62%) rotate(-6deg); animation-timing-function: ease-in; }
  64% { opacity: 1; transform: translate(105%, 8%) rotate(30deg); }
  68%, 100% { opacity: 0; transform: translate(125%, 55%) rotate(45deg); }
}
/* Les éclaboussures apparaissent au départ du saut, restent pendant l'arc et s'effacent après la rentrée dans l'eau. */
@keyframes ba-splash { 0%, 34% { opacity: 0; transform: scale(.96); } 41% { opacity: 1; transform: scale(1.05); } 70% { opacity: .9; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(.98); } }

/* Récompense quand la personne agit. */
.ba-art.is-happy .ba-l--poule { animation: ba-hop .9s cubic-bezier(.3, 0, .4, 1) 2 both; }
.ba-art.is-happy .ba-l--cochon { animation: ba-pig 1.4s ease-in-out both; transform-origin: 85% 92%; }
.ba-art.is-happy .ba-l--vache { animation: ba-nod 1.6s ease-in-out both; }
.ba-art.is-happy .ba-l--omble1 { animation: ba-leap 1.7s linear 2 both; }
.ba-art.is-happy .ba-l--omble3 { animation: ba-leap 1.7s linear .5s 2 both; }
.ba-art.is-happy .ba-l--eau2 { animation: ba-splash 1.7s linear .5s 2 both; }
.ba-art.is-happy .ba-l--eau { animation: ba-splash 1.7s linear 2 both; }
@keyframes ba-hop { 0% { transform: none; } 15% { transform: scale(1.06, .9); } 45% { transform: translateY(-55%) scale(.94, 1.1); } 80% { transform: translateY(0) scale(1.08, .88); } 100% { transform: none; } }
@keyframes ba-pig { 0%, 100% { transform: none; } 35% { transform: rotate(3.5deg); } 55% { transform: rotate(3deg) translateY(-2%); } 75% { transform: rotate(.5deg); } }
@keyframes ba-nod { 0%, 100% { transform: none; } 25% { transform: rotate(-2.5deg); } 50% { transform: rotate(.5deg); } 75% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) {
  .ba-l, .ba-art.is-happy .ba-l { animation: none !important; }
  .ba-art { transition: none; }
  .ba-l--omble3, .ba-l--eau2 { display: none; }
  .ba-l--vallon { translate: none; }
}
.besa-app.ba .ba-l--vallon img { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%); mask-image: linear-gradient(to right, transparent 0, #000 22%); }

/* Performance : la dérive au repos passe par le compositeur ; pendant un vol on allège le tracé. */
.besa-app.ba .ba-map svg { will-change: transform; }
.ba-map.is-moving { }
.ba-map.is-moving .circo, .ba-map.is-moving .detail path { stroke: none; transition: none; }
.ba-map.is-moving .slab use:nth-child(even), .ba-map.is-moving .walls use:nth-child(even) { display: none; }
.ba-map.is-moving svg { shape-rendering: optimizeSpeed; }

/* Performance de l'illustration : couches du compositeur seulement pour ce qui bouge ; tout se fige pendant un vol de caméra
   et sur appareil lent (classe is-lite posée par carte.js). */
.ba-l--poule, .ba-l--omble1, .ba-l--omble3, .ba-l--eau, .ba-l--eau2, .ba-l--cochon, .ba-l--vache { will-change: transform; }
.ba-stage.is-flying .ba-art .ba-l { animation-play-state: paused !important; }
.ba-stage.is-lite .ba-art .ba-l { animation: none !important; }
.ba-stage.is-lite .ba-l--omble3, .ba-stage.is-lite .ba-l--eau2 { display: none; }

/* Le bout de la grande colline qui passe sous la colline claire de gauche s'efface avec elle. */
.besa-app.ba .ba-l--colline img { -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 8%, #000 30%); mask-image: linear-gradient(to right, transparent 0, transparent 8%, #000 30%); }
