/* =========================================================================
 * Effectory Hero Block (centered — text, carousel, trust badges)
 * Auto-loaded via block.json `style` key
 *
 * Every selector below is scoped under `.rf-hero` (added to the block's
 * wrapper alongside `.effectory-hero` — see hero.php) so this stylesheet
 * can never match markup rendered by the rf-hero-split block, even though
 * both stylesheets are always loaded together in wp-admin.
 * ====================================================================== */


.rf-hero.effectory-hero {
    --ink-soft: #3a4358;
    --bg: #fff;

    position: relative;
    background: var(--bg);
    color: var(--wp--preset--color--dark);
    /* Clip sideways only: the gradient div has to be able to bleed up
       behind the nav (it does its own bottom/corner clipping). Done with
       clip-path rather than `overflow-x: clip; overflow-y: visible`, because
       Safari clips the vertical axis too with that combination, cutting the
       gradient off at the block's top edge (white strip behind the nav).
       Negative top/bottom insets leave both vertical edges open. */
    clip-path: inset(-100vh 0 -100vh 0);
    padding: clamp(3rem, 5vw, 5rem) 20px clamp(3rem, 8vw, 6rem);
    padding-bottom: calc(clamp(3rem, 8vw, 4rem) + var(--hero-overlap-amount, 0px));
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
    text-align: center;
    border-radius: 0 0 80px 0;
    max-width:inherit !important;
}
.rf-hero.effectory-hero.alignwide {
    /*max-width: calc(var(--wp--style--global--wide-size) + 10rem)*/
}

.rf-hero.effectory-hero *,
.rf-hero.effectory-hero *::before,
.rf-hero.effectory-hero *::after {
    box-sizing: border-box;
}

/* atmospheric backdrop — .effectory-hero__gradient (see hero.php).
 * Bleeds upward past the block's own top edge so it runs all the way up
 * behind the nav, which goes transparent for this block via body.has-rf-hero
 * in template-parts/header/menu.css. The div itself clips (overflow hidden +
 * rounded bottom-right corner); the blurred gradient lives on its ::before so
 * the blur never softens that clipped edge. */
.rf-hero.effectory-hero {
    --hero-gradient-bleed: 300px;
}

.rf-hero .effectory-hero__gradient {
    position: absolute;
    top: calc(-1 * var(--hero-gradient-bleed));
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0 0 80px 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.rf-hero .effectory-hero__gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--wp--preset--gradient--atmosphere);
}

.rf-hero.effectory-hero.peach .effectory-hero__gradient::before {
    background: var(--wp--preset--gradient--peach);
    filter: blur(64px);
}

.rf-hero.effectory-hero.lavender .effectory-hero__gradient::before {
    background: var(--wp--preset--gradient--lavender);
    filter: blur(60px);
}

.rf-hero.effectory-hero.seafoam .effectory-hero__gradient::before {
    background: radial-gradient(
            140% 140% at 100% 100%,
            #D4EEE9 0%,
            #FDF6DB 48%,
            #F9F7F5 71%,
            #FCFBFA 99%
    );
}

/* ---------- layout ---------- */
.rf-hero .effectory-hero__inner {
    position: relative;
    z-index: 2;
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;

}

/* ---------- text ---------- */
.rf-hero .effectory-hero__text {
    max-width: 100%;
}

.rf-hero .effectory-hero__title {
    font-family: Poppins;
    font-size: var(--wp--preset--font-size--r-extralarge);
    font-weight: 800;
    line-height: 1.3em;
    letter-spacing: -0.025em;
    color: var(--wp--preset--color--dark);
    margin: 0 0 clamp(1.5rem, 3vw, 2rem);
}

.rf-hero .effectory-hero__eyebrow {
    color: #808898;
    text-align: center;
    font-family: Poppins;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-style: normal;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.8s cubic-bezier(.2, .7, .2, 1) 0.5s, transform 0.8s cubic-bezier(.2, .7, .2, 1) 0.5s;
}
.rf-hero.effectory-hero.is-revealed .effectory-hero__eyebrow {
    opacity: 1;
    transform: translateY(0);
}

