/* COPIE AUTOMATIQUE de la mascotte de la vitrine (brokeo-site). Ne pas modifier : node ace studio:copier-mascotte */

/**
 * Mascotte de l'assistant Brokeo : dessin, décors et états.
 *
 * Repris sans changement de la démonstration validée (docs/mascotte/mascotte-brokeo.html,
 * version 3, 21 décors).
 * Seul le préfixe change : « svg » devient « .mascotte », pour ne toucher
 * aucun autre dessin du site. Les couleurs viennent des variables du thème.
 */

.mascotte {
	--fg: var(--ink);
	--eye: #12263F;
	display: block;
	overflow: visible;
}

.mascotte .place { transform-box: view-box; transform-origin: 0 0; transform: translate(20px, 8px); transition: transform .7s cubic-bezier(.3, 1.35, .5, 1); }
.mascotte .char, .mascotte .body, .mascotte .blink, .mascotte .eyes, .mascotte .dots circle, .mascotte .bars rect, .mascotte .m-open { transform-box: fill-box; transform-origin: center; }
.mascotte .body { transform-origin: 50% 100%; }
.mascotte .dots, .mascotte .bars, .mascotte .eyes-happy, .mascotte .m-open, .mascotte .m-smile, .mascotte .acc, .mascotte .ground { display: none; }
.mascotte .body rect { fill: var(--coral); }
.mascotte .shadow { fill: var(--line); }
.mascotte .eye { fill: var(--eye); }
.mascotte .happy, .mascotte .m-flat, .mascotte .m-smile { fill: none; stroke: var(--eye); stroke-width: 3.4; stroke-linecap: round; }
.mascotte .m-open { fill: var(--eye); }
.mascotte .dots circle, .mascotte .bars rect { fill: var(--fg); }
.mascotte .ground { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }

