
/* Conteneur du carousel - compatible avec votre thème */
        .ai-carousel-container {
            background: var(--ai-gradient-neural);
            border: 2px solid var(--ai-border);
            border-radius: 28px;
            box-shadow: var(--ai-shadow-lg);
            margin: 80px auto; /* Augmentation des marges verticales */
            padding: 40px 20px;
            max-width: 1200px;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(12px);
            /* Isolation du carrousel */
            isolation: isolate;
        }

        /* Effet réseau neural en arrière-plan */
        .ai-carousel-container::before {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image: 
                radial-gradient(circle at 20% 80%, rgba(30,64,175,0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(16,185,129,0.02) 0%, transparent 50%);
            z-index: 1;
            pointer-events: none;
        }

        /* Barre circuit neural en haut */
        .ai-carousel-container::after {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 6px;
            background: var(--ai-gradient-primary);
            box-shadow: 0 0 20px #1e40af44;
            z-index: 10;
            animation: aiNeuralPulse 4s infinite ease-in-out;
        }

        /* Titre du carousel */
        .ai-carousel-title {
            color: var(--ai-secondary);
            font-family: 'Roboto Mono', 'JetBrains Mono', 'Courier New', monospace;
            font-weight: 800;
            font-size: 1.8rem;
            margin-bottom: 32px;
            text-align: center;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            background: var(--ai-gradient-primary);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            position: relative;
            z-index: 2;
        }

        .ai-carousel-title::before {
            content: "◉ ";
            color: var(--ai-accent);
            font-size: 0.8em;
            margin-right: 8px;
            animation: aiCursor 2s infinite;
        }

        /* Container flex pour les cartes */
        .ai-carousel-flex {
            display: flex;
            flex: 1;
            gap: 8px;
            align-items: flex-start;
            justify-content: center;
            position: relative;
            z-index: 2;
        }

        /* Cartes individuelles */
        .ai-card {
            flex: 1 1 1%;
            position: relative;
            transition: flex 600ms cubic-bezier(0.25, 1, 0.5, 1), 
                        opacity 350ms ease,
                        transform 350ms ease,
                        box-shadow 350ms ease;
            cursor: pointer;
            min-height: 400px;
        }

        .ai-card:hover {
            flex-basis: 35%;
            transform: translateY(-8px) scale(1.02);
        }

        .ai-card__inner {
            margin: 0.25rem;
            background: var(--ai-bg-card);
            border-radius: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(30,64,175,0.12);
            transition: var(--ai-transition);
            position: relative;
        }

        .ai-card__inner::before {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(45deg, transparent 60%, rgba(16,185,129,0.08) 100%);
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 1;
        }

        .ai-card:hover .ai-card__inner::before {
            opacity: 1;
        }

        /* .ai-card:hover .ai-card__inner {
            box-shadow: 0 0 0 3px var(--ai-accent), 0 15px 40px rgba(30,64,175,0.2);
            border-color: var(--ai-accent);
        } */

        .ai-card picture {
            width: 100%;
            height: 600px;         /* Fixe la hauteur à 600px */
            padding-bottom: 0;     /* Désactive le ratio pour forcer la hauteur fixe */
            overflow: hidden;
            position: relative;
        }

        .ai-card picture img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            transition: var(--ai-transition);
            filter: saturate(1.1) brightness(0.95) contrast(1.05);
        }

        .ai-card:hover picture img {
            filter: saturate(1.3) brightness(1.02) contrast(1.1);
            transform: scale(1.08);
        }

        .ai-card.is-active,
        .ai-card:hover {
            opacity: 1;
        }

        /* Pattern de marges pour créer un effet décalé */
        .ai-card:nth-child(2),
        .ai-card:nth-child(5) {
            margin-top: 0;
        }

        .ai-card:nth-child(2),
        .ai-card:nth-child(4),
        .ai-card:nth-child(6) {
            margin-top: 3%;
        }

        .ai-card:nth-child(3) {
            margin-top: 6%;
        }

        /* Responsive design */
        @media (max-width: 1024px) {
            .ai-carousel-container {
                padding: 30px 15px;
                margin: 60px auto; /* Marges réduites mais toujours importantes */
            }
            
            .ai-carousel-title {
                font-size: 1.5rem;
            }
            
            .ai-carousel-flex {
                gap: 6px;
            }
            
            .ai-card picture {
                padding-bottom: 100%; /* <-- Hauteur sur tablette */
            }
        }

        @media (max-width: 768px) {
            .ai-carousel-container {
                margin: 40px auto; /* Marges adaptées pour mobile */
            }
            
            .ai-carousel-flex {
                flex-wrap: wrap;
                gap: 12px;
            }
            
            .ai-card {
                flex: 1 1 calc(50% - 6px);
                min-height: 250px;
            }
            
            .ai-card:hover {
                flex-basis: calc(50% - 6px);
            }
            
            .ai-card picture {
                padding-bottom: 80%; /* <-- Hauteur sur mobile */
            }
            
            /* Reset margins sur mobile */
            .ai-card:nth-child(n) {
                margin-top: 0 !important;
            }
        }

        @media (max-width: 480px) {
            .ai-carousel-container {
                padding: 20px 10px;
                margin: 30px auto; /* Marges réduites pour très petits écrans */
                border-radius: 16px;
            }
            
            .ai-carousel-title {
                font-size: 1.2rem;
                margin-bottom: 20px;
            }
            
            .ai-card {
                flex: 1 1 100%;
                min-height: 200px;
            }
            
            .ai-card:hover {
                flex-basis: 100%;
                transform: translateY(-4px) scale(1.01);
            }
        }

        /* Animations */
        @keyframes aiNeuralPulse {
            0%, 100% { box-shadow: 0 0 20px #1e40af44; }
            50% { box-shadow: 0 0 30px #1e40af66; }
        }

        @keyframes aiCursor {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0.3; }
        }

        /* Mode sombre */
        @media (prefers-color-scheme: dark) {
            :root {
                --ai-bg: #0f0f0f;
                --ai-bg-soft: #1a1a1a;
                --ai-bg-card: #1a1a1a;
                --ai-border: #374151;
                --ai-text: #f9fafb;
            }
            
            .ai-card picture img {
                opacity: 0.92;
                filter: saturate(1.1) brightness(0.88) contrast(1.1);
            }
            
            .ai-card:hover picture img {
                opacity: 1;
                filter: saturate(1.3) brightness(1.0) contrast(1.15);
            }
        }

/* Légende sous l'image au survol - VERSION CORRIGÉE */
.ai-card .ai-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 158, 175, 0.92);
  color: #fff;
  font-size: 1.08em;
  font-family: 'Inter', Arial, sans-serif;
  padding: 18px 12px 14px 12px;
  text-align: center;
  border-radius: 0 0 16px 16px;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 2px 12px #1e40af33;
  
  /* Changement crucial : plus de transition avec délai */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  
  /* Empêche le reflow pendant la transition */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-card:hover .ai-card-caption,