/* word-by-word stagger (spans injected by JS) */
/* Manual line breaks in the title are tuned for desktop widths — on mobile
   they just cause awkward short lines, so let the title wrap naturally.
   (hero.js keeps a space next to each <br>, so words don't run together.) */
@media (max-width: 700px) {
    .rf-hero .effectory-hero__title br {
        display: none;
    }
}

.rf-hero .effectory-hero__title .word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.rf-hero .effectory-hero__title .word > span {
    display: inline-block;
    transform: translateY(105%);
    /* Runs from first paint (spans are rendered by hero.php), so the title
       never waits for the deferred hero.js. */
    animation: effectory-rise 0.9s cubic-bezier(.2, .7, .2, 1) forwards;
}

.rf-hero .effectory-hero__title .word:nth-child(1) > span {
    animation-delay: 0.05s;
}

.rf-hero .effectory-hero__title .word:nth-child(2) > span {
    animation-delay: 0.15s;
}

.rf-hero .effectory-hero__title .word:nth-child(3) > span {
    animation-delay: 0.25s;
}

.rf-hero .effectory-hero__title .word:nth-child(4) > span {
    animation-delay: 0.35s;
}

.rf-hero .effectory-hero__title .word:nth-child(5) > span {
    animation-delay: 0.45s;
}

.rf-hero .effectory-hero__title .word:nth-child(6) > span {
    animation-delay: 0.55s;
}

.rf-hero .effectory-hero__title .word:nth-child(7) > span {
    animation-delay: 0.65s;
}

.rf-hero .effectory-hero__title .word:nth-child(n+8) > span {
    animation-delay: 0.75s;
}

@keyframes effectory-rise {
    to {
        transform: translateY(0);
    }
}

.rf-hero .effectory-hero__subtitle {
    font-size: var(--wp--preset--font-size--r-medium);
    line-height: 1.5;
    margin: 0 auto clamp(2rem, 3.5vw, 2.5rem);
    max-width: 95%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(.2, .7, .2, 1) 0.5s, transform 0.8s cubic-bezier(.2, .7, .2, 1) 0.5s;
}

.rf-hero.effectory-hero.is-revealed .effectory-hero__subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- USPs row ---------- */
.rf-hero .effectory-hero__usps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    margin: 0 0 clamp(2rem, 3.5vw, 2.5rem);
    padding: 0;
    list-style: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(.2, .7, .2, 1) 0.58s, transform 0.8s cubic-bezier(.2, .7, .2, 1) 0.58s;
}

.rf-hero.effectory-hero.is-revealed .effectory-hero__usps {
    opacity: 1;
    transform: translateY(0);
}

.rf-hero .effectory-hero__usp {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    text-align: center;
}

.rf-hero .effectory-hero__usp-icon {
    display: inline-flex;
    flex: none;
    color: var(--wp--preset--color--dark);
}

.rf-hero .effectory-hero__usp-icon svg {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin:0 auto;
}

.rf-hero .effectory-hero__usp-text {
    font-family: Poppins;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--wp--preset--color--dark);
}

/* ---------- buttons wrapper ---------- */
.rf-hero .effectory-hero__buttons {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(.2, .7, .2, 1) 0.65s, transform 0.8s cubic-bezier(.2, .7, .2, 1) 0.65s;
}

.rf-hero.effectory-hero.is-revealed .effectory-hero__buttons {
    opacity: 1;
    transform: translateY(0);
}

.rf-hero .effectory-hero__buttons .wp-block-buttons {
    gap: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .rf-hero .effectory-hero__title .word > span {
        transform: none !important;
        animation: none !important;
    }

    .rf-hero .effectory-hero__subtitle,
    .rf-hero .effectory-hero__usps,
    .rf-hero .effectory-hero__buttons,
    .rf-hero .effectory-hero__form-scribble {
        opacity: 1 !important;
        transform: none !important;
    }
}
@media (max-width: 768px) {
    .rf-hero.effectory-hero.is-revealed .effectory-hero__form-scribble {
        right: -16px;
    }
}

