/* ==========================================================
   MOTION · scroll animations (AOS) · section snap · parallax
   (js/motion.js does the moving parts)

   1. AOS, quieter: the library moves things 100px and zooms from
      60%. Here every animation travels a short distance, so the
      page feels fluid instead of jumpy. Which animation each block
      uses is set in the HTML (data-aos="..."):
        fade-up      section titles, text, accordions
        fade-right   left-hand column of a split layout  } fade-up on
        fade-left    right-hand column of a split layout } phones/tablets
        zoom-in      panels: testimonials, call-to-action, wordmark
        zoom-in-up   cards in a grid (with a stagger)
        zoom-out     large photos (they settle into place)
        fade         things a link jumps to (the contact form)
   2. Section snap (desktop and tablet).
   3. Parallax between sections: as one section gives way to the
      next, the content moves a little slower than the page; at rest
      on a section, everything sits exactly as designed (js/motion.js).
   Everything here is off for visitors who ask for reduced motion.
   ========================================================== */

/* ---------- 1. AOS distances ---------- */
[data-aos="fade-up"]     { transform: translate3d(0, 28px, 0); }
[data-aos="fade-down"]   { transform: translate3d(0, -28px, 0); }
[data-aos="fade-right"]  { transform: translate3d(-36px, 0, 0); }
[data-aos="fade-left"]   { transform: translate3d(36px, 0, 0); }
[data-aos="zoom-in"]     { transform: scale(0.94); }
[data-aos="zoom-in-up"]  { transform: translate3d(0, 28px, 0) scale(0.96); }
[data-aos="zoom-out"]    { transform: scale(1.05); }
[data-aos="slide-right"] { transform: translate3d(-56px, 0, 0); }
[data-aos="slide-left"]  { transform: translate3d(56px, 0, 0); }
[data-aos="slide-up"]    { transform: translate3d(0, 56px, 0); }

/* phones and small tablets: side-by-side layouts stack into one column there, so
   blocks rise instead of sliding in from the side (nothing pokes past the screen edge) */
@media (max-width: 991.98px) {
    [data-aos="fade-right"],
    [data-aos="fade-left"] {
        transform: translate3d(0, 28px, 0);
    }
}

/* a block sliding in from the side never makes the page wider: it is cut at the
   screen edge ("clip" cuts without turning main into a scroll box) */
main {
    overflow-x: clip;
}

/* the Benefits cards animate one by one, and AOS's own rules would cancel their
   hover lift (and make it as slow as the entrance): give it back */
.bento .card-c[data-aos] {
    transition-property: opacity, transform, box-shadow;
}

.bento .card-c[data-aos].aos-animate:hover {
    transform: translateY(-5px);
    transition-duration: 0.3s;
}

/* ---------- 2. section snap ----------
   "mandatory": when you stop scrolling, the page always settles on a section
   (its start, or its end when it is taller than the window). Inside a section
   taller than the window you can still stop anywhere, so nothing is skipped.
   Desktop and tablet only: on phones snapping fights the thumb flick.
   Too firm for your taste? Change "mandatory" to "proximity" below: the page
   then only settles when you stop close to a section. */
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
    html {
        scroll-snap-type: y mandatory;
    }

    /* - not the first section: its snap point would sit 40px below the top of the
         page and the page would jump there on load, hiding the info bar;
       - the contact form card and Consultoria's 4 steps (#processo) are snap points
         of their own: links jump straight to them, so they must be places the page
         is allowed to stop. */
    main > section:not(:first-child),
    .contact-form-card,
    #processo {
        scroll-snap-align: start;
    }

    /* every section the page stops on fills the window, with its content in the
       middle: it lands with its top at the top of the screen (the navbar hides when
       you scroll down) and is at least one screen tall. A section taller than the
       screen keeps its height and you scroll through it as before.
       Grid, not flex: the content keeps its full width and its own centring. */
    main > section:not(:first-child) {
        min-height: 100vh;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-content: center;
        scroll-margin-top: 0;
        /* same space above and below, or "centred" would sit off-centre
           (some sections had none on top and 6rem at the bottom) */
        padding-top: 6rem;
        padding-bottom: 6rem;
    }

    /* the testimonials panel is sized as a share of the window (height: 100% of a
       60vh section); in a grid that "100%" has nothing to measure against and the
       panel collapsed to nothing. Give it its height directly and centre it. */
    /* the partners get a screen of their own like every other section (so the page
       stops on them), with the logos sized up to fill it */
    main > section.partners .partners-title {
        margin-bottom: 2.25rem;
        font-size: 0.95rem;
    }

    main > section.partners .partner-logos {
        gap: 1.25rem;
        max-width: 1100px;
        margin: 0 auto;
    }

    main > section.partners .partner-logos li {
        height: 112px;
        padding: 0.8rem 1.4rem;
        border-radius: 16px;
    }

    main > section.partners .partner-logos li.tile {
        padding: 0;
    }

    main > section.partners .partner-logos img {
        max-width: 220px;
    }

    main > section#testimonials {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* its 10rem / 13rem outside margins left dead bands between screens: a scroll
           that ended in one snapped back to the section before, so the page got stuck */
        margin-top: 0;
        margin-bottom: 0;
    }

    main > section#testimonials #testCarousel {
        height: 60vh;
        flex: none;
    }

    /* the cards right under a page's header have "pt-0" (no top space) so they hug
       the header; as a full screen of their own they need the same space as the rest */
    main > section.pt-0:not(:first-child) {
        padding-top: 6rem !important;
    }

    /* the very top (info bar showing) and the very bottom (whole footer) are
       stops too, so neither can be pulled out of reach. The top one has to exist
       before any script runs, or the page would jump to the second section while
       loading: the header is an empty box near the top of the page, and its margin
       reaches back past the space above it, so its stop is the top itself. */
    body > header {
        scroll-snap-align: start;
        scroll-margin-top: 200px;
    }

    body > footer {
        scroll-snap-align: end;
    }
}

/* short windows (a 1366x768 laptop shows ~650px of page): almost every section is
   taller than that, so a firm snap would keep tugging between them; there the page
   only settles when you stop close to a section start */
@media (min-width: 992px) and (max-height: 699.98px) and (prefers-reduced-motion: no-preference) {
    html {
        scroll-snap-type: y proximity;
    }
}

/* the contact section cuts off its background decorations with "overflow: hidden",
   which also hides the form card from the page's snapping (and the page could then
   never stop on the form). "clip" makes the same cut without that side effect.
   Browsers that don't know "clip" simply keep "hidden". */
main > .contact-section {
    overflow: clip;
}

/* ---------- 3. parallax between sections ---------- */
.cc-drift {
    will-change: translate;
}
