/* ============================================
   HUNTOOL RESPONSIVE
   Mobile-first breakpoints
   ============================================ */

/* ---- MOBILE BASE (< 640px) ---- */

/* Header mobile */
.menu-toggle {
    display: flex;
}

.nav-desktop {
    display: none;
}

/* Hero — mobile layout */
.hero {
    padding: var(--space-5) 0 var(--space-8);
    min-height: auto;
    display: flex;
    align-items: flex-start;
}

.hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
}

@media (max-width: 1023px) {
    .hero-grid > * {
        min-width: 0;
    }

    .hero-title {
        line-height: 1.15;
    }
}

.hero-title {
    font-size: clamp(1.75rem, 7vw, 2.4rem);
}

/* Hero V2 mobile */
.hero-v2 {
    padding-top: 10vh;
    padding-bottom: 8vh;
}

.hero-title-huge {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
}

/* Sticky scroll mobile */
.sticky-section {
    flex-direction: column;
    padding: var(--space-8) 0;
}

.sticky-content {
    width: 100%;
}

.sticky-visual {
    position: relative;
    top: auto;
    height: 50vh;
}

.feature-item {
    min-height: auto;
    padding: var(--space-5) 0 var(--space-5) var(--space-4);
}

/* Mini sticky scroll mobile */
.sticky-section-mini {
    flex-direction: column;
    padding: var(--space-4) 0;
}

.sticky-section-mini .sticky-content {
    width: 100%;
}

.sticky-section-mini .sticky-visual {
    position: relative;
    top: auto;
    height: 35vh;
}

.sticky-section-mini .feature-item {
    min-height: auto;
    padding: var(--space-2) 0 var(--space-2) var(--space-3);
}

.sticky-section-mini.reverse {
    flex-direction: column;
}

/* Hide sticky visuals only on mobile — scoped max-width */
@media (max-width: 1023px) {
    .sticky-visual,
    .sticky-section-mini .sticky-visual {
        display: none;
    }
}

/* Hide hero image + floating badges on mobile */
.hero-visual {
    display: none;
}

/* Center hero when image is hidden */
.hero-content {
    text-align: center;
    gap: var(--space-3);
}

.hero-subtitle {
    margin-inline: auto;
    font-size: var(--text-base);
}

.hero-actions {
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
}

.hero-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Marquee compact on mobile */
.marquee-track {
    gap: var(--space-8);
}

.marquee-track img {
    height: 25px;
}

/* Logo bar compact on mobile */
.logo-bar {
    margin-top: var(--space-2);
}

.hero-proof {
    justify-content: center;
    margin-top: 0;
}

/* Compact logo bar on mobile */
.logo-bar .container {
    margin-bottom: var(--space-3) !important;
}

/* Features */
.features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.feature-row {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-block: var(--space-12);
}

.feature-row:nth-child(even) {
    direction: ltr;
}

/* Testimonials */
.testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

/* Pricing */
.pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.card-pricing.featured {
    transform: none;
    order: -1;
}

.card-pricing.featured:hover {
    transform: translateY(-4px);
}

/* Stats */
.stats-row {
    flex-direction: column;
    gap: var(--space-8);
}

.stats-row .stat-divider {
    width: 3rem;
    height: 1px;
}

/* Commitments */
.commitments-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

/* Blog grid */
.blog-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

/* Footer */
.footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    text-align: center;
}

.footer-brand .footer-logo {
    justify-content: center;
}

.footer-brand p {
    margin-inline: auto;
}

.footer-partners {
    justify-content: center;
}

.footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
}

.footer-social {
    justify-content: center;
}

/* Demo */
.demo-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

/* Sections - on mobile, allow natural height */
.section {
    padding-block: var(--space-10);
    min-height: auto;
}

.section.section-compact {
    padding-block: var(--space-4);
}

.section-lg {
    padding-block: var(--space-12);
    min-height: auto;
}

.demo-section {
    min-height: auto;
}

.cta-section {
    min-height: auto;
}

.hero {
    min-height: auto;
}

.section-header {
    margin-bottom: var(--space-10);
}

/* Grid utils */
.grid-2,
.grid-3,
.grid-4 {
    grid-template-columns: 1fr;
}

/* ---- TABLET (>= 640px) ---- */
@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .commitments-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }

    .footer-brand .footer-logo {
        justify-content: flex-start;
    }

    .footer-brand p {
        margin-inline: 0;
    }

    .footer-partners {
        justify-content: flex-start;
    }

    .hero-actions {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .hero-actions .btn {
        width: auto;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-10);
    }

    .stats-row .stat-divider {
        width: 1px;
        height: 3rem;
    }
}

