/* ═══════════════════════════════════════════════════════════════════
   Page d'accueil : vitrine des outils d'intelligence artificielle
   ═══════════════════════════════════════════════════════════════════ */

.ia-vitrine {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-20, 5rem);
  background-color: var(--clr-hero-bg, #1B4332);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(201, 149, 42, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 90%, rgba(76, 175, 125, 0.10) 0%, transparent 45%);
  color: var(--clr-hero-text, #F5F0E8);
}

.ia-vitrine .section__title { color: var(--clr-hero-text, #F5F0E8); }
.ia-vitrine .section__subtitle { color: var(--clr-hero-muted, rgba(245, 240, 232, 0.65)); }

.ia-vitrine__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-4, 1rem);
  padding: 4px 12px;
  border: 1px solid rgba(199, 144, 30, 0.5);
  border-radius: 999px;
  background: rgba(199, 144, 30, 0.12);
  color: #E5A72A;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ia-vitrine__grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));     /* six outils : deux rangées de trois */
  gap: var(--space-6, 1.5rem);
}

@media (max-width: 960px) { .ia-vitrine__grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ia-vitrine__grille { grid-template-columns: minmax(0, 1fr); } }

/* Le nouvel outil est mis en avant */
.ia-carte { position: relative; }
.ia-carte--nouveau { border-color: rgba(199, 144, 30, 0.6); box-shadow: 0 0 0 1px rgba(199, 144, 30, 0.25), 0 14px 34px rgba(0, 0, 0, 0.25); }

.ia-carte__nouveau {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: #C7901E;
  color: #1a1408;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ─── Carte d'un outil ────────────────────────────────────────────── */

.ia-carte {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 12px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ia-carte:hover,
.ia-carte:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(199, 144, 30, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.ia-carte__corps {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-5, 1.25rem);
}

.ia-carte__titre {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: var(--text-xl, 1.25rem);
  color: var(--clr-hero-text, #F5F0E8);
}

.ia-carte__texte {
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.6;
  color: var(--clr-hero-muted, rgba(245, 240, 232, 0.65));
}

.ia-carte__lien {
  margin-top: auto;
  padding-top: var(--space-3, 0.75rem);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  color: #E5A72A;
}

.ia-vitrine__pied {
  margin-top: var(--space-10, 2.5rem);
  text-align: center;
  color: var(--clr-hero-muted, rgba(245, 240, 232, 0.65));
  font-size: var(--text-sm, 0.875rem);
}

.ia-vitrine__pied a { color: #E5A72A; font-weight: 600; }

/* ─── Petites animations « aperçu » ───────────────────────────────── */

.ia-apercu {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 1. Transcription : un acte manuscrit, puis le texte qui s'écrit */
.ia-apercu--acte {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
}

.ia-acte {
  height: 62px;
  border-radius: 4px;
  background: linear-gradient(135deg, #e9dcc0, #d8c49d);
  box-shadow: inset 0 0 12px rgba(120, 90, 40, 0.35);
}

.ia-acte svg { width: 100%; height: 100%; }

.ia-frappe {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 13px;
  color: var(--clr-hero-text, #F5F0E8);
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #E5A72A;
  width: 0;
  animation: ia-frappe 6s steps(34, end) infinite;
}

@keyframes ia-frappe {
  0%, 8%    { width: 0; }
  55%, 92%  { width: 100%; }
  100%      { width: 0; }
}

/* 2. Restauration : une photo sépia rayée, un curseur révèle la couleur */
.ia-apercu--photo { background: #2b3a4a; }

.ia-photo,
.ia-photo-ancienne {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ia-photo-ancienne {
  filter: sepia(1) contrast(0.85) brightness(0.9) blur(0.6px);
  clip-path: inset(0 0 0 var(--coupe, 50%));
  animation: ia-curseur 5s ease-in-out infinite alternate;
}

.ia-photo-curseur {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  animation: ia-curseur-trait 5s ease-in-out infinite alternate;
}

@keyframes ia-curseur { from { clip-path: inset(0 0 0 20%); } to { clip-path: inset(0 0 0 80%); } }
@keyframes ia-curseur-trait { from { left: 20%; } to { left: 80%; } }

/* 3. Histoire : les lignes d'un livre qui s'écrivent */
.ia-apercu--livre { display: flex; align-items: center; justify-content: center; }
.ia-apercu--livre svg { width: 170px; height: 120px; }

.ia-ligne {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: ia-ecrire 6s ease-in-out infinite;
}

.ia-ligne:nth-of-type(2) { animation-delay: 0.4s; }
.ia-ligne:nth-of-type(3) { animation-delay: 0.8s; }
.ia-ligne:nth-of-type(4) { animation-delay: 1.2s; }
.ia-ligne:nth-of-type(5) { animation-delay: 1.6s; }
.ia-ligne:nth-of-type(6) { animation-delay: 2.0s; }

@keyframes ia-ecrire {
  0%, 10%   { stroke-dashoffset: 60; }
  40%, 85%  { stroke-dashoffset: 0; }
  100%      { stroke-dashoffset: 60; }
}

/* 4. Ancêtre : des bulles de conversation qui apparaissent */
.ia-apercu--chat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
}

.ia-bulle {
  max-width: 82%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  animation: ia-bulle 7s ease infinite;
}

.ia-bulle--ancetre {
  align-self: flex-start;
  background: #e9dcc0;
  color: #2b2418;
  font-family: var(--font-serif, Georgia, serif);
  border-bottom-left-radius: 3px;
}

.ia-bulle--moi {
  align-self: flex-end;
  background: #C7901E;
  color: #1a1408;
  border-bottom-right-radius: 3px;
}

.ia-bulle:nth-child(2) { animation-delay: 1.2s; }
.ia-bulle:nth-child(3) { animation-delay: 2.4s; }

@keyframes ia-bulle {
  0%        { opacity: 0; transform: translateY(6px); }
  8%, 80%   { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; }
}

/* Mouvement réduit : on affiche l'état final, sans animation */
@media (prefers-reduced-motion: reduce) {
  .ia-frappe { animation: none; width: 100%; }
  .ia-photo-ancienne { animation: none; clip-path: inset(0 0 0 50%); }
  .ia-photo-curseur { animation: none; left: 50%; }
  .ia-ligne { animation: none; stroke-dashoffset: 0; }
  .ia-bulle { animation: none; opacity: 1; }
  .ia-carte { transition: none; }
}

/* 5. Arbre : une question, l'arbre s'illumine branche par branche, l'ancêtre trouvé répond */
.ia-apercu--arbre { display: flex; align-items: center; justify-content: center; }
.ia-apercu--arbre svg { width: 78%; height: 78%; margin-top: 18px; }

.ia-arbre-trait { stroke: rgba(245, 240, 232, 0.28); stroke-width: 1.6; fill: none; }

.ia-noeud {
  fill: #2f4a3c;
  stroke: rgba(245, 240, 232, 0.55);
  stroke-width: 1.4;
  animation: ia-noeud 8s ease-in-out infinite;
}

.ia-noeud:nth-of-type(2) { animation-delay: 0.15s; }
.ia-noeud:nth-of-type(3) { animation-delay: 0.3s; }
.ia-noeud:nth-of-type(4) { animation-delay: 0.45s; }
.ia-noeud:nth-of-type(5) { animation-delay: 0.6s; }
.ia-noeud:nth-of-type(6) { animation-delay: 0.75s; }
.ia-noeud:nth-of-type(7) { animation-delay: 0.9s; }
.ia-noeud:nth-of-type(8) { animation-delay: 1.05s; }
.ia-noeud:nth-of-type(9) { animation-delay: 1.2s; }
.ia-noeud:nth-of-type(10) { animation-delay: 1.35s; }

@keyframes ia-noeud {
  0%, 18%   { fill: #2f4a3c; }
  24%       { fill: #4CAF7D; }
  34%, 100% { fill: #2f4a3c; }
}

.ia-noeud--trouve { animation-name: ia-trouve; animation-delay: 0s !important; }

@keyframes ia-trouve {
  0%, 44%   { fill: #2f4a3c; stroke: rgba(245, 240, 232, 0.55); r: 7; }
  52%, 88%  { fill: #E5A72A; stroke: #fff3d6; r: 10; }
  100%      { fill: #2f4a3c; r: 7; }
}

.ia-arbre-question,
.ia-arbre-reponse {
  position: absolute;
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
}

.ia-arbre-question {
  top: 10px;
  right: 12px;
  background: #C7901E;
  color: #1a1408;
  border-bottom-right-radius: 3px;
  animation: ia-arbre-question 8s ease infinite;
}

.ia-arbre-reponse {
  bottom: 10px;
  left: 12px;
  background: #e9dcc0;
  color: #2b2418;
  font-family: var(--font-serif, Georgia, serif);
  border-bottom-left-radius: 3px;
  animation: ia-arbre-reponse 8s ease infinite;
}

@keyframes ia-arbre-question {
  0%        { opacity: 0; transform: translateY(-6px); }
  6%, 88%   { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; }
}

@keyframes ia-arbre-reponse {
  0%, 52%   { opacity: 0; transform: translateY(6px); }
  60%, 88%  { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ia-noeud { animation: none; }
  .ia-noeud--trouve { fill: #E5A72A; }
  .ia-arbre-question, .ia-arbre-reponse { animation: none; opacity: 1; }
}

/* 6. GeneBook : un petit fil d'actualité qui défile doucement */
.ia-apercu--gb {
  padding: 0 14px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}

.ia-gb-defile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  animation: ia-gb-defile 18s linear infinite;
}

.ia-gb-carte {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #1c1e21;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.ia-gb-tete { display: flex; align-items: center; gap: 8px; }
.ia-gb-tete strong { display: block; font-size: 12.5px; color: #1c1e21; }
.ia-gb-tete em { display: block; font-style: normal; font-size: 10.5px; color: #65676b; }

.ia-gb-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.ia-gb-carte p { margin: 7px 0 6px; color: #1c1e21; }

.ia-gb-bas {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid #ece7de;
  font-size: 11px;
  color: #65676b;
}

.ia-gb-pouce {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1B4332;
}

.ia-gb-pouce svg { width: 9px; height: 9px; fill: #fff; }
.ia-gb-com { margin-left: auto; }

/* La liste est doublée : la remonter de moitié donne une boucle sans à-coup */
@keyframes ia-gb-defile { from { transform: translateY(0); } to { transform: translateY(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .ia-gb-defile { animation: none; }
}