/* ---------- carousel ---------- */
.rf-hero .effectory-hero__carousel {
    --carousel-gap: 10px;
    --carousel-slide-w: clamp(300px, 27vw, 380px);
    --carousel-transition: 650ms cubic-bezier(.25, .1, .25, 1);
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: clamp(2rem, 5vw, 3.5rem);
    display: block;
}

.rf-hero .effectory-hero__carousel-viewport {
    position: relative;
    height: clamp(360px, 34vw, 440px);
    touch-action: pan-y;
    margin-top:clamp(0.25rem, 3vw, 1rem);
}

.rf-hero .effectory-hero__carousel-track {
    position: absolute;
    inset: 0;
}

.rf-hero .effectory-hero__carousel-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--carousel-slide-w);
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: transform var(--carousel-transition), opacity var(--carousel-transition), filter var(--carousel-transition);
    filter: saturate(0.85);
}

/* wrap-around snap: far-prev <-> far-next repositions instantly, no sweep */
.rf-hero .effectory-hero__carousel-slide.is-teleporting {
    transition: none;
}

.rf-hero .effectory-hero__carousel-slide[data-position="active"] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 3;
    pointer-events: auto;
    filter: none;
}

.rf-hero .effectory-hero__carousel-slide[data-position="prev"] {
    transform: translate(calc(-50% - 100% - -10px), -50%) scale(0.84);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
}

.rf-hero .effectory-hero__carousel-slide[data-position="next"] {
    transform: translate(calc(-50% + 100% + -10px), -50%) scale(0.84);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
}

/* far-out peeking cards — empty dummy placeholders, same gap as prev/next */
.rf-hero .effectory-hero__carousel-slide[data-position="far-prev"],
.rf-hero .effectory-hero__carousel-slide[data-position="far-next"] {
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
    filter: saturate(0.5);
    transition: transform var(--carousel-transition), opacity var(--carousel-transition), filter var(--carousel-transition);
}

.rf-hero .effectory-hero__carousel-slide[data-position="far-prev"] {
    /* prev + far-prev are both already scaled to 0.84, so this step only needs
       to close the gap between two shrunk cards — not a full card-width again,
       otherwise the empty space between them reads bigger than the near gap. */
    transform: translate(calc(-50% - 192% + 20px), -50%) scale(0.84);
}

.rf-hero .effectory-hero__carousel-slide[data-position="far-next"] {
    transform: translate(calc(-50% + 192% - 20px), -50%) scale(0.84);
}

/* keep the card shape but fade its content away — a blank bookend, not a hard cut */
.rf-hero .effectory-hero__carousel-slide .effectory-hero__carousel-card > * {
    opacity: 1;
    transition: opacity var(--carousel-transition);
}

.rf-hero .effectory-hero__carousel-slide[data-position="far-prev"] .effectory-hero__carousel-card > *,
.rf-hero .effectory-hero__carousel-slide[data-position="far-next"] .effectory-hero__carousel-card > * {
    opacity: 0;
}

.rf-hero .effectory-hero__carousel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    --carousel-card-pad: clamp(1.5rem, 2.5vw, 2.25rem);
    padding: var(--carousel-card-pad);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 1.75rem;
    box-shadow: 0 4.195px 80px 0 rgba(44, 57, 83, 0.08);


}

.rf-hero .effectory-hero__carousel-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.9rem;
    /* in the flow, pulled up to hang from the card's top edge, so the title
       always starts 24px below it */
    margin: calc(-1 * var(--carousel-card-pad)) 0 24px;
    border-radius: 0 0 8px 8px;

    background: #7DA4F7;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.rf-hero .effectory-hero__carousel-title {
    margin: 0 0 0.5rem;
    font-family: Poppins, sans-serif;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--wp--preset--color--dark);
}

.rf-hero .effectory-hero__carousel-desc {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.rf-hero .effectory-hero__carousel-media {
}

.rf-hero .effectory-hero__carousel-lottie {
    max-width: 302px;
    aspect-ratio: 302 / 360;
    object-fit:contain;
}

.rf-hero .effectory-hero__carousel-video {
    display: block;
    max-width: 302px;
    width: 100%;
    aspect-ratio: 302 / 360;
    object-fit: contain;
    background: transparent;
}

/* ---------- carousel nav arrows ---------- */
.rf-hero .effectory-hero__carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    color: var(--wp--preset--color--dark);
    box-shadow: 0 1px 32px 0 rgba(44, 57, 83, 0.12);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.rf-hero .effectory-hero__carousel-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 14px 30px -12px rgba(20, 30, 60, 0.4);
}


