/* ================================================================
   StitchProUSA — Animated Hero  (hero-animated.css)
   Scroll-driven: products scatter DOWN, gather UP
   ================================================================ */

/* ── Section shell ────────────────────────────────────────── */
.sa-hero-anim {
    position: relative;
    min-height: 100vh;
    background: var(--hero-anim-bg, #1a3560);
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* ── Subtle radial glow behind products ───────────────────── */
.sa-hero-anim::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 60% at 68% 50%, rgba(245,197,24,.07) 0%, transparent 70%),
        radial-gradient(ellipse 40% 80% at 10% 80%,  rgba(255,255,255,.03) 0%, transparent 60%);
    pointer-events: none;
}

/* ── Decorative dot particles ─────────────────────────────── */
.sa-hero-anim__particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.sa-hero-anim__dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(245, 197, 24, 0.18);
    animation: sa-dot-drift linear infinite;
}
.sa-hero-anim__dot:nth-child(1)  { width:6px;  height:6px;  top:12%; left:8%;  animation-duration:14s; animation-delay:-2s;  }
.sa-hero-anim__dot:nth-child(2)  { width:10px; height:10px; top:22%; left:18%; animation-duration:18s; animation-delay:-5s;  }
.sa-hero-anim__dot:nth-child(3)  { width:4px;  height:4px;  top:70%; left:5%;  animation-duration:11s; animation-delay:-1s;  }
.sa-hero-anim__dot:nth-child(4)  { width:8px;  height:8px;  top:85%; left:25%; animation-duration:16s; animation-delay:-8s;  }
.sa-hero-anim__dot:nth-child(5)  { width:5px;  height:5px;  top:45%; left:42%; animation-duration:13s; animation-delay:-3s;  }
.sa-hero-anim__dot:nth-child(6)  { width:12px; height:12px; top:8%;  left:55%; animation-duration:20s; animation-delay:-6s;  }
.sa-hero-anim__dot:nth-child(7)  { width:6px;  height:6px;  top:30%; left:72%; animation-duration:15s; animation-delay:-4s;  }
.sa-hero-anim__dot:nth-child(8)  { width:9px;  height:9px;  top:65%; left:88%; animation-duration:17s; animation-delay:-9s;  }
.sa-hero-anim__dot:nth-child(9)  { width:4px;  height:4px;  top:90%; left:70%; animation-duration:12s; animation-delay:-2s;  }
.sa-hero-anim__dot:nth-child(10) { width:7px;  height:7px;  top:50%; left:95%; animation-duration:19s; animation-delay:-7s;  }
.sa-hero-anim__dot:nth-child(11) { width:11px; height:11px; top:20%; left:92%; animation-duration:22s; animation-delay:-1s;  }
.sa-hero-anim__dot:nth-child(12) { width:5px;  height:5px;  top:78%; left:45%; animation-duration:14s; animation-delay:-5s;  }
.sa-hero-anim__dot:nth-child(13) { width:8px;  height:8px;  top:15%; left:35%; animation-duration:16s; animation-delay:-3s;  }
.sa-hero-anim__dot:nth-child(14) { width:3px;  height:3px;  top:60%; left:62%; animation-duration:10s; animation-delay:-6s;  }
.sa-hero-anim__dot:nth-child(15) { width:6px;  height:6px;  top:40%; left:15%; animation-duration:13s; animation-delay:-4s;  }
.sa-hero-anim__dot:nth-child(16) { width:14px; height:14px; top:5%;  left:80%; animation-duration:21s; animation-delay:-8s;  }
.sa-hero-anim__dot:nth-child(17) { width:5px;  height:5px;  top:92%; left:90%; animation-duration:15s; animation-delay:-2s;  }
.sa-hero-anim__dot:nth-child(18) { width:7px;  height:7px;  top:55%; left:30%; animation-duration:18s; animation-delay:-7s;  }

@keyframes sa-dot-drift {
    0%   { transform: translateY(0px) scale(1); opacity:.6; }
    50%  { transform: translateY(-28px) scale(1.15); opacity:.3; }
    100% { transform: translateY(0px) scale(1); opacity:.6; }
}

/* ── Text content (left side) ─────────────────────────────── */
.sa-hero-anim__content {
    position: relative;
    z-index: 10;
    width: 50%;
    max-width: 580px;
    padding: 60px 0 60px 6%;
    animation: sa-content-enter .8s cubic-bezier(.16,.5,.3,1) both;
}
@keyframes sa-content-enter {
    from { opacity:0; transform: translateY(30px); }
    to   { opacity:1; transform: translateY(0); }
}

.sa-hero-anim__inner { max-width: 520px; }

.sa-hero-anim__eyebrow {
    display: inline-block;
    background: rgba(245,197,24,.18);
    color: #f5c518;
    border: 1px solid rgba(245,197,24,.35);
    border-radius: 100px;
    padding: 5px 16px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 18px;
    animation: sa-content-enter .7s cubic-bezier(.16,.5,.3,1) .15s both;
}

.sa-hero-anim__heading {
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    margin: 0 0 20px;
    animation: sa-content-enter .7s cubic-bezier(.16,.5,.3,1) .25s both;
}
.sa-hero-anim__heading span { color: #f5c518; }

.sa-hero-anim__sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,.78);
    line-height: 1.65;
    margin: 0 0 32px;
    animation: sa-content-enter .7s cubic-bezier(.16,.5,.3,1) .35s both;
}

