/* Web Katalyst — scènes animées : hero de l'accueil, aperçu d'agent, exemple.
   Principe : l'état final est l'état par défaut. Les animations ne s'appliquent que sous la classe .is-anim,
   posée par le script quand les animations sont permises. Chaque scène se joue une fois puis reste stable. */

/* ---------- Hero de l'accueil ---------- */
@media (min-width: 1024px) { .wk-hero.wk-hero-home { padding: 48px 0 56px; } }
.wk-scene { position: relative; margin: 0; }
.wk-scene-glow { position: absolute; inset: 2% -12% 18% -6%; background: radial-gradient(58% 52% at 58% 42%, rgba(255, 255, 255, .08), transparent 72%); pointer-events: none; }
.wk-scene-site { position: relative; padding-top: 23%; }
.wk-scene-site .wk-mascot-hero { top: 0; right: 4%; width: 42%; }
.wk-scene-site .wk-device-phone { right: 3%; bottom: -5%; width: 21%; }
.wk-scene .wk-stage-caption { position: static; margin: 26px 0 0; text-align: right; font-size: .8125rem; color: var(--on-dark-muted); }

.wk-scene-agent { position: relative; margin-top: 16px; padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--line-dark); background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); }
.wk-scene-tag { margin: 0 0 10px !important; }
.wk-scene-tag span { display: inline-block; padding: 3px 10px; border: 1px solid #4a5163; border-radius: 99px; font-size: .625rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--wk-yellow); }
.wk-sa-flow { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 10px; align-items: stretch; }
.wk-sa-in { align-self: center; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: .8125rem; line-height: 1.3; transform: rotate(-2deg); }
.wk-sa-in b { display: block; }
.wk-sa-in small { color: var(--on-dark-muted); font-size: .6875rem; }
.wk-sa-ico { position: relative; flex: none; width: 28px; height: 28px; border-radius: 7px; background: rgba(255, 255, 255, .1); }
.wk-sa-ico::before { content: ""; position: absolute; inset: 8px 6px; border: 1.5px solid #fff; border-radius: 2px; }
.wk-sa-ico::after { content: ""; position: absolute; left: 9px; top: 9px; width: 8px; height: 8px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg) translate(-2px, -2px); }
.wk-sa-beam { align-self: center; height: 2px; background: repeating-linear-gradient(90deg, var(--wk-yellow) 0 6px, transparent 6px 10px); transform-origin: left center; }
.wk-sa-out { padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--text); font-size: .75rem; line-height: 1.35; box-shadow: var(--shadow-lg); }
.wk-sa-head { margin: 0 0 6px !important; font-weight: 700; font-size: .8125rem; color: var(--text-strong); }
.wk-sa-out dl { margin: 0; }
.wk-sa-out dl div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.wk-sa-out dt { color: var(--muted); }
.wk-sa-out dd { margin: 0; font-weight: 700; color: var(--text-strong); text-align: right; }
.wk-sa-line { display: block; height: 6px; margin: 7px 0; border-radius: 3px; background: #e3e5ea; width: var(--w); transform-origin: left center; }
.wk-sa-reply { display: flex; flex-direction: column; }
.wk-sa-reply .wk-badge { align-self: flex-start; margin: auto 0 0; }
.wk-scene-bottom { position: relative; }
.wk-scene-caption { margin-top: 10px; font-size: .8125rem; color: var(--on-dark-muted); }
.wk-scene-replay { position: absolute; top: 0; right: 14px; min-height: 44px; padding: 0; background: none; border: 0; color: #fff; font: 600 .8125rem var(--font-text); text-decoration: underline; text-decoration-color: var(--wk-yellow); text-underline-offset: 5px; cursor: pointer; }

@media (max-width: 639px) {
  .wk-sa-flow { grid-template-columns: 1fr 1fr; }
  .wk-sa-in { grid-column: 1 / -1; justify-self: start; }
  .wk-sa-beam { display: none; }
}

/* Animation du hero : sur ordinateur seulement. Sur mobile, la composition est statique (fluidité et chargement d'abord). */
@keyframes wk-s-up { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wk-s-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wk-s-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wk-s-in { from { opacity: 0; transform: rotate(-6deg) translate(-18px, 10px); } to { opacity: 1; transform: rotate(-2deg); } }
/* Le site arrive de trois quarts, en retrait, puis se stabilise dans un léger trois quarts. */
@keyframes wk-s-tilt { from { opacity: 0; transform: rotateY(-30deg) rotateX(8deg) translate3d(70px, 30px, -180px); } 60% { opacity: 1; } to { opacity: 1; transform: rotateY(-8deg) rotateX(2deg); } }
@keyframes wk-s-phone { from { opacity: 0; transform: translate3d(90px, 20px, 190px) rotateY(-16deg); } to { opacity: 1; transform: translateZ(64px); } }
/* Le caméléon se pose : il descend, s'enfonce à peine, puis se redresse. */
@keyframes wk-s-mascot { 0% { opacity: 0; transform: translateZ(34px) scaleX(-1) translateY(-34px) rotate(-6deg); } 62% { opacity: 1; transform: translateZ(34px) scaleX(-1) translateY(4px) rotate(1.5deg); } 82% { transform: translateZ(34px) scaleX(-1) translateY(-1px) rotate(-.4deg); } 100% { opacity: 1; transform: translateZ(34px) scaleX(-1); } }

@media (min-width: 1024px) {
  /* Profondeur : le site, sa version mobile et le caméléon sont sur trois plans d'un même espace. */
  .wk-scene { perspective: 1700px; perspective-origin: 35% 38%; }
  .wk-scene-site { transform: rotateY(calc(-8deg + var(--px, 0) * 3.5deg)) rotateX(calc(2deg - var(--py, 0) * 2.5deg)); transform-style: preserve-3d; transform-origin: 55% 55%; transition: transform .5s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
  .wk-scene-site .wk-device-desktop { box-shadow: -26px 34px 70px rgba(0, 0, 0, .5), 0 4px 10px rgba(0, 0, 0, .25); }
  .wk-scene-site .wk-device-phone { transform: translateZ(64px); box-shadow: -18px 26px 44px rgba(0, 0, 0, .5); }
  .wk-scene-site .wk-mascot-hero { transform: translateZ(34px) scaleX(-1); }
  .wk-scene .wk-stage-caption { margin-top: 34px; }

  .wk-scene.is-anim .wk-scene-site { animation: wk-s-tilt 1.5s cubic-bezier(.2, .7, .2, 1) .1s backwards; }
  .wk-scene.is-anim .wk-device-phone { animation: wk-s-phone 1s cubic-bezier(.2, .7, .2, 1) 1s backwards; }
  .wk-scene.is-anim .wk-mascot-hero { animation: wk-s-mascot 1s cubic-bezier(.3, .6, .3, 1) 1.7s backwards; }
  .wk-scene.is-anim .wk-stage-caption { animation: wk-s-fade .4s ease 2.2s both; }
  .wk-scene.is-anim .wk-scene-agent { animation: wk-s-up .5s cubic-bezier(.2, .7, .2, 1) 2.6s both; }
  .wk-scene.is-anim .wk-scene-caption { animation: wk-s-fade .4s ease 2.8s both; }
  .wk-scene.is-anim .wk-sa-in { animation: wk-s-in .5s ease-out 3s both; }
  .wk-scene.is-anim .wk-sa-beam { animation: wk-s-grow .4s ease-out 3.5s both; }
  .wk-scene.is-anim .wk-sa-record { animation: wk-s-up .45s ease-out 3.8s both; }
  .wk-scene.is-anim .wk-sa-record dl div { animation: wk-s-fade .35s ease calc(4.2s + var(--r) * .25s) both; }
  .wk-scene.is-anim .wk-sa-reply { animation: wk-s-up .45s ease-out 4.9s both; }
  .wk-scene.is-anim .wk-sa-line { animation: wk-s-grow .4s ease-out calc(5.3s + var(--l) * .18s) both; }
  .wk-scene.is-anim .wk-sa-reply .wk-badge { animation: wk-s-fade .4s ease 6s both; }
}
@media (max-width: 1023px) { .wk-scene-replay { display: none; } }
/* Seul mouvement durable : la teinte de la mascotte, suspendue quand la scène n'est pas à l'écran. */
.wk-scene.is-offscreen .wk-mascot-tint { animation-play-state: paused; }

/* ---------- Démonstration d'agent : un point d'attention à la fois ---------- */
.wk-demo { position: relative; }
/* Barre de lecture : étape précédente, cinq étapes, étape suivante, pause. Sans script, les étapes sont une liste. */
.wk-demo-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wk-demo-top .wk-demo-steps { flex: 1; min-width: 0; margin-bottom: 0 !important; overflow: visible; }
.wk-demo:not(.is-anim) .wk-demo-top { align-items: flex-start; }
.wk-demo:not(.is-anim) .wk-demo-steps { display: grid; gap: 6px; }
.wk-demo:not(.is-anim) .wk-demo-steps button { width: 100%; min-height: 40px; height: auto; padding: 6px 14px 6px 6px; border-radius: 22px; white-space: normal; text-align: left; }
.wk-demo-steps em { font-style: normal; }
.wk-demo.is-anim .wk-demo-steps { gap: 6px; align-items: center; }
.wk-demo.is-anim .wk-demo-steps li { position: relative; flex: 0 0 auto; }
.wk-demo.is-anim .wk-demo-steps li + li { padding-left: 14px; }
.wk-demo.is-anim .wk-demo-steps li + li::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 2px; margin-top: -1px; background: var(--line-dark); }
.wk-demo.is-anim .wk-demo-steps button { width: 40px; min-height: 40px; padding: 0; justify-content: center; border-color: transparent; }
.wk-demo.is-anim .wk-demo-steps button span { width: 30px; height: 30px; font-size: .8125rem; }
.wk-demo.is-anim .wk-demo-steps button[aria-current="step"] span { box-shadow: 0 0 0 4px rgba(255, 193, 14, .25); }
.wk-demo.is-anim .wk-demo-steps em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wk-demo-nav { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-dark); background: transparent; color: #fff; font: 400 1.375rem/1 var(--font-text); cursor: pointer; }
.wk-demo-nav span { display: block; margin-top: -3px; }
.wk-demo-nav:disabled { opacity: .3; cursor: default; }
.wk-demo-nav:not(:disabled):hover { border-color: var(--wk-yellow); }
.wk-demo-control { flex: none; min-height: 40px; margin-left: auto; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-dark); background: transparent; color: #fff; font: 600 .8125rem var(--font-text); cursor: pointer; }
.wk-demo-control::before { content: "❚❚"; margin-right: 8px; font-size: .625rem; letter-spacing: 1px; color: var(--wk-yellow); vertical-align: 1px; }
.wk-demo-control[data-etat="reprendre"]::before { content: "▶"; font-size: .6875rem; letter-spacing: 0; }
.wk-demo-control[data-etat="rejouer"]::before { content: "↻"; font-size: .9375rem; letter-spacing: 0; vertical-align: -1px; }
.wk-demo-control:hover { border-color: var(--wk-yellow); }
/* L'étape en cours, en toutes lettres : toujours visible, sur deux lignes au plus. */
.wk-demo .wk-demo-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: 3em; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 193, 14, .1); border-left: 3px solid var(--wk-yellow); color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.35; }
.wk-demo-caption[hidden] { display: none; }
.wk-demo-caption b { flex: none; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wk-yellow); }
/* Petit écran : les cinq étapes sur une ligne entière, puis les flèches à gauche et la pause à droite. Rien ne déborde. */
@media (max-width: 599px) {
  .wk-scenario { padding: 14px; }
  .wk-demo.is-anim .wk-demo-top { flex-wrap: wrap; gap: 8px; }
  .wk-demo.is-anim .wk-demo-top .wk-demo-steps { order: -1; flex: 0 0 100%; justify-content: space-between; }
  .wk-demo.is-anim .wk-demo-steps li + li { padding-left: 0; }
  .wk-demo.is-anim .wk-demo-steps li + li::before { content: none; }
}

