/* ============================================
   Fast2 — Homepage : editorial storytelling
   Typographie, rythme, espace.
   ============================================ */

/* ── Hero ── */
.home-hero {
    position: relative;
    padding: calc(var(--header-height) + var(--sp-4xl)) 0 var(--sp-2xl);
    background: var(--c-dark);
    color: var(--c-white);
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Fond anime — orbes de lumiere diffuse */
.home-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.home-hero__bg::before,
.home-hero__bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    will-change: transform;
}
/* Orbe rose — large, traverse la scene */
.home-hero__bg::before {
    width: 70%;
    height: 70%;
    bottom: -20%;
    right: -10%;
    background: radial-gradient(circle, rgba(233, 30, 99, 0.22) 0%, rgba(233, 30, 99, 0.06) 50%, transparent 70%);
    animation: orb-drift-1 18s ease-in-out infinite alternate;
}
/* Orbe bleu — traverse en sens inverse */
.home-hero__bg::after {
    width: 60%;
    height: 65%;
    top: -15%;
    left: -10%;
    background: radial-gradient(circle, rgba(27, 58, 158, 0.18) 0%, rgba(27, 58, 158, 0.05) 50%, transparent 70%);
    animation: orb-drift-2 22s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.7; }
    33%  { transform: translate(-30%, -35%) scale(1.15); opacity: 1; }
    66%  { transform: translate(-10%, -50%) scale(0.9); opacity: 0.8; }
    100% { transform: translate(-45%, -20%) scale(1.05); opacity: 0.9; }
}
@keyframes orb-drift-2 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
    33%  { transform: translate(35%, 30%) scale(1.2); opacity: 1; }
    66%  { transform: translate(15%, 50%) scale(0.85); opacity: 0.75; }
    100% { transform: translate(40%, 15%) scale(1.1); opacity: 0.9; }
}