.sa-hero-anim__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    animation: sa-content-enter .7s cubic-bezier(.16,.5,.3,1) .45s both;
}

.sa-hero-anim__btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, background .18s;
    display: inline-block;
}
.sa-hero-anim__btn--primary {
    background: #f5c518;
    color: #1a3560;
    box-shadow: 0 4px 18px rgba(245,197,24,.35);
}
.sa-hero-anim__btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(245,197,24,.5);
    color: #1a3560;
}
.sa-hero-anim__btn--outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,.45);
}
.sa-hero-anim__btn--outline:hover {
    border-color: #fff;
    transform: translateY(-3px);
    color: #fff;
}

.sa-hero-anim__proof {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    animation: sa-content-enter .7s cubic-bezier(.16,.5,.3,1) .55s both;
}
.sa-hero-anim__sep { color: rgba(255,255,255,.25); }

/* ── Product images (right side) ──────────────────────────── */
.sa-hero-anim__products {
    position: absolute;
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    pointer-events: none;
}

/* Each product item */
.sa-hero-anim__item {
    position: absolute;
    will-change: transform;
    /* All transitions driven by JS, but default smooth for reduced-motion */
    transition: transform .08s linear;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,.4));
}

/* ── At-rest positions (scroll = 0) ───────────────────────── */
/* Cap: upper center-right, slight tilt */
.sa-hero-anim__item--cap {
    width: 220px;
    top: 10%;
    left: 10%;
    transform: rotate(-8deg);
    animation: sa-product-in .9s cubic-bezier(.16,.5,.3,1) .1s both;
    z-index: 4;
}

/* Shirt: center, largest, slight tilt right */
.sa-hero-anim__item--shirt {
    width: 290px;
    top: 22%;
    left: 30%;
    transform: rotate(5deg);
    animation: sa-product-in .9s cubic-bezier(.16,.5,.3,1) .25s both;
    z-index: 5;
}

/* Mug: lower left area of products panel */
.sa-hero-anim__item--mug {
    width: 185px;
    top: 50%;
    left: 5%;
    transform: rotate(12deg);
    animation: sa-product-in .9s cubic-bezier(.16,.5,.3,1) .4s both;
    z-index: 4;
}

@keyframes sa-product-in {
    from { opacity:0; transform: scale(.6) translateY(40px); }
    to   { opacity:1; }
}

/* SVG & img fill the item */
.sa-hero-anim__item img,
.sa-hero-anim__item .sa-svg-product {
    width: 100%;
    height: auto;
    display: block;
}

/* Product label badge */
.sa-hero-anim__label {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(245,197,24,.92);
    color: #1a3560;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    opacity: 0;
    transition: opacity .3s ease;
}
.sa-hero-anim__item:hover .sa-hero-anim__label { opacity: 1; }

/* ── Scroll hint ───────────────────────────────────────────── */
.sa-hero-anim__scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255,255,255,.4);
    font-size: .75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: sa-content-enter 1s ease 1.2s both;
    pointer-events: none;
}
.sa-hero-anim__chevron {
    width: 20px;
    height: 20px;
    margin: 6px auto 0;
    border-right: 2px solid rgba(255,255,255,.3);
    border-bottom: 2px solid rgba(255,255,255,.3);
    transform: rotate(45deg);
    animation: sa-chevron-bounce 1.6s ease infinite;
}
@keyframes sa-chevron-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity:.4; }
    50%       { transform: rotate(45deg) translateY(5px); opacity:.9; }
}

/* ── Scattered state (applied by JS via class) ────────────── */
/* JS uses inline transforms; this class dims and blurs slightly */
.sa-hero-anim--scattered .sa-hero-anim__item {
    filter: drop-shadow(0 30px 60px rgba(0,0,0,.5));
}
.sa-hero-anim--scattered .sa-hero-anim__products::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(245,197,24,.04) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sa-hero-anim__content { width: 60%; }
    .sa-hero-anim__products { width: 45%; }
    .sa-hero-anim__item--shirt { width: 240px; }
    .sa-hero-anim__item--cap   { width: 180px; }
    .sa-hero-anim__item--mug   { width: 155px; }
}

@media (max-width: 768px) {
    .sa-hero-anim {
        min-height: auto;
        padding-bottom: 300px; /* space for products below */
    }
    .sa-hero-anim__content {
        width: 100%;
        padding: 60px 24px 24px;
        text-align: center;
    }
    .sa-hero-anim__ctas { justify-content: center; }
    .sa-hero-anim__proof { justify-content: center; }
    .sa-hero-anim__products {
        width: 100%;
        height: 280px;
        top: auto;
        bottom: 0;
    }
    .sa-hero-anim__item--cap   { width: 120px; top: 10%; left:  5%; }
    .sa-hero-anim__item--shirt { width: 160px; top:  5%; left: 35%; }
    .sa-hero-anim__item--mug   { width: 110px; top: 15%; left: 68%; }
}

@media (max-width: 480px) {
    .sa-hero-anim__heading { font-size: 2rem; }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .sa-hero-anim__item,
    .sa-hero-anim__dot,
    .sa-hero-anim__content,
    .sa-hero-anim__eyebrow,
    .sa-hero-anim__heading,
    .sa-hero-anim__sub,
    .sa-hero-anim__ctas,
    .sa-hero-anim__proof,
    .sa-hero-anim__scroll-hint {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
