/* ============================================================
   IDENTITÉ DE MARQUE — NOTRE APPROCHE
   "L'IA accélère. L'œil humain décide."
   ============================================================ */

.bb-craft,
.bb-craft *,
.bb-craft *::before,
.bb-craft *::after {
  box-sizing: border-box;
}

.bb-craft h2,
.bb-craft h3 {
  display: block;
  white-space: normal;
  position: static;
  max-width: none;
  overflow: visible;
}

/* TOKENS */
.bb-craft {
  --bb-ink:         #0B1B2B;
  --bb-ink-soft:    #3A4A5A;
  --bb-ink-mute:    #5A6B7B;
  --bb-line:        #E8EEF6;
  --bb-line-soft:   #EFF2F8;

  --bb-ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --bb-font:        "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --mx: 50%;
  --my: 50%;

  position: relative;
  font-family: var(--bb-font);
  background: #FFFFFF;
  overflow: hidden;
  isolation: isolate;
}

/* CURSOR GLOW — mouse-following */
.bb-craft__cursor {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mx) var(--my),
    rgba(47, 123, 255, 0.09) 0%,
    rgba(47, 123, 255, 0.03) 25%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bb-craft:hover .bb-craft__cursor {
  opacity: 1;
}

/* GRAIN subtil */
.bb-craft__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.03;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

.bb-craft__inner {
  position: relative;
  z-index: 3;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0;
}

/* HEADER */
.bb-craft__head {
  text-align: center;
  margin: 0 auto 48px;
  max-width: 720px;
}

.bb-craft__kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 16px;
  margin: 0 0 22px;
  border-radius: 999px;
  background: rgba(var(--color-blue-rgb), 0.08);
  border: 1px solid rgba(var(--color-blue-rgb), 0.16);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-blue);
  max-width: max-content;
  overflow: hidden;
  isolation: isolate;
}

.bb-craft__kicker::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(47, 123, 255, 0.25) 50%, transparent 100%);
  animation: bb-craft-shimmer 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.bb-craft__kickerDot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-blue);
  flex-shrink: 0;
  z-index: 1;
  animation: bb-craft-pulse 2.5s ease-out infinite;
}

@keyframes bb-craft-shimmer {
  0%, 70%, 100% { transform: translateX(0); opacity: 0; }
  80%          { opacity: 1; }
  90%          { transform: translateX(400%); opacity: 0; }
}

@keyframes bb-craft-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0.6), 0 0 8px rgba(47, 123, 255, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(var(--color-blue-rgb), 0), 0 0 8px rgba(47, 123, 255, 0.6); }
  100% { box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0), 0 0 8px rgba(47, 123, 255, 0.6); }
}

.bb-craft__title {
  font-family: var(--bb-font);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--bb-ink);
  margin: 0 auto 16px;
  max-width: 18ch;
  text-wrap: balance;
}

.bb-craft__titleAccent {
  position: relative;
  display: inline-block;
  color: var(--color-blue);
  white-space: nowrap;
}

.bb-craft__titleAccent::after {
  content: "" !important;
  position: absolute !important;
  bottom: 4px !important;
  left: -4px !important;
  right: -4px !important;
  height: 14px !important;
  background: rgba(47, 123, 255, 0.35) !important;
  background-image: none !important;
  border-radius: 4px !important;
  z-index: 0 !important;
  display: block !important;
  pointer-events: none;
  /* Animation : la barre se déploie de gauche à droite au scroll */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.bb-craft.is-in-view .bb-craft__titleAccent::after {
  transform: scaleX(1);
}

.bb-craft__subtitle {
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 auto;
  color: var(--bb-ink-soft);
  max-width: 600px;
}

/* PROCESS LINE — IA → Humain → Marque prête */
.bb-craft__process {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 580px;
  margin: 0 auto 48px;
  padding: 0 30px;
}

.bb-craft__processTrack {
  position: absolute;
  top: 21px;
  left: 60px;
  right: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(var(--color-blue-rgb), 0.25) 0%,
    rgba(47, 123, 255, 0.45) 50%,
    rgba(var(--color-blue-rgb), 0.25) 100%
  );
  border-radius: 2px;
  overflow: hidden;
}

.bb-craft__processLight {
  position: absolute;
  top: 16px;
  left: 60px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow:
    0 0 0 1px var(--color-blue-bright),
    0 0 14px rgba(47, 123, 255, 0.9),
    0 0 28px rgba(47, 123, 255, 0.5);
  animation: bb-craft-travel 6s ease-in-out infinite;
  z-index: 2;
}