/* Décors : formes plates, couleurs de la marque */
.mascotte .acc { transform-box: fill-box; transform-origin: 50% 100%; animation: pop .55s cubic-bezier(.3, 1.5, .5, 1) both; }
.mascotte .ink { fill: var(--fg); }
.mascotte .ink-line { fill: none; stroke: var(--fg); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mascotte .glass { fill: var(--bg); }
.mascotte .coral { fill: var(--coral); }
.mascotte .drop { fill: var(--muted); }
.mascotte .swing { transform-box: view-box; transform-origin: 122px 48px; animation: swing 2.4s ease-in-out infinite; }
.mascotte .beat { transform-box: fill-box; transform-origin: center; animation: beat 1.4s ease-in-out infinite; }
.mascotte .beat2 { animation-delay: .35s; }
.mascotte .fall { animation: fall 1.6s linear infinite; }
.mascotte .fall2 { animation-delay: .5s; }
.mascotte .fall3 { animation-delay: 1s; }
.mascotte .wheel { transform-box: fill-box; transform-origin: center; }
.mascotte .rays { transform-box: fill-box; transform-origin: center; animation: spin 14s linear infinite; }

.mascotte.p-voiture .place { transform: translate(51px, 21px) scale(.5); }
.mascotte.p-moto .place { transform: translate(42px, 30px) scale(.45); }
.mascotte.p-loyer .place { transform: translate(-2px, 31px) scale(.8); }
.mascotte.p-pilier .place { transform: translate(44px, 20px) scale(.6); }
.mascotte.p-lpp .place { transform: translate(52px, 31px) scale(.8); }
.mascotte.p-velo .place { transform: translate(37px, 24px) scale(.45); }
.mascotte.p-batiment .place, .mascotte.p-voyage .place, .mascotte.p-plan .place { transform: translate(6px, 43px) scale(.7); }
.mascotte.p-bateau .place { transform: translate(47px, 46px) scale(.55); }
.mascotte.p-enfant .place { transform: translate(7px, 27px) scale(.85); }

.mascotte[class*="p-"] .shadow { display: none; }
.mascotte[class*="p-"] .ground { display: block; }
.mascotte[class*="p-"] .dots { transform: translate(48px, 22px); }
/* Décors posés sur la tête : les points de réflexion passent à droite, à hauteur des yeux. */
.mascotte.p-menage .dots, .mascotte.p-rc .dots, .mascotte.p-protection .dots, .mascotte.p-cyber .dots, .mascotte.p-vie .dots, .mascotte.p-maladie .dots,
.mascotte.p-compl .dots, .mascotte.p-laa .dots, .mascotte.p-laac .dots, .mascotte.p-construction .dots { transform: translate(58px, 40px); }
.mascotte.p-bateau .ground { display: none; }

.mascotte.p-voiture .acc.voiture, .mascotte.p-moto .acc.moto, .mascotte.p-menage .acc.menage, .mascotte.p-rc .acc.rc,
.mascotte.p-loyer .acc.loyer, .mascotte.p-cyber .acc.cyber, .mascotte.p-pilier .acc.pilier, .mascotte.p-vie .acc.vie,
.mascotte.p-lpp .acc.lpp, .mascotte.p-maladie .acc.maladie, .mascotte.p-compl .acc.compl, .mascotte.p-protection .acc.protection,
.mascotte.p-velo .acc.velo, .mascotte.p-batiment .acc.batiment, .mascotte.p-construction .acc.construction, .mascotte.p-voyage .acc.voyage,
.mascotte.p-bateau .acc.bateau, .mascotte.p-laa .acc.laa, .mascotte.p-laac .acc.laac, .mascotte.p-enfant .acc.enfant, .mascotte.p-plan .acc.plan { display: block; }
.mascotte.p-velo .wheel { animation: spin 1.2s linear infinite; }
.mascotte .drift { animation: drift 2.6s ease-in-out infinite; }
.mascotte .coin { transform-box: fill-box; transform-origin: center; animation: coin 1.9s ease-in infinite; }
.mascotte .kid { transform-box: fill-box; transform-origin: 50% 100%; animation: kid 1.8s ease-in-out infinite; }
.mascotte.p-voiture .wheel { animation: spin 1.1s linear infinite; }
.mascotte.p-moto .wheel { animation: spin 1s linear infinite; }

@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes swing { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes tilt { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.mascotte .tilt { transform-box: view-box; transform-origin: 80px 6px; animation: tilt 3.2s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes drift { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
@keyframes coin { 0% { transform: translateY(-12px); opacity: 0; } 15% { opacity: 1; } 80% { transform: translateY(18px); opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
@keyframes kid { 0%,55%,100% { transform: translateY(0); } 70% { transform: translateY(-7px); } 85% { transform: translateY(0); } }
@keyframes fall { 0% { transform: translateY(-8px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }

/* États (identiques à la version précédente) */
@keyframes breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.025,.975); } }
@keyframes blink { 0%,90%,100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
@keyframes sway { 0%,100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes glance { 0%,35% { transform: translate(2px,5px); } 50%,85% { transform: translate(-2px,5px); } 100% { transform: translate(2px,5px); } }
@keyframes dot { 0%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes bar { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes talk { 0%,100% { transform: scale(1,.6); } 50% { transform: scale(1,1.15); } }
@keyframes hop { 0% { transform: translateY(0); } 25% { transform: translateY(-14px); } 50% { transform: translateY(0); } 65% { transform: translateY(-5px); } 80%,100% { transform: translateY(0); } }

.mascotte .body { animation: breathe 4.5s ease-in-out infinite; }
.mascotte .blink { animation: blink 5s ease-in-out infinite; }

.mascotte[data-state="thinking"] .char { animation: sway 1.8s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.mascotte[data-state="thinking"] .eyes { transform: translate(6px,-5px); }
.mascotte[data-state="thinking"] .dots { display: block; }
.mascotte[data-state="thinking"] .dots circle { animation: dot 1.2s ease-in-out infinite; }
.mascotte[data-state="thinking"] .dots circle:nth-child(2) { animation-delay: .2s; }
.mascotte[data-state="thinking"] .dots circle:nth-child(3) { animation-delay: .4s; }

.mascotte[data-state="waiting"] .char { animation: bob 2s ease-in-out infinite; }
.mascotte[data-state="waiting"] .eyes { animation: glance 4.5s ease-in-out infinite; }

.mascotte[data-state="listening"] .bars { display: block; }
.mascotte[data-state="listening"] .bars rect { animation: bar 0.9s ease-in-out infinite; }
.mascotte[data-state="listening"] .bars rect:nth-child(2) { animation-delay: .15s; }
.mascotte[data-state="listening"] .bars rect:nth-child(3) { animation-delay: .3s; }
.mascotte[data-state="listening"] .body { animation-duration: 1.6s; }
.mascotte[data-state="listening"] .m-flat { display: none; }
.mascotte[data-state="listening"] .m-open { display: block; animation: talk .7s ease-in-out infinite; }

.mascotte[data-state="done"] .char { animation: hop 1s ease-out 1; }
.mascotte[data-state="done"] .eyes-open { display: none; }
.mascotte[data-state="done"] .eyes-happy { display: block; }
.mascotte[data-state="done"] .m-flat { display: none; }
.mascotte[data-state="done"] .m-smile { display: block; }

@media (prefers-reduced-motion: reduce) {
  .mascotte *, .mascotte { animation: none !important; transition: none !important; }
}

/* Styles du dessin, transformés en classes (politique de sécurité de l’atelier). */
.mascotte .ms-1 { stroke-width:9 !important; stroke-linecap:butt !important; }
.mascotte .ms-2 { stroke:var(--surface) !important; stroke-width:3 !important; }
.mascotte .ms-3 { font-family:'Manrope',system-ui,sans-serif !important; font-weight:800 !important; font-size:17px !important; fill:var(--coral) !important; }
.mascotte .ms-4 { stroke-width:6 !important; }
.mascotte .ms-5 { stroke:var(--coral) !important; stroke-width:3 !important; }
.mascotte .ms-6 { stroke-width:4 !important; }
.mascotte .ms-7 { transform-origin:128px 78px !important; }
.mascotte .ms-8 { stroke-width:1.6 !important; }
.mascotte .ms-9 { stroke:var(--fg) !important; stroke-width:4 !important; stroke-linejoin:round !important; }
.mascotte .ms-10 { stroke-width:1.8 !important; }
.mascotte .ms-11 { stroke:var(--fg) !important; stroke-width:3 !important; stroke-linejoin:round !important; }
.mascotte .ms-12 { stroke:var(--muted) !important; stroke-width:2.5 !important; }
.mascotte .ms-13 { transform-origin:24px 0px !important; }
.mascotte .ms-14 { stroke-width:2 !important; }
.mascotte .ms-15 { fill:#F7F7F4 !important; stroke:var(--eye) !important; stroke-width:1.6 !important; }
.mascotte .ms-16 { fill:#D5D8D2 !important; }