/* ── Golf green — illustration narrative ── */
.home-hero__golf {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.golf-ball {
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Balle 1 — raté : parabole lisse, atterrit, roule et sort du cadre */
.golf-ball--miss {
    animation: golf-miss 5s linear 0.5s forwards;
}

/* Balle 2 — réussi : parabole, atterrit, roule au fond du trou */
.golf-ball--hit {
    animation: golf-hit 4s linear 9s forwards;
}

/* Trajectoire parabolique lisse — balle ratée
   Arc continu sans changement de direction en l'air,
   puis roulement au sol et sortie de cadre */
@keyframes golf-miss {
    0%   { transform: translate(0px, 555px); opacity: 0; }
    2%   { transform: translate(25px, 540px); opacity: 0.7; }
    4%   { transform: translate(55px, 510px); opacity: 0.8; }
    7%   { transform: translate(100px, 460px); opacity: 0.8; }
    10%  { transform: translate(150px, 400px); opacity: 0.8; }
    13%  { transform: translate(205px, 340px); opacity: 0.8; }
    16%  { transform: translate(260px, 280px); opacity: 0.8; }
    19%  { transform: translate(315px, 228px); opacity: 0.8; }
    22%  { transform: translate(370px, 185px); opacity: 0.8; }
    25%  { transform: translate(420px, 155px); opacity: 0.8; }
    28%  { transform: translate(465px, 140px); opacity: 0.8; }       /* sommet */
    31%  { transform: translate(510px, 142px); opacity: 0.8; }
    34%  { transform: translate(558px, 160px); opacity: 0.8; }
    37%  { transform: translate(608px, 195px); opacity: 0.8; }
    40%  { transform: translate(658px, 245px); opacity: 0.8; }
    43%  { transform: translate(710px, 308px); opacity: 0.8; }
    46%  { transform: translate(762px, 375px); opacity: 0.8; }
    49%  { transform: translate(810px, 430px); opacity: 0.8; }
    52%  { transform: translate(845px, 458px); opacity: 0.8; }       /* atterrit */
    54%  { transform: translate(855px, 453px); opacity: 0.8; }       /* micro-rebond */
    56%  { transform: translate(868px, 460px); opacity: 0.8; }       /* se pose */
    62%  { transform: translate(940px, 472px); opacity: 0.8; }       /* roule */
    70%  { transform: translate(1020px, 480px); opacity: 0.75; }     /* passe le trou */
    78%  { transform: translate(1090px, 486px); opacity: 0.5; }      /* sort du green */
    88%  { transform: translate(1160px, 490px); opacity: 0.25; }
    100% { transform: translate(1220px, 494px); opacity: 0; }        /* hors cadre */
}

/* Trajectoire parabolique lisse — balle réussie
   Arc continu, atterrit plus près du trou, roule et tombe dedans */
@keyframes golf-hit {
    0%   { transform: translate(0px, 545px) scale(1); opacity: 0; }
    2%   { transform: translate(25px, 528px) scale(1); opacity: 0.7; }
    4%   { transform: translate(55px, 498px) scale(1); opacity: 0.85; }
    7%   { transform: translate(100px, 448px) scale(1); opacity: 0.85; }
    10%  { transform: translate(148px, 390px) scale(1); opacity: 0.85; }
    13%  { transform: translate(200px, 332px) scale(1); opacity: 0.85; }
    16%  { transform: translate(255px, 278px) scale(1); opacity: 0.85; }
    19%  { transform: translate(310px, 230px) scale(1); opacity: 0.85; }
    22%  { transform: translate(362px, 190px) scale(1); opacity: 0.85; }
    25%  { transform: translate(410px, 160px) scale(1); opacity: 0.85; }
    28%  { transform: translate(452px, 145px) scale(1); opacity: 0.85; }  /* sommet */
    31%  { transform: translate(498px, 148px) scale(1); opacity: 0.85; }
    34%  { transform: translate(545px, 168px) scale(1); opacity: 0.85; }
    37%  { transform: translate(595px, 205px) scale(1); opacity: 0.85; }
    40%  { transform: translate(645px, 258px) scale(1); opacity: 0.85; }
    43%  { transform: translate(695px, 318px) scale(1); opacity: 0.85; }
    46%  { transform: translate(742px, 372px) scale(1); opacity: 0.85; }
    49%  { transform: translate(785px, 412px) scale(1); opacity: 0.85; }
    52%  { transform: translate(818px, 436px) scale(1); opacity: 0.85; }  /* atterrit */
    54%  { transform: translate(828px, 432px) scale(1); opacity: 0.85; }  /* micro-rebond */
    56%  { transform: translate(838px, 438px) scale(1); opacity: 0.85; }  /* se pose */
    62%  { transform: translate(862px, 434px) scale(1); opacity: 0.9; }   /* roule */
    68%  { transform: translate(888px, 432px) scale(1); opacity: 0.95; }
    74%  { transform: translate(906px, 430px) scale(1); opacity: 1; }     /* approche */
    80%  { transform: translate(912px, 430px) scale(0.85); opacity: 1; }  /* bord du trou */
    86%  { transform: translate(916px, 430px) scale(0.5); opacity: 0.9; } /* tombe */
    93%  { transform: translate(916px, 430px) scale(0.12); opacity: 0.6; }
    100% { transform: translate(916px, 430px) scale(0); opacity: 0; }     /* au fond ! */
}

/* Glow from hole — ball-as-lightbulb illuminates upward */
.golf-glow {
    opacity: 0;
    transform-origin: 916px 430px;
    animation: golf-glow-in 2s ease-out 12.5s forwards,
               golf-glow-pulse 4s ease-in-out 14.5s infinite;
}

@keyframes golf-glow-in {
    0%   { opacity: 0; transform: scale(0.2); }
    25%  { opacity: 0.6; transform: scale(0.85); }
    50%  { opacity: 1; transform: scale(1.1); }
    75%  { opacity: 0.9; transform: scale(1.05); }
    100% { opacity: 0.8; transform: scale(1); }
}

@keyframes golf-glow-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 0.9; transform: scale(1.08); }
}

/* Ray shimmer — each ray flickers at a different rhythm */
.golf-glow__ray--1 { animation: ray-shimmer 1.8s ease-in-out 14.5s infinite; }
.golf-glow__ray--2 { animation: ray-shimmer 2.2s ease-in-out 14.8s infinite; }
.golf-glow__ray--3 { animation: ray-shimmer 2.0s ease-in-out 15.0s infinite; }
.golf-glow__ray--4 { animation: ray-shimmer 2.5s ease-in-out 14.6s infinite; }
.golf-glow__ray--5 { animation: ray-shimmer 2.3s ease-in-out 15.2s infinite; }

