/* Landing page publique — hero plein écran + animations au scroll */

/* Navbar masquée tant qu'on est tout en haut, apparaît au scroll */
.body-landing .navbar.sticky-top {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.body-landing.is-scrolled .navbar.sticky-top {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

/* Scroll wrapper — donne la hauteur supplémentaire pour l'effet zoom-out */
/* height = plage du zoom-out (80vh) + viewport (100vh) + hold final (100px) */
.hero-scroll-wrapper {
    --scroll-progress: 0;
    --hero-hold: 1000px;
    position: relative;
    height: calc(180vh + var(--hero-hold));
    margin-top: -56px;
}

/* Sticky container — reste collé en haut, ses paddings augmentent avec le scroll */
.hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-block: calc(var(--scroll-progress) * 12vh);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: padding-block 0.08s linear;
}

/* Largeur cible à la fin du scroll — suit les breakpoints du .container Tabler */
.hero-sticky {
    --hero-target-width: calc(100vw - 2rem);
}
@media (min-width: 576px)  { .hero-sticky { --hero-target-width: 540px; } }
@media (min-width: 768px)  { .hero-sticky { --hero-target-width: 720px; } }
@media (min-width: 992px)  { .hero-sticky { --hero-target-width: 960px; } }
@media (min-width: 1200px) { .hero-sticky { --hero-target-width: 1140px; } }
@media (min-width: 1400px) { .hero-sticky { --hero-target-width: 1320px; } }

.hero-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #e8e8ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    opacity: clamp(0, calc((var(--scroll-progress) - 0.65) * 10), 1);
    transition: opacity 0.15s linear;
    pointer-events: none;
}

.hero-status-bar-dots {
    display: flex;
    gap: 8px;
}

