
/* ================================================
   THE MINGL MAGIC
   Premium 3-Step Experience Section
   Standalone CSS
================================================ */

.mmagic {
    --mm-pink: #ed3678;
    --mm-green: #173c30;

    position: relative;
    isolation: isolate;
    overflow: hidden;

    padding: 68px 0 82px;

    background:
        radial-gradient(
            ellipse at 0% 100%,
            #ffe2e6 0,
            transparent 32%
        ),
        radial-gradient(
            ellipse at 100% 15%,
            #ffeadf 0,
            transparent 38%
        ),
        #fff8f5;

    font-family: "Poppins", sans-serif;
}

.mmagic::after {
    content: "";
    pointer-events: none;
    position: absolute;

    left: -10%;
    bottom: -95px;

    width: 120%;
    height: 135px;

    background: #ffd7df;
    border-radius: 50% 50% 0 0;

    z-index: -1;
    opacity: 0.6;
}

.mmagic *,
.mmagic *::before,
.mmagic *::after {
    box-sizing: border-box;
}

/* ==============================
   CONTAINER & HEADING
============================== */

.mmagic__container {
    max-width: 1360px;
    position: relative;
}

.mmagic__heading {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto 40px;
}

.mmagic__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 18px;

    color: var(--mm-pink);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 16px;
}

.mmagic__eyebrow::before,
.mmagic__eyebrow::after {
    content: "";
    width: 50px;
    height: 2px;
    background: var(--mm-pink);
}

.mmagic__heading h2 {
    font-size: clamp(32px, 3.7vw, 52px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -1px;

    color: var(--mm-green);
    margin: 12px 0;
}

.mmagic__heading p {
    color: #696463;
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
}

/* ==============================
   THREE-STEP LAYOUT
============================== */

.mmagic__journey {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        38px
        minmax(0, 1fr)
        38px
        minmax(0, 1fr);

    align-items: center;
    gap: 0;
}

/* ==============================
   STEP CARDS
============================== */

.mmagic__step {
    position: relative;
    min-width: 0;
    padding-bottom: 51px;
}

/* Premium Organic Image Shape */

.mmagic__visual {
    position: relative;
    aspect-ratio: 1.24;

    overflow: hidden;

    border: 5px solid #fff;

    box-shadow:
        0 15px 34px rgba(119, 54, 67, 0.10);

    background: #fae9dc;

    border-radius:
        32% 14% 24% 12% /
        20% 25% 18% 23%;

    transform: translateZ(0);
}

.mmagic__step--two .mmagic__visual {
    border-radius:
        17% 24% 19% 26% /
        18% 14% 24% 19%;
}

.mmagic__step--three .mmagic__visual {
    border-radius:
        23% 21% 18% 26% /
        19% 25% 18% 21%;
}

/* Image Styling */

.mmagic__visual img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.85s
        cubic-bezier(0.18, 0.8, 0.2, 1);
}

.mmagic__step--one .mmagic__visual img {
    object-position: 54% 64%;
}

.mmagic__step--two .mmagic__visual img {
    object-position: center;
}

.mmagic__step--three .mmagic__visual img {
    object-position: center;
}

/* ==============================
   PINK DECORATIVE RAYS
============================== */

.mmagic__rays {
    position: absolute;

    top: 5px;
    left: 12px;

    color: var(--mm-pink);
    font-size: 37px;
    line-height: 1;

    transform: rotate(-15deg);
    text-shadow: 0 2px 6px #fff;
}

/* ==============================
   OVERLAPPING DESCRIPTION CARD
============================== */

.mmagic__info {
    position: absolute;

    bottom: 0;
    left: 50%;

    width: 92%;
    min-height: 103px;

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 13px 17px;

    background: rgba(255, 250, 249, 0.98);

    border: 1px solid rgba(255, 255, 255, 0.9);

    box-shadow:
        0 12px 24px rgba(190, 87, 108, 0.15);

    border-radius: 55px 45px 54px 45px;

    z-index: 2;
}

/* Number Circle */

