/* Effets : entrée, analyse, verdict, transitions. Chargé après styles.css.
   Trois temps forts seulement (entrée, verdict, changement de rubrique) ; le reste reste discret. */

:root { --ambiance: var(--accent); --expo: cubic-bezier(.16, 1, .3, 1); }
html { -moz-osx-font-smoothing: grayscale; }
html.verrou, html.verrou body { overflow: hidden; }
h1, h2, .verdict-nom { text-wrap: balance; }
.chapeau, .verdict-resume, .raisons li, .rubrique-texte { text-wrap: pretty; }
.tableau td, .purif, [data-compter] { font-variant-numeric: tabular-nums; }

/* ---------- Fond vivant ---------- */
.fond-toile { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.fond-balayage { background: linear-gradient(90deg, transparent, var(--ambiance), transparent); transition: opacity .6s; }
.lueur {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--ambiance) 13%, transparent) 0%, transparent 62%);
  transform: translate3d(var(--lx, 60vw), var(--ly, 20vh), 0); opacity: 0; transition: opacity .8s;
}
.pret .lueur { opacity: 1; }
.flash { position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: 0;
  background: radial-gradient(90% 70% at 70% 35%, color-mix(in srgb, var(--teinte, var(--accent)) 30%, transparent), transparent 70%); }
