/* Animated figures inside articles (02/11/2026). Markup built by includes/art-anim.php, motion by art-anim.js.
   The resting style of every element is its final, complete state: motion only runs under .aa-on (figure on
   screen, script loaded), so without JavaScript or with reduced motion the reader sees a full static picture. */

.aa { --aa-o: #FF7634; --aa-o2: #FFA97A; --aa-c: #4FD1FF; --aa-m: #9aa3b2; --aa-t: #e8eaf0;
    margin: 30px 0 34px; padding: 24px 24px 18px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08);
    background: radial-gradient(ellipse at 50% 0%, #11151f, #07080d 78%); color: var(--aa-t); position: relative; }
.aa-titre { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--aa-o2); font-weight: 700; margin: 0 0 16px; }
.aa figcaption { margin-top: 16px; font-size: .9rem; line-height: 1.55; color: var(--aa-m); }
.aa figcaption b { color: #d6dae3; }

/* A word chip, lit by --p (0 to 1) */
.aa-mot { --p: 0; display: inline-flex; align-items: center; position: relative; padding: 5px 10px; margin: 3px 2px; border-radius: 8px;
    font-size: 1rem; line-height: 1.3; color: var(--aa-t); border: 1px solid rgba(255,255,255,.1);
    background: color-mix(in srgb, var(--aa-o) calc(var(--p) * 55%), rgba(255,255,255,.03));
    box-shadow: 0 0 calc(var(--p) * 18px) color-mix(in srgb, var(--aa-o) calc(var(--p) * 70%), transparent);
    transition: background-color .45s, box-shadow .45s, opacity .45s, border-color .45s, transform .45s; }
.aa-mot.aa-focus { border-color: var(--aa-c); color: #fff; box-shadow: 0 0 14px rgba(79,209,255,.45); background: rgba(79,209,255,.16); }
.aa-mots { display: flex; flex-wrap: wrap; align-items: center; }

/* 1. Timeline with model sizes */
.aa-frise ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; position: relative; }
.aa-frise ol::before { content: ''; position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: linear-gradient(90deg, var(--aa-o), var(--aa-c)); transform-origin: left; }
.aa-frise li { position: relative; padding-top: 44px; }
.aa-frise li::before { content: ''; position: absolute; top: 24px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #07080d; border: 2px solid var(--aa-o); box-shadow: 0 0 10px rgba(255,118,52,.6); }
.aa-frise time { position: absolute; top: 0; left: 0; font-size: .82rem; color: var(--aa-m); font-weight: 600; }
.aa-frise b { display: block; font-size: 1.05rem; color: #fff; margin-bottom: 4px; }
.aa-frise li > span { display: block; font-size: .85rem; line-height: 1.4; color: #c4c9d4; min-height: 2.8em; }
.aa-taille { margin-top: 10px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.aa-taille i { display: block; height: 100%; width: calc(var(--t) * 100%); background: linear-gradient(90deg, var(--aa-o), var(--aa-o2)); border-radius: 3px; transform-origin: left; }
.aa-frise small { display: block; margin-top: 5px; font-size: .78rem; color: var(--aa-o2); }
.aa-on.aa-frise ol::before { animation: aa-trace 1.4s ease-out both; }
.aa-on.aa-frise li { animation: aa-monte .6s calc(.25s + var(--i) * .22s) ease-out both; }
.aa-on.aa-frise .aa-taille i { animation: aa-trace .9s calc(.6s + var(--i) * .22s) ease-out both; }
@media (max-width: 767px) {
    .aa-frise ol { grid-template-columns: 1fr; gap: 6px; padding-left: 28px; }
    .aa-frise ol::before { left: 6px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; transform-origin: top; }
    .aa-frise li { padding: 0 0 10px; }
    .aa-frise li::before { left: -28px; top: 4px; }
    .aa-frise time { position: static; display: block; }
    .aa-frise li > span { min-height: 0; }
}

/* 2. Reading word by word (RNN) against all at once (Transformer) */
.aa-voie { padding: 12px 0; }
.aa-voie + .aa-voie { border-top: 1px dashed rgba(255,255,255,.08); }
.aa-voie-tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.aa-voie-tete b { color: #fff; font-size: 1rem; }
.aa-voie-tete span { color: var(--aa-m); font-size: .9rem; }
.aa-voie-tete em { margin-left: auto; font-style: normal; font-size: .85rem; color: var(--aa-o2); font-variant-numeric: tabular-nums; }
.aa-voie[data-mode="rnn"] .aa-mot { opacity: var(--o, 1); }
.aa-mot.aa-lu { border-color: var(--aa-o); }
.aa-mot.aa-cle { border-color: var(--aa-c); }

/* 3. Positions: same words, another order */
.aa-ligne { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
.aa-ligne .aa-mots { flex: 1 1 auto; }
.aa-pos { position: absolute; top: -9px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--aa-c); color: #05060a; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.aa-sens { flex: 0 0 auto; font-size: .88rem; color: var(--aa-o2); border: 1px solid rgba(255,118,52,.35); border-radius: 20px; padding: 3px 12px; }

/* 4. Attention between a sentence and its translation: two columns joined by weighted lines */
.aa-align { display: grid; grid-template-columns: 1fr minmax(80px, 1.3fr) 1fr; align-items: stretch; }
.aa-col { display: flex; flex-direction: column; gap: 6px; }
.aa-col .aa-mot { margin: 0; justify-content: center; }
.aa-col-tete { font-size: .8rem; color: var(--aa-m); text-align: center; margin-bottom: 2px; letter-spacing: .06em; text-transform: uppercase; }
.aa-fils { position: relative; }
.aa-fils svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.aa-fils line { stroke: var(--aa-o); stroke-linecap: round; transition: opacity .4s, stroke-width .4s; }
.aa-mot.aa-actif { border-color: var(--aa-c); box-shadow: 0 0 14px rgba(79,209,255,.5); }

/* 5. Self-attention: the focus word lights the words it looks at */
.aa-phrase { padding: 10px 0 6px; }
.aa-phrase + .aa-phrase { border-top: 1px dashed rgba(255,255,255,.08); }
.aa-phrase .aa-mot { flex-direction: column; padding-bottom: 9px; }
.aa-phrase .aa-mot::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px;
    background: var(--aa-o); transform: scaleX(var(--p)); transform-origin: left; transition: transform .5s; }
.aa-phrase .aa-mot.aa-focus::after { display: none; }
.aa-phrase .aa-sens { display: inline-block; margin-top: 8px; transition: opacity .5s; }

/* 6. BERT: guess the hidden word from both sides */
.aa-trou { min-width: 120px; justify-content: center; border-style: dashed; border-color: var(--aa-c); color: #fff; font-weight: 700; }
.aa-fleche { color: var(--aa-c); font-size: .85rem; margin: 0 4px; opacity: .8; }
.aa-cand { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; max-width: 480px; min-height: 40px; }
.aa-cand li { display: grid; grid-template-columns: 130px 1fr 62px; align-items: center; gap: 10px; font-size: .95rem; }
.aa-cand li span { color: #d6dae3; }
.aa-cand li i { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; position: relative; }
.aa-cand li i::before { content: ''; position: absolute; inset: 0; width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--aa-o), var(--aa-o2)); border-radius: 4px; transform-origin: left; transition: transform .6s; }
.aa-cand li em { font-style: normal; text-align: right; color: var(--aa-o2); font-variant-numeric: tabular-nums; }
.aa-cand li.aa-gagne span { color: #fff; font-weight: 700; }
.aa-cand li.aa-vrai span { color: var(--aa-c); }
.aa-orig { display: block; font-size: .72rem; color: var(--aa-c); font-weight: 400; opacity: .85; }
.aa-mot.aa-faux { border-color: var(--aa-o); border-style: dashed; font-style: italic; color: var(--aa-o2); }
.aa-mot.aa-colle { margin-left: -1px; border-left-style: dashed; }

/* 7. GPT: the next word, again and again */
.aa-suite .aa-mots { min-height: 48px; }
.aa-mot.aa-genere { border-color: rgba(255,118,52,.55); }
.aa-curseur { display: inline-block; width: 2px; height: 1.2em; background: var(--aa-o); margin-left: 4px; vertical-align: middle; animation: aa-clic 1s steps(1) infinite; }

/* 8. T5: every task becomes text in, text out */
.aa-t5 { display: grid; gap: 10px; }
.aa-t5-ligne { display: grid; grid-template-columns: 1fr 74px 1fr; align-items: center; gap: 10px; }
.aa-t5-ligne > span { padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); font-size: .92rem; line-height: 1.4; }
.aa-t5-ligne > span b { color: var(--aa-o2); font-weight: 700; }
.aa-t5-ligne > span:last-child { border-color: rgba(79,209,255,.35); color: #fff; }
.aa-t5-ligne > span small { display: block; margin-top: 3px; font-size: .78rem; color: var(--aa-m); }
.aa-t5-boite { text-align: center; font-weight: 800; color: #05060a; background: linear-gradient(135deg, var(--aa-o), var(--aa-o2)); border-radius: 10px; padding: 8px 0; font-size: .9rem; }
.aa-on.aa-texte .aa-t5-ligne > span:first-child { animation: aa-monte .5s calc(var(--i) * .9s) both; }
.aa-on.aa-texte .aa-t5-boite { animation: aa-souffle .7s calc(.35s + var(--i) * .9s) both; }
.aa-on.aa-texte .aa-t5-ligne > span:last-child { animation: aa-monte .5s calc(.7s + var(--i) * .9s) both; }
@media (max-width: 575px) {
    .aa { padding: 18px 14px 14px; }
    .aa-t5-ligne { grid-template-columns: 1fr; gap: 6px; }
    .aa-t5-boite { padding: 4px 0; }
    .aa-cand li { grid-template-columns: 96px 1fr 58px; }
    .aa-align { grid-template-columns: 1fr minmax(44px, .7fr) 1fr; }
    .aa-mot { font-size: .92rem; padding: 4px 8px; }
}

@keyframes aa-trace { from { transform: scaleX(0); } }
@keyframes aa-monte { from { opacity: 0; transform: translateY(12px); } }
@keyframes aa-souffle { from { opacity: 0; transform: scale(.85); } 60% { transform: scale(1.06); } }
@keyframes aa-clic { 50% { opacity: 0; } }
@media (max-width: 767px) { .aa-on.aa-frise ol::before { animation-name: aa-trace-v; } }
@keyframes aa-trace-v { from { transform: scaleY(0); } }

@media (prefers-reduced-motion: reduce) {
    .aa *, .aa *::before, .aa *::after { animation: none !important; transition: none !important; }
}