.hero-status-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.hero-status-dot-red    { background: #ff5f56; }
.hero-status-dot-yellow { background: #ffbd2e; }
.hero-status-dot-green  { background: #27c93f; }

.hero-status-bar-datetime {
    font-size: 0.75rem;
    font-weight: 500;
    color: #3a3a3c;
    font-variant-numeric: tabular-nums;
}

/* Liste de boutons "Connecter X" — révèle synchronisé avec la status bar */
.hero-connect-list {
    opacity: clamp(0, calc((var(--scroll-progress) - 0.65) * 10), 1);
    transform: translateY(calc((1 - clamp(0, (var(--scroll-progress) - 0.65) * 10, 1)) * 32px));
    transition: opacity 0.15s linear, transform 0.15s linear;
}

.hero-fullscreen {
    width: calc(100vw - var(--scroll-progress) * (100vw - var(--hero-target-width)));
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--scroll-progress) * 1.75rem);
    box-shadow:
        0 calc(var(--scroll-progress) * 40px)
        calc(var(--scroll-progress) * 80px)
        rgba(0, 0, 0, calc(var(--scroll-progress) * 0.45));
    transition: border-radius 0.08s linear, box-shadow 0.08s linear, width 0.08s linear;
}

/* Gradient "lever de soleil" — lueur chaude qui monte depuis le bas sur fond nuit */
.hero-sunrise {
    background:
        radial-gradient(ellipse 95% 60% at 50% 105%,
            rgba(255, 204, 128, 0.85) 0%,
            rgba(255, 130, 92, 0.7) 22%,
            rgba(214, 69, 125, 0.5) 42%,
            rgba(90, 45, 130, 0.3) 62%,
            transparent 80%),
        linear-gradient(180deg,
            #0a0e24 0%,
            #141935 35%,
            #2a1f4a 65%,
            #4a2455 100%);
    color: #f8fafc;
}

.hero-sunrise .hero-lead {
    color: rgba(248, 250, 252, 0.82);
}

.hero-sunrise .hero-eyebrow {
    color: #ffd89b;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.text-gradient-sunrise {
    background: linear-gradient(90deg, #ffd89b 0%, #ff9a56 35%, #ff5e8a 70%, #c56ef0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.btn-ghost-light {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}
.btn-ghost-light:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-display {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.hero-lead {
    font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    color: var(--tblr-secondary);
    max-width: 44rem;
    margin: 0 auto;
    line-height: 1.55;
}

/* Sortie synchronisée au scroll : au-delà de 5% de --scroll-progress, */
/* le h1, le lead et les cta s'effacent avec un léger zoom-in + slide vers le haut. */
/* Spécificité (0,3,0) pour écraser [data-reveal].is-visible (0,2,0). */
.hero-fullscreen .hero-display.is-visible,
.hero-fullscreen .hero-lead.is-visible,
.hero-fullscreen .hero-cta.is-visible {
    opacity: calc(1 - clamp(0, var(--scroll-progress) * 1.75, 1));
    transform:
        translate3d(0, calc(clamp(0, var(--scroll-progress) * 1.75, 1) * -32px), 0)
        scale(calc(1 + clamp(0, var(--scroll-progress) * 1.75, 1) * 0.08));
    transition: opacity 0.12s linear, transform 0.12s linear;
}

/* Le container hero s'étire en hauteur entre --scroll-progress 5% et 50%. */
/* min-height passe de 0 (hauteur naturelle ~contenu) à 100% (full hero). */
/* Comme .hero-fullscreen centre verticalement ses enfants et que le container */
/* est en flex-column / flex-start, l'eyebrow remonte vers la status bar. */
/* padding-top 30px réserve la place de la status bar. */
/* Facteur 2.222 = 1 / (0.50 - 0.05). */
.hero-fullscreen > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(clamp(0, (var(--scroll-progress) - 0.05) * 2.222, 1) * 100%);
    padding-top: 30px;
    transition: min-height 0.15s linear;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tblr-primary);
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 999px;
    margin-bottom: 2rem;
    background: var(--tblr-bg-surface);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(248, 250, 252, 0.7);
    opacity: calc(1 - var(--scroll-progress) * 2);
    animation: hero-bounce 2.4s ease-in-out infinite;
    transition: opacity 0.2s linear;
}

/* Card flottante déclenchée par clic sur .hero-connect-list — arc depuis le bas
   jusqu'à 75% de hauteur, puis sortie en courbe vers le haut-droite avec rotation */
.hero-floating-card {
    --fly-dir: 1;
    --stack-x: 0px;
    --stack-y: 0px;
    --stack-rot: 0deg;
    position: absolute;
    top: 0;
    left: 50%;
    width: min(360px, calc(100vw - 2rem));
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 115vh) rotate(0deg);
    z-index: 3;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hero-floating-card--left {
    --fly-dir: -1;
}

/* Décalages pendant la pause — simule une pile de cartes */
.hero-floating-card--1 { --stack-x: 6px;   --stack-y: -4px;  --stack-rot: 3deg; }
.hero-floating-card--2 { --stack-x: -14px; --stack-y: 8px;   --stack-rot: -4deg; }
.hero-floating-card--3 { --stack-x: 12px;  --stack-y: -10px; --stack-rot: -2deg; }
.hero-floating-card--4 { --stack-x: -8px;  --stack-y: 14px;  --stack-rot: 5deg; }

.hero-floating-card.is-flying {
    animation: hero-card-arc 5.5s cubic-bezier(0.33, 0, 0.4, 1) forwards;
}

@keyframes hero-card-arc {
    0% {
        transform: translate(-50%, 115vh) rotate(0deg);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    45% {
        transform: translate(calc(-50% + var(--stack-x)), calc(55vh - 50% + var(--stack-y))) rotate(var(--stack-rot));
        opacity: 1;
    }
    60% {
        transform: translate(calc(-50% + var(--stack-x)), calc(55vh - 50% + var(--stack-y))) rotate(var(--stack-rot));
        opacity: 1;
    }
    75% {
        transform: translate(calc(-50% + var(--fly-dir) * 18vw), calc(35vh - 50%)) rotate(calc(var(--fly-dir) * 14deg));
        opacity: 1;
    }
    90% {
        transform: translate(calc(-50% + var(--fly-dir) * 40vw), calc(5vh - 50%)) rotate(calc(var(--fly-dir) * 26deg));
        opacity: 0.85;
    }
    100% {
        transform: translate(calc(-50% + var(--fly-dir) * 65vw), -45vh) rotate(calc(var(--fly-dir) * 36deg));
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-floating-card.is-flying {
        animation: none;
        opacity: 1;
        transform: translate(-50%, calc(55vh - 50%)) rotate(0deg);
    }
}

@keyframes hero-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 8px); }
}

.hero-loader-icon {
    display: inline-block;
    animation: hero-loader-spin 2s linear infinite;
    vertical-align: -0.125em;
}

@keyframes hero-loader-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-loader-icon { animation: none; }
}

.section-landing {
    padding: 6rem 0;
}

.section-landing-alt {
    background: var(--tblr-bg-surface-secondary);
}

.section-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tblr-primary);
    margin-bottom: 1rem;
}