@keyframes bb-craft-travel {
  0%   { left: 60px; opacity: 0; transform: scale(0.6); }
  5%   { opacity: 1; transform: scale(1); }
  35%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
  50%  { left: calc(50% - 6px); opacity: 1; transform: scale(1.3); }
  65%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
  95%  { left: calc(100% - 72px); opacity: 1; transform: scale(1); }
  100% { left: calc(100% - 72px); opacity: 0; transform: scale(0.6); }
}

.bb-craft__processNode {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}

.bb-craft__processIcon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--bb-line);
  color: var(--bb-ink-mute);
  box-shadow:
    0 6px 14px rgba(11, 27, 43, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.5s var(--bb-ease),
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    background 0.4s ease;
}

.bb-craft__processIcon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.bb-craft__processNode--human .bb-craft__processIcon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-bright) 100%);
  border-color: rgba(var(--color-blue-rgb), 0.30);
  color: #FFFFFF;
  box-shadow:
    0 12px 28px rgba(var(--color-blue-rgb), 0.30),
    0 0 0 4px rgba(255, 255, 255, 0.95),
    0 0 24px rgba(47, 123, 255, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  animation: bb-craft-human-glow 2.8s ease-in-out infinite;
}

.bb-craft__processNode--human .bb-craft__processIcon svg {
  width: 24px;
  height: 24px;
}

@keyframes bb-craft-human-glow {
  0%, 100% {
    box-shadow:
      0 12px 28px rgba(var(--color-blue-rgb), 0.30),
      0 0 0 4px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(47, 123, 255, 0.20),
      inset 0 1px 0 rgba(255, 255, 255, 0.30);
  }
  50% {
    box-shadow:
      0 14px 32px rgba(var(--color-blue-rgb), 0.38),
      0 0 0 4px rgba(255, 255, 255, 0.95),
      0 0 40px rgba(47, 123, 255, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.30);
  }
}

.bb-craft__processNode--ai .bb-craft__processIcon {
  color: var(--color-blue);
}

.bb-craft__processNode--ready .bb-craft__processIcon {
  color: var(--color-blue);
}

.bb-craft__processLabel {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--bb-ink);
  line-height: 1;
  margin-top: 4px;
}

.bb-craft__processSub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-ink-mute);
  line-height: 1;
}

.bb-craft__processNode--human .bb-craft__processLabel {
  color: var(--color-blue);
}

/* CARDS — 3 mini cartes */
.bb-craft__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

.bb-craft__card {
  --mx: 50%;
  --my: 50%;

  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border: 1px solid var(--bb-line);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(11, 27, 43, 0.02),
    0 8px 22px rgba(11, 27, 43, 0.04);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.5s var(--bb-ease),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.bb-craft__card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mx) var(--my),
    rgba(47, 123, 255, 0.10),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.bb-craft__card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-blue-bright));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--bb-ease);
  z-index: 2;
}

.bb-craft__card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--color-blue-rgb), 0.20);
  box-shadow:
    0 16px 36px rgba(11, 27, 43, 0.07),
    0 6px 14px rgba(var(--color-blue-rgb), 0.06);
}

.bb-craft__card:hover::before { opacity: 1; }
.bb-craft__card:hover::after  { transform: scaleX(1); }

.bb-craft__cardIcon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-blue-soft);
  border: 1px solid rgba(var(--color-blue-rgb), 0.10);
  color: var(--color-blue);
  margin-bottom: 16px;
  transition:
    transform 0.5s var(--bb-ease),
    background 0.4s ease;
}

.bb-craft__cardIcon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.bb-craft__card:hover .bb-craft__cardIcon {
  background: rgba(var(--color-blue-rgb), 0.14);
  transform: rotate(-4deg) scale(1.06);
}

.bb-craft__cardTitle {
  position: relative;
  z-index: 1;
  font-family: var(--bb-font);
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--bb-ink);
  margin: 0 0 8px;
}

.bb-craft__cardText {
  position: relative;
  z-index: 1;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bb-ink-soft);
  margin: 0;
}

