/* ═══════════════════════════════════════════════════════════════════
   Section « boucle d'apprentissage » — remplace l'ancienne section
   `.intelligence` (aplat vert sombre, cartes abstraites).

   PRÉFIXE RENOMMÉ : `.loop-` ET NON `.hero-`
   Le bloc d'origine préfixait ses classes en `.hero-`. Aucune collision
   réelle avec l'existant — vérifié classe par classe — mais le site a
   une VRAIE section hero, avec `.hero-copy`, `.hero-glow`, `.hero-stage`.
   Un `.hero-card` situé 450 lignes plus bas aurait envoyé le prochain
   lecteur chercher au mauvais endroit. Le dessin est identique.

   AUCUNE DÉPENDANCE : pas de JS, pas d'image, pas d'icône externe.
   Les maquettes et les icônes sont des SVG intégrés.
   ═══════════════════════════════════════════════════════════════════ */

.loop-section {
  --loop-bg:     #D8EFD2;   /* fond de section */
  --loop-edge:   #0B2418;   /* contour des cartes — la signature de la DA */
  --loop-ink:    #0B2418;   /* titres */
  --loop-green:  #245F38;   /* accent : traits, chiffres, états */
  --loop-tint:   #E8F6EC;   /* surfaces douces à l'intérieur des cartes */
  --loop-line:   #E7EDE9;   /* filet des éléments de maquette */
  --loop-muted:  #45604F;
  --loop-soft:   #5C7367;
  --loop-font:   inherit;   /* hérite du Hanken Grotesk du site */
  --loop-max:    1280px;

  /* Le conteneur de requête est la SECTION, parent de la grille : un
     élément ne peut pas interroger sa propre taille. */
  container-type: inline-size;
  display: block;
  position: relative;
  overflow: hidden;
  background-color: var(--loop-bg);
  /* Aplat franc : ni dégradé, ni quadrillage. Le bloc d'origine posait
     un voile blanc radial et une grille de 56 px sur le fond vert. Le
     contour des cartes suffit à les détacher — deux textures qui se
     superposent finissent par se disputer l'attention. */
  color: var(--loop-ink);
  font-family: var(--loop-font);
  padding: 72px 28px;
  -webkit-font-smoothing: antialiased;
}

.loop-inner {
  max-width: var(--loop-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@container (min-width: 980px) {
  .loop-section { padding: 88px 48px; }
  .loop-inner { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 64px; }
}

/* ── Colonne texte ──────────────────────────────────────────────── */
.loop-eyebrow {
  display: block;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--loop-green);
}
.loop-title {
  margin: 0;
  /* Mêmes valeurs que le titre de la section voisine (« Les briques
     réunies »), qui reprend lui-même celles de la production :
     48 px, interligne 1.03, approche -2.1 px, 38 px sous 820 px.
     Le clamp d'origine montait jusqu'à 56 px — cette section aurait
     parlé plus fort que sa voisine sans raison. */
  font-size: 48px;
  line-height: 1.03;
  letter-spacing: -2.1px;
  font-weight: 700;
  text-wrap: balance;
}
@media (max-width: 820px) {
  .loop-title { font-size: 38px; }
}
.loop-lede {
  margin: 26px 0 0;
  max-width: 30em;
  font-size: clamp(14.5px, 1.25cqw, 16.5px);
  font-weight: 400;
  line-height: 1.65;
  color: var(--loop-muted);
  text-wrap: pretty;
}
.loop-cta {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--loop-edge);
  color: #fff;
  border: 1.5px solid var(--loop-edge);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}
.loop-cta svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .18s ease;
}
.loop-cta:hover { background: var(--loop-green); border-color: var(--loop-green); }
.loop-cta:hover svg { transform: translateX(3px); }
.loop-cta:focus-visible { outline: 3px solid var(--loop-edge); outline-offset: 3px; }

/* ── Colonne cartes ─────────────────────────────────────────────── */
.loop-cards { position: relative; display: grid; grid-template-columns: 1fr; gap: 14px; }
@container (min-width: 640px) {
  .loop-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .loop-card--low { margin-top: 38px; }
}