.mmagic__count {
    display: grid;
    place-items: center;

    flex-shrink: 0;

    width: 50px;
    height: 50px;

    border-radius: 50%;

    background: var(--mm-pink);
    color: #fff;

    font-size: 20px;
    font-weight: 700;
}

/* Step Icons */

.mmagic__icon {
    display: grid;
    place-items: center;

    color: var(--mm-pink);
    font-size: 29px;

    flex-shrink: 0;
}

/* Description Text */

.mmagic__copy {
    min-width: 0;
}

.mmagic__copy h3 {
    margin: 0 0 3px;

    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.27;

    color: var(--mm-green);
    font-weight: 700;
}

.mmagic__copy p {
    margin: 0;

    font-size: clamp(13px, 1.05vw, 15px);
    line-height: 1.45;

    color: #65605f;
}

/* ==============================
   PINK CONNECTING ARROWS
============================== */

.mmagic__connector {
    position: relative;
    display: block;

    z-index: 3;

    color: var(--mm-pink);
    margin: 0 -17px;

    transform: translateY(-10px);
}

.mmagic__connector svg {
    display: block;

    width: 72px;
    max-width: none;
    height: auto;

    filter:
        drop-shadow(0 2px 2px rgba(255,255,255,.7));
}

/* ==============================
   PREMIUM HOVER ANIMATIONS
============================== */

@media (hover: hover) and (pointer: fine) {

    .mmagic__step:hover .mmagic__visual img {
        transform: scale(1.055);
    }

    .mmagic__step:hover .mmagic__info {
        box-shadow:
            0 16px 33px rgba(190, 87, 108, 0.25);
    }

}

/* ==============================
   SCROLL REVEAL ANIMATION
   JS enabled only
============================== */

.mmagic.mm-magic-ready .mmagic__step {
    opacity: 0;
    translate: 0 28px;

    transition:
        opacity 0.65s ease,
        translate 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mmagic.mm-magic-ready
.mmagic__step.mm-magic-visible {
    opacity: 1;
    translate: 0 0;
}

/* ==============================
   SMALL DESKTOP
============================== */

@media (max-width: 1100px) {

    .mmagic__journey {
        grid-template-columns:
            minmax(0, 1fr)
            24px
            minmax(0, 1fr)
            24px
            minmax(0, 1fr);
    }

    .mmagic__connector svg {
        width: 54px;
    }

    .mmagic__info {
        width: 96%;
        padding: 11px;
        gap: 7px;
        min-height: 110px;
    }

    .mmagic__count {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .mmagic__icon {
        font-size: 23px;
    }

}

/* ==============================
   MOBILE RESPONSIVE
============================== */

@media (max-width: 767px) {

    .mmagic {
        padding: 54px 0 65px;
    }

    .mmagic__heading {
        margin-bottom: 29px;
    }

    .mmagic__heading h2 {
        font-size: clamp(28px, 7vw, 39px);
    }

    .mmagic__heading p {
        font-size: 15px;
    }

    .mmagic__eyebrow {
        font-size: 13px;
        gap: 9px;
    }

    .mmagic__eyebrow::before,
    .mmagic__eyebrow::after {
        width: 27px;
    }

    .mmagic__journey {
        grid-template-columns: 1fr;
        gap: 14px;

        max-width: 450px;
        margin: auto;
    }

    .mmagic__step {
        padding-bottom: 43px;
    }

    .mmagic__visual {
        aspect-ratio: 1.4;
    }

    .mmagic__info {
        width: 90%;
        min-height: 82px;
        padding: 10px 15px;
    }

    .mmagic__copy h3 {
        font-size: 18px;
    }

    .mmagic__copy p {
        font-size: 14px;
    }

    .mmagic__connector {
        margin: -10px auto 3px;

        transform: rotate(90deg);

        width: 48px;
        height: 48px;
    }

    .mmagic__connector svg {
        width: 48px;
    }

    .mmagic__count {
        width: 43px;
        height: 43px;
    }

    .mmagic__icon {
        font-size: 25px;
    }

}

/* ==============================
   REDUCED MOTION SUPPORT
============================== */

@media (prefers-reduced-motion: reduce) {

    .mmagic.mm-magic-ready .mmagic__step {
        opacity: 1;
        translate: 0 0;
        transition: none;
    }

    .mmagic__visual img {
        transition: none;
    }

}

/* ================================================
   MINGL MAGIC - "Melt & Swirl" scroll animation
   APPEND THIS AT THE VERY END of your existing
   Mingl Magic CSS (it overrides the old reveal).
   Everything is scoped to .mm-magic-ready, so if JS
   fails or reduced-motion is on, the section simply
   shows normally.
================================================ */

/* ------------------------------
   Step: scroll-linked fade + lift
------------------------------ */

.mmagic.mm-magic-ready .mmagic__step {
    opacity: var(--so, 0);
    translate: 0 calc((1 - var(--so, 0)) * 44px);
    transition: none;
    transition-delay: 0s !important;
}

/* ------------------------------
   1. Melting soft-serve cream layer
   Slides down as you scroll, drips leading the way
------------------------------ */

.mmagic__drip {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.45) 0,
            rgba(255, 255, 255, 0) 38%
        ),
        #ffa3bd;

    transform: translate3d(0, calc(var(--sp, 0) * 128%), 0);
    will-change: transform;
}

