/* ============================================================
                RAY STUDIO CRAFT ANIMATION
============================================================ */

.craft-animation-section {
    grid-column: 1 / -1 !important;
    width: 100%;
    max-width: none;

    margin: 45px 0 65px;

    overflow: hidden;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #eee0cd,
            #f8f2ea
        );

    opacity: 0;
    transform: translateY(45px);

    transition:
        opacity 0.9s ease,
        transform 0.9s ease;
}


/* ============================================================
                SHOW SECTION ON SCROLL
============================================================ */

.craft-animation-section.craft-visible {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
                INNER LAYOUT
============================================================ */

.craft-animation-inner {
    min-height: 430px;

    padding: 55px 6%;

    display: grid;

    grid-template-columns:
        minmax(280px, 0.9fr)
        minmax(420px, 1.1fr);

    align-items: center;

    gap: 55px;
}


/* ============================================================
                TEXT AREA
============================================================ */

.craft-animation-text {
    max-width: 500px;
}


.craft-small-title {
    margin-bottom: 10px;

    color: #a8743a;

    font-size: 10px;

    font-weight: 600;

    letter-spacing: 3px;

    text-transform: uppercase;
}


.craft-animation-text h2 {
    margin-bottom: 16px;

    color: #4b3328;

    font-family:
        "Cormorant Garamond",
        serif;

    font-size: 45px;

    font-weight: 600;

    line-height: 1.05;
}


.craft-description {
    color: #6e5a50;

    font-size: 13px;

    line-height: 1.9;
}


/* ============================================================
                DIVIDER
============================================================ */

.craft-divider {
    max-width: 230px;

    margin-top: 25px;

    display: flex;

    align-items: center;

    gap: 12px;

    color: #a8743a;
}


.craft-divider span {
    flex: 1;

    height: 1px;

    background:
        rgba(75, 51, 40, 0.25);
}


.craft-divider i {
    font-size: 13px;
}


/* ============================================================
                SEWING SCENE
============================================================ */

.sewing-scene {
    position: relative;

    width: 100%;

    max-width: 550px;

    height: 320px;

    margin: 0 auto;
}


/* ============================================================
                THREAD SPOOL
============================================================ */

.thread-spool {
    position: absolute;

    top: 18px;
    left: 45px;

    width: 58px;
    height: 92px;

    z-index: 5;

    animation:
        spoolFloat
        3s ease-in-out
        infinite;
}


.spool-top,
.spool-bottom {
    position: absolute;

    left: 2px;

    width: 54px;
    height: 12px;

    border-radius: 50%;

    background: #4b3328;
}


.spool-top {
    top: 0;
}


.spool-bottom {
    bottom: 0;
}


.spool-thread {
    position: absolute;

    top: 8px;
    left: 9px;

    width: 40px;
    height: 75px;

    overflow: hidden;

    border-radius: 6px;

    background: #a8743a;
}


.thread-layer {
    position: absolute;

    left: 3px;

    width: 34px;
    height: 1px;

    background:
        rgba(255, 255, 255, 0.4);
}


.thread-layer-1 {
    top: 16px;
}


.thread-layer-2 {
    top: 31px;
}


.thread-layer-3 {
    top: 46px;
}


.thread-layer-4 {
    top: 61px;
}


/* ============================================================
                THREAD LINE
============================================================ */

.thread-line {
    position: absolute;

    top: 74px;
    left: 95px;

    width: 215px;
    height: 80px;

    border-top:
        2px solid #a8743a;

    border-right:
        2px solid #a8743a;

    border-radius:
        0 45px 0 0;

    z-index: 2;

    animation:
        threadPulse
        1.2s ease-in-out
        infinite;
}


/* ============================================================
                SEWING MACHINE
============================================================ */

.sewing-machine {
    position: absolute;

    right: 25px;
    bottom: 53px;

    width: 350px;
    height: 220px;

    z-index: 4;
}


/* ============================================================
                MACHINE TOP
============================================================ */

.machine-top {
    position: absolute;

    top: 15px;
    right: 28px;

    width: 230px;
    height: 62px;

    border-radius:
        45px 35px 8px 8px;

    background: #4b3328;
}


/* ============================================================
                MACHINE BODY
============================================================ */

.machine-body {
    position: absolute;

    top: 52px;
    right: 28px;

    width: 205px;
    height: 90px;

    border-radius:
        4px 4px 30px 12px;

    background: #4b3328;
}


.machine-brand {
    position: absolute;

    top: 24px;
    right: 55px;

    color: #eee0cd;

    font-family:
        "Cormorant Garamond",
        serif;

    font-size: 21px;

    font-weight: 700;

    letter-spacing: 5px;
}


.machine-decoration {
    position: absolute;

    top: 52px;
    right: 69px;

    color: #a8743a;

    font-size: 11px;
}


/* ============================================================
                MACHINE ARM
============================================================ */

.machine-arm {
    position: absolute;

    top: 83px;
    left: 92px;

    width: 75px;
    height: 45px;

    border-radius:
        0 0 22px 22px;

    background: #4b3328;
}


/* ============================================================
                MACHINE WHEEL
============================================================ */

.machine-wheel {
    position: absolute;

    top: -10px;
    right: -20px;

    width: 72px;
    height: 72px;

    border:
        7px solid #a8743a;

    border-radius: 50%;

    animation:
        machineWheel
        1.8s linear
        infinite;
}


.wheel-center {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 14px;
    height: 14px;

    border-radius: 50%;

    background: #a8743a;

    transform:
        translate(-50%, -50%);
}


.wheel-line {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 2px;
    height: 56px;

    background: #a8743a;

    transform-origin:
        center center;
}


.wheel-line-1 {
    transform:
        translate(-50%, -50%);
}


.wheel-line-2 {
    transform:
        translate(-50%, -50%)
        rotate(45deg);
}


.wheel-line-3 {
    transform:
        translate(-50%, -50%)
        rotate(90deg);
}


.wheel-line-4 {
    transform:
        translate(-50%, -50%)
        rotate(135deg);
}


/* ============================================================
                NEEDLE HOLDER
============================================================ */

.needle-holder {
    position: absolute;

    left: 100px;
    top: 112px;

    width: 22px;
    height: 76px;
}


.needle-holder::before {
    content: "";

    position: absolute;

    top: 0;
    left: 2px;

    width: 18px;
    height: 28px;

    border-radius: 4px;

    background: #a8743a;
}


/* ============================================================
                MOVING NEEDLE
============================================================ */

.sewing-needle {
    position: absolute;

    top: 22px;
    left: 9px;

    width: 2px;
    height: 55px;

    background: #4b3328;

    animation:
        needleMovement
        0.45s ease-in-out
        infinite;
}


.sewing-needle::after {
    content: "";

    position: absolute;

    bottom: -4px;
    left: -1px;

    width: 4px;
    height: 4px;

    border:
        1px solid #4b3328;

    border-radius: 50%;
}


/* ============================================================
                NEEDLE THREAD
============================================================ */

.needle-thread {
    position: absolute;

    top: 37px;
    left: 11px;

    width: 1px;
    height: 60px;

    background: #a8743a;

    animation:
        needleMovement
        0.45s ease-in-out
        infinite;
}


/* ============================================================
                PRESSER FOOT
============================================================ */

.presser-foot {
    position: absolute;

    left: 91px;
    bottom: 26px;

    width: 40px;
    height: 8px;

    border-radius: 2px;

    background: #4b3328;
}


/* ============================================================
                MACHINE BASE
============================================================ */

.machine-base {
    position: absolute;

    left: 42px;
    bottom: 8px;

    width: 285px;
    height: 25px;

    border-radius:
        5px 5px 14px 14px;

    background: #4b3328;
}


/* ============================================================
                FABRIC
============================================================ */

.fabric-piece {
    position: absolute;

    left: 65px;
    right: 18px;
    bottom: 40px;

    height: 72px;

    overflow: hidden;

    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            #c99568,
            #a8743a
        );

    transform:
        skewX(-4deg);

    animation:
        fabricMovement
        4s ease-in-out
        infinite;
}