.section-title-lg {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.feature-card {
    height: 100%;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    border-radius: var(--tblr-border-radius-lg);
    padding: 2rem;
    transition: transform .3s ease, border-color .3s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--tblr-primary);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--tblr-primary) 15%, transparent);
    color: var(--tblr-primary);
    margin-bottom: 1.25rem;
}
.feature-icon .icon { width: 1.5rem; height: 1.5rem; }

.integration-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-left: auto;
    margin-right: auto;
}
.integration-logo svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--tblr-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
    will-change: opacity, transform;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

[data-tilt-3d] {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    --tilt-x: 50;
    --tilt-y: 50;
}

[data-holographic] {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 12px;
}

[data-holographic]::before,
[data-holographic]::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: inherit;
}

[data-holographic]::before {
    background: radial-gradient(
        circle at calc(var(--tilt-x, 50) * 1%) calc(var(--tilt-y, 50) * 1%),
        rgba(255, 255, 255, 0.55),
        rgba(255, 255, 255, 0) 55%
    );
    mix-blend-mode: plus-lighter;
    z-index: 2;
}

[data-holographic]::after {
    background:
        linear-gradient(
            115deg,
            rgba(255, 0, 128, 0.45),
            rgba(128, 0, 255, 0.45),
            rgba(0, 200, 255, 0.45),
            rgba(0, 255, 170, 0.45),
            rgba(255, 220, 0, 0.45),
            rgba(255, 0, 128, 0.45)
        );
    background-size: 250% 250%;
    background-position: calc(var(--tilt-x, 50) * 1%) calc(var(--tilt-y, 50) * 1%);
    mix-blend-mode: color-dodge;
    z-index: 3;
}

[data-holographic]:hover::before,
[data-holographic]:hover::after {
    opacity: 1;
}

.testimonials-stack {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 560px;
    padding: 2rem 1rem;
}

.testimonials-stack__card {
    grid-area: 1 / 1;
    width: min(100%, 460px);
    margin: 0;
    transform-origin: center;
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.75);
    will-change: transform;
    animation-duration: 1.1s;
    animation-timing-function: cubic-bezier(0.45, 0.05, 0.55, 0.95);
    animation-fill-mode: forwards;
}

.testimonials-stack__card--top {
    z-index: 2;
    transform: translate3d(-2%, -10%, 0) rotate(-4deg);
}

.testimonials-stack__card--bottom {
    z-index: 1;
    transform: translate3d(2%, 10%, 0) rotate(3deg);
}

/* Swapped final state (applied without animation on initial load) */
.testimonials-stack.is-swapped .testimonials-stack__card--top {
    z-index: 1;
    transform: translate3d(-2%, 10%, 0) rotate(3deg);
}

