/* ============================================================
   TECHNIC' INFORMATIQUE — section animée au scroll
   « Ce qui se passe pendant votre nettoyage »
   Timeline : écran de confidentialité (votre image) → session
   de nettoyage (composants .hd-* du hero) → comme au premier
   jour. Toute la sémantique visuelle vient des tokens du site.
   ============================================================ */

/* Le site ne défile jamais horizontalement (aucun élément ne doit
   provoquer un léger glissement latéral, ex. sur iPhone). */
body { overflow-x: hidden; overflow-x: clip; }

.scrolly-sec {
    --sc-end-bg: linear-gradient(160deg, #e8f1ff 0%, #f5f5f7 55%, #eef1f6 100%);
    --sc-done-bg: rgba(255, 255, 255, .9);
    --sc-done-border: rgba(0, 0, 0, .06);
}
:root[data-theme="dark"] .scrolly-sec {
    --sc-end-bg: linear-gradient(160deg, #1e2333 0%, #14151c 55%, #101013 100%);
    --sc-done-bg: rgba(29, 29, 31, .86);
    --sc-done-border: rgba(255, 255, 255, .1);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .scrolly-sec {
        --sc-end-bg: linear-gradient(160deg, #1e2333 0%, #14151c 55%, #101013 100%);
        --sc-done-bg: rgba(29, 29, 31, .86);
        --sc-done-border: rgba(255, 255, 255, .1);
    }
}

/* Piste de scroll : la section haut fait défiler une scène épinglée */
.scrolly { height: 285vh; position: relative; }
.scrolly-stage {
    position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    --sc-k: 1;
}
.sc-scaler {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    transform: scale(var(--sc-k, 1)); transform-origin: center;
}
/* Adaptation aux écrans : contain-fit native, résolue par le navigateur
   sur 100svh/100vw — recalculée en continu (redimensionnement, zoom
   système, rotation), sans aucune mesure JavaScript.
   La réserve du bas laisse la place à la flèche d'invitation. */
@supports (scale: calc((100svh - 122px) / 640px)) {
    .scrolly-stage {
        --sc-k: clamp(0.45, min(calc((100svh - 122px) / 640px), calc((100vw - 64px) / 560px)), 1.25);
    }
}

/* Ordinateur : écran (fonds superposés) + base alu comme le hero */
.scrolly-laptop { position: relative; z-index: 1; width: 560px; flex: none;
    animation: hdFloat 7s ease-in-out 1.6s infinite; }
.scrolly-screen {
    aspect-ratio: 16 / 10; background: #101013; border-radius: 16px; padding: 10px 12px;
    position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.sc-el {
    position: absolute; inset: 10px 12px; border-radius: 8px; overflow: hidden;
    opacity: 0; pointer-events: none; transition: opacity .5s var(--ease-out);
}
.sc-el.on { opacity: 1; pointer-events: auto; }
.sc-work { z-index: 1; }
.sc-conf { z-index: 2; }   /* l'écran d'attente passe PAR-DESSUS la session */
.sc-end { z-index: 3; }
.sc-glow {
    position: absolute; inset: -14% -10%; z-index: 0; pointer-events: none;
    background:
        radial-gradient(50% 48% at 30% 42%, rgba(0, 113, 227, .30), transparent 70%),
        radial-gradient(46% 46% at 72% 58%, rgba(124, 77, 255, .24), transparent 70%);
    filter: blur(34px);
}

/* Étape 1 — l'écran d'attente du site, mode confidentialité */
.sc-conf img { width: 100%; height: 100%; object-fit: cover; }
.sc-badge {
    position: absolute; top: 12px; right: 12px;
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
    padding: 8px 13px; border-radius: 999px; backdrop-filter: blur(8px);
}
.sc-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green);
    animation: scLive 1.5s ease-in-out infinite; }
@keyframes scLive { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* Étape 2 — la session de nettoyage : les composants du mockup du hero */
.sc-work .hd-win { box-shadow: none; }
.sc-work .hd-li, .sc-work .hd-k b, .sc-work .hd-track i { animation: none; }
.sc-work .hd-k b { opacity: 1; transition: color .4s ease; }
.sc-work .hd-track i { transition: width .5s var(--ease-out), background-color .5s var(--ease-out); }
.sc-work .hd-li { transition: opacity .4s ease, color .4s ease; }
.sc-work .hd-li.done { opacity: .72; }
.sc-work .hd-li.done .dot { background: var(--green); }
.sc-work .hd-li.done strong { color: var(--text-2); }
/* « Traitement en cours » : point bleu pulsé — distinct de l'orange
   d'attente et du vert « corrigé » */
.sc-work .hd-li.busy .st { border-color: var(--blue); }
.sc-work .hd-li.busy .st::before {
    background: var(--blue); opacity: 1; animation: scBusyDot 1s ease-in-out infinite;
}
@keyframes scBusyDot { 0%, 100% { opacity: .95; } 50% { opacity: .35; } }

/* Étape 4 — bureau nettoyé + carte de fin (le bouton ouvre la modale du site) */
.sc-end { background: var(--sc-end-bg); display: grid; place-content: center; }
.sc-done {
    background: var(--sc-done-bg); border: 1px solid var(--sc-done-border);
    border-radius: 20px; padding: 22px 30px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    max-width: min(440px, 86vw); backdrop-filter: blur(14px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
}
.sc-done-check {
    width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff;
    font-size: 24px; display: grid; place-content: center;
    box-shadow: 0 10px 26px rgba(52, 199, 89, .35);
}
.sc-done h3 { font-size: 1.32rem; }
.sc-done p { font-size: .92rem; color: var(--text-2); }
.sc-done .btn { margin-top: 10px; }
.scrolly-base {
    height: 13px; width: 114%; margin-left: -7%;
    background: var(--hd-base); border-radius: 2px 2px 12px 12px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .2);
}

/* Étapes affichées : puces + grande barre + carte de présentation */
.sc-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sc-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600; color: var(--text-2);
    background: var(--chip-bg); border: 1px solid var(--border-soft);
    border-radius: 999px; padding: 6px 12px;
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.sc-chip i { font-style: normal; font-size: 11px; font-variant-numeric: tabular-nums;
    color: var(--text-3); transition: color .3s ease; }
.sc-chip.now { background: var(--blue); border-color: var(--blue); color: #fff; }
.sc-chip.now i { color: rgba(255, 255, 255, .72); }
.sc-chip.done { color: var(--blue); background: rgba(0, 113, 227, .1); border-color: transparent; }
.sc-chip.done i { color: var(--blue); }

.sc-trackrow { width: 430px; display: flex; align-items: center; gap: 12px; }
.sc-track { flex: 1; height: 6px; border-radius: 999px; background: var(--meter-track); overflow: hidden; }
.sc-track i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--blue); }
.sc-pct { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2);
    min-width: 2.9em; text-align: right; }

.sc-panel { position: relative; width: 560px; min-height: 172px; }
.sc-panel-item {
    position: absolute; inset: 0;
    background: var(--card-bg); border-radius: var(--radius-card); box-shadow: var(--card-shadow);
    padding: 20px 28px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 7px;
    opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.sc-panel-item.show { opacity: 1; transform: none; pointer-events: auto; }
.sc-panel-item .eyebrow { margin-bottom: 2px; font-size: .78rem; }
.sc-panel-item h3 { font-size: 1.15rem; margin-bottom: 2px; }
.sc-panel-item p { font-size: .95rem; color: var(--text-2); max-width: 36em; }

/* Invitation au défilement — présente sur toute la page : apparait
   après 1 s d'inactivité, disparait dès qu'on bouge (géré par scrolly.js) */
.sc-arrow {
    position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--border-soft); box-shadow: var(--card-shadow);
    display: grid; place-content: center; color: var(--text); font-family: inherit; cursor: pointer;
    opacity: 0; pointer-events: none; z-index: 45;
    transition: opacity .35s ease, background-color .35s ease, border-color .35s ease, color .35s ease;
}
.sc-arrow.on {
    opacity: 1; pointer-events: auto;
    background: var(--blue); border-color: var(--blue); color: #fff;
    box-shadow: 0 8px 26px rgba(0, 113, 227, .35);
    animation: scArrowBob 1.4s ease-in-out infinite;
}
@keyframes scArrowBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

@media (prefers-reduced-motion: reduce) {
    .sc-live, .sc-arrow.on { animation: none; }
    .sc-work .hd-li.busy .st::before { animation: none; opacity: 1; }
    .scrolly-laptop { animation: none; }
}
/* Écrans étroits (téléphones portrait, même seuil que fitScene dans scrolly.js) :
   composition native qui occupe toute la largeur, sans mise à l'échelle */
@media (max-width: 640px) {
    /* La nav occupe ~100 px sur téléphone (logo + marque sur 2 lignes) :
       on lui réserve sa place, et on recentre le reste. */
    .scrolly-stage {
        --sc-k: 1;
        padding-top: calc(104px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }
    .sc-arrow { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .sc-scaler { width: 100%; gap: 7px; }
    .scrolly-laptop, .sc-panel { width: 100%; }
    .sc-trackrow { width: 92%; }
    /* Fenêtre : écran plus haut (11/8) + contenu compact
       pour que les 5 étapes ET la jauge tiennent toujours. */
    .scrolly-screen { aspect-ratio: 11 / 8; padding: 7px 10px; }
    .sc-el { inset: 7px 10px; }
    .sc-work .hd-bar { padding: 5px 9px; }
    .sc-work .hd-body { padding: 6px 8px; gap: 5px; }
    .sc-work .hd-list { gap: 5px; }
    .sc-work .hd-li { padding: 4px 8px; font-size: .72rem; line-height: 1.35; }
    .sc-work .hd-k { font-size: .66rem; margin-bottom: 3px; }
    .sc-panel { min-height: 148px; }
}
@media (max-width: 560px) {
    .sc-chip span { display: none; }
    .sc-chip { padding: 6px 10px; }
    .sc-panel { min-height: 148px; }
    .sc-panel-item { padding: 14px 18px; }
    .sc-done { padding: 18px 20px; }
    .sc-done h3 { font-size: 1.12rem; }
    .sc-badge { font-size: 9.5px; padding: 6px 10px; top: 10px; right: 10px; }
}
