/* ==========================================================================
   Page d'accueil publique — templates/home/index.html.twig
   D'apres la maquette validee « La journee d'un gerant » (1440 px).
   Ecrit contre public/css/tokens.css : aucune couleur brute, une teinte
   d'outil se demande par [data-tint]. Le vocabulaire partage des autres
   pages publiques (.hp, hp-btn...) vit dans public-commun.css.
   ========================================================================== */

.hm {
    --hm-colonne: 1200px;
    --hm-gouttiere: max(var(--gutter-page), calc((100% - var(--hm-colonne)) / 2));
    --hm-ombre-carte: 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent),
                      0 6px 18px color-mix(in srgb, var(--ink) 6%, transparent);

    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}

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

.hm :where(h1, h2, h3, p, ul, li, figure, figcaption, fieldset, legend) {
    margin: 0;
    padding: 0;
}

.hm :where(ul) {
    list-style: none;
}

.hm-main {
    min-height: 0;
    padding: 0;
}

/* ---------- Teintes d'outil ----------------------------------------------- */
.hm [data-tint="documents"] { --tint: var(--mod-documents); --tint-ink: var(--mod-documents-ink); --tint-a: var(--mod-documents-tint); }
.hm [data-tint="stock"]     { --tint: var(--mod-stock);     --tint-ink: var(--mod-stock-ink);     --tint-a: var(--mod-stock-tint); }
.hm [data-tint="crm"]       { --tint: var(--mod-crm);       --tint-ink: var(--mod-crm-ink);       --tint-a: var(--mod-crm-tint); }
.hm [data-tint="planning"]  { --tint: var(--mod-planning);  --tint-ink: var(--mod-planning-ink);  --tint-a: var(--mod-planning-tint); }
.hm [data-tint="finance"]   { --tint: var(--mod-finance);   --tint-ink: var(--mod-finance-ink);   --tint-a: var(--mod-finance-tint); }
.hm [data-tint="expenses"]  { --tint: var(--mod-expenses);  --tint-ink: var(--mod-expenses-ink);  --tint-a: var(--mod-expenses-tint); }
.hm [data-tint="assistant"] { --tint: var(--mod-assistant); --tint-ink: var(--mod-assistant-ink); --tint-a: var(--mod-assistant-tint); }

/* Les icones au trait : 24 x 24, teinte de l'outil ou encre. */
.hm svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Typographie --------------------------------------------------- */
.hm-h1 {
    max-width: 980px;
    font-family: var(--font-display);
    font-size: 72px;
    line-height: 1.02;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.035em;
}

.hm-h2 {
    font-family: var(--font-display);
    font-size: 48px;
    line-height: var(--lh-tight);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.03em;
}

.hm-h3 {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: var(--lh-snug);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--track-title);
}

.hm-h3--petit {
    font-family: var(--font-ui);
    font-size: 17px;
    letter-spacing: 0;
}

.hm-surtitre {
    font-size: 14px;
    font-weight: var(--weight-medium);
    color: var(--ink-muted);
}

.hm-intro {
    font-size: 18px;
    line-height: var(--lh-loose);
    color: var(--ink-muted);
}

/* Un lien dans une phrase d'introduction : la couleur du texte courant,
   souligné pour se distinguer sans changer de ton. */
.hm-intro-lien {
    color: var(--ink);
    font-weight: var(--weight-medium);
    text-underline-offset: 3px;
}

/* ---------- Boutons ------------------------------------------------------- */
.hm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

.hm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-md);
    padding: 0 var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.hm-btn--grand {
    height: 48px;
}

.hm-btn--plein {
    background: var(--ink);
    color: var(--ink-on-dark);
}

.hm-btn--plein:hover {
    background: var(--ink-secondary);
    color: var(--ink-on-dark);
}

.hm-btn--contour {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--ink);
}

.hm-btn--contour:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.hm a:focus-visible,
.hm button:focus-visible,
.hm summary:focus-visible {
    outline: 2px solid var(--info);
    outline-offset: 2px;
    border-radius: var(--radius-chip);
}

.hm-lien {
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
    color: var(--ink);
    text-underline-offset: 3px;
}

/* ---------- Sections ------------------------------------------------------ */
.hm-section {
    padding: 72px var(--hm-gouttiere);
    border-top: 1px solid var(--border);
}

.hm-section--gris {
    background: var(--surface-sunken);
}

.hm-entete {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    max-width: 920px;
    margin: 0 auto var(--space-12);
    text-align: center;
}

.hm-section--gris .hm-entete {
    margin-bottom: 56px;
}