.ai-card:focus-within .ai-card-caption {
  opacity: 1;
  visibility: visible;
}

/* Alternative si tu veux garder du texte multiligne */
.ai-card .ai-card-caption.multiline {
  white-space: normal;
  /* Fixe la hauteur pour éviter le reflow */
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
  
  :root {
    --surface: #111;
      --c: white;
    --c2: #9ae3dc;
    --c3: magenta;
  }
  
@layer properties {
@property --elh {
/* eye left height   */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}

@property --erx {
/* eye right x pos   */
  syntax: '<percentage>';
  inherits: true;
  initial-value: 0%;
}
@property --fx {
/* face x pos   */
  syntax: '<percentage>';
  inherits: true;
  initial-value: 0%;
}
@property --ealw {
/* ear left w    */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}@property --earw {
/* ear right w    */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}


@property --erh {
/* eye right height   */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}
@property --mh {
/* mouth height   */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}
@property --mw {
/* mouth width   */
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}
  }

:root {
  --surface: #111;
    --c: white;
  --c2: #9ae3dc;
  --c3: magenta;
}

.ai-bot {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px auto;
  transform: scale(4.2);
  width: 34px;
  aspect-ratio: 1;
  position: relative;
  animation: blink 2.4s ease infinite, move-head 4.2s linear(0 0%, 0 2.27%, 0.02 4.53%, 0.04 6.8%, 0.06 9.07%, 0.1 11.33%, 0.14 13.6%, 0.25 18.15%, 0.39 22.7%, 0.56 27.25%, 0.77 31.8%, 1 36.35%, 0.89 40.9%, 0.85 43.18%, 0.81 45.45%, 0.79 47.72%, 0.77 50%, 0.75 52.27%, 0.75 54.55%, 0.75 56.82%, 0.77 59.1%, 0.79 61.38%, 0.81 63.65%, 0.85 65.93%, 0.89 68.2%, 1 72.7%, 0.97 74.98%, 0.95 77.25%, 0.94 79.53%, 0.94 81.8%, 0.94 84.08%, 0.95 86.35%, 0.97 88.63%, 1 90.9%, 0.99 93.18%, 0.98 95.45%, 0.99 97.73%, 1 100%)  infinite, mouth 1.2s ease-in infinite;

  .head {
    background: linear-gradient(var(--c) 80%,color-mix(in srgb, var(--c), black 30%), var(--c) );
    border-radius: .375rem;
    position: absolute;
    width: 28px;
    height: 20px;
    
    
    &:before, &:after {
      content: '';
      position: absolute;
      left: -4px;
      top: 6px;
      width: 2px;
      height: 8px;
      background: var(--c,1);
      border-radius: 2px 0 0 2px;
      scale: var(--ealw, 1) 1;
    }
    &:after {
      right: -4px;
      left: unset;
       border-radius: 0 2px 2px 0;
      scale: var(--earw, 1) 1;
    }
    
    .face {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: absolute;
      inset: 0 3px;
      background: var(--surface);
      translate: var(--fx) 0;
      border-radius: 4px;
      padding: 4px 4px 2px 4px;
      gap: 3px;
      
      &:before {
        content: '';
        background: var(--c);
        position: absolute;
        height: 1px;
        width: 10px;
        top: -2px;
        border-radius: 2px 2px 0 0;
mask:        radial-gradient(circle at 50% 100%, transparent 45%, black 45%)
      }
     
      
      .eyes {
        display: flex;
        height: 8px;
        gap: 6px;
        &:before, &:after {
          content: '';
          width: 5px;
          height:  8px;
          scale: 1 var(--elh);
          filter: drop-shadow( 0 0 2px var(--c2));
          background: repeating-linear-gradient(to bottom, var(--c), var(--c) .25px, transparent .25px, transparent .6px), linear-gradient(to bottom, var(--c3), transparent 60%), var(--c2);
          border-radius: 1px;
          translate: var(--erx) 0;
        }
        
        &:after {
           scale: 1 var(--erh);
                translate: var(--erx) 0;
        }
      }
      
      .mouth  {
          width: 10px;
        height: 2px;
        background: var(--c2);
        border-radius: 0 0 1px 1px;
        filter: drop-shadow( 0 0 2px var(--c2));
        scale: var(--mw, 1) var(--mh, 1);
      }
    }
  }
}

@layer animations {
  
@keyframes blink {
  from,10%, to { 
    --elh: 1;
    --erh: 1;
  }
  
  2% {
    --elh: .2;
  }
  
  8% {
    --erh: .1;
  }
}

@keyframes mouth {
  from, 30%,70%, to { 
  --mh: 1;
    --mw: 1;
  }
  
  20% {
    --mh: .5;
  }
  
  60%{ 
      --mw: .7;
  }
}

@keyframes move-head {
  from, 20%, 40% to{ 
    --erx: 0%
      --fx: 0%;
    --ealw: 1;
        --earw: 1;
  }
  
  10% {
    --erx: 20%;
          --fx: 10%;
    --ealw: 1.5;
        --earw: .5;
  }
  
  30% {
    --erx: -20%;
          --fx: -10%;
  --ealw: .5;
        --earw: 1.5;
  }
  
}
}


* {
  box-sizing: border-box;
}
  
  /* body {
    display: grid;
    place-items: center;
    height: 100dvh;
    background: var(--surface);
  } */