@keyframes ray-shimmer {
    0%, 100% { opacity: 1; }
    40%      { opacity: 0.3; }
    70%      { opacity: 0.8; }
}

.home-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

/* Staged entrance — all hero elements start invisible */
.home-hero__staged {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.home-hero__stat {
    font-family: var(--ff-display);
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: var(--fw-bold);
    line-height: 0.85;
    color: var(--c-white);
    letter-spacing: -0.04em;
    margin-bottom: var(--sp-md);
    user-select: none;
    position: absolute;
    top: -0.15em;
    right: -5%;
    pointer-events: none;
    animation-name: hero-stat-in;
    animation-duration: 1.2s;
    animation-delay: 0.2s;
}
/* "0%" golden glow — lights up when ball enters the hole, then shimmers */
.home-hero__stat-zero,
.home-hero__stat-pct {
    display: inline-block;
    animation: stat-zero-glow 2.5s ease-out 12.5s forwards,
               stat-zero-shimmer 2.2s ease-in-out 15s infinite;
}

@keyframes stat-zero-glow {
    0%   { color: inherit; text-shadow: none; }
    30%  { color: rgba(245, 190, 60, 1); text-shadow: 0 0 50px rgba(245, 190, 60, 0.7), 0 0 100px rgba(245, 190, 60, 0.35), 0 0 150px rgba(245, 190, 60, 0.15); }
    100% { color: rgba(245, 190, 60, 0.9); text-shadow: 0 0 40px rgba(245, 190, 60, 0.55), 0 0 80px rgba(245, 190, 60, 0.25), 0 0 120px rgba(245, 190, 60, 0.1); }
}

/* Shimmer — mirrors the ray flicker rhythm */
@keyframes stat-zero-shimmer {
    0%   { color: rgba(245, 190, 60, 0.9);  text-shadow: 0 0 40px rgba(245, 190, 60, 0.55), 0 0 80px rgba(245, 190, 60, 0.25), 0 0 120px rgba(245, 190, 60, 0.1); }
    15%  { color: rgba(245, 190, 60, 0.65); text-shadow: 0 0 28px rgba(245, 190, 60, 0.35), 0 0 55px rgba(245, 190, 60, 0.12); }
    30%  { color: rgba(245, 190, 60, 1);    text-shadow: 0 0 55px rgba(245, 190, 60, 0.75), 0 0 100px rgba(245, 190, 60, 0.35), 0 0 140px rgba(245, 190, 60, 0.15); }
    50%  { color: rgba(245, 190, 60, 0.75); text-shadow: 0 0 35px rgba(245, 190, 60, 0.45), 0 0 65px rgba(245, 190, 60, 0.15); }
    65%  { color: rgba(245, 190, 60, 1);    text-shadow: 0 0 60px rgba(245, 190, 60, 0.8),  0 0 110px rgba(245, 190, 60, 0.4),  0 0 160px rgba(245, 190, 60, 0.18); }
    80%  { color: rgba(245, 190, 60, 0.7);  text-shadow: 0 0 30px rgba(245, 190, 60, 0.4),  0 0 60px rgba(245, 190, 60, 0.15); }
    100% { color: rgba(245, 190, 60, 0.9);  text-shadow: 0 0 40px rgba(245, 190, 60, 0.55), 0 0 80px rgba(245, 190, 60, 0.25), 0 0 120px rgba(245, 190, 60, 0.1); }
}

.home-hero__stat-pct {
    font-size: 0.5em;
    vertical-align: super;
}

.home-hero__title {
    font-family: var(--ff-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--c-white);
    margin-bottom: var(--sp-md);
    max-width: 600px;
}

/* Lines stack vertically inside h1 */
.home-hero__line {
    display: block;
}
.home-hero__line--1 {
    margin-bottom: 0.3em;
    animation-name: hero-rise;
    animation-duration: 0.9s;
    animation-delay: 0.5s;
}
.home-hero__line--2 {
    margin-bottom: 0.15em;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75em;
    font-weight: var(--fw-semibold);
    animation-name: hero-slide;
    animation-duration: 0.8s;
    animation-delay: 2.2s;
}
.home-hero__line--3 {
    color: var(--c-primary);
    font-size: 0.75em;
    font-weight: var(--fw-bold);
    animation-name: hero-accent;
    animation-duration: 1s;
    animation-delay: 3.8s;
}

.home-hero__source {
    font-family: var(--ff-mono);
    font-size: var(--fs-2xs, 0.7rem);
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--sp-xl);
}