.hm-entete--gauche {
    align-items: flex-start;
    margin: 0;
    text-align: left;
}

/* La reglette des sept teintes. */
.hm-reglette {
    display: inline-flex;
    gap: var(--space-1);
}

.hm-reglette span {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--tint);
}

.hm-reglette--large {
    gap: 6px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hm-hero {
    padding: 72px var(--hm-gouttiere) 88px;
    text-align: center;
}

.hm-hero-texte {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-16);
}

.hm-chapo {
    max-width: 640px;
    font-size: 20px;
    line-height: var(--lh-normal);
    color: var(--ink-muted);
}

.hm-hero .hm-actions {
    margin-top: var(--space-2);
}

.hm-mention {
    font-size: 14px;
    color: var(--ink-muted);
}

/* ---------- Le montage -----------------------------------------------------
   La scene est dessinee en unites de maquette : --u vaut 1 px de la
   maquette (1200 x 456), rapporte a la largeur reelle de la figure. En
   dessous de 1100 px, --u vaut 1 px et la scene se range en colonne.
   -------------------------------------------------------------------------- */
.hm-montage {
    --u: 1px;

    max-width: var(--hm-colonne);
    margin: 0 auto;
    container-type: inline-size;
}

.hm-liens {
    display: none;
}

.hm-liens g {
    color: var(--tint);
}

.hm-liens path {
    stroke-opacity: 0.45;
    stroke-width: 1.5;
}

.hm-liens .hm-lien-depart {
    fill: currentColor;
    stroke: none;
}

.hm-liens .hm-lien-arrivee {
    fill: var(--surface);
    stroke-width: 1.5;
}

.hm-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: calc(34 * var(--u));
    height: calc(34 * var(--u));
    border-radius: calc(10 * var(--u));
    background: var(--tint-a);
    color: var(--tint);
}

.hm-icone svg {
    width: calc(17 * var(--u));
    height: calc(17 * var(--u));
    stroke-width: 1.8;
}

/* La carte de l'Assistant */
.hm-assistant {
    display: flex;
    flex-direction: column;
    max-width: calc(420 * var(--u));
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent),
                0 18px 44px color-mix(in srgb, var(--ink) 10%, transparent);
    text-align: left;
}

.hm-assistant-tete {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--u));
    padding: calc(14 * var(--u)) calc(18 * var(--u));
    border-bottom: 1px solid var(--border);
}

.hm-assistant .hm-icone {
    width: calc(30 * var(--u));
    height: calc(30 * var(--u));
    border-radius: calc(9 * var(--u));
}

.hm-assistant .hm-icone svg {
    width: calc(16 * var(--u));
    height: calc(16 * var(--u));
}

.hm-assistant-nom {
    flex-grow: 1;
    font-size: calc(16 * var(--u));
    font-weight: var(--weight-semibold);
}

.hm-lecture {
    display: inline-flex;
    align-items: center;
    gap: calc(6 * var(--u));
    font-size: calc(13 * var(--u));
    color: var(--ink-muted);
}

.hm-lecture svg {
    width: calc(13 * var(--u));
    height: calc(13 * var(--u));
    stroke-width: 2;
}

.hm-assistant-corps {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: calc(12 * var(--u));
    padding: calc(16 * var(--u)) calc(18 * var(--u));
}

.hm-question {
    align-self: flex-end;
    padding: calc(9 * var(--u)) calc(14 * var(--u));
    border-radius: calc(14 * var(--u)) calc(14 * var(--u)) calc(4 * var(--u)) calc(14 * var(--u));
    background: var(--surface-sunken);
    font-size: calc(15 * var(--u));
}

.hm-reponse {
    font-size: calc(15 * var(--u));
    line-height: var(--lh-normal);
}

.hm-reponse strong {
    font-weight: var(--weight-semibold);
}

.hm-reponse .hm-alerte {
    color: var(--danger);
}

.hm-conseil {
    padding-left: calc(10 * var(--u));
    border-left: 3px solid var(--mod-assistant);
    font-size: calc(14 * var(--u));
    line-height: var(--lh-normal);
    color: var(--ink-secondary);
}

.hm-sources {
    margin-top: auto;
    font-size: calc(12 * var(--u));
    color: var(--ink-muted);
}

/* Les six signaux */
.hm-signaux {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.hm-signal {
    display: flex;
    align-items: center;
    gap: calc(12 * var(--u));
    min-height: calc(76 * var(--u));
    padding: 0 calc(16 * var(--u));
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--hm-ombre-carte);
    text-align: left;
}