.testimonials-stack.is-swapped .testimonials-stack__card--bottom {
    z-index: 2;
    transform: translate3d(2%, -10%, 0) rotate(-4deg);
}

/* Forward path: after first interaction, play the "lift-and-swap" animation */
.testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--top {
    animation-name: stack-top-swap;
}

.testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--bottom {
    animation-name: stack-bottom-swap;
}

/* Reverse path: separate keyframes so the animation restarts from the beginning
   (changing only animation-direction on the same name does not restart) */
.testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--top {
    animation-name: stack-top-unswap;
}

.testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--bottom {
    animation-name: stack-bottom-unswap;
}

@keyframes stack-top-swap {
    0% {
        transform: translate3d(-2%, -10%, 0) rotate(-4deg);
        z-index: 2;
    }
    50% {
        transform: translate3d(-2%, -65%, 0) rotate(-6deg);
        z-index: 2;
    }
    50.01% {
        z-index: 1;
    }
    100% {
        transform: translate3d(-2%, 10%, 0) rotate(3deg);
        z-index: 1;
    }
}

@keyframes stack-bottom-swap {
    0% {
        transform: translate3d(2%, 10%, 0) rotate(3deg);
        z-index: 1;
    }
    50% {
        transform: translate3d(2%, 65%, 0) rotate(5deg);
        z-index: 1;
    }
    50.01% {
        z-index: 2;
    }
    100% {
        transform: translate3d(2%, -10%, 0) rotate(-4deg);
        z-index: 2;
    }
}

@keyframes stack-top-unswap {
    0% {
        transform: translate3d(-2%, 10%, 0) rotate(3deg);
        z-index: 1;
    }
    50% {
        transform: translate3d(-2%, -65%, 0) rotate(-6deg);
        z-index: 1;
    }
    50.01% {
        z-index: 2;
    }
    100% {
        transform: translate3d(-2%, -10%, 0) rotate(-4deg);
        z-index: 2;
    }
}

@keyframes stack-bottom-unswap {
    0% {
        transform: translate3d(2%, -10%, 0) rotate(-4deg);
        z-index: 2;
    }
    50% {
        transform: translate3d(2%, 65%, 0) rotate(5deg);
        z-index: 2;
    }
    50.01% {
        z-index: 1;
    }
    100% {
        transform: translate3d(2%, 10%, 0) rotate(3deg);
        z-index: 1;
    }
}

@media (max-width: 767.98px) {
    .testimonials-stack {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        min-height: 0;
        padding: 0;
    }

    .testimonials-stack__card,
    .testimonials-stack .testimonials-stack__card--top,
    .testimonials-stack .testimonials-stack__card--bottom,
    .testimonials-stack.is-swapped .testimonials-stack__card--top,
    .testimonials-stack.is-swapped .testimonials-stack__card--bottom,
    .testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--top,
    .testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--bottom,
    .testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--top,
    .testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--bottom {
        width: 100%;
        transform: none;
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal],
    .scroll-indicator {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
    }

    [data-tilt-3d] {
        transform: none;
        transition: none;
    }

    [data-holographic]::before,
    [data-holographic]::after {
        display: none;
    }

    .hero-scroll-wrapper {
        height: 100vh;
    }
    .hero-sticky {
        padding: 0;
        transition: none;
    }
    .hero-fullscreen {
        width: 100vw;
        border-radius: 0;
        box-shadow: none;
        transition: none;
    }
    .body-landing .navbar.sticky-top {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .testimonials-stack__card,
    .testimonials-stack.is-swapped .testimonials-stack__card--top,
    .testimonials-stack.is-swapped .testimonials-stack__card--bottom,
    .testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--top,
    .testimonials-stack.has-interacted.is-swapped .testimonials-stack__card--bottom,
    .testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--top,
    .testimonials-stack.has-interacted:not(.is-swapped) .testimonials-stack__card--bottom {
        transform: none;
        transition: none;
        animation: none;
    }
}
