/* ===== Page d'accueil ===== */
:root {
    /* Palette reprise du logo animé TOTOM */
    --c-green: #3df42f;   /* T */
    --c-blue: #2f9bf4;    /* O */
    --c-orange: #f45d2f;  /* T */
    --c-yellow: #f4d22f;  /* O */
    --c-pink: #f42f87;    /* M */
    --accent: var(--c-orange);
    --muted: rgba(255, 255, 255, 0.62);
    --line: #ffffff;   /* séparateurs */
}

.home main { overflow-x: clip; }   /* "hidden" casserait le hero collant */

.kicker {
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
}

.accent { color: var(--accent); }

/* Numéro de chapitre : carré à contour de couleur, un peu plus haut que la première lettre (28 px minimum),
   devant le titre sur la même ligne, chiffre en bas à droite dans le carré (taille fixe) */
.chap {
    position: relative;
    display: inline-block;
    width: max(0.9em, 28px);
    height: max(0.9em, 28px);
    margin-right: 0.35em;
    border: 2px solid var(--chap-color, var(--accent));   /* contour de couleur, pas de fond */
    box-sizing: border-box;
    vertical-align: baseline;
    flex: none;
}
.chap-num {
    position: absolute;
    right: 3px;
    bottom: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    color: var(--chap-color, var(--accent));
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: 1px solid #ffffff;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.btn:hover { border-color: #fff; transform: translateY(-2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--c-pink); border-color: var(--c-pink); }

/* ---------- Fond : logo animé ---------- */
.logo-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;   /* sous le contenu, sans l'isoler (le titre peut se fondre avec le logo) */
    pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    height: 300vh;
}
.hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: flex-end;
    padding: 120px 80px 110px;
}
/* Titre centré, gros, orange ; il s'efface au scroll (opacité gérée dans totom-logo.js) */
.hero-sticky { justify-content: center; align-items: center; text-align: center; }
.hero-title {
    color: var(--c-orange);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.hero-line { display: block; font-size: clamp(36px, 7.5vw, 120px); }
.hero-sub { font-size: clamp(48px, 11vw, 180px); margin-top: 0.08em; }

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 32px;
    z-index: 1;
    width: 22px;
    height: 36px;
    border: 1px solid var(--edge);
    transform: translateX(-50%);
}
.scroll-hint span {
    position: absolute;
    left: 50%;
    top: 7px;
    width: 2px;
    height: 7px;
    background: #fff;
    transform: translateX(-50%);
    animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint {
    0% { opacity: 0; transform: translate(-50%, 0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ---------- Piliers ---------- */
.pillars {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 80px;
    display: flex;
    flex-direction: column;
    gap: 140px;
}
/* Texte au-dessus, animation en dessous */
.pillar {
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.pillar-text { align-self: stretch; text-align: left; }   /* textes sur le côté */
.pillar-text { order: 1; }
.pillar-visual { order: 2; }
.pillar-visual {
    aspect-ratio: 16 / 10;
    max-height: 600px;   /* règle du site : aucun visuel au-delà de 600 px de haut */
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}
.pillar-visual video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pillar:nth-child(1) { --chap-color: var(--c-green); }
.pillar:nth-child(2) { --chap-color: var(--c-blue); }
.pillar:nth-child(3) { --chap-color: var(--c-pink); }
.pillar-text h2 {
    font-size: clamp(30px, 3.2vw, 46px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 24px;
}
.pillar-text p {
    font-size: 17px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 560px;
}

/* Apparition au scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Animation 1 : cadre motion design (canvas) --- */
.anim-motion { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* --- Animation 2 : nœuds ComfyUI --- */
.anim-nodes { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6%; }
.anim-nodes .node rect:first-child { fill: #0a0a0a; stroke: #ffffff; }
.anim-nodes .node-main rect:first-child { stroke: var(--accent); }
.anim-nodes text { fill: rgba(255,255,255,0.85); font-size: 12px; font-family: inherit; }
.anim-nodes .node-bar, .anim-nodes .node-track { fill: none; stroke: #ffffff; }
.anim-nodes .node-progress {
    fill: var(--accent);
    transform-box: fill-box;
    transform-origin: left;
    animation: sample 4s ease-in-out infinite;
}
@keyframes sample {
    0%, 15% { transform: scaleX(0); }
    65%, 100% { transform: scaleX(1); }
}
.wire { fill: none; stroke: #ffffff; stroke-width: 1.5; }
.pulse {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 14 200;
    stroke-dashoffset: 14;
    animation: pulse 4s linear infinite;
}
.pulse.p2 { animation-delay: 0.15s; }
.pulse.p3, .pulse.p4 { animation-name: pulseOut; }
@keyframes pulse {
    0% { stroke-dashoffset: 14; opacity: 1; }
    15% { stroke-dashoffset: -110; opacity: 1; }
    16%, 100% { opacity: 0; }
}
@keyframes pulseOut {
    0%, 64% { stroke-dashoffset: 14; opacity: 0; }
    65% { opacity: 1; }
    80% { stroke-dashoffset: -80; opacity: 1; }
    81%, 100% { opacity: 0; }
}
.thumb { animation: thumb 4s ease infinite; }
.thumb.t1 { fill: var(--c-yellow); }
.thumb.t2 { fill: var(--c-blue); }
@keyframes thumb {
    0%, 75% { opacity: 0.08; }
    85%, 95% { opacity: 1; }
    100% { opacity: 0.08; }
}

/* --- Animation 3 : deux carrés (personnage + code) --- */
/* Deux carrés encadrés, collés l'un à l'autre */
.pillar-duo {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 960px;
    max-height: none;
    overflow: visible;
}
.duo-cell {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--edge);
    overflow: hidden;
}
.duo-cell + .duo-cell { border-left: 0; }

.anim-talk { position: absolute; inset: 0; }
.anim-talk svg { width: 100%; height: 100%; display: block; padding: 6%; }
.talk-stroke { stroke: #fff; stroke-width: 2; }
.talk-white { fill: #fff; }
.talk-screen { fill: #0a0a0a; stroke: #fff; stroke-width: 2; }
.talk-pants { fill: var(--c-blue); }
.talk-shirt { fill: var(--c-orange); }
.talk-skin { fill: var(--c-yellow); }
.talk-dark { fill: #0a0a0a; }
.talk-arm { fill: none; stroke: var(--c-orange); stroke-width: 8; stroke-linecap: square; stroke-linejoin: miter; }
.talk-line { transform-box: fill-box; transform-origin: left; transform: scaleX(0); }
.talk-line.l1 { fill: var(--c-pink); }
.talk-line.l2 { fill: var(--c-blue); }
.talk-line.l3 { fill: var(--c-green); }
.talk-line.l4 { fill: var(--c-yellow); }
.talk-mouth { transform-box: fill-box; transform-origin: center; }

/* Bulle de texte (HTML par-dessus le dessin) */
.talk-bubble {
    position: absolute;
    top: 6%;
    left: 40%;
    right: 6%;
    padding: 8px 10px;
    border: 1px solid #fff;
    background: #0a0a0a;
    font-size: clamp(10px, 0.95vw, 13px);
    line-height: 1.35;
    color: #fff;
    min-height: 3.6em;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.talk-bubble::after {   /* pointe vers la tête */
    content: '';
    position: absolute;
    left: 10px;
    bottom: -9px;
    width: 14px;
    height: 9px;
    background: #fff;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.anim-talk.has-text .talk-bubble { opacity: 1; }

/* Il parle */
.anim-talk.is-talking .talk-mouth { animation: talkMouth 0.16s steps(2) infinite alternate; }
.anim-talk.is-talking .talk-head { animation: talkNod 0.8s ease-in-out infinite; }
@keyframes talkMouth { from { transform: scaleY(1); } to { transform: scaleY(3); } }
@keyframes talkNod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* L'ordinateur écrit le code */
.anim-talk.is-coding .talk-line { animation: talkCode 1.1s steps(6) infinite; }
.anim-talk.is-coding .talk-line.l2 { animation-delay: 0.25s; }
.anim-talk.is-coding .talk-line.l3 { animation-delay: 0.5s; }
.anim-talk.is-coding .talk-line.l4 { animation-delay: 0.75s; }
.anim-talk.is-coding .talk-hand { animation: talkTap 0.14s ease-in-out infinite alternate; }
.anim-talk.is-done .talk-line { transform: scaleX(1); }
@keyframes talkCode { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes talkTap { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* --- Animation 3 : code --- */
.anim-code {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: clamp(9px, 0.88vw, 12px);
}
.code-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--edge);
    color: var(--muted);
}
.code-bar i { width: 10px; height: 10px; border: 1px solid var(--edge); }
.code-bar span { margin-left: 10px; }
.code-prompt {
    padding: 12px 16px;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--edge);
    min-height: 2.6em;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}
.code-prompt-label { color: var(--accent); font-weight: 600; }
.code-body {
    flex: 1;
    margin: 0;
    padding: 14px 16px;
    color: #d6d6d6;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow: hidden;
}
.code-body .k { color: var(--c-pink); }
.code-body .s { color: var(--c-green); }
.code-body .c { color: rgba(255,255,255,0.35); }
.code-body .n { color: var(--c-blue); }
.caret {
    display: inline-block;
    width: 7px;
    height: 1.1em;
    background: var(--accent);
    vertical-align: text-bottom;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Chaîne de fabrication ---------- */
.pipeline {
    padding: 120px 80px;
    max-width: 1400px;
    margin: 0 auto;
}
.section-head { max-width: 720px; margin: 0 0 70px; text-align: left; }
.section-head h2 {
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
}
.section-lead { font-size: 17px; line-height: 1.75; color: var(--muted); }

/* 3 étapes par ligne, centrées ; le texte est en face de son carré */
.pipeline-steps {
    list-style: none;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 260px));
    justify-content: center;
    gap: 56px 48px;
    margin-bottom: 80px;
}
.pipeline-steps li {
    position: relative;
    z-index: 1;
    font-size: 18px;
    color: rgba(255,255,255,0.9);
}
.pipeline-steps li { --chap-color: var(--edge); }
.pipeline-steps .chap, .pipeline-steps .chap-num { transition: border-color 0.3s ease, color 0.3s ease; }
.pipeline-steps li:nth-of-type(5n+1) { --dot: var(--c-green); }
.pipeline-steps li:nth-of-type(5n+2) { --dot: var(--c-blue); }
.pipeline-steps li:nth-of-type(5n+3) { --dot: var(--c-orange); }
.pipeline-steps li:nth-of-type(5n+4) { --dot: var(--c-yellow); }
.pipeline-steps li:nth-of-type(5n+5) { --dot: var(--c-pink); }
.pipeline-steps.is-visible li { --chap-color: var(--dot); }
.pipeline-steps.is-visible li:nth-of-type(2) .chap, .pipeline-steps.is-visible li:nth-of-type(2) .chap-num { transition-delay: .15s; }
.pipeline-steps.is-visible li:nth-of-type(3) .chap, .pipeline-steps.is-visible li:nth-of-type(3) .chap-num { transition-delay: .3s; }
.pipeline-steps.is-visible li:nth-of-type(4) .chap, .pipeline-steps.is-visible li:nth-of-type(4) .chap-num { transition-delay: .45s; }
.pipeline-steps.is-visible li:nth-of-type(5) .chap, .pipeline-steps.is-visible li:nth-of-type(5) .chap-num { transition-delay: .6s; }
.pipeline-steps.is-visible li:nth-of-type(6) .chap, .pipeline-steps.is-visible li:nth-of-type(6) .chap-num { transition-delay: .75s; }
.pipeline-steps.is-visible li:nth-of-type(7) .chap, .pipeline-steps.is-visible li:nth-of-type(7) .chap-num { transition-delay: .9s; }
.pipeline-steps.is-visible li:nth-of-type(8) .chap, .pipeline-steps.is-visible li:nth-of-type(8) .chap-num { transition-delay: 1.05s; }

/* Liens qui apparaissent entre deux carrés tirés au hasard */
.pipeline-links {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}
.pipeline-links path {
    fill: none;
    stroke-width: 2;
}

/* ---------- CTA + footer ---------- */
.cta {
    text-align: center;
    padding: 140px 40px;
    border-top: 1px solid var(--line);
}
.cta h2 {
    font-size: clamp(34px, 5vw, 72px);
    font-weight: 300;
    letter-spacing: -0.03em;
    margin-bottom: 40px;
}
/* Fin de l'accueil : un écran vide où le logo animé redevient opaque */
.cta-logo {
    min-height: 100vh;
    min-height: 100svh;
}
/* Fixé juste sous le logo (--logo-bottom calculé dans totom-logo.js), apparaît en bas de page */
.cta-text {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(50% + var(--logo-bottom, 80px) + 28px);
    padding: 0 20px;
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    opacity: 0;
    visibility: hidden;
}
.cta-text a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: color 0.3s ease;
}
.cta-text a:hover { color: var(--c-pink); }

.site-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 30px 80px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}
.footer-social { display: flex; gap: 24px; }
.footer-social a { color: var(--muted); text-decoration: none; transition: color .3s ease; }
.footer-social a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-sticky, .pillars, .pipeline { padding-left: 40px; padding-right: 40px; }
    .site-footer { padding: 30px 40px; }
    .pillar { gap: 32px; }
    .pipeline-steps { grid-template-columns: repeat(3, minmax(0, 220px)); gap: 48px 32px; }
}

@media (max-width: 768px) {
    .hero-sticky { padding: 110px 20px 90px; }
    .pillars { padding: 80px 20px; gap: 90px; }
    .pillar { gap: 24px; }
    /* les deux carrés restent côte à côte, même sur mobile */
    .pipeline { padding: 80px 20px; }
    .pipeline-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 20px; }
    .cta { padding: 90px 20px; }
    .site-footer { padding: 24px 20px; }
}

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

/* ===== Page Scripts ===== */
.scripts-hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 170px 80px 80px;
}
/* Même typo que le titre de l'accueil, en plus petit, centrée */
.scripts-title {
    font-size: clamp(30px, 5vw, 72px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--page-color);
    text-align: center;
    max-width: 1000px;
    margin: 0 auto 28px;
}
/* Petite phrase éphémère sous le titre */
.scripts-wink {
    font-size: 12px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    margin: -12px auto 24px;
    max-width: 640px;
    overflow: visible;
    transition: max-height 0.6s ease, margin 0.6s ease;
}
.scripts-wink .ch {
    display: inline-block;
    white-space: pre;
    opacity: 0;
    transform: translateY(8px);
    animation: winkIn 0.4s ease forwards, winkWave 1.6s ease-in-out infinite;
}
@keyframes winkIn { to { opacity: 1; transform: translateY(0); } }
@keyframes winkWave { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
.scripts-wink .ch.is-gone { visibility: hidden; }
.wink-bit {
    position: fixed;
    width: 4px;
    height: 4px;
    pointer-events: none;
    z-index: 50;
    transition: transform 0.7s cubic-bezier(.2,.7,.3,1), opacity 0.7s ease;
}
.method {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 60px;
    background: var(--edge);
    border: 1px solid var(--edge);
}
.method li {
    background: #0a0a0a;
    padding: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}
.method strong {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 8px;
}
.method li:nth-child(1) { --chap-color: var(--c-green); }
.method li:nth-child(2) { --chap-color: var(--c-blue); }
.method li:nth-child(3) { --chap-color: var(--c-yellow); }
.method li:nth-child(4) { --chap-color: var(--c-pink); }

/* Une vignette de 300 × 200 par script */
.scripts-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 80px 120px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 300px));
    justify-content: center;
    gap: 16px;
}
.script-card {
    --card: var(--c-green);
    display: flex;
    flex-direction: column;
    height: 200px;
    border: 1px solid var(--edge);
    transition: border-color 0.3s ease;
}
.script-card:hover { border-color: var(--card); }
.script-card:nth-child(5n+1) { --card: var(--c-green); }
.script-card:nth-child(5n+2) { --card: var(--c-blue); }
.script-card:nth-child(5n+3) { --card: var(--c-orange); }
.script-card:nth-child(5n+4) { --card: var(--c-yellow); }
.script-card:nth-child(5n+5) { --card: var(--c-pink); }
.script-card { --chap-color: var(--card); }
.script-anim { flex: 1; min-height: 0; border-bottom: 1px solid var(--edge); }
.script-info { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 5px; text-align: center; align-items: center; }

/* Écran avec souris : au repos seulement le titre, au survol l'animation + le texte + les liens */
@media (hover: hover) {
    .script-card { position: relative; overflow: hidden; }
    .script-anim {
        position: absolute;
        left: 0; right: 0; top: 0;
        height: 104px;
        opacity: 0;
        transition: opacity 0.35s ease;
    }
    .script-info {
        position: absolute;
        left: 0; right: 0;
        top: 50%;
        transform: translateY(-50%);
        transition: top 0.4s cubic-bezier(.2,.7,.2,1), transform 0.4s cubic-bezier(.2,.7,.2,1);
    }
    .script-info p, .script-actions {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, max-height 0.4s ease;
    }
    .script-card:hover .script-anim, .script-card:focus-within .script-anim { opacity: 1; }
    .script-card:hover .script-info, .script-card:focus-within .script-info { top: 100%; transform: translateY(-100%); }
    .script-card:hover .script-info p, .script-card:focus-within .script-info p,
    .script-card:hover .script-actions, .script-card:focus-within .script-actions { opacity: 1; max-height: 40px; }
    .script-card:hover .script-info p, .script-card:focus-within .script-info p { transition-delay: 0.1s; }
}
.script-info h2 { font-size: 15px; font-weight: 400; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.script-info .chap { width: 20px; height: 20px; border-width: 1.5px; vertical-align: -3px; }
.script-info .chap-num { font-size: 7px; right: 2px; bottom: 2px; }
.script-info p {
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.script-badge { font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--edge); padding: 1px 4px; margin-left: 6px; vertical-align: middle; }
.script-actions { display: flex; gap: 6px; justify-content: center; }
.script-link {
    padding: 5px 8px;
    border: 1px solid var(--card);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}
.script-link:hover { background: var(--card); color: #0a0a0a; }


/* ---------- Petites animations en carrés (scripts-help.js) ---------- */
.sh-svg { width: 100%; height: 100%; display: block; }
.sh-label { fill: rgba(255, 255, 255, 0.6); font-size: 10px; font-family: inherit; letter-spacing: 0.5px; }
.sh-label.sh-dark { fill: #0a0a0a; }
.sh-move, .sh-slide, .sh-pop, .sh-color, .sh-static {
    transform: translate(var(--x0), var(--y0));
    transform-box: fill-box;
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(.7, 0, .3, 1);
    animation-fill-mode: both;
}
.sh-move { animation-name: shMove; }
.sh-slide { animation-name: shSlide; }
.sh-pop { animation-name: shPop; transform-origin: center; }
.sh-color { animation-name: shColor; }
.sh-blink { animation: shBlink 1.2s ease-in-out infinite; }
.sh-face { opacity: 0; animation: shFace 4s ease infinite both; }
@keyframes shMove {
    0%, 12% { transform: translate(var(--x0), var(--y0)); }
    45%, 82% { transform: translate(var(--x1), var(--y1)); }
    100% { transform: translate(var(--x0), var(--y0)); }
}
@keyframes shSlide {
    0%, 8% { opacity: 0; transform: translate(var(--x0), var(--y0)); }
    12% { opacity: 1; }
    40%, 82% { opacity: 1; transform: translate(var(--x1), var(--y1)); }
    95%, 100% { opacity: 0; transform: translate(var(--x1), var(--y1)); }
}
@keyframes shPop {
    0%, 6% { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(0); }
    18%, 82% { opacity: 1; transform: translate(var(--x0), var(--y0)) scale(1); }
    95%, 100% { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(1); }
}
@keyframes shColor {
    0%, 20% { fill: var(--c0); transform: translate(var(--x0), var(--y0)); }
    35%, 85% { fill: var(--c1); transform: translate(var(--x0), var(--y0)); }
    100% { fill: var(--c0); transform: translate(var(--x0), var(--y0)); }
}
@keyframes shBlink { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.sh-fold { animation: shFold 4s cubic-bezier(.6, 0, .4, 1) infinite both; }
@keyframes shFold { 0%, 12% { transform: rotate(0deg); } 45%, 75% { transform: rotate(9deg); } 100% { transform: rotate(0deg); } }
@keyframes shFace { 0%, 10% { opacity: 0; } 25%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Fenêtre "Comment ça marche ?" ---------- */
.help-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
}
.help-modal.is-open { display: flex; }
.help-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 600px;
    overflow: auto;
    padding: 28px 28px 22px;
    background: #0a0a0a;
    border: 1px solid var(--edge);
}
.help-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: #fff; font-size: 32px; cursor: pointer; }
.help-close:hover { color: var(--page-color); }
.help-script { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--page-color); margin-bottom: 14px; }
.help-stage { aspect-ratio: 16 / 9; max-height: 320px; border: 1px solid var(--edge); }
.help-title { font-size: 22px; font-weight: 400; margin: 20px 0 8px; }
.help-text { font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, 0.8); min-height: 3.4em; }
.help-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.help-nav button {
    width: 48px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--edge);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.help-nav button:hover:not(:disabled) { background: var(--page-color); border-color: var(--page-color); color: #0a0a0a; }
.help-nav button:disabled { opacity: 0.25; cursor: default; }
.help-count { font-size: 13px; letter-spacing: 2px; color: var(--muted); }

.pillar-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
}
.pillar-link:hover { text-decoration: underline; }

@media (max-width: 1024px) {
    .scripts-hero, .scripts-grid { padding-left: 40px; padding-right: 40px; }
    .method { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .scripts-hero { padding: 120px 20px 50px; }
    .scripts-grid { padding: 10px 20px 80px; }
    .script-card { height: 200px; }
}
@media (max-width: 480px) {
    .method { grid-template-columns: 1fr; }
}
