/* (FR) Page publique « Fonctionnalités » : hero en dégradé avec captures du site, vitrines
   texte + capture en alternance, puis cartes. Les animations sont décoratives : sans elles
   (mouvement réduit, navigateur ancien), tout reste visible et lisible. */

.features-page {
    --f-ink: #24192a;
    --f-muted: #5f5868;
    --f-surface: #ffffff;
    --f-surface-2: #faf6fa;
    --f-border: rgba(36, 25, 42, 0.09);
    --f-accent: var(--gin-primary, #BC70A4);
    --f-accent-2: var(--gin-secondary, #BFD641);
    --f-shadow: 0 24px 60px -34px rgba(46, 18, 52, 0.45);
    max-width: 1120px;
    color: var(--f-ink);
}

[data-theme="dark"] .features-page {
    --f-ink: #f1edf6;
    --f-muted: #b3abc2;
    --f-surface: #1c1d29;
    --f-surface-2: #222433;
    --f-border: rgba(255, 255, 255, 0.1);
    --f-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}

/* ---------- Hero ---------- */

.features-hero {
    position: relative;
    display: grid;
    gap: 2rem;
    align-items: center;
    overflow: hidden;
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 24px;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(191, 214, 65, 0.28), transparent 60%),
        radial-gradient(70% 90% at 0% 100%, rgba(188, 112, 164, 0.55), transparent 65%),
        linear-gradient(135deg, #2b1631 0%, #4a2150 55%, #6b2f6a 100%);
    color: #fff;
    box-shadow: var(--f-shadow);
    isolation: isolate;
}

    /* Halo qui dérive lentement derrière le texte. */
    .features-hero::before {
        content: "";
        position: absolute;
        inset: -30%;
        z-index: -1;
        background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.08), transparent 30%);
        animation: features-spin 26s linear infinite;
    }

@media (min-width: 992px) {
    .features-hero {
        grid-template-columns: 1.05fr 1fr;
        padding: 2.25rem 2.5rem 2.5rem;
    }
}

.features-hero .breadcrumb {
    margin-bottom: 1.1rem;
    font-size: 0.85rem;
}

    .features-hero .breadcrumb a {
        color: rgba(255, 255, 255, 0.75);
        text-decoration: none;
    }

    .features-hero .breadcrumb-item.active,
    .features-hero .breadcrumb-item + .breadcrumb-item::before {
        color: rgba(255, 255, 255, 0.55);
    }

.features-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

    .features-kicker i {
        color: var(--f-accent-2);
    }

