/* SOGUADTECH — blocs propres à la page d'accueil.
   Couleurs, police, boutons (ui-btn), conteneur (ui-wrap) et bloc contact
   (pg-reach) sont définis dans css/styles.css, commun à tout le site.   */

.page-accueil {
    --section: clamp(4.5rem, 9vw, 7.5rem);
    --unit: #c6d0dc;
}

/* ── 1. Haut de page ── */

.home-hero {
    padding: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(3.5rem, 7vw, 6rem);
}

.home-hero__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: clamp(2rem, 4vw, 3.25rem);
    align-items: center;
}

.page-accueil main .home-hero__title {
    grid-column: 1 / -1;
    max-width: 21ch;
    font-size: clamp(2.375rem, 5.6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.032em;
}

.home-hero__copy {
    grid-column: 1 / span 5;
}

.home-hero__lead {
    max-width: 34ch;
    color: var(--slate);
    font-size: clamp(1.125rem, 1.5vw, 1.25rem);
    line-height: 1.55;
}

.home-hero__copy .ui-actions {
    margin-top: 2rem;
}

.home-hero__note {
    margin-top: 1.5rem;
    color: var(--slate);
    font-size: 0.9375rem;
}

.home-hero__media {
    grid-column: 6 / -1;
    position: relative;
    margin: 0;
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
    border-radius: 20px;
    background: var(--mist);
}

.home-hero__media img {
    display: block;
    width: 100%;
    height: auto;
}

.home-status {
    position: absolute;
    top: clamp(1rem, 2.5vw, 1.5rem);
    left: clamp(1rem, 2.5vw, 1.5rem);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.95rem 0.5rem 0.8rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 30, 61, 0.08), 0 8px 24px -12px rgba(15, 30, 61, 0.3);
    color: var(--slate);
    font-size: 0.875rem;
    line-height: 1.25;
}

.home-status strong {
    margin-right: 0.35rem;
    color: var(--ok);
    font-weight: 700;
}

.home-dot {
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(15, 122, 69, 0.16);
}

/* ── 2. Le problème : 100 défibrillateurs ── */

.home-fleet {
    padding: var(--section) 0;
    background: var(--mist);
}

.home-fleet__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(2.5rem, 5vw, 4rem) var(--col-gap);
    align-items: center;
}

.home-fleet__copy {
    grid-column: 1 / span 6;
}

.page-accueil main .home-fleet h2 {
    max-width: 20ch;
}

.home-fleet__text {
    max-width: 44ch;
    margin-top: 1.5rem;
    color: var(--slate);
    font-size: 1.125rem;
}

.home-fleet__source {
    margin-top: 2rem;
    color: var(--slate);
    font-size: 0.875rem;
}

.home-fleet__chart {
    grid-column: 8 / -1;
    justify-self: end;
    width: 100%;
    max-width: 440px;
}

.home-fleet__units {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: clamp(5px, 0.9vw, 9px);
}

/* Chaque carré reprend la silhouette du Clark One : un boîtier aux coins arrondis */
.home-fleet__unit {
    aspect-ratio: 1;
    border-radius: 26%;
    background: var(--unit);
}

.home-fleet__unit--off {
    background: var(--signal);
    transition: background-color 0.45s ease;
    transition-delay: calc(var(--d, 0) * 45ms);
}

/* État initial de l'animation (ajouté par js/home.js) : sans JS, les 32 restent rouges */
.home-fleet__units.is-armed:not(.is-revealed) .home-fleet__unit--off {
    background: var(--unit);
    transition: none;
}

.home-fleet__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1.25rem;
    color: var(--slate);
    font-size: 0.875rem;
    list-style: none;
}

.home-fleet__legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.home-fleet__legend li::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 26%;
    background: var(--unit);
}

.home-fleet__legend li.is-off::before {
    background: var(--signal);
}

/* ── 3. La solution en 3 temps ── */

