/* ==========================================================================
   La Fresque — page /team : bloc équipe « laboratoire IA »
   Tout est préfixé .ai-team pour ne pas toucher au menu, à l’en-tête ni au
   reste du site. Palette du logo : bleu marine #25377F + or #B59F0E,
   accent cyan pour l’effet « réseau neuronal ».
   ========================================================================== */

@property --ai-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.ai-team {
    --ai-navy: #25377f;
    --ai-navy-deep: #0a1140;
    --ai-navy-mid: #1a2760;
    --ai-gold: #b59f0e;
    --ai-gold-light: #e2cf55;
    --ai-cyan: #35c2e8;
    --ai-cyan-soft: #9be7ff;
    --ai-wa: #25d366;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 96px 0 108px;
    background:
        radial-gradient(ellipse 60% 55% at 12% 0%, rgba(53, 194, 232, .20), transparent 60%),
        radial-gradient(ellipse 55% 50% at 92% 100%, rgba(181, 159, 14, .22), transparent 60%),
        linear-gradient(160deg, var(--ai-navy-deep) 0%, var(--ai-navy-mid) 55%, #0d1650 100%);
    color: #fff;
    font-family: var(--ztc-family-font2, "Figtree", sans-serif);
}

.ai-team *,
.ai-team *::before,
.ai-team *::after { box-sizing: border-box; }

/* Le thème du site justifie tous les <p> : on remet à zéro dans le bloc */
.ai-team p { margin: 0; text-align: inherit; }

/* --- Décor : grille, halos, réseau neuronal ------------------------------ */
.ai-team__grid {
    position: absolute;
    inset: -48px 0 0 0;
    z-index: -3;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 75%);
    animation: ai-grid 14s linear infinite;
}

@keyframes ai-grid { to { transform: translateY(48px); } }

.ai-team__orb {
    position: absolute;
    z-index: -2;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    pointer-events: none;
}

.ai-team__orb--a {
    top: -120px;
    left: -100px;
    background: radial-gradient(circle, rgba(53, 194, 232, .55), transparent 65%);
    animation: ai-drift-a 18s ease-in-out infinite alternate;
}

.ai-team__orb--b {
    right: -120px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(181, 159, 14, .55), transparent 65%);
    animation: ai-drift-b 22s ease-in-out infinite alternate;
}

@keyframes ai-drift-a { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes ai-drift-b { to { transform: translate(-160px, -70px) scale(1.2); } }

.ai-team__net {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- En-tête du bloc ------------------------------------------------------ */
.ai-team__inner {
    position: relative;
    width: min(100% - 48px, 1240px);
    margin: 0 auto;
}

.ai-team__head { max-width: 860px; margin: 0 auto 64px; text-align: center; }

.ai-team__kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 14px;
    border: 1px solid rgba(155, 231, 255, .35);
    border-radius: 999px;
    background: rgba(53, 194, 232, .1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--ai-cyan-soft);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* barres façon « voix de l’IA » */
.ai-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }

.ai-wave i {
    display: block;
    width: 3px;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--ai-cyan-soft), var(--ai-cyan));
    transform-origin: center;
    animation: ai-wave 1.1s ease-in-out infinite;
}

.ai-wave i:nth-child(2) { animation-delay: -.9s; }
.ai-wave i:nth-child(3) { animation-delay: -.6s; }
.ai-wave i:nth-child(4) { animation-delay: -.3s; }
.ai-wave i:nth-child(5) { animation-delay: -.75s; }

@keyframes ai-wave {
    0%, 100% { transform: scaleY(.25); }
    50% { transform: scaleY(1); }
}