.flash.eclat { animation: eclat 1s var(--expo); }
@keyframes eclat { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Écran d'entrée ---------- */
.seuil { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; }
.seuil.parti { display: none; }
.seuil-rideau { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--fond); transition: transform 1s var(--expo); }
.seuil-haut { top: 0; box-shadow: 0 1px 0 var(--trait-fort); }
.seuil-bas { bottom: 0; }
.seuil-rideau::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--trait) 1px, transparent 1px), linear-gradient(90deg, var(--trait) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .7;
  -webkit-mask-image: radial-gradient(ellipse 60% 90% at 50% 100%, #000, transparent 75%); mask-image: radial-gradient(ellipse 60% 90% at 50% 100%, #000, transparent 75%);
}
.seuil-bas::after { -webkit-mask-image: radial-gradient(ellipse 60% 90% at 50% 0%, #000, transparent 75%); mask-image: radial-gradient(ellipse 60% 90% at 50% 0%, #000, transparent 75%); }
.seuil.leve .seuil-haut { transform: translateY(-101%); }
.seuil.leve .seuil-bas { transform: translateY(101%); }

.seuil-coeur { position: relative; z-index: 2; display: grid; justify-items: center; gap: 18px; padding: 24px; text-align: center; transition: transform .9s var(--expo), opacity .5s, filter .6s; }
.seuil.ouvre .seuil-actions { animation: part .3s ease-in forwards; pointer-events: none; }
@keyframes part { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }
.seuil.leve .seuil-coeur { transform: scale(1.35); opacity: 0; filter: blur(14px); }

.seuil-balance { width: clamp(120px, 18vw, 176px); height: auto; overflow: visible; color: var(--accent); filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 55%, transparent)); }
.seuil-balance path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: trace 1.5s var(--expo) .15s forwards; }
.seuil-balance .plateau { fill: color-mix(in srgb, currentColor 14%, transparent); }
.seuil-balance .pivot { fill: currentColor; opacity: 0; animation: point .5s ease-out 1s forwards; }
.seuil-balance .halo { fill: none; stroke: currentColor; stroke-width: .6; opacity: .28; stroke-dasharray: 3 7; transform-origin: 60px 52px; animation: tourne 26s linear infinite; }
.seuil-balance .fleau { transform-origin: 60px 30px; animation: penche 4.4s ease-in-out 1.4s infinite; }
.seuil.ouvre .fleau { animation: equilibre .7s var(--ressort) forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes point { to { opacity: 1; } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes penche { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes equilibre { from { transform: rotate(7deg); } to { transform: rotate(0deg); } }

.seuil-marque { display: flex; gap: .18em; font: 800 clamp(2.6rem, 9vw, 5.6rem)/1 "Unbounded", var(--f-titre); letter-spacing: .06em; color: var(--texte); }
.seuil-marque span { opacity: 0; animation: lettre-seuil .9s var(--expo) forwards; animation-delay: calc(.55s + var(--n) * .09s); }
.seuil-marque span:nth-child(1) { --n: 0; } .seuil-marque span:nth-child(2) { --n: 1; } .seuil-marque span:nth-child(3) { --n: 2; }
.seuil-marque span:nth-child(4) { --n: 3; } .seuil-marque span:nth-child(5) { --n: 4; }
@keyframes lettre-seuil { from { opacity: 0; transform: translateY(40px) scale(1.25); filter: blur(16px); } to { opacity: 1; transform: none; filter: none; } }

.seuil-devise { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font: 500 .8rem var(--f-mono); text-transform: uppercase; letter-spacing: .16em; }
.seuil-devise span { display: inline-flex; align-items: center; gap: 8px; opacity: 0; animation: monte .7s var(--expo) forwards; }
.seuil-devise span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.d-v { color: var(--vert); animation-delay: 1.15s !important; }
.d-r { color: var(--rouge); animation-delay: 1.3s !important; }
.d-g { color: var(--gris); animation-delay: 1.45s !important; }

.seuil-actions { display: grid; justify-items: center; gap: 12px; margin-top: 14px; opacity: 0; animation: monte .8s var(--expo) 1.7s forwards; transition: opacity .3s, transform .3s; }
.bouton-entree {
  position: relative; cursor: pointer; border: 0; border-radius: 999px; padding: 16px 30px;
  background: var(--accent); color: var(--accent-encre); font: 600 1.02rem var(--f-texte);
  transition-property: transform, box-shadow; transition-duration: .25s; transition-timing-function: var(--ressort);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: pouls 2.2s ease-out 2.4s infinite;
}
.bouton-entree:hover { transform: scale(1.05); }
.bouton-entree:active { transform: scale(.96); }
@keyframes pouls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.bouton-discret { cursor: pointer; background: transparent; border: 0; padding: 10px 14px; min-height: 44px; color: var(--doux); font-size: .92rem; text-decoration: underline; text-underline-offset: 4px; }
.bouton-discret:hover { color: var(--texte); }

.seuil-faisceaux { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.seuil-faisceaux span { position: absolute; left: -30%; width: 160%; height: 3px; transform: translateX(-110%) skewX(-24deg); opacity: 0; }
.seuil-faisceaux span:nth-child(1) { top: 38%; background: linear-gradient(90deg, transparent, var(--rouge), transparent); box-shadow: 0 0 26px 4px var(--rouge); }
.seuil-faisceaux span:nth-child(2) { top: 50%; background: linear-gradient(90deg, transparent, var(--gris), transparent); box-shadow: 0 0 26px 4px var(--gris); }
.seuil-faisceaux span:nth-child(3) { top: 62%; background: linear-gradient(90deg, transparent, var(--vert), transparent); box-shadow: 0 0 26px 4px var(--vert); }
.seuil.ouvre .seuil-faisceaux span { animation: faisceau .75s var(--expo) forwards; }
.seuil.ouvre .seuil-faisceaux span:nth-child(1) { animation-delay: .35s; }
.seuil.ouvre .seuil-faisceaux span:nth-child(2) { animation-delay: .5s; }
.seuil.ouvre .seuil-faisceaux span:nth-child(3) { animation-delay: .65s; }
@keyframes faisceau { 0% { transform: translateX(-110%) skewX(-24deg); opacity: 1; } 100% { transform: translateX(110%) skewX(-24deg); opacity: 1; } }

/* ---------- Arrivée de l'accueil ---------- */
.js-fx .barre { transform: translateY(-110%); transition: transform .9s var(--expo) .15s; }
.js-fx.pret .barre { transform: none; }
#titre .mot { display: inline-block; white-space: nowrap; }
.m-v { color: var(--vert); } .m-r { color: var(--rouge); } .m-g { color: var(--gris); }
#titre .lettre { display: inline-block; }
.js-fx:not(.fini) #titre .lettre { opacity: 0; transform: translateY(.55em) rotateX(-60deg); filter: blur(8px); transform-origin: 50% 100%; }
.js-fx.pret:not(.fini) #titre .lettre { animation: lettre .8s var(--expo) forwards; animation-delay: calc(.25s + var(--i) * 22ms); }
@keyframes lettre { to { opacity: 1; transform: none; filter: none; } }
.js-fx:not(.fini) .hero .surtitre, .js-fx:not(.fini) .hero .chapeau, .js-fx:not(.fini) .hero .recherche, .js-fx:not(.fini) .hero .exemples, .js-fx:not(.fini) .hero .instrument, .js-fx:not(.fini) .defile { opacity: 0; transform: translateY(22px); }
.js-fx.pret:not(.fini) .hero .surtitre { animation: monte .7s var(--expo) .1s forwards; }
.js-fx.pret:not(.fini) .hero .chapeau { animation: monte .7s var(--expo) .75s forwards; }
.js-fx.pret:not(.fini) .hero .recherche { animation: monte .7s var(--expo) .9s forwards; }
.js-fx.pret:not(.fini) .hero .exemples { animation: monte .7s var(--expo) 1.05s forwards; }
.js-fx.pret:not(.fini) .hero .instrument { animation: surgit 1.1s var(--expo) .55s forwards; }
.js-fx.pret:not(.fini) .defile { animation: monte .8s var(--expo) 1.25s forwards; }
@keyframes surgit { from { opacity: 0; transform: translateY(40px) scale(.92) rotateX(14deg); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.hero { perspective: 1400px; }

/* ---------- Instrument : relief, analyse, verdict ---------- */
.instrument { transform-style: preserve-3d; box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--v) 45%, transparent), 0 1px 0 rgba(255, 255, 255, .06) inset; }
.instrument.incline { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out, border-color .5s, background .5s, box-shadow .5s; }
.instrument-reflet { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .09), transparent 60%); }
.instrument.incline .instrument-reflet { opacity: 1; }
.etincelles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
[data-verdict="analyse"] { --v: var(--accent); }

.analyse-barre { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.analyse-barre span { height: 3px; border-radius: 999px; background: var(--trait-fort); overflow: hidden; position: relative; }
.analyse-barre span::after { content: ""; position: absolute; inset: 0; background: var(--v); transform: scaleX(0); transform-origin: left; transition: transform .28s ease-out, background-color .4s; }
.analyse-barre span.plein::after { transform: scaleX(1); }

.graduations line { stroke: var(--trait-fort); stroke-width: 1.4; stroke-linecap: round; }
.graduations line.forte { stroke: var(--pale); stroke-width: 2; }
.instrument.scan .aiguille { animation: cherche 1.05s cubic-bezier(.5, 0, .5, 1); }
@keyframes cherche { 0% { transform: rotate(0deg); } 22% { transform: rotate(-72deg); } 58% { transform: rotate(72deg); } 82% { transform: rotate(-30deg); } 100% { transform: rotate(0deg); } }
.instrument.scan .instrument-rayon { animation: rayon 1.05s linear; }
.instrument.scan .verdict-mot { letter-spacing: .12em; font-size: 1.5rem; opacity: .85; }
.instrument.scan .arc { opacity: .5; animation: clignote .35s steps(2) infinite; }
@keyframes clignote { 50% { opacity: .18; } }
.aiguille.doute { animation: doute 1.1s ease-out; }
@keyframes doute { 0% { transform: rotate(0deg); } 20% { transform: rotate(-13deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); } 100% { transform: rotate(0deg); } }
.instrument.secoue { animation: secoue .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes secoue { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
.jauge { position: relative; }
.onde { position: absolute; left: 50%; bottom: 8%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; border: 2px solid var(--v); opacity: 0; pointer-events: none; }
.instrument.revele .onde { animation: onde 1s var(--expo); }
@keyframes onde { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(14); opacity: 0; } }
.instrument.revele .verdict-mot { animation: frappe .7s var(--ressort) both; text-shadow: 0 0 34px color-mix(in srgb, var(--v) 60%, transparent); }
@keyframes frappe { 0% { opacity: 0; transform: scale(1.7); filter: blur(12px); letter-spacing: .2em; } 60% { opacity: 1; filter: none; } 100% { transform: none; letter-spacing: -.02em; } }
.verdict-mot { font-family: "Unbounded", var(--f-titre); max-width: 100%; overflow-wrap: anywhere; transition: font-size .2s, letter-spacing .2s; }
.instrument.revele .raisons li { animation: monte .55s var(--expo) both; animation-delay: calc(var(--i) * 90ms + .35s); }

/* ---------- Bandeau défilant ---------- */
.defile { margin-top: clamp(28px, 4vw, 44px); overflow: hidden; border-block: 1px solid var(--trait);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.defile-piste { display: flex; gap: 10px; width: max-content; padding: 12px 0; animation: defile 70s linear infinite; }
.defile:hover .defile-piste, .defile:focus-within .defile-piste { animation-play-state: paused; }
@keyframes defile { to { transform: translateX(-50%); } }
.defile-item { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap; min-height: 40px;
  background: transparent; border: 1px solid var(--trait); border-radius: 999px; padding: 7px 14px; font-size: .88rem; color: var(--doux);
  transition-property: color, border-color, transform; transition-duration: .2s; }
.defile-item::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--v); box-shadow: 0 0 10px var(--v); }
.defile-item:hover { color: var(--texte); border-color: var(--v); transform: translateY(-2px); }
.defile-item b { font: 500 .68rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--v); }

/* ---------- Chiffres ---------- */
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.chiffres div { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--panneau); }
.chiffres strong { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1 "Unbounded", var(--f-titre); letter-spacing: -.02em; color: var(--texte); }
.chiffres span { color: var(--doux); font-size: .9rem; }

/* ---------- Transition entre rubriques ---------- */
.volet { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: grid; grid-template-rows: repeat(3, 1fr); }
.volet span { transform: translateX(-102%); will-change: transform; }
.volet span:nth-child(1) { background: var(--rouge); }
.volet span:nth-child(2) { background: var(--gris); }
.volet span:nth-child(3) { background: var(--vert); }
.volet.passe span { animation: volet .78s cubic-bezier(.76, 0, .24, 1) both; }
.volet.passe span:nth-child(2) { animation-delay: .06s; }
.volet.passe span:nth-child(3) { animation-delay: .12s; }
@keyframes volet { 0% { transform: translateX(-102%); } 45%, 55% { transform: translateX(0); } 100% { transform: translateX(102%); } }

/* ---------- Détails ---------- */
.barre-outils { display: flex; gap: 8px; }
#bouton-son .croix-son { display: block; } #bouton-son .ondes-son { display: none; }
#bouton-son[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
#bouton-son[aria-pressed="true"] .croix-son { display: none; } #bouton-son[aria-pressed="true"] .ondes-son { display: block; animation: clignote 1.2s steps(2) 2; }
.bouton-theme { width: 42px; height: 42px; }
.rubrique { position: relative; overflow: hidden; transform-style: preserve-3d; }
.rubrique.incline { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px); transition: transform .15s ease-out, border-color .25s; }
.rubrique::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%); }
.rubrique:hover::after { opacity: 1; }
.resultat-arnaque.alerte { animation: secoue .5s cubic-bezier(.36, .07, .19, .97), alerte 1.2s ease-out; }
@keyframes alerte { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rouge) 70%, transparent); } 100% { box-shadow: 0 0 0 28px transparent; } }
.case:active, .puce:active, .filtre:active, .defile-item:active { transform: scale(.97); }
.bouton-principal { position: relative; overflow: hidden; }
.bouton-principal::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); animation: reflet 3.6s ease-in-out 2.5s infinite; }
@keyframes reflet { 0%, 70% { left: -60%; } 100% { left: 130%; } }

