/* =====================================================
   Service Commercial IA — motion design (09/11/2026)
   Tout est coupé si le visiteur demande moins d'animations
   (prefers-reduced-motion).
   ===================================================== */

/* Barre de progression de lecture */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transform-origin: 0 50%; transform: scaleX(0);
  z-index: 200; pointer-events: none;
}

/* Hero : halos qui respirent et « + » qui flottent */
.hero { position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.hero-deco { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55;
  animation: orb-drift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 420px; height: 420px; right: -80px; top: 60px; background: rgba(244, 80, 44, 0.22); }
.orb-2 { width: 360px; height: 360px; left: -120px; bottom: -120px; background: rgba(18, 43, 74, 0.16); animation-duration: 22s; }
@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 40px) scale(1.15); }
}
.plus {
  position: absolute; width: 34px; height: 34px; opacity: 0.85;
  animation: plus-float 9s ease-in-out infinite;
}
.plus::before, .plus::after { content: ""; position: absolute; border-radius: 4px; }
.plus::before { left: 50%; top: 0; width: 28%; height: 100%; transform: translateX(-50%); background: var(--accent); }
.plus::after  { top: 50%; left: 0; height: 28%; width: 100%; transform: translateY(-50%); background: var(--navy); }
.plus-1 { right: 12%; top: 26%; }
.plus-2 { right: 26%; top: 66%; width: 22px; height: 22px; animation-delay: -3s; opacity: 0.6; }
.plus-3 { right: 6%;  top: 76%; width: 48px; height: 48px; animation-delay: -6s; opacity: 0.35; }
.plus-4 { left: 56%;  top: 16%; width: 18px; height: 18px; animation-delay: -1.5s; opacity: 0.5; }
@keyframes plus-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(90deg); }
}

/* Mot accentué du titre : soulignement qui se dessine */
.hero h1 .accent { position: relative; display: inline-block; }
.hero h1 .accent::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.12em;
  background: var(--accent); border-radius: 4px; opacity: 0.28;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 1s cubic-bezier(.2,.7,.2,1) 0.6s;
}
.hero h1.visible .accent::after, html:not(.js) .hero h1 .accent::after { transform: scaleX(1); }

/* Boutons principaux : reflet qui traverse */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg); z-index: -1; pointer-events: none;
  animation: btn-shine 4.5s ease-in-out infinite;
}
@keyframes btn-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* Bandeau défilant des outils */
.marquee {
  background: var(--navy); color: #F1F3F7; overflow: hidden;
  padding: 16px 0; border-top: 3px solid var(--accent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px; padding-right: 56px;
}
.marquee span::before { content: "+"; color: var(--accent); font-size: 1.35rem; font-weight: 700; }
.marquee em { font-style: normal; font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; color: rgba(241,243,247,0.65); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Conversations qui s'écrivent en direct */
html.js .chat.typing .bubble, html.js .chat.typing .chat-note { display: none; }
html.js .chat .bubble.shown, html.js .chat .chat-note.shown { display: block; animation: bubble-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.typing-dots {
  align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px;
  background: #EEF1F5; border-radius: 16px; border-bottom-left-radius: 4px;
}
.typing-dots.right { align-self: flex-end; background: var(--navy); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite ease-in-out; }
.typing-dots.right i { background: #F1F3F7; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Lignes d'application qui s'allument une à une */
html.js .app.cascade .app-row { opacity: 0; transform: translateX(-14px); }
html.js .app .app-row.shown { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

/* Fenêtres et cartes : relief au survol, halo qui suit la souris */
.window, .card,
html.js .card.reveal.visible, html.js .window.reveal.visible {
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, opacity .7s ease;
}
@media (hover: hover) and (pointer: fine) {
  .card { position: relative; }
  .card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(244, 80, 44, 0.13), transparent 60%);
    opacity: 0; transition: opacity .3s ease;
  }
  .card:hover::before { opacity: 1; }
  .card:hover { box-shadow: 0 22px 50px rgba(11, 28, 51, 0.14); }
  .window:hover { box-shadow: 0 34px 80px rgba(11, 28, 51, 0.2); }
}

/* Chiffres clés : léger rebond à la fin du comptage */
.stat-num { display: inline-block; }
.stat-num.counted { animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }

/* SelfCode : ligne orange qui relie les étapes au fil du défilement */
.steps-line { position: relative; }
.steps-line::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 52px; height: 3px; z-index: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 3px; transform: scaleX(var(--progress, 0)); transform-origin: 0 50%;
}
.steps-line .card { z-index: 1; }
.steps-line .offer-step { transition: background .4s ease, color .4s ease, transform .4s ease; }
.steps-line .card.lit .offer-step { background: var(--accent); color: var(--white); transform: scale(1.06); }

/* Un agent par service */
.services-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 72px; }
.services { margin-top: 28px; }
.service { display: flex; flex-direction: column; gap: 6px; }
.service h3 { font-size: 1.25rem; margin: 6px 0 4px; }
.service p strong { color: var(--navy); }
.service-status {
  align-self: flex-start; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
  background: rgba(18, 43, 74, 0.08); color: var(--navy);
}
.service-status.live { background: rgba(244, 80, 44, 0.12); color: var(--accent); }
.service-status.live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: 1px;
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 80, 44, 0.5); } 50% { box-shadow: 0 0 0 6px rgba(244, 80, 44, 0); } }
.service-next { border: 2px dashed rgba(244, 80, 44, 0.45); background: #FFF8F5; }
.service-link { margin-top: auto; padding-top: 10px; color: var(--accent); font-weight: 600; text-decoration: none; }
.service-link:hover { text-decoration: underline; }

/* Vidéo SelfCode */
.video-frame { margin: 36px 0 8px; }
.video-frame video { display: block; width: 100%; height: auto; background: var(--navy-deep); aspect-ratio: 16 / 9; }

/* Sections sombres : le halo orange se déplace lentement */
.section-dark { background-size: 140% 140%; animation: dark-glow 16s ease-in-out infinite alternate; }
@keyframes dark-glow { from { background-position: 0% 0%; } to { background-position: 100% 60%; } }

@media (max-width: 980px) {
  .steps-line::before { display: none; }
  .plus-3, .plus-4 { display: none; }
}
@media (max-width: 720px) {
  .plus-1, .plus-2 { display: none; }
  .orb-1 { width: 260px; height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .chat.typing .bubble, html.js .chat.typing .chat-note { display: block !important; }
  html.js .app.cascade .app-row { opacity: 1 !important; transform: none !important; }
  .typing-dots { display: none !important; }
  .scroll-progress { display: none; }
  .steps-line::before { transform: scaleX(1); }
}