.home-watch {
    padding: var(--section) 0;
}

.home-watch__head {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem var(--col-gap);
    align-items: end;
}

.page-accueil main .home-watch__head h2 {
    grid-column: 1 / span 6;
    max-width: 16ch;
}

.home-watch__head p {
    grid-column: 8 / -1;
    max-width: 42ch;
    color: var(--slate);
    font-size: 1.125rem;
}

/* Animation 3D (iframe animation-dae.html), posée sur le même fond que la photo du haut */
.home-anim {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    aspect-ratio: 2.1 / 1;
    border-radius: 20px;
    overflow: hidden;
    background: var(--mist);
}

.home-anim iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.home-watch__steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--col-gap);
    margin-top: clamp(3rem, 6vw, 4.5rem);
    list-style: none;
}

/* Ligne de vie qui relie les trois états */
.home-watch__steps::before {
    content: "";
    position: absolute;
    top: 0.4375rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--line);
}

.home-watch__step {
    position: relative;
    padding-top: 2.5rem;
}

.home-watch__step::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 6px var(--paper);
}

.home-watch__step--alert::before {
    background: var(--signal);
}

/* Étape en cours dans l'animation : le point s'entoure d'un halo */
.home-watch__step::before {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-watch__step.is-active::before {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px var(--paper), 0 0 0 11px rgba(15, 122, 69, 0.22);
}

.home-watch__step--alert.is-active::before {
    box-shadow: 0 0 0 6px var(--paper), 0 0 0 11px rgba(217, 45, 32, 0.22);
}

.home-watch__state {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--ok);
    font-size: 0.875rem;
    font-weight: 700;
}

.home-watch__step--alert .home-watch__state {
    color: var(--signal);
}

.home-watch__step p {
    max-width: 32ch;
    margin-top: 0.5rem;
    color: var(--slate);
}

/* ── 4. Preuves ── */

.home-proof {
    padding: 0 0 var(--section);
}

.home-proof__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.5rem var(--col-gap);
    padding-top: clamp(3.5rem, 7vw, 5.5rem);
    border-top: 1px solid var(--line);
}

.page-accueil main .home-proof h2 {
    grid-column: 1 / span 4;
    max-width: 13ch;
}

.home-proof__list {
    grid-column: 6 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem var(--col-gap);
}

.home-proof__list dt {
    margin-bottom: 0.4rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-proof__list dd {
    color: var(--slate);
}

/* ── Responsive ── */

@media (max-width: 960px) {
    .home-anim {
        aspect-ratio: 1.45 / 1;
    }

    .home-hero__copy,
    .home-hero__media,
    .home-fleet__copy,
    .home-fleet__chart,
    .page-accueil main .home-watch__head h2,
    .home-watch__head p,
    .page-accueil main .home-proof h2,
    .home-proof__list {
        grid-column: 1 / -1;
    }

    .home-fleet__chart {
        justify-self: start;
    }

    .page-accueil main .home-proof h2 {
        max-width: 20ch;
    }

    .home-watch__steps {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .home-watch__steps::before {
        top: 0.5rem;
        bottom: 0.5rem;
        left: 0.4375rem;
        right: auto;
        width: 2px;
        height: auto;
    }

    .home-watch__step {
        padding: 0 0 0 2.5rem;
    }

    .home-watch__step::before {
        top: 0.1rem;
    }
}

/* En dessous, l'animation passe en format portrait : indicateurs en haut, scène en dessous */
@media (max-width: 760px) {
    .home-anim {
        aspect-ratio: auto;
        height: 620px;
        border-radius: 16px;
    }
}

@media (max-width: 600px) {
    .home-hero__media {
        padding-top: 3.75rem;
        border-radius: 16px;
    }

    .home-status {
        font-size: 0.8125rem;
    }

    .home-proof__list {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-fleet__unit--off,
    .home-watch__step::before {
        transition: none;
    }
}