/* The drips hanging from the bottom edge */
.mmagic__drip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 1px);
    height: 60px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cg fill='%23ffa3bd'%3E%3Crect width='120' height='16'/%3E%3Crect x='14' width='14' height='44' rx='7'/%3E%3Crect x='58' width='14' height='30' rx='7'/%3E%3Crect x='92' width='14' height='54' rx='7'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 60px;
    background-repeat: repeat-x;
}

/* Photo settles from a slight zoom while the cream melts off */
.mmagic.mm-magic-ready .mmagic__visual img {
    transform: scale(calc(1.16 - var(--sp, 0) * 0.16));
    transition: none;
}

/* ------------------------------
   2. Glossy shine sweep over the photo
------------------------------ */

.mmagic__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;

    background: linear-gradient(
        115deg,
        transparent 38%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 62%
    );
    background-size: 260% 100%;
    background-position: calc(100% - var(--sp, 0) * 100%) 0;
    mix-blend-mode: soft-light;
}

/* Pink rays slowly spin as the step arrives */
.mmagic.mm-magic-ready .mmagic__rays {
    z-index: 5;
    transform: rotate(calc(-15deg + var(--sp, 0) * 200deg))
               scale(calc(0.6 + var(--sp, 0) * 0.4));
}

/* ------------------------------
   3. Description card: springy pop
   + progress ring around the number
------------------------------ */

.mmagic.mm-magic-ready .mmagic__info {
    opacity: clamp(0, calc(var(--ip, 0) * 2), 1);
    scale: calc(0.82 + var(--ip, 0) * 0.18);
    translate: 0 calc((1 - var(--ip, 0)) * 26px);
}

.mmagic__count {
    position: relative;
}

.mmagic.mm-magic-ready .mmagic__count::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;

    background: conic-gradient(
        var(--mm-pink) calc(var(--sp, 0) * 360deg),
        rgba(237, 54, 120, 0.16) 0
    );

    -webkit-mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 3px),
        #000 calc(100% - 2px)
    );
    mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 3px),
        #000 calc(100% - 2px)
    );
}

/* ------------------------------
   4. Arrows draw themselves
------------------------------ */

.mmagic.mm-magic-ready .mmagic__connector {
    clip-path: inset(-10px calc((1 - var(--cp, 0)) * 100% + 0px) -10px -10px);
    opacity: var(--cp, 0);
    scale: calc(0.8 + var(--cp, 0) * 0.2);
}

/* ------------------------------
   5. Floating fruits (parallax)
------------------------------ */

.mmagic__fruit {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
    will-change: transform;
    opacity: 0.92;
    filter: drop-shadow(0 8px 10px rgba(190, 87, 108, 0.22));
}

/* ------------------------------
   6. Finale: cherry drop + sprinkle burst
------------------------------ */