/* ============================================================
                STITCHING LINE
============================================================ */

.stitch-line {
    position: absolute;

    top: 23px;
    left: 0;

    width: 200%;

    display: flex;

    gap: 11px;

    animation:
        stitchingMovement
        1.4s linear
        infinite;
}


.stitch-line span {
    width: 15px;
    height: 2px;

    flex-shrink: 0;

    background:
        rgba(255, 255, 255, 0.9);
}


/* ============================================================
                FABRIC DECORATION
============================================================ */

.fabric-pattern {
    position: absolute;

    color:
        rgba(255, 255, 255, 0.35);

    font-size: 20px;
}


.fabric-pattern-one {
    left: 45px;
    bottom: 7px;
}


.fabric-pattern-two {
    right: 70px;
    top: 7px;
}


/* ============================================================
                FLOATING DETAILS
============================================================ */

.floating-thread {
    position: absolute;

    color: #a8743a;

    opacity: 0.5;

    animation:
        floatingDetail
        3s ease-in-out
        infinite;
}


.floating-thread-one {
    top: 30px;
    right: 95px;

    font-size: 15px;
}


.floating-thread-two {
    top: 120px;
    left: 20px;

    font-size: 10px;

    animation-delay: 0.8s;
}


.floating-thread-three {
    right: 15px;
    bottom: 55px;

    font-size: 12px;

    animation-delay: 1.5s;
}