.hm-signal-texte {
    display: flex;
    flex-direction: column;
    gap: calc(3 * var(--u));
    min-width: 0;
}

.hm-signal-nom {
    font-size: calc(14 * var(--u));
    font-weight: var(--weight-semibold);
}

.hm-signal-valeur {
    font-size: calc(13 * var(--u));
    font-weight: var(--weight-medium);
    color: var(--tint-ink);
    font-variant-numeric: tabular-nums;
}

.hm-legende {
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

/* Au bureau : la scene de la maquette, a l'echelle de la figure. */
@media (min-width: 1100px) {
    .hm-montage {
        position: relative;
        aspect-ratio: 1200 / 456;
    }

    .hm-scene {
        --u: calc(100cqw / 1200);
        position: absolute;
        inset: 0;
    }

    .hm-liens {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .hm-assistant {
        position: absolute;
        left: calc(390 * var(--u));
        top: calc(70 * var(--u));
        width: calc(420 * var(--u));
        height: calc(284 * var(--u));
    }

    .hm-signaux {
        display: block;
        margin: 0;
    }

    .hm-signal {
        position: absolute;
        width: calc(256 * var(--u));
        height: calc(76 * var(--u));
        left: calc(40 * var(--u));
    }

    .hm-signal-valeur {
        white-space: nowrap;
    }

    .hm-signal:nth-child(3n + 1) { top: calc(16 * var(--u)); }
    .hm-signal:nth-child(3n + 2) { top: calc(174 * var(--u)); }
    .hm-signal:nth-child(3n + 3) { top: calc(332 * var(--u)); }
    .hm-signal:nth-child(n + 4) { left: calc(904 * var(--u)); }

    .hm-legende {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
    }
}

/* ==========================================================================
   Du devis au paiement — Confiance
   ========================================================================== */
.hm-grille4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-12);
}

.hm-benefice {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hm-benefice-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.hm-benefice-icone svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

.hm-benefice p {
    font-size: 16px;
    line-height: var(--lh-loose);
    color: var(--ink-muted);
}

.hm-preuve {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.hm-preuve svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.6;
}

.hm-preuve p {
    font-size: var(--text-body);
    line-height: var(--lh-normal);
    color: var(--ink-muted);
}

/* ==========================================================================
   Les outils
   ========================================================================== */
.hm-outils {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.hm-outil {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    transition: border-color var(--duration) var(--ease);
}

.hm-outil:hover {
    border-color: var(--border-strong);
}

.hm-outil-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--tint-a);
    color: var(--tint);
}

.hm-outil-icone svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.7;
}

.hm-outil-nom {
    margin-top: 6px;
    font-size: var(--text-title-2);
    font-weight: var(--weight-semibold);
}

/* Le nom mene a la page de l'outil ; la carte entiere est cliquable. */
.hm-outil-nom a {
    color: inherit;
    text-decoration: none;
}

.hm-outil-nom a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.hm-outil-nom a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hm-outil-nom a:focus-visible {
    outline: none;
}

.hm-outil:has(a:focus-visible) {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

.hm-outil-resume {
    font-size: var(--text-body);
    line-height: var(--lh-normal);
    color: var(--ink-muted);
}

.hm-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    height: 24px;
    margin-top: var(--space-1);
    padding: 0 9px;
    border-radius: var(--radius-pill);
    background: var(--success-tint);
    color: var(--success-ink);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.hm-outil--pack {
    justify-content: space-between;
    border-color: var(--border-strong);
}

.hm-outil--pack .hm-outil-nom {
    margin-top: 0;
}

.hm-outil-pack {
    font-size: var(--text-body);
    line-height: var(--lh-normal);
    color: var(--ink-secondary);
}

.hm-outil-pack strong {
    font-weight: var(--weight-semibold);
    color: var(--ink);
}

.hm-outil-pack :is(strong, s) {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Tarifs — le configurateur
   ========================================================================== */
.hm-config {
    max-width: 1040px;
    margin: 0 auto;
}

.hm-metiers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: var(--space-5);
}

.hm-metiers-libelle {
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
    color: var(--ink-secondary);
}

.hm-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-button);
    background: var(--surface-sunken);
}

.hm-segment {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--space-2);
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 14px;
    font-weight: var(--weight-medium);
    white-space: nowrap;
    cursor: pointer;
}

.hm-segment:hover {
    color: var(--ink);
}

.hm-segment[aria-pressed="true"] {
    background: var(--surface);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent);
    color: var(--ink);
    font-weight: var(--weight-semibold);
}