.wk-demo-msg, .wk-demo-sources, .wk-demo-tool, .wk-demo-draft, .wk-demo-left, .wk-demo-actions, .wk-demo dl { transition: opacity .6s ease, box-shadow .6s ease; }
.wk-demo-msg { outline: 3px solid transparent; outline-offset: 4px; transition: opacity .6s ease, outline-color .6s ease; }
.wk-demo dl div { transition: background-color .6s; }
.wk-demo-draft mark { background: #ffe38a; }

/* Avant lecture : ce qui n'est pas encore arrivé est masqué ; l'état « is-on » le révèle. */
.wk-demo.is-anim mark:not(.is-on) { background: transparent; font-weight: 400; box-shadow: none; }
.wk-demo.is-anim mark.is-now { box-shadow: 0 0 0 3px rgba(255, 193, 14, .5); }
.wk-demo.is-anim dl div:not(.is-on) dd span { opacity: 0; transform: translateX(-8px); }
.wk-demo.is-anim dl div.is-on dd span { background: transparent; }
.wk-demo.is-anim dl div.is-now { background: #fff8de; }
.wk-demo.is-anim dl div.is-now dd span { background: #ffe38a; }
.wk-demo.is-anim .wk-demo-sources li:not(.is-on)::before { opacity: 0; }
.wk-demo.is-anim .wk-demo-sources li.is-on { border-color: var(--wk-yellow); }
.wk-demo.is-anim .wk-demo-sources li.is-now { background: rgba(255, 193, 14, .2); }
.wk-demo.is-anim:not(.has-draft) .wk-demo-draft-text { clip-path: inset(0 100% 0 0); opacity: 0; }
.wk-demo.is-anim.has-draft .wk-demo-draft-text { clip-path: inset(0 0 0 0); }
.wk-demo.is-anim:not(.is-check) .wk-demo-actions { opacity: .25; pointer-events: none; }
.wk-demo.is-anim.is-focus.is-check .wk-demo-actions { box-shadow: inset 0 0 0 3px rgba(255, 193, 14, .6); border-radius: 0 0 10px 10px; background: #fffbea; }

/* Pendant la lecture, ce qui n'est pas le sujet de l'étape s'estompe. Étapes : 1 demande, 2 fiche, 3 sources, 4 réponse, 5 validation. */
.wk-demo.is-focus[data-etape="1"] .wk-demo-tool { opacity: .34; }
.wk-demo.is-focus[data-etape="1"] .wk-demo-sources, .wk-demo.is-focus[data-etape="2"] .wk-demo-sources { opacity: .28; }
.wk-demo.is-focus[data-etape="1"] .wk-demo-msg { outline-color: var(--wk-yellow); }
.wk-demo.is-focus[data-etape="3"] .wk-demo-msg { opacity: .42; }
.wk-demo.is-focus[data-etape="4"] .wk-demo-left, .wk-demo.is-focus[data-etape="5"] .wk-demo-left { opacity: .42; }
.wk-demo.is-focus[data-etape="2"] .wk-demo-draft, .wk-demo.is-focus[data-etape="3"] .wk-demo-draft { opacity: .45; }
.wk-demo.is-focus[data-etape="4"] .wk-demo-draft { box-shadow: 0 0 0 3px rgba(255, 193, 14, .45); }
.wk-demo.is-focus[data-etape="4"] dl, .wk-demo.is-focus[data-etape="5"] dl { opacity: .55; }

/* Petit écran : seuls les panneaux de l'étape sont affichés, dans une hauteur réservée (pas de saut de page). */
.wk-demo.is-stage .wk-demo-body { min-height: 400px; align-content: start; }
.wk-demo.is-stage dl div { align-items: flex-start; }
.wk-demo.is-stage dt { max-width: 42%; }
.wk-demo.is-stage[data-vue="a"] .wk-demo-sources, .wk-demo.is-stage[data-vue="a"] .wk-demo-tool,
.wk-demo.is-stage[data-vue="ac"] .wk-demo-sources, .wk-demo.is-stage[data-vue="ac"] .wk-demo-draft, .wk-demo.is-stage[data-vue="ac"] .wk-demo-actions, .wk-demo.is-stage[data-vue="ac"] .is-from-src,
.wk-demo.is-stage[data-vue="bc"] .wk-demo-msg, .wk-demo.is-stage[data-vue="bc"] .wk-demo-draft, .wk-demo.is-stage[data-vue="bc"] .wk-demo-actions, .wk-demo.is-stage[data-vue="bc"] .is-from-msg,
.wk-demo.is-stage[data-vue="d"] .wk-demo-left, .wk-demo.is-stage[data-vue="d"] dl { display: none; }
.wk-demo.is-stage .wk-demo-tool, .wk-demo.is-stage .wk-demo-sources, .wk-demo.is-stage .wk-demo-msg { animation: wk-demo-in .45s ease both; opacity: 1 !important; }
.wk-demo.is-stage[data-vue="ac"] dl, .wk-demo.is-stage[data-vue="bc"] dl { margin-bottom: 12px; }
@keyframes wk-demo-in { from { opacity: 0; transform: translateY(8px); } }

/* Puce qui porte une information de la demande (ou d'une source) vers le champ de la fiche. */
@media (min-width: 900px) { .wk-demo-left { align-content: center; } }
.wk-demo-fly { position: absolute; z-index: 5; left: 0; top: 0; padding: 1px 7px; border-radius: 4px; background: var(--wk-yellow); color: var(--wk-ink); font-weight: 700; font-size: .8125rem; line-height: 1.6; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); transition: transform .74s cubic-bezier(.45, 0, .2, 1); will-change: transform; }

/* ---------- Aperçu d'agent (carte d'offre) ---------- */
.wk-offer-visual.is-agent { aspect-ratio: auto; min-height: 250px; padding: 22px; align-items: center; background: var(--wk-ink) radial-gradient(60% 70% at 50% 50%, rgba(255, 255, 255, .07), transparent 70%); }
.wk-apercu { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; font-size: .75rem; line-height: 1.3; }
.wk-apercu ul { display: grid; gap: 8px; margin: 0; }
.wk-offer .wk-apercu li::before { content: none; }
.wk-offer .wk-apercu-in li { padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; transform: rotate(calc(-3deg + var(--i) * 2.5deg)) translateX(calc(var(--i) * 6px)); }
.wk-apercu b { display: block; }
.wk-apercu small { color: var(--on-dark-muted); font-size: .6875rem; }
.wk-apercu-core { position: relative; display: grid; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--wk-yellow); background: var(--wk-ink-2); box-shadow: 0 0 34px rgba(255, 193, 14, .22); }
.wk-apercu-core::before, .wk-apercu-core::after { content: ""; position: absolute; top: 50%; width: 14px; height: 2px; background: repeating-linear-gradient(90deg, var(--wk-yellow) 0 4px, transparent 4px 7px); }
.wk-apercu-core::before { left: -15px; }
.wk-apercu-core::after { right: -15px; }
.wk-apercu-core span { font-size: .625rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--wk-yellow); }
.wk-apercu-core i { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 7px; background: var(--wk-ink-3); color: #fff; font-style: normal; font-weight: 600; }
.wk-apercu-core i::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wk-yellow); }
.wk-offer .wk-apercu-out li { padding: 9px 11px; border-radius: 9px; background: #fff; color: var(--text-strong); box-shadow: var(--shadow-lg); }
.wk-apercu-out small { color: var(--muted); }
@media (max-width: 420px) { .wk-apercu { gap: 10px; font-size: .6875rem; } .wk-apercu-core { padding: 9px; } }

/* ---------- Offre « Sites web & e-commerce » : boutique et site vitrine ---------- */
.wk-offer-visual.is-duo { position: relative; align-items: flex-start; }
.wk-offer-visual.is-duo .wk-device-tall { right: 18px; bottom: 0; width: 24%; max-height: 82%; border-radius: 10px 10px 0 0; border-bottom: 0; }

/* ---------- Exemple d'agent sur l'accueil ---------- */
.wk-example-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 32px; margin-bottom: 28px; }
.wk-example-head .wk-head { margin-bottom: 0; }
.wk-example-head .wk-link { color: #fff; }
.wk-example-section .wk-demo { background: var(--wk-ink-2); }

@media (prefers-reduced-motion: reduce) {
  .wk-scene *, .wk-apercu * { animation: none !important; }
  .wk-scene-site { transition: none !important; }
  .wk-demo *, .wk-demo { transition: none !important; animation: none !important; }
}

/* Démonstration sans lecture (sans script, animations réduites) : les cinq étapes côte à côte sur grand écran. */
@media (min-width: 1000px) {
  .wk-demo:not(.is-anim) .wk-demo-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .wk-demo:not(.is-anim) .wk-demo-steps button { height: 100%; align-items: flex-start; border-radius: 12px; padding: 10px 12px 10px 8px; line-height: 1.35; }
  .wk-demo:not(.is-anim) .wk-demo-top { flex-wrap: wrap; }
  .wk-demo:not(.is-anim) .wk-demo-top .wk-demo-steps { flex: 0 0 100%; }
}
/* Petit écran, étape des sources : la fiche seule, avec une ligne par source (nom et ce qu'elle apporte). */
.wk-demo.is-stage[data-vue="bc"] .wk-demo-left { display: none; }