.rf-hero .effectory-hero__carousel-arrow--prev {
    left: clamp(0px, 2vw, 24px);
}

.rf-hero .effectory-hero__carousel-arrow--next {
    right: clamp(0px, 2vw, 24px);
}

/* ---------- carousel dots ---------- */
.rf-hero .effectory-hero__carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.rf-hero .effectory-hero__carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(58, 67, 88, 0.25);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rf-hero .effectory-hero__carousel-dot.is-active {
    background: var(--wp--preset--color--dark);
    transform: scale(1.3);
}

@media (max-width: 700px) {
    .rf-hero .effectory-hero__carousel {
        --carousel-slide-w: clamp(220px, 72vw, 300px);
    }

    /* touch swipes replace the buttons on small screens */
    .rf-hero .effectory-hero__carousel-arrow {
        display: none;
    }

    /* keep prev/next peeking at the edges (partly off-screen) instead of hiding them */
    .rf-hero .effectory-hero__carousel-slide[data-position="prev"],
    .rf-hero .effectory-hero__carousel-slide[data-position="next"] {
        opacity: 0.65;
    }

    .rf-hero .effectory-hero__carousel-slide[data-position="far-prev"],
    .rf-hero .effectory-hero__carousel-slide[data-position="far-next"] {
        opacity: 0;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rf-hero .effectory-hero__carousel-slide {
        transition-duration: 0.01ms !important;
    }
}

/* ---------- embedded (HubSpot) form ---------- */
.rf-hero .effectory-hero__form-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 636px;
    margin: -2rem auto 2rem;
}

.rf-hero .effectory-hero__form {
    /* gradient borders can't use the `border` shorthand — paint the fill on the
       padding-box and the radial gradient on the border-box of a transparent border.
       `background-color` only clips to the final layer, so the fill is faked as a
       flat gradient here to give it its own padding-box origin/clip. */
    border: 2px solid transparent;
    border-radius: 16px;
    background-image:
            linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
            radial-gradient(circle, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    padding: 40px;
    box-shadow: 0 4.195px 80px 0 rgba(44, 57, 83, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    text-align: left;
}

.rf-hero .effectory-hero__form-embed {
    /* holds the space the HubSpot fields will occupy so embedding the script doesn't shift the layout */
    min-height: 455px;
}

.rf-hero .effectory-hero__form-scribble {
    position: absolute;
    right: -39px;
    bottom: -21px;
    width: clamp(34px, 4vw, 50px);
    height: auto;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.4) rotate(-18deg);
    transform-origin: 70% 30%;
    transition: opacity 0.6s cubic-bezier(.34, 1.56, .64, 1) 0.9s, transform 0.6s cubic-bezier(.34, 1.56, .64, 1) 0.9s;
}

.rf-hero.effectory-hero.is-revealed .effectory-hero__form-scribble {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

@media (max-width: 700px) {
    .rf-hero .effectory-hero__form {
        padding: 40px 24px;
    }
}

/* ---------- compliance / trust badges row ---------- */
.rf-hero .effectory-hero__badges {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(20px, 5vw, 40px);
    margin-top: clamp(5rem, 4vw, 10rem);
    justify-content: center;

}

.rf-hero .effectory-hero__badge {
    display: block;
    max-height: clamp(44px, 4vw, 60px);
    width: auto;
    object-fit: contain;
    height: clamp(44px, 4vw, 60px);
    opacity:0.6;
    transition: opacity 300ms ease-in-out;
    will-change: opacity;
    /* uncomment if the source logos come in full colour and need muting to match the screenshot */
    /* filter: grayscale(1); opacity: 0.8; */
}
.rf-hero .effectory-hero__badge:hover {
    opacity:1;
    transition: opacity 300ms ease-in-out;
}

@media (max-width: 600px) {
    .rf-hero .effectory-hero__badges {
        justify-content: center;
        gap: 1.5rem;
    }
}
