/* ==========================================================================
   Web Katalyst — Landing IA V0.2 : direction visuelle
   Hero (scène), démonstration (interface), méthode (schéma), emplacements mascotte.
   Uniquement des éléments HTML/CSS/SVG : textes nets et modifiables, aucune bibliothèque.
   Règle : l'état par défaut est l'état FINAL, lisible sans animation. Les animations
   ne s'appliquent que sous .is-playing / .is-armed, posées par js/main.js.
   ========================================================================== */

/* ---------- Étiquettes communes ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font: 700 .6875rem/1.3 var(--font-text); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tag-illus { background: rgba(255,255,255,.08); color: var(--on-dark-muted); border: 1px solid var(--line-dark); }
.tag-real { background: transparent; color: var(--wk-yellow); border: 1px solid var(--wk-yellow); }
.tag-real::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wk-yellow); }
.redact { display: inline-block; color: transparent; background: #3a3f4c; border-radius: 3px; line-height: 1.1; letter-spacing: -.1em; user-select: none; vertical-align: -1px; }
.section-dark .redact, .demo .redact { background: #4a5060; }

/* ==========================================================================
   1. HERO — scène
   ========================================================================== */
.hero-ia { padding-bottom: 56px; }
@media (min-width: 1024px) { .hero-ia .hero-grid { grid-template-columns: .92fr 1.08fr; gap: 48px; } }

.scene { margin: 0; min-width: 0; }
.scene figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; font-size: .8125rem; line-height: 1.45; color: var(--on-dark-muted); }
.scene-stage { container-type: inline-size; position: relative; }
.scene-plane { position: relative; }
.scene-glow { position: absolute; pointer-events: none; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,193,14,.20), rgba(255,193,14,.06) 55%, transparent); filter: blur(2px); }