.features-hero h1 {
    margin-bottom: 0.9rem;
    font-size: clamp(1.75rem, 4.2vw, 2.7rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

.features-intro {
    max-width: 560px;
    margin-bottom: 1.4rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.6;
}

.features-hero-actions,
.features-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.features-btn-light,
.features-btn-ghost {
    padding: 0.6rem 1.15rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.features-btn-light {
    border: 0;
    background: #fff;
    color: #4a2150;
}

    .features-btn-light:hover,
    .features-btn-light:focus-visible {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.55);
        color: #4a2150;
    }

.features-btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    color: #fff;
}

    .features-btn-ghost:hover,
    .features-btn-ghost:focus-visible {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

.features-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    margin: 1.6rem 0 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    list-style: none;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

    .features-stats strong {
        display: block;
        color: #fff;
        font-size: 1.45rem;
        line-height: 1.15;
    }

/* Deux captures superposées : le catalogue derrière, le perfect serve devant. */
.features-hero-visual {
    position: relative;
    min-height: 300px;
}

@media (min-width: 992px) {
    .features-hero-visual {
        min-height: 400px;
    }
}

.features-frame {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--f-border);
    border-radius: 16px;
    background: var(--f-surface);
    box-shadow: var(--f-shadow);
}

    .features-frame img {
        display: block;
        width: 100%;
        height: auto;
    }

/* Barre de fenêtre façon navigateur, pour qu'on lise « c'est le site ». */
.features-frame-bar {
    display: flex;
    gap: 5px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--f-border);
    background: var(--f-surface-2);
}

    .features-frame-bar i {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #e3dce5;
    }

        .features-frame-bar i:nth-child(1) { background: #f28b82; }
        .features-frame-bar i:nth-child(2) { background: #fdd663; }
        .features-frame-bar i:nth-child(3) { background: #81c995; }

.features-hero .features-frame {
    position: absolute;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.7);
}

.features-frame--back {
    top: 0;
    left: 0;
    width: 82%;
    transform: rotate(-3deg);
    animation: features-float 9s ease-in-out infinite;
}

.features-frame--front {
    right: 2%;
    bottom: -6%;
    width: 34%;
    border-radius: 20px;
    transform: rotate(4deg);
    animation: features-float 7s ease-in-out -2s infinite reverse;
}

.features-bubble {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 7px 13px;
    border-radius: 999px;
    background: #fff;
    color: #3a1d40;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
    animation: features-bob 5s ease-in-out infinite;
}

    .features-bubble i {
        color: darkgoldenrod;
    }

.features-bubble--a {
    top: 58%;
    left: -2%;
}

.features-bubble--b {
    top: 6%;
    right: 4%;
    animation-delay: -2.5s;
}

    .features-bubble--b i {
        color: #e0457b;
    }

@media (max-width: 575.98px) {
    .features-hero {
        padding-bottom: 2.75rem;
    }

    .features-hero-visual {
        min-height: 250px;
    }

    .features-frame--back {
        width: 88%;
    }

    .features-frame--front {
        width: 38%;
        bottom: 0;
    }
}

/* ---------- Sommaire ---------- */

.features-nav {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: -1.4rem auto 2.5rem;
    padding: 6px;
    border: 1px solid var(--f-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--f-surface) 88%, transparent);
    box-shadow: 0 14px 34px -22px rgba(46, 18, 52, 0.5);
    backdrop-filter: blur(10px);
}

    .features-nav a {
        padding: 7px 16px;
        border-radius: 999px;
        color: var(--f-ink);
        font-size: 0.9rem;
        font-weight: 700;
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

        .features-nav a:hover,
        .features-nav a:focus-visible {
            background: var(--f-accent);
            color: #fff;
        }

/* ---------- Sections ---------- */

/* Fond plein : le décor animé du site ne doit pas passer sous le texte. */
.features-section {
    margin-bottom: 2rem;
    padding: 1.5rem 1.25rem 0.5rem;
    border: 1px solid var(--f-border);
    border-radius: 24px;
    background: var(--f-surface);
    box-shadow: 0 20px 52px -34px rgba(46, 18, 52, 0.4);
    scroll-margin-top: 80px;
}

@media (min-width: 768px) {
    .features-section {
        padding: 2.25rem 2.25rem 1rem;
    }
}

.features-section-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.features-section-num {
    flex: none;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--f-accent), var(--f-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.features-section h2 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
}

.features-section-intro {
    margin: 0;
    color: var(--f-muted);
}

.features-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 0.8rem;
    border-radius: 13px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--f-accent) 22%, transparent), color-mix(in srgb, var(--f-accent-2) 22%, transparent));
    color: var(--f-accent);
    font-size: 1.15rem;
}

/* Vitrine : texte d'un côté, capture de l'autre, en alternance. */
.features-spotlight {
    display: grid;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2.75rem;
    scroll-margin-top: 80px;
}

@media (min-width: 768px) {
    .features-spotlight {
        grid-template-columns: 1fr 1.15fr;
        gap: 3rem;
    }

    .features-spotlight--flip .features-spotlight-text {
        order: 2;
    }
}

.features-spotlight-text h3 {
    margin-bottom: 0.6rem;
    font-size: 1.45rem;
    font-weight: 800;
}

