/* ==========================================================================
   Page « IA souveraine » — le bleu porte cette page, l'orange reste l'action.
   ========================================================================== */

.ia-hero__intro {
  max-width: 760px;
}

.ia-hero__intro h1 {
  margin-bottom: 22px;
}

.ia-hero__intro .lead {
  margin-bottom: 30px;
}

/* Schéma de fonctionnement : 3 étapes reliées par un flux animé */

.routing {
  margin-top: clamp(40px, 6vw, 72px);
}

.flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px clamp(36px, 5vw, 72px);
  padding: 0;
  list-style: none;
}

.flow__node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 24px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}

.flow__node--gateway {
  background: linear-gradient(160deg, var(--b-50), var(--b-100));
  border-color: rgba(47, 95, 208, 0.35);
}

.flow__node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  width: calc(clamp(36px, 5vw, 72px) - 16px);
  height: 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 10px, transparent 10px 18px);
}

@media (prefers-reduced-motion: no-preference) {
  .flow__node:not(:last-child)::after {
    animation: flow-dash 0.9s linear infinite;
  }
}

@keyframes flow-dash {
  to {
    background-position-x: 18px;
  }
}

.flow__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.flow__node--gateway .flow__step {
  background: var(--orange);
  color: var(--ink);
}

.flow__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.flow__title small {
  color: var(--fg-3);
  font-size: 0.85rem;
  font-weight: 450;
}

.flow__node p:not(.flow__title) {
  color: var(--fg-2);
}

.flow__target {
  padding: 12px 14px;
  border-radius: 12px;
}

.flow__target + .flow__target {
  margin-top: 6px;
}

.flow__target--local {
  background: var(--g-100);
}

.flow__target--local .flow__title {
  color: var(--green-ink);
}

.flow__target--api {
  background: transparent;
  border: 2px dashed var(--line-2);
}

.flow__target p:not(.flow__title) {
  font-size: 0.95rem;
}

.routing__caption {
  margin-top: 22px;
  color: var(--fg-3);
  font-size: 0.92rem;
}

/* Local ou hybride */

.fit {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--o-50);
  color: var(--fg) !important;
  font-size: 0.95rem;
  font-weight: 550;
}

.fit--b {
  background: var(--b-50);
}

.modes__common {
  max-width: 76ch;
  margin-top: clamp(28px, 4vw, 44px);
  color: var(--fg-2);
}

.modes__common strong {
  color: var(--fg);
}

/* Outils rebranchés */

.outils {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}

.outils h2 {
  margin-bottom: 18px;
}

.code {
  margin-top: 32px;
  overflow: hidden;
  background: #0B0F19;
  border-radius: var(--r-md);
  box-shadow: 0 24px 40px -24px rgba(11, 15, 25, 0.6);
}

.code__title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #1E293B;
  color: #CBD5E1;
  font-size: 0.85rem;
}

.code__dots {
  display: inline-flex;
  gap: 6px;
}

.code__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #FF5F57;
}

.code__dots i:nth-child(2) { background: #FEBC2E; }
.code__dots i:nth-child(3) { background: #28C840; }

.code pre {
  margin: 0;
  padding: 18px 20px 20px;
  overflow-x: auto;
  color: #F8FAFC;
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.75;
}

.code__comment {
  color: #7C8BA3;
}

.tools {
  display: grid;
  gap: 12px;
}

.tool {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 12px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.tool:nth-child(even) {
  border-left-color: var(--orange);
}

.tool:hover {
  background: var(--b-50);
}

.tool dt {
  font-size: 1.08rem;
  font-weight: 700;
}

.tool dd {
  margin: 0;
  color: var(--fg-2);
}

.tools__note {
  margin-top: 16px;
  color: var(--fg-3);
  font-size: 0.92rem;
}

/* MCP */

.mcp {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.mcp h2 {
  margin-bottom: 18px;
}

.checklist {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--fg-2);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.checklist li:hover {
  border-color: rgba(255, 122, 0, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.checklist .icon {
  margin: 0;
}

.checklist strong {
  color: #fff;
  font-weight: 650;
}

/* Technologies : un bloc par famille */

.stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.stack__group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: var(--r-md);
}

.stack__group:nth-child(3n + 2) {
  border-top-color: var(--blue);
}

.stack__group:nth-child(3n) {
  border-top-color: var(--green);
}

.stack__group dt {
  font-size: 1.02rem;
  font-weight: 700;
}

.stack__group dd {
  margin: 0;
}

.stack__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.stack__group li {
  padding: 4px 12px;
  border-radius: 999px;
  background: #F1F5F9;
  color: var(--fg-2);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Méthode : numéros reliés */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px clamp(18px, 3vw, 40px);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 70px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 750;
  box-shadow: 0 8px 18px -8px rgba(47, 95, 208, 0.8);
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 23px;
  left: 58px;
  right: calc(-1 * clamp(18px, 3vw, 40px) + 8px);
  height: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 8px, transparent 8px 14px);
  opacity: 0.5;
}

.step h3 {
  margin-bottom: 8px;
}

.step p {
  color: var(--fg-2);
}

@media (max-width: 1080px) {
  .outils,
  .mcp {
    grid-template-columns: minmax(0, 1fr);
  }

  .stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step::after {
    display: none;
  }
}

@media (max-width: 860px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  /* Le flux devient vertical */
  .flow__node:not(:last-child)::after {
    top: calc(100% + 8px);
    left: 40px;
    width: 4px;
    height: 28px;
    background: repeating-linear-gradient(180deg, var(--orange) 0 10px, transparent 10px 18px);
    animation-name: flow-dash-v;
  }
}

@keyframes flow-dash-v {
  to {
    background-position-y: 18px;
  }
}

@media (max-width: 640px) {
  .stack,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .code pre {
    font-size: 12.5px;
  }
}