.ai-team .ai-team__title {
    position: relative;
    margin: 26px 0 0;
    color: #fff;
    font-family: var(--ztc-family-font1, "Space Grotesk", sans-serif);
    font-size: clamp(26px, 3.6vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    text-transform: none;
}

/* Effet « saisie » : le texte complet reste en place (mise en page stable,
   lisible sans JavaScript) et une copie animée s’écrit par-dessus. */
.ai-typed-live { display: none; }

.ai-js .ai-typed-ghost { visibility: hidden; }

.ai-js .ai-typed-live {
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #fff 0%, var(--ai-cyan-soft) 55%, var(--ai-gold-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-js .ai-typed-live::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: .9em;
    margin-left: 4px;
    border-radius: 2px;
    background: var(--ai-gold-light);
    -webkit-text-fill-color: initial;
    vertical-align: -.08em;
    animation: ai-caret 1s steps(1) infinite;
}

@keyframes ai-caret { 50% { opacity: 0; } }

/* --- Grille de cartes ------------------------------------------------------ */
.ai-team__cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 700px) {
    .ai-team__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .ai-team__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 699.98px) {
    .ai-team { padding: 68px 0 76px; }
    .ai-team__head { margin-bottom: 44px; }
    .ai-team__cards { max-width: 420px; margin: 0 auto; }
}

/* entrée en cascade (déclenchée par le JS ; visible tel quel sans JS) */
.ai-js .ai-card-wrap { opacity: 0; }

.ai-js .ai-card-wrap.is-in {
    animation: ai-rise .9s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 130ms);
}

@keyframes ai-rise {
    from { opacity: 0; transform: translateY(46px) scale(.96); filter: blur(8px); }
    to { opacity: 1; transform: none; filter: none; }
}

/* --- Carte ------------------------------------------------------------------ */
.ai-card {
    position: relative;
    height: 100%;
    padding: 34px 22px 24px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 26px;
    background: linear-gradient(165deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .04) 100%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px rgba(4, 8, 32, .45), inset 0 1px 0 rgba(255, 255, 255, .16);
    text-align: center;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .35s ease-out, box-shadow .35s ease-out, border-color .35s;
    will-change: transform;
}

.ai-card.is-tilting { transition: transform .08s linear, box-shadow .35s ease-out, border-color .35s; }

.ai-card:hover {
    border-color: rgba(155, 231, 255, .4);
    box-shadow: 0 30px 70px rgba(4, 8, 32, .55), 0 0 44px rgba(53, 194, 232, .18), inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* liseré lumineux qui tourne autour de la carte */
.ai-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--ai-angle), transparent 0deg, transparent 70deg, var(--ai-cyan) 140deg, var(--ai-gold-light) 200deg, transparent 260deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: .55;
    pointer-events: none;
    transition: opacity .35s;
    animation: ai-angle 7s linear infinite;
}

.ai-card:hover::before { opacity: 1; animation-duration: 3.5s; }

@keyframes ai-angle { to { --ai-angle: 360deg; } }

/* halo qui suit le curseur */
.ai-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(155, 231, 255, .16), transparent 60%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.ai-card:hover::after { opacity: 1; }

.ai-card__idx {
    position: absolute;
    top: 16px;
    left: 20px;
    color: rgba(155, 231, 255, .7);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: .12em;
}

/* nœud du « réseau » en haut de la carte */
.ai-card__node {
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: var(--ai-cyan);
    box-shadow: 0 0 14px var(--ai-cyan);
}

.ai-card__node::after {
    content: "";
    position: absolute;
    inset: -6px;
    border: 1.5px solid var(--ai-cyan);
    border-radius: 50%;
    animation: ai-ping 2.4s ease-out infinite;
}