.features-spotlight-text p {
    color: var(--f-muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.features-spotlight-shot {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

    .features-spotlight-shot:hover {
        transform: translateY(-4px) rotate(-0.4deg);
        box-shadow: 0 34px 70px -34px rgba(46, 18, 52, 0.6);
    }

/* Capture en hauteur (perfect serve) : plus étroite, centrée. */
.features-frame--tall {
    justify-self: center;
    width: min(100%, 270px);
}

.features-spotlight:target .features-spotlight-text,
.features-card:target {
    outline: 3px solid color-mix(in srgb, var(--f-accent) 45%, transparent);
    outline-offset: 8px;
    border-radius: 14px;
}

.features-points {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.94rem;
    line-height: 1.5;
}

    .features-points li {
        display: flex;
        gap: 0.55rem;
        margin-bottom: 0.4rem;
    }

    .features-points i {
        flex: none;
        margin-top: 0.25em;
        color: var(--f-accent);
        font-size: 0.8rem;
    }

.features-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    color: var(--f-accent);
    font-weight: 700;
    text-decoration: none;
}

    .features-card-link i {
        transition: transform 0.2s ease;
    }

    .features-card-link:hover i,
    .features-card-link:focus-visible i {
        transform: translateX(4px);
    }

/* Cartes des fonctionnalités sans capture. */
.features-grid {
    display: grid;
    gap: 1rem;
}

/* Deux colonnes : quatre cartes par section, sans orpheline. */
@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.features-grid {
    margin-bottom: 1.5rem;
}

.features-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.35rem 1.2rem;
    border: 1px solid var(--f-border);
    border-radius: 18px;
    background: var(--f-surface-2);
    box-shadow: 0 14px 34px -30px rgba(46, 18, 52, 0.5);
    scroll-margin-top: 80px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

    .features-card:hover {
        transform: translateY(-4px);
        border-color: color-mix(in srgb, var(--f-accent) 40%, transparent);
        box-shadow: var(--f-shadow);
    }

    .features-card h3 {
        margin-bottom: 0.45rem;
        font-size: 1.08rem;
        font-weight: 800;
    }

    .features-card p {
        margin-bottom: 0.7rem;
        color: var(--f-muted);
        font-size: 0.95rem;
        line-height: 1.6;
    }

/* ---------- Appel final ---------- */

.features-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding: 1.75rem;
    border-radius: 24px;
    background:
        radial-gradient(80% 120% at 100% 100%, rgba(191, 214, 65, 0.3), transparent 60%),
        linear-gradient(120deg, #4a2150, #8a3d82);
    color: #fff;
    box-shadow: var(--f-shadow);
}

    .features-cta h2 {
        margin-bottom: 0.35rem;
        font-size: 1.5rem;
        font-weight: 800;
    }

    .features-cta p {
        max-width: 560px;
        margin: 0;
        color: rgba(255, 255, 255, 0.82);
    }

/* ---------- Animations ---------- */

@keyframes features-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

@keyframes features-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

@keyframes features-spin {
    to { transform: rotate(1turn); }
}

@keyframes features-rise {
    from {
        opacity: 0;
        translate: 0 28px;
    }
}

@keyframes features-in {
    from {
        opacity: 0;
        translate: 0 14px;
    }
}

/* Entrée du hero au chargement, puis apparition des blocs au défilement là où le navigateur
   sait lier une animation au défilement (sinon ils sont simplement là). */
@media (prefers-reduced-motion: no-preference) {
    .features-hero-text > * {
        animation: features-in 0.6s ease-out both;
    }

        .features-hero-text > :nth-child(2) { animation-delay: 0.05s; }
        .features-hero-text > :nth-child(3) { animation-delay: 0.1s; }
        .features-hero-text > :nth-child(4) { animation-delay: 0.15s; }
        .features-hero-text > :nth-child(5) { animation-delay: 0.2s; }
        .features-hero-text > :nth-child(6) { animation-delay: 0.25s; }

    @supports (animation-timeline: view()) {
        .features-spotlight,
        .features-card,
        .features-section-head,
        .features-cta {
            animation: features-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .features-hero::before,
    .features-frame--back,
    .features-frame--front,
    .features-bubble {
        animation: none;
    }

    .features-card,
    .features-spotlight-shot,
    .features-card-link i {
        transition: none;
    }
}