/* Bottom container — sits below inner on desktop, reordered on mobile */
.home-hero__bottom {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.home-hero__sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.55);
    line-height: var(--lh-relaxed);
    max-width: 540px;
}

.home-hero__staged--late {
    animation-name: hero-fade;
    animation-duration: 0.8s;
    animation-delay: 5.2s;
}

.home-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
    opacity: 0.2;
}

/* ── Hero keyframes ── */
@keyframes hero-stat-in {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 0.12; transform: scale(1); }
}

@keyframes hero-rise {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-slide {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes hero-accent {
    0%   { opacity: 0; transform: translateY(20px) scale(0.95); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hero-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ── Sections alternees ── */
.home-section {
    padding: var(--sp-4xl) 0;
}

.home-section--light {
    background: var(--c-light);
}

.home-section--white {
    background: var(--c-white);
}

.home-section--dark {
    background: var(--c-dark);
    color: var(--c-white);
    position: relative;
    overflow: hidden;
}

.home-section__col {
    max-width: 640px;
    margin-inline: auto;
}

.home-section__heading {
    font-family: var(--ff-display);
    font-size: clamp(1.25rem, 2.5vw, 1.625rem);
    font-weight: var(--fw-bold);
    color: var(--c-dark);
    line-height: var(--lh-tight);
    margin-bottom: var(--sp-lg);
}

.home-section__text {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.85;
    color: var(--c-text);
    margin-bottom: var(--sp-lg);
}

.home-section__text:last-child {
    margin-bottom: 0;
}

/* ── Fuse — Mission Impossible burning fuse (sparkler style) ── */
.fuse {
    position: relative;
    width: 100%;
    height: 40px;
    margin: var(--sp-lg) 0 0;
    overflow: visible;
}

/* The cord — textured rope */
.fuse__cord {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background:
        repeating-linear-gradient(115deg,
            rgba(140, 90, 45, 0.45) 0px,
            rgba(100, 65, 35, 0.2) 2px,
            rgba(130, 85, 42, 0.4) 4px,
            rgba(90, 58, 30, 0.18) 6px,
            rgba(140, 90, 45, 0.45) 8px
        );
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow:
        0 -0.5px 0 rgba(180, 130, 70, 0.1),
        0 0.5px 1px rgba(60, 35, 15, 0.12);
    /* clip from left as it burns — controlled by JS via --burn-pct */
    clip-path: inset(0 0 0 var(--burn-pct, 0%));
    transition: clip-path 0.1s linear;
}

/* Ash residue behind the burn — very faint */
.fuse__ash {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(100, 80, 60, 0.08);
    transform: translateY(-50%);
    clip-path: inset(0 var(--ash-right, 100%) 0 0);
    transition: clip-path 0.1s linear;
}

/* The hot point — vivid bright core, visible on light bg */
.fuse__ember {
    position: absolute;
    top: 50%;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #FF6B00 0%, #E04000 50%, #B22800 80%, transparent 100%);
    box-shadow:
        0 0 4px 2px rgba(255, 80, 0, 0.9),
        0 0 10px 4px rgba(230, 60, 0, 0.6),
        0 0 20px 8px rgba(200, 40, 0, 0.3);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

/* Individual spark particle — vivid streaks visible on light background */
.fuse__spark {
    position: absolute;
    width: 1.5px;
    height: 6px;
    background: linear-gradient(to top, rgba(200, 60, 0, 0.95), rgba(255, 120, 0, 0.9));
    border-radius: 1px;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}


/* Pivot — phrase isolee, mise en valeur */
.home-section__pivot {
    font-family: var(--ff-display);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: var(--fw-semibold);
    color: var(--c-primary);
    line-height: var(--lh-tight);
    padding-left: var(--sp-lg);
    border-left: 3px solid var(--c-primary);
    margin: 0;
}


/* ── F.A.S.T. — Grille 4 dimensions (dark) ── */
.home-fast {
    position: relative;
    overflow: hidden;
}

.home-fast::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 30% 70%, rgba(233, 30, 99, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(27, 58, 158, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.home-fast__quote {
    max-width: 640px;
    margin: 0 auto var(--sp-3xl);
    padding: 0;
    border: none;
    position: relative;
    text-align: center;
}

.home-fast__quote p {
    font-family: var(--ff-display);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: var(--fw-medium);
    color: rgba(255, 255, 255, 0.85);
    line-height: var(--lh-relaxed);
    margin: 0;
}

.home-fast__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-lg);
    max-width: 900px;
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

.home-fast__card {
    padding: var(--sp-xl);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}
.home-fast__card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(233, 30, 99, 0.2);
    transform: translateY(-2px);
}

.home-fast__letter {
    display: block;
    font-family: var(--ff-display);
    font-size: 2.5rem;
    font-weight: var(--fw-bold);
    color: var(--c-primary);
    line-height: 1;
    margin-bottom: var(--sp-sm);
}
.home-fast__letter--blue  { color: var(--c-secondary-light); }
.home-fast__letter--amber { color: var(--c-tertiary); }
.home-fast__letter--green { color: var(--c-success); }

.home-fast__title {
    font-family: var(--ff-display);
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    color: var(--c-white);
    margin-bottom: var(--sp-xs);
}

.home-fast__desc {
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.6);
    line-height: var(--lh-relaxed);
}


/* ── CTA ── */
.home-cta {
    padding: var(--sp-4xl) 0;
    background: var(--c-surface);
}

.home-cta__inner {
    max-width: 640px;
    margin-inline: auto;
    text-align: center;
}

.home-cta__text {
    font-family: var(--ff-display);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: var(--fw-semibold);
    color: var(--c-dark);
    line-height: var(--lh-tight);
    margin-bottom: var(--sp-xl);
}

.home-cta .btn {
    min-width: 280px;
}


/* ── Responsive ── */
@media (max-width: 767px) {
    .home-hero {
        padding: calc(var(--header-height) + var(--sp-xl)) 0 0;
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    /* Text block first — above the golf */
    .home-hero__inner {
        order: 1;
        max-width: 100%;
        padding-bottom: 0;
        position: relative;
        z-index: 2;
    }

    /* Golf green — zoom into the green area (centered x=912, y=440 in viewBox) */
    .home-hero__golf {
        order: 2;
        position: relative;
        inset: auto;
        width: 100%;
        height: 240px;
        opacity: 0.85;
        margin-top: -20px;
        margin-bottom: -20px;
        z-index: 0;
        transform: scale(2.5);
        transform-origin: 83% 73%;
    }

    /* "Vos équipes font de leur mieux…" below golf — above the drawing */
    .home-hero__bottom {
        order: 3;
        padding-bottom: var(--sp-xl);
        position: relative;
        z-index: 2;
    }

    /* Reduce source bottom margin — golf handles spacing */
    .home-hero__source {
        margin-bottom: 0;
    }

    /* Reinforce "70% des projets" — bigger, bolder */
    .home-hero__line--1 {
        font-size: 1.15em;
        font-weight: var(--fw-bold);
        letter-spacing: -0.01em;
    }

    .home-hero__title {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
    }

    .home-hero__sub {
        font-size: 0.95rem;
    }

    /* 70% watermark — keep as reinforcing background, bigger */
    .home-hero__stat {
        font-size: 6rem;
        right: -2%;
        top: -0.12em;
    }

    .home-section {
        padding: var(--sp-2xl) 0;
    }

    .home-section__pivot {
        padding-left: var(--sp-md);
    }

    .home-fast__grid {
        grid-template-columns: 1fr;
    }

    .home-fast__quote {
        margin-bottom: var(--sp-2xl);
    }

    .home-cta .btn {
        width: 100%;
        max-width: 320px;
    }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
    .home-hero__staged {
        opacity: 1;
        animation: none;
    }
    .home-hero__stat {
        opacity: 0.12;
    }
    .home-hero__bg::before,
    .home-hero__bg::after {
        animation: none;
    }
    .golf-ball,
    .golf-glow {
        display: none;
    }
    .fuse__ember {
        display: none;
    }
}