@keyframes ai-ping {
    0% { transform: scale(.4); opacity: .9; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* --- Avatar avec anneaux orbitaux et balayage « scanner » -------------------- */
.ai-avatar {
    position: relative;
    width: 176px;
    height: 176px;
    margin: 6px auto 22px;
    animation: ai-float 6s ease-in-out infinite;
}

.ai-card-wrap:nth-child(2) .ai-avatar { animation-delay: -1.5s; }
.ai-card-wrap:nth-child(3) .ai-avatar { animation-delay: -3s; }
.ai-card-wrap:nth-child(4) .ai-avatar { animation-delay: -4.5s; }

@keyframes ai-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.ai-avatar__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(53, 194, 232, .7);
    animation: ai-spin 16s linear infinite;
}

.ai-avatar__ring--gold {
    inset: 8px;
    border: 2px dotted rgba(226, 207, 85, .75);
    animation-duration: 22s;
    animation-direction: reverse;
}

@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-avatar__photo {
    position: absolute;
    inset: 18px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: var(--ai-navy);
    box-shadow: 0 0 0 4px rgba(37, 55, 127, .5), 0 12px 32px rgba(4, 8, 32, .5), 0 0 34px rgba(53, 194, 232, .28);
}

.ai-avatar__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    transition: transform .6s ease;
}

.ai-card:hover .ai-avatar__photo img { transform: scale(1.08); }

/* ligne de balayage verticale */
.ai-avatar__photo::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 42%;
    background: linear-gradient(180deg, transparent 0%, rgba(53, 194, 232, .0) 30%, rgba(155, 231, 255, .5) 96%, rgba(255, 255, 255, .9) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .85);
    transform: translateY(-100%);
    animation: ai-scan 3.6s ease-in-out infinite;
    pointer-events: none;
}

.ai-card-wrap:nth-child(2) .ai-avatar__photo::after { animation-delay: -.9s; }
.ai-card-wrap:nth-child(3) .ai-avatar__photo::after { animation-delay: -1.8s; }
.ai-card-wrap:nth-child(4) .ai-avatar__photo::after { animation-delay: -2.7s; }

@keyframes ai-scan {
    0% { transform: translateY(-100%); opacity: 0; }
    15% { opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(240%); opacity: 0; }
}

/* petites pastilles orbitales */
.ai-avatar__sat {
    position: absolute;
    inset: 0;
    animation: ai-spin 9s linear infinite;
    pointer-events: none;
}

.ai-avatar__sat::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    border-radius: 50%;
    background: var(--ai-gold-light);
    box-shadow: 0 0 14px var(--ai-gold-light);
}

/* --- Texte ------------------------------------------------------------------ */
.ai-team .ai-card__name {
    margin: 0 0 12px;
    color: #fff;
    font-family: var(--ztc-family-font1, "Space Grotesk", sans-serif);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.005em;
    text-transform: none;
}

.ai-card__role {
    display: inline-block;
    min-height: 2.9em;
    padding: 6px 14px;
    border: 1px solid rgba(226, 207, 85, .4);
    border-radius: 14px;
    background: rgba(226, 207, 85, .1);
    color: var(--ai-gold-light);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
}

.ai-card__role-wrap { display: flex; justify-content: center; margin-bottom: 22px; }

.ai-contact {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    padding: 12px 16px;
    border: 1px solid rgba(37, 211, 102, .45);
    border-radius: 999px;
    background: rgba(37, 211, 102, .1);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .3s, border-color .3s, transform .2s, box-shadow .3s;
}

.ai-contact:hover {
    border-color: var(--ai-wa);
    background: rgba(37, 211, 102, .22);
    box-shadow: 0 10px 28px rgba(37, 211, 102, .28);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.ai-contact__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ai-wa);
    color: #fff;
    font-size: 17px;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, .6);
    animation: ai-pulse 2.6s ease-out infinite;
}

@keyframes ai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
    70%, 100% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}

/* reflet qui traverse le bouton */
.ai-contact::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    animation: ai-shine 4.5s ease-in-out infinite;
}

@keyframes ai-shine {
    0%, 55% { left: -60%; }
    100% { left: 130%; }
}

/* --- Accessibilité : moins d’animations à la demande ------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ai-team *,
    .ai-team *::before,
    .ai-team *::after {
        animation: none !important;
        transition: none !important;
    }

    .ai-js .ai-card-wrap { opacity: 1; }
    .ai-card { transform: none; }
}