/* ============================================================
                ANIMATIONS
============================================================ */

@keyframes machineWheel {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


@keyframes needleMovement {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(18px);
    }

}


@keyframes stitchingMovement {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-52px);
    }

}


@keyframes fabricMovement {

    0%,
    100% {
        transform:
            translateX(0)
            skewX(-4deg);
    }

    50% {
        transform:
            translateX(13px)
            skewX(-4deg);
    }

}


@keyframes spoolFloat {

    0%,
    100% {
        transform:
            translateY(0)
            rotate(-2deg);
    }

    50% {
        transform:
            translateY(-7px)
            rotate(2deg);
    }

}


@keyframes threadPulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }

}


@keyframes floatingDetail {

    0%,
    100% {
        opacity: 0.25;

        transform:
            translateY(0)
            rotate(0deg);
    }

    50% {
        opacity: 0.75;

        transform:
            translateY(-12px)
            rotate(20deg);
    }

}


/* ============================================================
                TABLET
============================================================ */

@media screen and (max-width: 950px) {

    .craft-animation-inner {
        min-height: auto;

        grid-template-columns: 1fr;

        gap: 30px;

        padding:
            45px
            35px;
    }


    .craft-animation-text {
        max-width: 650px;

        margin: 0 auto;

        text-align: center;
    }


    .craft-divider {
        margin:
            24px
            auto
            0;
    }


    .sewing-scene {
        max-width: 540px;
    }

}


/* ============================================================
                MOBILE
============================================================ */

@media screen and (max-width: 600px) {

    .craft-animation-section {
        margin:
            30px
            0
            45px;

        border-radius: 16px;
    }


    .craft-animation-inner {
        padding:
            38px
            18px
            30px;
    }


    .craft-animation-text h2 {
        font-size: 34px;
    }


    .craft-description {
        font-size: 12px;
    }


    .sewing-scene {
        height: 250px;

        transform:
            scale(0.78);

        transform-origin:
            top center;

        margin-bottom: -45px;
    }

}


/* ============================================================
        ACCESSIBILITY - REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    .machine-wheel,
    .sewing-needle,
    .needle-thread,
    .fabric-piece,
    .stitch-line,
    .thread-spool,
    .thread-line,
    .floating-thread {
        animation: none;
    }

}