/* ---- TABLET LANDSCAPE (>= 768px) ---- */
@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-pricing.featured {
        order: unset;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .demo-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- DESKTOP (>= 1024px) ---- */
@media (min-width: 1024px) {
    /* Show desktop nav */
    .nav-desktop {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    /* Hero — restore normal spacing on desktop */
    .hero {
        padding: var(--space-24) 0 var(--space-24);
        max-height: none;
    }

    /* Restore marquee original sizes on desktop */
    .marquee-track {
        gap: var(--space-16);
    }

    .marquee-track img {
        height: 35px;
    }

    /* Logo-bar: plus bas, moins haut */
    .logo-bar {
        margin-top: var(--space-8);
        padding-top: var(--space-2) !important;
        padding-bottom: var(--space-1) !important;
    }

    .hero-content {
        gap: var(--space-4);
    }

    /* Subtitle plus étroit sur desktop */
    .hero-subtitle {
        font-size: var(--text-lg);
        max-width: 30rem;
    }

    /* CTAs empilés sur desktop */
    .hero-actions {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
    }

    .hero-actions .btn {
        width: auto;
    }

    .hero-visual {
        display: none;
    }

    .hero-title .text-orange {
        white-space: nowrap;
    }

    /* Hero V2 desktop */
    .hero-v2 {
        padding-top: 18vh;
        padding-bottom: 12vh;
    }

    .hero-title-huge {
        font-size: clamp(3.2rem, 8vw, 6.5rem);
    }

    /* Sticky scroll desktop */
    .sticky-section {
        flex-direction: row;
        padding: var(--space-24) 0;
    }

    .sticky-content {
        width: 42%;
        padding-top: 10vh;
    }

    .sticky-visual {
        width: 55%;
        height: 80vh;
        position: sticky;
        top: 10vh;
    }

    .feature-item {
        min-height: 60vh;
        padding: 0 0 0 var(--space-8);
    }

    /* Mini sticky scroll desktop */
    .sticky-section-mini {
        flex-direction: row;
        padding: var(--space-4) 0;
        gap: var(--space-8);
    }

    .sticky-section-mini.reverse {
        flex-direction: row-reverse;
    }

    .sticky-section-mini .sticky-content {
        width: 40%;
        padding-top: 0;
    }

    .sticky-section-mini .sticky-visual {
        width: 56%;
        height: 50vh;
        min-height: 300px;
        max-height: 440px;
        position: sticky;
        top: 12rem;
        align-self: flex-start;
    }

    .sticky-section-mini .feature-item {
        min-height: 0;
        padding: var(--space-4) var(--space-5);
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .feature-row {
        grid-template-columns: 1fr 1fr;
        padding-block: var(--space-20);
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Pricing — keep 2 columns, wider cards */
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
        gap: var(--space-8);
    }

    .card-pricing.featured {
        grid-column: auto;
        max-width: none;
        order: unset;
    }

    /* Commitments */
    .commitments-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        text-align: left;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Sections - fit in viewport on desktop */
    .section {
        padding-block: var(--space-10);
        min-height: 100vh;
        display: flex;
        align-items: center;
    }

    /* Sections with mini sticky scrolls: no forced height */
    .section:has(.sticky-section-mini),
    .section.section-compact {
        min-height: auto;
        padding-block: var(--space-4);
        align-items: stretch;
    }

    /* Espacement généreux entre sections features */
    .section:has(.sticky-section-mini) {
        padding-block: var(--space-12);
    }

    .section > .container {
        width: 100%;
    }

    .section-lg {
        padding-block: var(--space-12);
        min-height: 100vh;
    }

    .demo-section {
        min-height: 100vh;
    }

    .cta-section {
        min-height: 100vh;
    }

    .hero {
        min-height: calc(100vh - 4.5rem);
    }
}

/* ---- LARGE DESKTOP (>= 1280px) ---- */
@media (min-width: 1280px) {
    :root {
        --gutter: var(--space-8);
    }

    .hero-title {
        font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
    }

    /* Show hero image + restore 2-col layout on large desktop */
    .hero-visual {
        display: block;
    }

    .hero-grid {
        /* Comme l’ancien hero (image) : moitié texte / moitié visuel pour la forme du titre */
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }

    .hero-content {
        text-align: left;
    }

    .hero-subtitle {
        margin-inline: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-proof {
        justify-content: flex-start;
    }
}

/* ---- ULTRA WIDE (>= 1536px) ---- */
@media (min-width: 1536px) {
    :root {
        font-size: 18px;
    }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .hover-lift:hover,
    .hover-scale:hover {
        transform: none !important;
    }

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }

    .marquee-track {
        animation: none !important;
    }

    .hero-float {
        animation: none !important;
    }
}

/* ---- SCROLL-DRIVEN : overrides finaux (chargé après 4-sections) ---- */
@media (min-width: 1024px) {
    /* La rangée complète devient le cadre sticky — le budget vient du spacer DOM */
    .sticky-section-mini {
        position: sticky;
        top: 5rem;
        align-self: flex-start;
        z-index: 2;
    }

    /* Le visuel — hauteur fixe pour que les mockups remplissent bien */
    .sticky-section-mini .sticky-visual {
        position: relative;
        top: auto;
        height: 55vh;
        min-height: 300px;
        max-height: 460px;
        align-self: flex-start;
    }
}

/* ---- PRINT ---- */
@media print {
    .header,
    .footer,
    .cursor-dot,
    .cursor-ring,
    .scroll-progress {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    [data-animate] {
        opacity: 1 !important;
    }
}