/* ANIMATIONS REVEAL AU SCROLL */
@media (prefers-reduced-motion: no-preference) {
  .bb-craft__kicker,
  .bb-craft__title,
  .bb-craft__subtitle,
  .bb-craft__process,
  .bb-craft__card {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(5px);
    transition:
      opacity 0.9s var(--bb-ease),
      transform 1s var(--bb-ease),
      filter 0.9s var(--bb-ease);
  }

  .bb-craft.is-in-view .bb-craft__kicker   { opacity: 1; transform: none; filter: none; transition-delay: 0.05s; }
  .bb-craft.is-in-view .bb-craft__title    { opacity: 1; transform: none; filter: none; transition-delay: 0.18s; }
  .bb-craft.is-in-view .bb-craft__subtitle { opacity: 1; transform: none; filter: none; transition-delay: 0.32s; }
  .bb-craft.is-in-view .bb-craft__process  { opacity: 1; transform: none; filter: none; transition-delay: 0.50s; }
  .bb-craft.is-in-view .bb-craft__card:nth-child(1) { opacity: 1; transform: none; filter: none; transition-delay: 0.70s; }
  .bb-craft.is-in-view .bb-craft__card:nth-child(2) { opacity: 1; transform: none; filter: none; transition-delay: 0.82s; }
  .bb-craft.is-in-view .bb-craft__card:nth-child(3) { opacity: 1; transform: none; filter: none; transition-delay: 0.94s; }
}

/* RESPONSIVE */
@media (max-width: 880px) {
  .bb-craft__inner { padding: 60px 0; }
  .bb-craft__head  { margin-bottom: 36px; }

  .bb-craft__title { font-size: clamp(24px, 5vw, 32px); }

  .bb-craft__titleAccent {
    white-space: normal;
    background-image: linear-gradient(to top, rgba(47, 123, 255, 0.22) 6px, transparent 6px);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0 2px;
  }
  .bb-craft__titleAccent::after { display: none; }

  .bb-craft__subtitle { font-size: 14.5px; }

  .bb-craft__process {
    max-width: 440px;
    margin-bottom: 36px;
    padding: 0 20px;
  }

  .bb-craft__processTrack { left: 50px; right: 50px; }

  .bb-craft__processLight {
    left: 50px;
  }
  @keyframes bb-craft-travel {
    0%   { left: 50px; opacity: 0; transform: scale(0.6); }
    5%   { opacity: 1; transform: scale(1); }
    35%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
    50%  { left: calc(50% - 6px); opacity: 1; transform: scale(1.3); }
    65%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
    95%  { left: calc(100% - 62px); opacity: 1; transform: scale(1); }
    100% { left: calc(100% - 62px); opacity: 0; transform: scale(0.6); }
  }

  .bb-craft__cards {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 460px;
  }

  .bb-craft__card:hover { transform: none; }
}

@media (max-width: 480px) {
  .bb-craft__inner { padding: 48px 0; width: min(1240px, calc(100% - 32px)); }

  .bb-craft__process { max-width: 100%; padding: 0 10px; }
  .bb-craft__processTrack { left: 40px; right: 40px; }
  .bb-craft__processNode { min-width: 64px; }
  .bb-craft__processIcon { width: 38px; height: 38px; }
  .bb-craft__processIcon svg { width: 17px; height: 17px; }
  .bb-craft__processNode--human .bb-craft__processIcon { width: 46px; height: 46px; }
  .bb-craft__processNode--human .bb-craft__processIcon svg { width: 21px; height: 21px; }
  .bb-craft__processLabel { font-size: 11px; }
  .bb-craft__processSub { font-size: 9px; }

  @keyframes bb-craft-travel {
    0%   { left: 40px; opacity: 0; transform: scale(0.6); }
    5%   { opacity: 1; transform: scale(1); }
    35%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
    50%  { left: calc(50% - 6px); opacity: 1; transform: scale(1.3); }
    65%  { left: calc(50% - 6px); opacity: 1; transform: scale(1); }
    95%  { left: calc(100% - 52px); opacity: 1; transform: scale(1); }
    100% { left: calc(100% - 52px); opacity: 0; transform: scale(0.6); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-craft *,
  .bb-craft *::before,
  .bb-craft *::after {
    animation: none !important;
    transition-duration: 0.1s !important;
  }
  .bb-craft__kicker,
  .bb-craft__title,
  .bb-craft__subtitle,
  .bb-craft__process,
  .bb-craft__card {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .bb-craft__titleAccent::after { transform: scaleX(1) !important; }
}

/* Defensive WP reset */
.bb-craft h2::before,
.bb-craft h2::after,
.bb-craft h3::before,
.bb-craft h3::after,
.bb-craft p::before,
.bb-craft p::after {
  content: none;
  display: none;
}
