/* ==========================================================================
   Refonte de l'accueil, 15/10/2026
   Accroche multi-projets, « Ce que je construis » par besoin, grille de
   réalisations équilibrée, bandeau spécialité froid. Chargé après
   sections.css, dont il reprend les cadres .fenetre et .telephone.
   Aussi chargé par coolcare.html pour .btn--clair et .specialite.
   ========================================================================== */

/* ============ BOUTON CLAIR, POUR LES FONDS ENCRE ============ */

.btn--clair {
    color: var(--text-white);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.45);
}

.btn--clair:hover {
    color: var(--encre);
    background: var(--text-white);
    border-color: var(--text-white);
    transform: translateY(-2px);
}

/* ============ ACCROCHE ============ */
/* Fond encre, quadrillage discret en dégradés CSS (aucune image à charger),
   et une lueur orange qui donne de l'énergie sans revenir au dégradé
   indigo vers rose. */

.home {
    padding-top: calc(var(--header-height) + var(--space-16));
    padding-bottom: var(--space-20);
    background:
        radial-gradient(ellipse 60% 55% at 85% 35%, rgba(255, 90, 31, 0.22), transparent 70%),
        radial-gradient(ellipse 45% 50% at 10% 90%, rgba(37, 99, 235, 0.25), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 40px 40px,
        var(--encre);
    color: var(--text-white);
}

.home__container {
    grid-template-columns: 1fr 1.05fr;
}

.home__surtitre {
    display: inline-block;
    margin-bottom: var(--space-5);
    padding: var(--space-1) var(--space-3);
    border: var(--border-width) solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
    color: rgba(255, 255, 255, 0.8);
}

.home__title {
    color: var(--text-white);
    letter-spacing: -0.035em;
    line-height: 1.05;
}

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

.home__description {
    color: rgba(255, 255, 255, 0.78);
    max-width: 34rem;
}

/* ---- Composition de plusieurs écrans ----
   Trois couches sur une même grille : la fenêtre de fond décalée en haut à
   gauche, la fenêtre principale, le téléphone au premier plan en bas à
   droite. Une grille plutôt que des positions absolues : la hauteur du bloc
   suit celle des images, rien ne déborde sur la section suivante. */

.ecrans {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto auto;
    position: relative;
}

.ecrans__arriere {
    grid-column: 1 / 9;
    grid-row: 1 / 3;
    transform: rotate(-4deg);
    opacity: 0.55;
}

.ecrans__principal {
    grid-column: 3 / 13;
    grid-row: 2 / 4;
    margin-top: -4rem;
    position: relative;
    z-index: 1;
    align-self: start;
}

.ecrans__mobile {
    grid-column: 9 / 13;
    grid-row: 3 / 4;
    align-self: end;
    max-width: 190px;
    justify-self: end;
    margin-right: -1rem;
    margin-bottom: -2.5rem;
    position: relative;
    z-index: 2;
    transform: rotate(5deg);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.ecrans .fenetre {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.ecrans .fenetre:hover {
    transform: none;
}

.ecrans__arriere.fenetre:hover {
    transform: rotate(-4deg);
}

.ecrans__legende {
    grid-column: 1 / 13;
    margin-top: var(--space-12);
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
    .ecrans__mobile {
        animation: flotte 6s ease-in-out 1.2s infinite alternate;
    }
}

@keyframes flotte {
    from { transform: rotate(5deg) translateY(0); }
    to { transform: rotate(5deg) translateY(-10px); }
}

@media screen and (max-width: 968px) {
    .home__container {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .ecrans__mobile {
        max-width: 140px;
        margin-right: 0;
    }
}

@media screen and (max-width: 768px) {
    .home__buttons {
        justify-content: flex-start;
    }
}

/* ============ CE QUE JE CONSTRUIS ============ */

.besoins {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.besoin {
    display: flex;
    flex-direction: column;
    padding: var(--space-8) var(--space-6);
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* Liseré orange qui se déploie au survol, en haut de la carte. */
.besoin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--bg-gradient);
    transition: width var(--transition-normal);
}

.besoin:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.besoin:hover::before {
    width: 100%;
}

.besoin__icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--encre);
    color: var(--accent-color);
    font-size: 1.6rem;
}

.besoin__titre {
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.besoin__texte {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-5);
}

.besoin__exemple {
    padding-top: var(--space-4);
    border-top: var(--border-width) dashed var(--border-color);
    font-size: var(--font-sm);
    color: var(--text-light);
}

.besoin__exemple a {
    color: var(--accent-texte);
    font-weight: var(--font-semibold);
}

/* ============ RÉALISATIONS : TUILES ============ */

.realisations {
    background: var(--bg-secondary);
}

.tuiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.tuile {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.tuile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.tuile--large {
    grid-column: span 2;
}

/* Même hauteur de visuel pour toutes les tuiles, quel que soit le format de
   la capture : c'est ce qui équilibre la grille. */
.tuile__visuel {
    height: 220px;
    overflow: hidden;
    background: var(--encre);
}

.tuile__visuel img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform var(--transition-slow);
}

.tuile:hover .tuile__visuel img {
    transform: scale(1.04);
}

/* Capture de téléphone : présentée en entier, centrée sur fond encre,
   plutôt que recadrée en paysage où elle ne montrerait qu'une bande. */
.tuile__visuel--mobile {
    display: flex;
    justify-content: center;
    padding-top: var(--space-4);
    background:
        radial-gradient(ellipse 70% 80% at 50% 100%, rgba(37, 99, 235, 0.45), transparent 70%),
        var(--encre);
}

.tuile__visuel--mobile img {
    width: auto;
    height: 115%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    object-fit: contain;
}

.tuile__corps {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-6);
}

.tuile__famille {
    align-self: flex-start;
    margin-bottom: var(--space-3);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.1);
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1d4ed8;
}