.hm-config-grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--space-4);
    align-items: stretch;
}

.hm-lignes {
    min-width: 0;
    padding: var(--space-2) var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.hm-ligne {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 56px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.hm-ligne:last-of-type {
    border-bottom: 0;
}

.hm-carre {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--border-strong);
    transition: background var(--duration) var(--ease);
}

.hm-ligne-nom {
    flex-grow: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: var(--weight-medium);
}

.hm-ligne-prix {
    font-size: var(--text-body);
    color: var(--ink-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* La case est la vraie commande (role="switch") : invisible, mais
   focalisable et cochable au clavier. La piste qui la suit la dessine. */
.hm-interrupteur {
    position: absolute;
    right: 0;
    width: 40px;
    height: 23px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.hm-piste {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 23px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    transition: background var(--duration-fast) var(--ease);
}

.hm-piste::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 18%, transparent);
    transition: transform var(--duration-fast) var(--ease);
}

.hm-interrupteur:checked ~ .hm-piste {
    background: var(--tint);
}

.hm-interrupteur:checked ~ .hm-piste::after {
    transform: translateX(17px);
}

.hm-ligne:has(.hm-interrupteur:checked) .hm-carre {
    background: var(--tint);
}

.hm-ligne:has(.hm-interrupteur:checked) .hm-ligne-prix {
    color: var(--ink);
}

.hm-interrupteur:focus-visible ~ .hm-piste {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

/* Le resume */
.hm-resume {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.hm-resume-nb {
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
    color: var(--ink-muted);
}

.hm-resume-total {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.hm-resume-total [data-resume-total] {
    font-family: var(--font-display);
    font-size: 52px;
    line-height: 1;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.hm-resume-unite {
    font-size: var(--text-body);
    color: var(--ink-muted);
}

.hm-resume-detail {
    margin-top: var(--space-3);
    font-size: var(--text-body);
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
}

.hm-resume-gratuit {
    margin-top: var(--space-2);
    font-size: 14px;
    color: var(--ink-muted);
}

.hm-resume-gratuit[hidden] {
    display: none;
}

.hm-paliers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: var(--space-6) 0 var(--space-8);
}

.hm-palier {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--ink-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hm-palier[data-actif] {
    background: var(--ink);
    color: var(--ink-on-dark);
}

.hm-resume-cta {
    height: 50px;
    margin-top: auto;
    font-size: 16px;
}

.hm-resume-note {
    margin-top: 14px;
    font-size: 14px;
    color: var(--ink-muted);
    text-align: center;
}

.hm-config-note {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--text-body);
    line-height: var(--lh-loose);
    color: var(--ink-muted);
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.hm-faq {
    display: grid;
    grid-template-columns: 460px minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
}

.hm-faq-liste {
    border-top: 1px solid var(--border);
}

.hm-faq-item {
    border-bottom: 1px solid var(--border);
}

/* La section suivante pose deja son filet : pas de second trait juste au-dessus. */
.hm-faq-item:last-child {
    border-bottom: 0;
}

.hm-faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-6);
    padding: 22px 0;
    font-size: 17px;
    font-weight: var(--weight-medium);
    list-style: none;
    cursor: pointer;
}

.hm-faq-item summary::-webkit-details-marker {
    display: none;
}

.hm-faq-item summary svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--ink-muted);
    stroke-width: 2;
    transition: transform var(--duration) var(--ease);
}

.hm-faq-item[open] summary svg {
    transform: rotate(180deg);
}

.hm-faq-item p {
    padding: 0 var(--space-12) 22px 0;
    font-size: 16px;
    line-height: var(--lh-loose);
    color: var(--ink-muted);
}

/* ==========================================================================
   Appel final
   ========================================================================== */
.hm-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
    text-align: center;
}

.hm-final-titre {
    font-family: var(--font-display);
    font-size: 56px;
    line-height: 1.05;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.035em;
}

.hm-final .hm-actions {
    margin-top: var(--space-2);
}

/* ==========================================================================
   Tablette et telephone
   ========================================================================== */
@media (max-width: 1100px) {
    .hm-grille4,
    .hm-outils {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hm-faq {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-10);
    }

    .hm-config-grille {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .hm-hero {
        padding-top: var(--space-10);
        padding-bottom: var(--space-12);
    }

    .hm-hero-texte {
        gap: var(--space-10);
        margin-bottom: var(--space-10);
    }

    .hm-h1 {
        font-size: 40px;
        line-height: 1.05;
    }

    .hm-chapo {
        font-size: 17px;
    }

    .hm-h2 {
        font-size: 32px;
    }

    .hm-final-titre {
        font-size: 36px;
    }

    .hm-intro {
        font-size: 16px;
    }

    .hm-section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .hm-entete,
    .hm-section--gris .hm-entete {
        margin-bottom: var(--space-8);
    }

    .hm-grille4 {
        gap: var(--space-8);
    }

    .hm-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .hm-metiers {
        flex-direction: column;
        gap: var(--space-2);
    }

    .hm-segments {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .hm-segment {
        white-space: normal;
        height: auto;
        min-height: var(--touch-target);
        padding: var(--space-1) var(--space-2);
    }

    .hm-lignes {
        padding: var(--space-1) var(--space-4);
    }

    .hm-ligne {
        gap: var(--space-3);
    }

    .hm-resume {
        padding: var(--space-6);
    }

    .hm-faq-item p {
        padding-right: 0;
    }
}

@media (max-width: 640px) {
    .hm-grille4 {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Une colonne : chaque benefice et chaque preuve se centrent, icone comprise. */
    .hm-benefice,
    .hm-preuve {
        align-items: center;
        text-align: center;
    }

    /* Les outils en liste : une ligne par outil (icone, nom, resume) plutot
       qu'une carte chacun, pour ne pas faire defiler huit cartes. */
    .hm-outils {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius-card);
        background: var(--surface);
        overflow: hidden;
    }

    .hm-outil {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: var(--space-4);
        row-gap: 2px;
        align-items: start;
        padding: var(--space-4);
        border: 0;
        border-radius: 0;
    }

    .hm-outil + .hm-outil {
        border-top: 1px solid var(--border-subtle);
    }

    .hm-outil-icone {
        grid-row: 1 / span 3;
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .hm-outil-icone svg {
        width: 18px;
        height: 18px;
    }

    .hm-outil :is(.hm-outil-nom, .hm-outil-resume, .hm-badge, .hm-outil-pack, .hm-lien) {
        grid-column: 2;
    }

    .hm-outil-nom {
        margin-top: 0;
        font-size: var(--text-title-3);
    }

    .hm-outil-resume {
        font-size: 14px;
    }

    .hm-outil--pack {
        display: flex;
        gap: var(--space-2);
        background: var(--surface-sunken);
    }

    /* La liste rogne ce qui deborde : le contour de focus passe a l'interieur. */
    .hm-outil:has(a:focus-visible) {
        outline-offset: -2px;
    }

    .hm-signaux {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 400px) {
    .hm-ligne-prix {
        font-size: var(--text-sm);
    }
}

/* ---------- Le montage, anime ----------------------------------------------
   home-index.js pose `data-anime` sur la figure (jamais si le visiteur a
   demande moins de mouvement), puis `est-visible` sur chaque piece, dans
   l'ordre : la question s'ecrit, la reponse vient, les liens se tracent
   vers les outils qu'elle cite et leurs cartes glissent en place. Sans
   script, tout est visible d'emblee.
   -------------------------------------------------------------------------- */
.hm-montage[data-anime] .hm-reponse,
.hm-montage[data-anime] .hm-conseil,
.hm-montage[data-anime] .hm-sources {
    opacity: 0;
    transform: translateY(calc(6 * var(--u)));
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.hm-montage[data-anime] .hm-question:empty {
    visibility: hidden;
}

.hm-montage[data-anime] .hm-question.est-en-frappe::after {
    content: "";
    display: inline-block;
    width: 1.5px;
    height: 1.05em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: currentColor;
    animation: hm-curseur 0.9s steps(1) infinite;
}

@keyframes hm-curseur {
    50% { opacity: 0; }
}

.hm-montage[data-anime] .hm-liens path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hm-montage[data-anime] .hm-liens circle {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hm-montage[data-anime] .hm-liens .hm-lien-depart {
    transition-delay: 0.6s;
}

.hm-montage[data-anime] .hm-signal {
    opacity: 0;
    transform: translateX(calc(-16 * var(--u)));
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hm-montage[data-anime] .hm-signal:nth-child(n + 4) {
    transform: translateX(calc(16 * var(--u)));
}

.hm-montage[data-anime] .est-visible,
.hm-montage[data-anime] .hm-signal.est-visible {
    opacity: 1;
    transform: none;
}

.hm-montage[data-anime] .hm-liens g.est-visible path {
    stroke-dashoffset: 0;
}

.hm-montage[data-anime] .hm-liens g.est-visible circle {
    opacity: 1;
}