/* Cartes d'entrée (sombres, en volume) */
.sc-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: linear-gradient(180deg, #2c303c, #1d2029); border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 28px -14px rgba(0,0,0,.75); color: #fff; }
.sc-txt { display: grid; min-width: 0; line-height: 1.25; }
.sc-txt b { font: 700 .8125rem/1.3 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-txt small { font-size: .6875rem; color: var(--on-dark-muted); }

/* Pictogrammes en CSS */
.sc-ico { position: relative; flex: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: #383d4a; color: #fff; font: 800 .5625rem/1 var(--font-text); letter-spacing: .02em; }
.sc-ico-mail::before { content: ""; width: 14px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; }
.sc-ico-mail::after { content: ""; position: absolute; width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-3px) rotate(45deg); }
.sc-ico-doc { background: #f4f4f2; color: var(--wk-ink); }
.sc-ico-person::before { content: ""; position: absolute; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sc-ico-person::after { content: ""; position: absolute; bottom: 6px; width: 14px; height: 7px; border-radius: 7px 7px 2px 2px; background: currentColor; }
.sc-ico-chat::before { content: ""; width: 15px; height: 11px; border: 1.5px solid currentColor; border-radius: 5px 5px 5px 1px; }

/* Le processus (bloc central éclairé) */
.sc-core { position: relative; display: grid; gap: 8px; padding: 14px; border-radius: 14px;
  background: linear-gradient(160deg, #262a35 0%, #171a22 100%);
  border: 1px solid rgba(255,193,14,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(0,0,0,.4), 0 24px 40px -18px rgba(0,0,0,.8), 0 0 46px -10px rgba(255,193,14,.28); }
.sc-core-title { font: 700 .625rem/1 var(--font-text); letter-spacing: .16em; text-transform: uppercase; color: var(--wk-yellow); }
.sc-step { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.05); color: #fff; font: 700 .8125rem/1.2 var(--font-title); }
.sc-step i { width: 8px; height: 8px; border-radius: 50%; background: var(--wk-yellow); box-shadow: 0 0 10px rgba(255,193,14,.8); }
.sc-beam { display: none; position: absolute; height: 2px; background: repeating-linear-gradient(90deg, rgba(255,193,14,.85) 0 6px, transparent 6px 12px); }

/* Ce qui est produit (cartes claires) */
.sc-out { position: relative; }
.sc-record, .sc-reply { border-radius: 12px; background: #fff; color: var(--text-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 22px 40px -16px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.25); padding: 12px 14px; }
.sc-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 700 .8125rem/1.2 var(--font-title); }
.sc-head .sc-ico { width: 22px; height: 22px; border-radius: 6px; background: var(--wk-ink); transform: scale(.9); }
.sc-record dl { margin: 0; display: grid; gap: 0; }
.sc-record dl > div { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid #eceae6; font-size: .75rem; }
.sc-record dt { color: var(--muted); }
.sc-record dd { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--wait-bg); color: var(--wait-ink); font-size: .6875rem; font-weight: 700; }
.sc-line { display: block; height: 6px; width: var(--w); margin: 0 0 7px; border-radius: 3px; background: #e6e5e1; transform-origin: left center; }
.sc-validate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.sc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--wk-yellow); color: var(--wk-ink); font: 700 .6875rem/1.3 var(--font-text); white-space: nowrap; }
.sc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wk-ink); }
.sc-btn { padding: 3px 9px; border-radius: 5px; background: var(--wk-ink); color: #fff; font: 700 .6875rem/1.3 var(--font-text); }
.sc-btn-ghost { background: transparent; color: var(--text-strong); border: 1px solid #d6d6d2; }

/* ---------- Disposition MOBILE (par défaut) : verticale, simplifiée ---------- */
.scene-plane { display: grid; gap: 12px; }
.scene-glow { left: 10%; right: 10%; top: 30%; height: 40%; }
.sc-in { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-in .sc-card { padding: 8px 10px; gap: 8px; }
.sc-in .sc-ico { width: 24px; height: 24px; }
.sc-in .sc-txt small { display: none; }
.sc-in .sc-msg .sc-txt b { font-size: 0; }
.sc-in .sc-msg .sc-txt b::after { content: "Message"; font-size: .8125rem; }
.sc-core { grid-template-columns: auto 1fr 1fr 1fr; align-items: center; padding: 10px; gap: 6px; }
.sc-core-title { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .5625rem; }
.sc-step { justify-content: center; padding: 8px 6px; font-size: .75rem; }
.sc-out { display: grid; gap: 10px; }
.sc-reply .sc-line:nth-of-type(n+3) { display: none; }

/* ---------- Disposition LARGE : scène en volume ---------- */
@container (min-width: 520px) {
  .scene-stage { perspective: 1700px; perspective-origin: 30% 40%; }
  .scene-plane { display: block; height: 0; padding-bottom: 74%; transform-style: preserve-3d; transform: rotateX(9deg) rotateY(-15deg) rotateZ(.6deg); }
  .scene-plane > * { position: absolute; }
  .scene-glow { left: 22%; top: 8%; width: 46%; height: 86%; }

  .sc-in { inset: 0 auto 0 0; width: 37%; display: block; }
  .sc-in .sc-card { position: absolute; width: 92%; padding: 9px 12px; }
  .sc-in .sc-txt small { display: block; }
  .sc-in .sc-msg .sc-txt b { font-size: .8125rem; }
  .sc-in .sc-msg .sc-txt b::after { content: none; }
  .sc-mail    { left: 0;   top: 6%;  transform: rotate(-5deg) translateZ(30px); }
  .sc-doc     { left: 10%; top: 29%; transform: rotate(4deg)  translateZ(10px); }
  .sc-contact { left: 1%;  top: 53%; transform: rotate(-2deg) translateZ(40px); }
  .sc-msg     { left: 8%;  top: 76%; transform: rotate(3deg)  translateZ(0); }

  .sc-core { left: 40%; top: 20%; width: 21%; grid-template-columns: 1fr; padding: 14px; transform: translateZ(20px); }
  .sc-core-title { writing-mode: horizontal-tb; transform: none; font-size: .625rem; }
  .sc-step { justify-content: flex-start; }
  .sc-beam { display: block; top: 52%; }
  .sc-beam-in { right: 100%; width: 22%; }
  .sc-beam-out { left: 100%; width: 18%; }

  .sc-out { right: 0; top: 0; width: 36%; height: 100%; display: block; transform: translateZ(50px); }
  .sc-record { position: absolute; top: 2%; left: 0; right: 0; }
  .sc-reply { position: absolute; top: 55%; left: 6%; right: -4%; }
  .sc-reply .sc-line:nth-of-type(n+3) { display: block; }
}

/* ---------- Animation (seulement sous .is-playing) ----------
   Cycle de 10 s : les informations entrent dans le processus, les étapes s'allument,
   la fiche se remplit, la réponse s'écrit, puis « À valider ». 0 % = 100 % = état final. */
.scene { --cycle: 10s; }
.scene.is-playing .sc-in .sc-card { animation: sc-card-in var(--cycle) cubic-bezier(.55,.05,.35,1) infinite; animation-delay: calc(var(--i) * .45s); }
.scene.is-playing .sc-step { animation: sc-step var(--cycle) ease infinite; animation-delay: calc(var(--s) * .5s); }
.scene.is-playing .sc-step i { animation: sc-dot var(--cycle) ease infinite; animation-delay: calc(var(--s) * .5s); }
.scene.is-playing .sc-record dl > div { animation: sc-row var(--cycle) ease infinite; animation-delay: calc(var(--r) * .35s); }
.scene.is-playing .sc-line { animation: sc-line var(--cycle) ease infinite; animation-delay: calc(var(--l) * .3s); }
.scene.is-playing .sc-validate { animation: sc-badge var(--cycle) ease infinite; }
.scene.is-playing .sc-beam { animation: sc-beam .9s linear infinite; }
.scene.is-playing .scene-glow { animation: sc-glow var(--cycle) ease infinite; }
.scene.is-paused * { animation-play-state: paused !important; }

/* Mobile : les cartes descendent vers le processus ; large : elles glissent vers la droite */
.sc-in .sc-card { --tx: 0px; --ty: 70px; --rot: 0deg; }
@container (min-width: 520px) {
  .sc-mail    { --tx: 33cqw; --ty: 12cqw;  --rot: -5deg; }
  .sc-doc     { --tx: 26cqw; --ty: 4cqw;   --rot: 4deg; }
  .sc-contact { --tx: 32cqw; --ty: -6cqw;  --rot: -2deg; }
  .sc-msg     { --tx: 28cqw; --ty: -18cqw; --rot: 3deg; }
}
@keyframes sc-card-in {
  0%, 10%   { opacity: 1; translate: 0 0; scale: 1; }
  24%       { opacity: 0; translate: var(--tx) var(--ty); scale: .35; }
  86%       { opacity: 0; translate: 0 -8px; scale: .96; }
  94%, 100% { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes sc-step {
  0%, 22%   { background: rgba(255,255,255,.05); }
  27%, 62%  { background: rgba(255,193,14,.16); }
  72%, 100% { background: rgba(255,255,255,.05); }
}
@keyframes sc-dot {
  0%, 22%   { background: #6b7080; box-shadow: none; }
  27%, 100% { background: var(--wk-yellow); box-shadow: 0 0 10px rgba(255,193,14,.8); }
}
@keyframes sc-row {
  0%, 12%   { opacity: 1; translate: 0 0; }
  16%, 38%  { opacity: 0; translate: -8px 0; }
  44%, 100% { opacity: 1; translate: 0 0; }
}
@keyframes sc-line {
  0%, 12%   { transform: scaleX(1); }
  16%, 50%  { transform: scaleX(0); }
  58%, 100% { transform: scaleX(1); }
}
@keyframes sc-badge {
  0%, 12%   { opacity: 1; scale: 1; }
  16%, 64%  { opacity: 0; scale: .9; }
  68%       { opacity: 1; scale: 1.06; }
  71%, 100% { opacity: 1; scale: 1; }
}
@keyframes sc-beam { to { background-position: 12px 0; } }
@keyframes sc-glow {
  0%, 18%   { opacity: .7; }
  32%, 60%  { opacity: 1; }
  80%, 100% { opacity: .7; }
}

/* ==========================================================================
   2. DÉMONSTRATION — interface
   ========================================================================== */
.demo-head { display: grid; gap: 20px; margin-bottom: 36px; }
@media (min-width: 1000px) { .demo-head { grid-template-columns: 1fr 1fr; gap: 64px; align-items: end; } }
.demo-head h2 { margin: 0; color: #fff; font-size: clamp(1.75rem, 1.25rem + 2.1vw, 2.75rem); letter-spacing: -.01em; }
.demo-intro p { color: #dde0e6; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .8125rem; color: var(--on-dark-muted); }
.legend li { display: flex; align-items: center; gap: 8px; }

/* Démonstration : la scène à étapes est dans css/sections.css (V0.4). */
.fict { font-weight: 400; color: var(--on-dark-muted); }

/* ==========================================================================
   4. MASCOTTE — emplacements réservés (masqués ; visibles en aperçu ?mascotte=1)
   ========================================================================== */
.mascot-slot { pointer-events: none; }
.mascot-preview .mascot-slot { display: grid !important; place-items: center; text-align: center; border: 2px dashed var(--wk-yellow); border-radius: 50% 50% 46% 54%; background: rgba(255,193,14,.08); color: var(--wk-yellow); font: 700 .6875rem/1.25 var(--font-text); padding: 8px; }
.mascot-preview .mascot-slot::after { content: attr(data-mascot-label); }
.mascot-hero { position: absolute; width: 46%; aspect-ratio: 1; right: -14%; bottom: -10%; }
.mascot-demo { position: absolute; width: 92px; height: 92px; right: 14px; bottom: 54px; }
.mascot-contact { width: 120px; height: 120px; margin: 24px 0 0; }
@container (max-width: 519px) { .mascot-hero { position: relative; right: auto; bottom: auto; width: 96px; justify-self: end; margin-top: -40px; } }

/* ==========================================================================
   Mouvement réduit : tout est figé dans l'état final
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .scene * { animation: none !important; transition: none !important; }
}

/* Bouton pause de la scène (même style que le bandeau) */
/* Commande de pause discrète : icône seule ; le libellé reste pour les lecteurs d'écran (WCAG 2.2.2). */
.scene-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--on-dark-muted); opacity: .7; cursor: pointer; vertical-align: middle; position: relative; }
.scene-toggle:hover, .scene-toggle:focus-visible { opacity: 1; border-color: var(--line-dark); color: var(--on-dark); }
.scene-toggle .mt-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.scene-toggle .mt-icon { width: 9px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.scene-toggle[aria-pressed="true"] .mt-icon { border: 0; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 9px solid currentColor; }
@media (pointer: coarse) { .scene-toggle { width: 44px; height: 44px; } }

/* ==========================================================================
   5. CAMÉLÉON — observateur discret de la scène (V0.3)
   Décoratif : ne recouvre ni texte, ni fiche, ni bouton. Une seule présence dans la page.
   Apparition douce, une fois : il prend d'abord les teintes de l'interface (anthracite et jaune), puis ses couleurs propres.
   Mouvement réduit : affiché tel quel, sans transition.
   ========================================================================== */
/* Mobile : au coin bas droit de la « Réponse préparée », tourné vers elle, à droite des boutons (jamais dessus). */
.scene-mascot { position: absolute; z-index: 3; pointer-events: none; height: auto; width: 100px; right: -6px; bottom: -30px; transform: scaleX(-1);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
/* Ordinateur : sous le bloc « Processus », tourné vers la réponse prête. */
@container (min-width: 520px) { .scene-mascot { left: 37.5%; right: auto; bottom: 0; width: 25%; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .scene-mascot { animation: mascot-adapt 2.6s ease-out .5s both; }
}
@keyframes mascot-adapt {
  0%   { opacity: 0; filter: grayscale(1) sepia(1) saturate(2.4) brightness(.62) drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
  35%  { opacity: 1; filter: grayscale(1) sepia(1) saturate(2.4) brightness(.62) drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
  100% { opacity: 1; filter: grayscale(0) sepia(0) saturate(1) brightness(1) drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
}