.mmagic__cherry {
    position: absolute;
    z-index: 6;
    top: -34px;
    right: 17%;

    font-size: 40px;
    line-height: 1;
    pointer-events: none;

    opacity: 0;
    transform: translateY(-120px) rotate(-30deg);
    filter: drop-shadow(0 6px 6px rgba(120, 20, 50, 0.3));

    transition:
        transform 0.9s cubic-bezier(0.34, 1.7, 0.5, 1),
        opacity 0.25s ease;
}

.is-celebrating .mmagic__cherry {
    opacity: 1;
    transform: translateY(0) rotate(8deg);
}

.mmagic__burst {
    position: absolute;
    z-index: 6;
    top: 38%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mmagic__burst i {
    position: absolute;
    left: -2px;
    top: -7px;
    width: 4px;
    height: 14px;
    border-radius: 4px;
    background: var(--c, #ed3678);
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) scale(0.3);
}

.is-celebrating .mmagic__burst i {
    animation: mm-sprinkle 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) var(--t, 0ms) both;
}

@keyframes mm-sprinkle {
    0% {
        opacity: 0;
        transform: rotate(var(--a)) translateY(0) scale(0.3);
    }
    15% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(calc(var(--a) + 40deg)) translateY(calc(var(--d) * -1)) scale(1);
    }
}

/* ------------------------------
   Mobile tweaks
------------------------------ */

@media (max-width: 767px) {

    .mmagic__fruit[data-hide-mobile] {
        display: none;
    }

    .mmagic__fruit {
        opacity: 0.75;
        transform-origin: center;
    }

    .mmagic__cherry {
        font-size: 32px;
        top: -26px;
    }

    /* Connector is rotated 90deg on mobile, so scale-in works better than a wipe */
    .mmagic.mm-magic-ready .mmagic__connector {
        clip-path: none;
        scale: calc(0.5 + var(--cp, 0) * 0.5);
    }
}

/* ------------------------------
   Reduced motion: show everything, no scrubbing
------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .mmagic__drip,
    .mmagic__fruit,
    .mmagic__burst,
    .mmagic__cherry {
        display: none;
    }
}


/* =========================================
   MINGL MAGIC - iPAD / TABLET FIX
   ========================================= */

@media (min-width: 768px) and (max-width: 1199px) {

    /* Give three cards enough breathing space */
    .mmagic__journey {
        grid-template-columns:
            minmax(0, 1fr)
            18px
            minmax(0, 1fr)
            18px
            minmax(0, 1fr);

        align-items: start;
        gap: 4px;
    }

    .mmagic__step {
        padding-bottom: 0;
        min-width: 0;
    }

    /* Image stays completely visible */
    .mmagic__visual {
        width: 100%;
        aspect-ratio: 1.15;
    }

    /* Move description below the image */
    .mmagic__info {
        position: relative;

        bottom: auto;
        left: auto;

        transform: none;

        width: 100%;
        min-height: 125px;

        margin: 10px auto 0;
        padding: 12px 10px;

        display: flex;
        align-items: center;
        gap: 8px;

        border-radius: 18px;
    }

    /* Smaller number badge */
    .mmagic__count {
        width: 34px;
        height: 34px;

        font-size: 14px;
        flex-shrink: 0;
    }

    /* Smaller icon */
    .mmagic__icon {
        font-size: 20px;
        flex-shrink: 0;
        padding-left:5px;
    }

    /* Better text alignment */
    .mmagic__copy {
        flex: 1;
        min-width: 0;
        text-align: left;
    }

    .mmagic__copy h3 {
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 5px;
    }

    .mmagic__copy p {
        font-size: 12px;
        line-height: 1.5;
        margin: 0;
    }

    /* Align arrows between images */
    .mmagic__connector {
        margin: 0 -8px;
        transform: translateY(60px);
    }

    .mmagic__connector svg {
        width: 38px;
    }

}

/* Extra adjustment for narrow iPads */
@media (min-width: 768px) and (max-width: 900px) {

    .mmagic__info {
        flex-wrap: wrap;
        align-content: center;
        justify-content: center;
        gap: 5px;
        min-height: 140px;
    }

    .mmagic__copy {
        flex-basis: 100%;
        text-align: center;
    }

    .mmagic__copy h3 {
        font-size: 14px;
    }

    .mmagic__copy p {
        font-size: 12px;
    }
}

