/*
 * La vitrine, en français (`index.html`) et en anglais (`index_en.html`) : une feuille pour
 * les deux. Couleurs, police et marque viennent de `brand.css`, lue avant elle ; aucune
 * couleur ne s'écrit ici (`publicPages.test.js`).
 *
 * Audit de design du 02/12/2026, lot 3 (rapport §3.3) : un seul élément fort, le cadran de
 * tontine ; le reste se tait. Un seul mouvement aussi : au chargement, le tour passe de Paul à
 * Clarisse, et rien ne bouge pour qui a demandé moins d'animations.
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    line-height: 1.5;
}

h1, h2, h3, p, figure, ul {
    margin: 0;
}

/* Les listes gardent leur rôle (`role="list"`) : Safari le retire à une liste sans puces. */
ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--link);
}

/* Aucun mot seul sur la dernière ligne d'un paragraphe, là où le navigateur sait l'éviter. */
p {
    text-wrap: pretty;
}

/* Une colonne : 1 160 px au plus, des marges qui ne tombent jamais à zéro. */
.wrap {
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ── Menu ─────────────────────────────────────────────────────────────── */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

/*
 * La couleur des liens du menu épargne son bouton : `.nav-links a`, plus précis que
 * `.btn-primary`, peignait le bouton du menu de la couleur des liens (1,01:1, lot 1).
 */
.nav-links a:not(.btn) {
    padding-top: 10px;
    padding-bottom: 10px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    text-underline-offset: 4px;
}

.nav-links a:not(.btn):hover {
    text-decoration: underline;
}

.nav-links .btn {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.9375rem;
}

/* ── Boutons ──────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1.0625rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* ── Accroche : le texte à gauche, le cadran à droite ─────────────────── */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px 64px;
    padding-top: 48px;
    padding-bottom: 96px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.lead {
    margin-top: 20px;
    max-width: 34em;
    font-size: 1.1875rem;
    line-height: 1.6;
    color: var(--muted);
}

.hero-action {
    margin-top: 32px;
}

.hint {
    margin-top: 14px;
    font-size: 0.9375rem;
    color: var(--muted);
}

/*
 * Le cadran : la tontine de la fiche Play, en horloge (le logo en est une). Huit places sur
 * le cercle de laiton, une coche sous qui a cotisé, une horloge sous qui n'a pas encore
 * cotisé (les icônes de l'écran), l'aiguille sur qui reçoit ce tour, le montant au centre.
 */
.dial {
    justify-self: center;
    width: 100%;
    max-width: 460px;
}

.dial-face {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.dial-face text {
    text-anchor: middle;
}

.dial-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
}

.dial-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

/* Les tours passés : un arc normé à 100 (`pathLength`), plein au repos. */
.dial-trail {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 100 100;
}

/* L'aiguille tourne autour du centre du cadran, en unités du dessin. */
.dial-hand {
    fill: var(--primary);
    transform-box: view-box;
    transform-origin: 200px 200px;
}

/* Le montant, l'élément le plus grand de la page (AGENTS.md §4.1.2). */
.dial-amount {
    fill: var(--text);
    font-size: 56px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.dial-unit {
    fill: var(--muted);
    font-size: 17px;
    font-weight: 500;
}

/* Le contour couleur du fond coupe le laiton autour de chaque place. */
.seat-disc {
    fill: var(--tint);
    stroke: var(--bg);
    stroke-width: 4;
}

.seat-initials {
    fill: var(--link);
    font-size: 14px;
    font-weight: 700;
}

.seat-name {
    fill: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.seat-now .seat-disc {
    fill: var(--primary);
}

.seat-now .seat-initials {
    fill: var(--on-primary);
}

.seat-now .seat-name {
    fill: var(--link);
    font-weight: 700;
}

/* Les pastilles (`<symbol>`) héritent de leur `<use>` : le fond du disque, puis le trait. */
.badge-paid {
    fill: var(--in);
    stroke: var(--bg);
}

.badge-wait {
    fill: var(--bg);
    stroke: var(--muted);
}

.dial figcaption {
    margin-top: 12px;
    text-align: center;
    font-size: 0.9375rem;
}

/* La seconde proposition de la légende tient d'un seul tenant : la ligne passe après le
   point-virgule, à toute largeur ; plus large que la colonne, elle se replie en elle-même. */
.dial-clause {
    display: inline-block;
}

.dial-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-top: 10px;
    color: var(--muted);
}

.dial-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-badge {
    flex: none;
}

/* ── Les gestes : trois écrans réels de l'application ─────────────────── */

.gestures,
.trust {
    padding-top: 96px;
    padding-bottom: 96px;
}

.gestures h2,
.trust h2 {
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.section-lead {
    margin-top: 12px;
    max-width: 40em;
    font-size: 1.125rem;
    color: var(--muted);
}

.gesture-scroller {
    margin-top: 48px;
}

.gesture-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
}

/* Les écrans s'alignent en bas : même largeur, même hauteur, donc même ligne de départ. */
.gesture {
    display: flex;
    flex-direction: column;
}

.gesture h3,
.fact h3 {
    font-size: 1.3125rem;
    line-height: 1.3;
    font-weight: 700;
}

.gesture p {
    margin-top: 8px;
    margin-bottom: 28px;
    color: var(--muted);
}

.gesture-screen {
    display: block;
    margin-top: auto;
    width: 100%;
    max-width: 300px;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

/* ── La confiance : quatre faits, sans numéros ────────────────────────── */

.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 64px;
    margin-top: 48px;
}

.fact p {
    margin-top: 8px;
    color: var(--muted);
}

.fact p + p {
    margin-top: 12px;
}

/* ── Pied de page ─────────────────────────────────────────────────────── */

/* Le bas laisse la place au bouton flottant de la version web (56 px, à 16 ou 24 px du bord). */
.site-footer {
    padding-top: 40px;
    padding-bottom: 112px;
    border-top: 1px solid var(--border);
    font-size: 0.9375rem;
    color: var(--muted);
}

.site-footer a {
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--text);
}

/* Une adresse ne se coupe pas à son tiret (« contact@codex- » puis « box.org »). */
.site-footer a[href^="mailto:"] {
    white-space: nowrap;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 24px;
    margin-top: 5px;
}

/* 44 px de haut, comme le bouton du menu : la marge du texte vient du lien lui-même. */
.footer-links a {
    display: inline-block;
    padding-top: 11px;
    padding-bottom: 11px;
}

.footer-note {
    margin-top: 5px;
    font-size: 0.875rem;
}

/* ── Tablette ─────────────────────────────────────────────────────────── */

@media (max-width: 1040px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Les trois écrans défilent à l'horizontale ; le suivant dépasse, pour dire qu'il y en a d'autres. */
@media (max-width: 860px) {
    .gesture-scroller {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 16px;
    }

    /* Une largeur fixe : un `minmax()` resterait à son minimum et ne laisserait dépasser que 11 px (820 px). */
    .gesture-list {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 40%;
        gap: 24px;
    }

    .gesture {
        scroll-snap-align: start;
    }
}

/* ── Téléphone : titre, phrase, bouton, puis le cadran sur toute la largeur ── */

@media (max-width: 760px) {
    .wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Le menu se réduit à l'autre langue : le bouton d'installation est juste dessous, la version web dans son bouton flottant. */
    .nav-links > :not(.nav-lang) {
        display: none;
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 8px;
        padding-bottom: 64px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .lead {
        font-size: 1.0625rem;
    }

    .hero-action .btn {
        width: 100%;
    }

    .gestures,
    .trust {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .gestures h2,
    .trust h2 {
        font-size: 1.75rem;
    }

    .gesture-list {
        grid-auto-columns: 78%;
        gap: 20px;
    }

    .facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }
}

/*
 * Le seul mouvement de la page, pour qui n'a rien demandé : le tour passe de Paul à Clarisse.
 * L'aiguille avance d'un cran, l'arc des tours passés la suit, la place de Paul s'éteint et
 * celle de Clarisse s'allume. Au repos, le dessin est déjà l'état final.
 */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }

    .dial-hand {
        animation: dial-hand 1.2s cubic-bezier(0.55, 0, 0.25, 1) 0.6s both;
    }

    .dial-trail {
        animation: dial-trail 1.2s cubic-bezier(0.55, 0, 0.25, 1) 0.6s both;
    }

    .seat-prev .seat-disc {
        animation: seat-prev-disc 0.4s ease-out 0.6s both;
    }

    .seat-prev .seat-initials {
        animation: seat-prev-initials 0.4s ease-out 0.6s both;
    }

    .seat-now .seat-disc {
        animation: seat-now-disc 0.4s ease-out 1.6s both;
    }

    .seat-now .seat-initials {
        animation: seat-now-initials 0.4s ease-out 1.6s both;
    }

    @keyframes dial-hand {
        from { transform: rotate(-45deg); }
    }

    @keyframes dial-trail {
        from { stroke-dashoffset: 50; }
    }

    @keyframes seat-prev-disc {
        from { fill: var(--primary); }
    }

    @keyframes seat-prev-initials {
        from { fill: var(--on-primary); }
    }

    @keyframes seat-now-disc {
        from { fill: var(--tint); }
    }

    @keyframes seat-now-initials {
        from { fill: var(--link); }
    }
}