.loop-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 18px;
  background: #fff;
  border: 1.5px solid var(--loop-edge);
  border-radius: 18px;
}
.loop-card__title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.loop-card__text {
  margin: 8px 0 0;
  font-size: 12.5px; font-weight: 400; line-height: 1.55;
  color: var(--loop-soft);
  text-wrap: pretty;
}
.loop-card__state {
  margin-top: auto; padding-top: 20px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; color: var(--loop-soft);
}
.loop-card__state i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--loop-green); flex-shrink: 0;
}
/* #A16207 et non #CA8A04 : l'ambre d'origine tombait à 2,6:1 sur blanc,
   sous le seuil de 3:1 exigé pour un élément porteur de sens. */
.loop-card__state--soft i { background: #A16207; }

/* Zone maquette en haut de carte */
.loop-mock {
  min-height: 128px; margin-bottom: 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}

/* ── Carte 1 : barre de recherche + résultats ───────────────────── */
.loop-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--loop-line); border-radius: 9px;
  padding: 8px 10px; background: #F6FAF7;
}
.loop-search svg {
  width: 13px; height: 13px; flex-shrink: 0;
  fill: none; stroke: var(--loop-green); stroke-width: 1.9; stroke-linecap: round;
}
.loop-search span {
  font-size: 10px; font-weight: 500; color: #35473F;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loop-hit {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--loop-line); border-radius: 9px; padding: 7px 9px;
}
.loop-hit--on { border: 1.5px solid var(--loop-green); }
.loop-hit b {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  background: var(--loop-tint); color: var(--loop-green);
  font-size: 7.5px; font-weight: 800; display: grid; place-items: center;
}
.loop-hit span {
  flex-grow: 1; font-size: 10px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loop-hit em {
  font-style: normal; font-size: 10px; font-weight: 700;
  color: var(--loop-green); white-space: nowrap; flex-shrink: 0;
}

/* ── Carte 2 : mini fenêtre + formulaire ────────────────────────── */
.loop-win { border: 1px solid var(--loop-line); border-radius: 10px; overflow: hidden; }
.loop-win__bar {
  height: 22px; border-bottom: 1px solid var(--loop-line);
  display: flex; align-items: center; gap: 4px; padding: 0 9px;
}
.loop-win__bar i { width: 5px; height: 5px; border-radius: 50%; background: #DCE4E0; }
.loop-win__body { padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.loop-lbl { font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: var(--loop-green); }
.loop-msg {
  border: 1.5px solid var(--loop-green); border-radius: 7px;
  background: #F2FAF0; padding: 7px 8px;
  font-size: 9px; font-weight: 500; line-height: 1.5; color: #35473F;
}
.loop-send {
  height: 22px; border-radius: 7px; background: var(--loop-edge); color: #fff;
  display: grid; place-items: center;
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.06em;
}

/* ── Carte 3 : courbe ───────────────────────────────────────────── */
.loop-chart svg { display: block; width: 100%; height: auto; }
.loop-kpi { display: flex; align-items: baseline; gap: 8px; }
.loop-kpi b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.loop-kpi span {
  font-size: 9.5px; font-weight: 700; color: var(--loop-edge);
  background: var(--loop-bg); border-radius: 999px; padding: 2px 7px;
}

/* Pastille flottante en débord — la signature de la DA des schémas.
   Masquée en une colonne : elle chevaucherait la première carte. */
.loop-pin {
  position: absolute; top: -19px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 8px;
  background: #fff; color: var(--loop-edge);
  border: 1.5px solid var(--loop-edge); border-radius: 999px;
  padding: 8px 14px 8px 10px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.loop-pin svg {
  width: 15px; height: 15px;
  fill: none; stroke: var(--loop-edge); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
@container (min-width: 640px) { .loop-pin { display: inline-flex; } }

@media (prefers-reduced-motion: reduce) {
  .loop-cta, .loop-cta svg { transition: none; }
}

@media (prefers-contrast: more) {
  .loop-card { border-width: 2px; }
  .loop-card__text, .loop-card__state { color: #2A3B33; }
  .loop-lede { color: #2A3B33; }
}