@media (max-width: 900px) {
  .barre { grid-template-areas: "marque outils" "onglets onglets"; }
  .barre-outils { grid-area: outils; justify-self: end; }
  .bouton-theme { grid-area: auto; }
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lueur { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .seuil-balance path { stroke-dashoffset: 0; }
  .seuil-marque span, .seuil-devise span, .seuil-actions, .seuil-balance .pivot { opacity: 1; }
  .js-fx #titre .lettre, .js-fx .hero .surtitre, .js-fx .hero .chapeau, .js-fx .hero .recherche, .js-fx .hero .exemples, .js-fx .hero .instrument, .js-fx .defile { opacity: 1; transform: none; filter: none; }
  .js-fx .barre { transform: none; }
  .defile-piste { animation: none; flex-wrap: wrap; width: auto; }
  .lueur, .fond-toile { display: none; }
}

/* ---------- Mot du verdict : tient dans le panneau, même sur petit téléphone ---------- */
.instrument { grid-template-columns: minmax(0, 1fr); }
.verdict-mot { font-size: clamp(1.45rem, 6.8vw, 2.5rem); }
@media (min-width: 901px) { .verdict-mot { font-size: clamp(1.9rem, 3vw, 2.4rem); } }

/* ---------- Fiche recherchée et dossier de preuves ---------- */
.instrument-niveau { font: 500 .7rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); text-align: center; }
.bouton-dossier { justify-self: center; cursor: pointer; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--v) 50%, var(--trait)); background: color-mix(in srgb, var(--v) 10%, transparent); color: var(--texte); font-weight: 500; font-size: .9rem; transition-property: transform, background-color; transition-duration: .2s; }
.bouton-dossier:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--v) 18%, transparent); }
.raisons a { text-underline-offset: 3px; }
.dossier { margin-top: clamp(28px, 4vw, 44px); padding: clamp(18px, 3vw, 30px); border: 1px solid var(--trait-fort); border-radius: 24px; background: var(--panneau); display: grid; gap: 22px; scroll-margin-top: 90px; animation: entree .5s var(--expo) both; }
.dossier-tete { --v: var(--accent); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 20px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--trait); }
.dossier-tete h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 6px 0; }
.dossier-verdict { display: grid; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--v) 40%, var(--trait)); background: color-mix(in srgb, var(--v) 8%, transparent); }
.dossier-verdict p { color: var(--doux); font-size: .95rem; }
.dossier-bloc { display: grid; gap: 10px; min-width: 0; }
.dossier-bloc h3 { margin: 0; font: 500 .76rem var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--pale); }
.dossier-lignes li { animation: none !important; }
.preuves { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--trait-fort); display: grid; gap: 6px; font-size: .88rem; color: var(--doux); }
.preuves q { font-style: italic; }
.preuves a, .dossier a { color: var(--accent); }
.preuves time { font: 400 .72rem var(--f-mono); color: var(--pale); }
.constat { padding: 12px 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--panneau-2); }
.cellule-texte { font-family: var(--f-texte) !important; white-space: normal !important; font-size: .88rem; color: var(--doux); }
@media (max-width: 900px) { .dossier-tete { grid-template-columns: minmax(0, 1fr); } }