.tuile__famille--client {
    background: rgba(255, 90, 31, 0.12);
    color: var(--accent-texte);
}

.tuile__famille--perso {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.tuile__titre {
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tuile__texte {
    flex: 1;
    font-size: var(--font-sm);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.tuile__lien {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    text-decoration: none;
}

/* Lien étiré : toute la tuile est cliquable, sans dupliquer le lien sur
   l'image, ce qui ferait annoncer deux fois la même destination. */
.tuile__lien::after {
    content: '';
    position: absolute;
    inset: 0;
}

.tuile__lien:hover {
    color: var(--accent-texte);
}

.tuile__lien--muet {
    font-weight: var(--font-normal);
    font-style: italic;
    color: var(--text-light);
}

.tuile__lien--muet::after {
    content: none;
}

/* ============ SPÉCIALITÉ MÉTIERS TECHNIQUES ET FROID ============ */

.specialite,
.section.specialite:nth-child(even) {
    background:
        radial-gradient(ellipse 50% 70% at 80% 50%, rgba(125, 211, 252, 0.16), transparent 70%),
        var(--encre);
    color: var(--text-white);
}

.specialite__container {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: var(--space-16);
    align-items: center;
}

.specialite__surtitre {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--glacier);
}

.specialite__titre {
    font-size: var(--font-4xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: var(--space-5);
}

.specialite__texte {
    font-size: var(--font-lg);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: var(--space-6);
}

.specialite__liste {
    list-style: none;
    margin: 0 0 var(--space-8);
    padding: 0;
    display: grid;
    gap: var(--space-3);
}

.specialite__liste li {
    position: relative;
    padding-left: var(--space-8);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.specialite__liste li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--glacier);
}

.specialite__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.specialite__visuel {
    margin: 0;
}

.specialite__visuel .telephone {
    max-width: 260px;
    background: #0b1220;
    border: 2px solid rgba(125, 211, 252, 0.25);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 60px rgba(125, 211, 252, 0.15);
}

.specialite__legende {
    margin-top: var(--space-4);
    text-align: center;
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.6);
}

/* ============ BANDEAU DE PREUVE ============ */

.preuve__item {
    border-left-color: var(--accent-color);
}

.preuve__chiffre {
    letter-spacing: -0.03em;
}

/* ============ PETITS ÉCRANS ============ */

@media screen and (max-width: 968px) {
    .besoins,
    .tuiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .specialite__container {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .specialite__titre {
        font-size: var(--font-3xl);
    }
}

@media screen and (max-width: 640px) {
    .besoins,
    .tuiles {
        grid-template-columns: 1fr;
    }

    .tuile--large {
        grid-column: auto;
    }

    .home {
        padding-top: calc(var(--header-height) + var(--space-8));
    }
}

/* ============ MÉTHODE ============ */
/* Sur fond blanc : elle suit désormais les réalisations, sur fond papier. */

.methode {
    background: var(--bg-primary);
}

.methode__icon {
    background: var(--encre);
    color: var(--accent-color);
}

/* ============ PAGE COOLCARE ============ */

.cas__surtitre {
    margin-bottom: var(--space-3);
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-texte);
}

.galerie__section {
    padding-top: 0;
}

/* Première rangée : le téléphone et le planning, côte à côte et
   resserrés. Deuxième rangée : les deux vues de bureau, plus larges. */
.galerie {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10) var(--space-8);
    align-items: end;
}

.galerie__item figure {
    margin: 0;
}

.galerie__item--mobile .telephone {
    max-width: 280px;
}

.galerie__item:not(.galerie__item--mobile):not(.galerie__item--large) .fenetre {
    max-width: 420px;
    margin-inline: auto;
}

.galerie figcaption {
    margin-top: var(--space-4);
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.galerie figcaption strong {
    color: var(--text-primary);
}

.galerie__note {
    margin-top: var(--space-10);
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-light);
}

.cas__chute {
    background: rgba(255, 90, 31, 0.07);
    border-left-color: var(--accent-color);
}

.cas__bloc-titre {
    color: var(--accent-texte);
}

.cas__liste li::before {
    color: var(--accent-texte);
}

@media screen and (max-width: 768px) {
    .galerie {
        grid-template-columns: 1fr;
    }
}

/* ============ ANCRES ============ */
/* Le portrait est dans un <picture> rétréci à son contenu par la grille
   (justify-items: start) : tant que l'image n'était pas chargée, il mesurait
   0 px de haut, puis la section À propos gagnait 150 px pendant le
   défilement. Le clic sur « Parler de mon projet » s'arrêtait donc trop haut,
   la cible ayant glissé entre-temps. Le cadre est désormais réservé d'emblée. */
.about--court .about__image picture {
    display: block;
    width: 100%;
}

/* Arrivée depuis une autre page (coolcare.html vers /#contact, par exemple) :
   c'est le navigateur qui saute à l'ancre, sans le calcul de navigation.js,
   et l'en-tête fixe recouvrait le haut de la section. */
section[id],
.besoin[id] {
    scroll-margin-top: var(--header-height);
}

/* Les cartes « Ce que je construis » sont des cibles d'ancre (pied de page).
   Le glissement d'apparition les décalait de 22 px au moment du saut, et
   l'arrivée se faisait sous l'en-tête. Elles gardent le fondu, sans glisser. */
.js-reveal .besoin.reveal {
    transform: none;
}
