﻿/* =============================================
   MOSSBERRY — HERO
   ============================================= */

.mby-hero {
    position: relative;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
    padding: 72px 80px 80px;
    box-sizing: border-box;
}

.mby-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mby-hero__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.mby-hero__blob--1 {
    width: 500px;
    height: 500px;
    background: rgba(var(--color-primary-rgb), 0.06);
    top: -160px;
    left: -100px;
}

.mby-hero__blob--2 {
    width: 350px;
    height: 350px;
    background: rgba(var(--color-accent-rgb), 0.07);
    bottom: -80px;
    left: 30%;
}

.mby-hero__layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 72px;
    align-items: center;
}

.mby-hero__content {
    display: flex;
    flex-direction: column;
    position: relative;
}

    .mby-hero__content::before {
        content: '';
        position: absolute;
        left: -24px;
        top: 10%;
        height: 80%;
        width: 5px;
        background: linear-gradient(180deg, transparent 0%, var(--color-accent) 25%, var(--color-primary) 75%, transparent 100%);
        border-radius: 0 3px 3px 0;
    }

.mby-hero__logo-link {
    display: inline-block;
    margin-bottom: 44px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

    .mby-hero__logo-link:hover {
        transform: translateY(-2px);
    }

.mby-hero__logo {
    display: block;
    height: 64px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    object-position: left center;
}

.mby-hero__title {
    font-family: var(--font-display) !important;
    font-size: clamp(2.8rem, 4.5vw, 5.5rem) !important;
    font-weight: 400 !important;
    font-style: italic !important;
    line-height: 0.95 !important;
    margin: 0 0 22px 0 !important;
    letter-spacing: -0.03em !important;
    color: var(--color-primary);
    -webkit-text-stroke: var(--stroke-display);
    paint-order: stroke fill;
}

.mby-hero__divider {
    width: 48px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 2px;
    margin-bottom: 22px;
}

.mby-hero__text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.8;
    color: #555555;
    margin-bottom: 40px;
}

    .mby-hero__text p {
        margin: 0;
    }

.mby-hero__footer {
    padding-top: 32px;
    border-top: 1px solid #e8e8e8;
}

/* ============================================================
   ANIMATED BORDER WRAPPER
   ============================================================ */

.mby-btn-wrap {
    position: relative;
    display: inline-block;
    padding: 3px;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-tertiary), var(--color-primary));
    background-size: 300% 100%;
    animation: mby-border-shift 3s ease infinite;
}

    .mby-btn-wrap::before {
        content: '';
        position: absolute;
        inset: -3px;
        border-radius: 18px;
        background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-tertiary), var(--color-primary));
        background-size: 300% 100%;
        animation: mby-border-shift 3s ease infinite;
        filter: blur(14px);
        opacity: 0.6;
        z-index: -1;
        transition: opacity 0.3s, filter 0.3s;
    }

    .mby-btn-wrap:hover::before {
        filter: blur(24px);
        opacity: 0.9;
    }

@keyframes mby-border-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================================
   BUTTON
   ============================================================ */

.mby-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px 52px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #1a1232 0%, #110d22 100%);
    border: none;
    border-radius: 13px;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

    .mby-btn:hover {
        transform: scale(1.04);
    }

    .mby-btn:active {
        transform: scale(0.97);
    }

    /* Shimmer sweep */
    .mby-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
        transition: left 0.5s ease;
        z-index: 3;
        pointer-events: none;
    }

    .mby-btn:hover::before {
        left: 100%;
    }

    /* Inner border */
    .mby-btn::after {
        content: '';
        position: absolute;
        inset: 2px;
        border-radius: 11px;
        border: 1px solid rgba(255,255,255,0.12);
        pointer-events: none;
        z-index: 6;
    }

/* ============================================================
   COLOR FILL — scaleY from bottom + color cycle
   Key: scaleY handles reveal (via transition),
        background-color cycles (via animation).
        They touch different CSS properties — no conflict.
   ============================================================ */

.mby-btn__fill {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 13px;
    /* Hidden below button — clip-path avoids any transform conflict */
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    /* Color cycle paused until hover */
    background-color: var(--color-primary);
    animation: mby-color-cycle 5s linear infinite paused;
}

.mby-btn:hover .mby-btn__fill {
    clip-path: inset(0% 0 0 0); /* fully revealed from bottom */
    animation-play-state: running;
}

/* Each color holds ~25%, then smoothly blends into the next */
@keyframes mby-color-cycle {
    0% {
        background-color: var(--color-primary);
    }
    /* purple      — hold */
    25% {
        background-color: var(--color-primary);
    }

    35% {
        background-color: var(--color-accent);
    }
    /* olive green — hold */
    60% {
        background-color: var(--color-accent);
    }

    70% {
        background-color: var(--color-tertiary);
    }
    /* blue-gray   — hold */
    92% {
        background-color: var(--color-tertiary);
    }

    100% {
        background-color: var(--color-primary);
    }
    /* back to purple */
}

/* ── Everything above the fill ── */
.mby-btn__text,
.mby-btn__icon,
.mby-btn__sparkle,
.mby-btn__pulse {
    position: relative;
    z-index: 4;
}

/* Text shimmer */
.mby-btn__text {
    background: linear-gradient(90deg, #ffffff, #dddddd, #ffffff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: mby-text-shimmer 2.5s linear infinite;
}

@keyframes mby-text-shimmer {
    to {
        background-position: 200% center;
    }
}

/* Arrow */
.mby-btn__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mby-btn:hover .mby-btn__icon {
    animation: mby-icon-bounce 0.6s ease infinite;
}

@keyframes mby-icon-bounce {
    0%, 100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(6px);
    }
}

/* Sparkles */
.mby-btn__sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

    .mby-btn__sparkle:nth-of-type(2) {
        left: 12%;
        bottom: 25%;
    }

    .mby-btn__sparkle:nth-of-type(3) {
        left: 28%;
        bottom: 35%;
    }

    .mby-btn__sparkle:nth-of-type(4) {
        left: 50%;
        bottom: 20%;
    }

    .mby-btn__sparkle:nth-of-type(5) {
        left: 72%;
        bottom: 30%;
    }

    .mby-btn__sparkle:nth-of-type(6) {
        left: 88%;
        bottom: 25%;
    }

.mby-btn:hover .mby-btn__sparkle {
    animation: mby-sparkle-float 1.5s ease-in-out infinite;
}

    .mby-btn:hover .mby-btn__sparkle:nth-of-type(2) {
        animation-delay: 0.0s;
    }

    .mby-btn:hover .mby-btn__sparkle:nth-of-type(3) {
        animation-delay: 0.2s;
    }

    .mby-btn:hover .mby-btn__sparkle:nth-of-type(4) {
        animation-delay: 0.4s;
    }

    .mby-btn:hover .mby-btn__sparkle:nth-of-type(5) {
        animation-delay: 0.6s;
    }

    .mby-btn:hover .mby-btn__sparkle:nth-of-type(6) {
        animation-delay: 0.8s;
    }

@keyframes mby-sparkle-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0);
    }
}

/* Pulse rings */
.mby-btn__pulse {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    border: 2px solid rgba(255,255,255,0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.mby-btn:hover .mby-btn__pulse {
    animation: mby-pulse-expand 1.5s ease-out infinite;
}

    .mby-btn:hover .mby-btn__pulse:nth-of-type(7) {
        animation-delay: 0.0s;
    }

    .mby-btn:hover .mby-btn__pulse:nth-of-type(8) {
        animation-delay: 0.5s;
    }

    .mby-btn:hover .mby-btn__pulse:nth-of-type(9) {
        animation-delay: 1.0s;
    }

@keyframes mby-pulse-expand {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* ── Image ── */
.mby-hero__image-wrap {
    position: relative;
}

.mby-hero__image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 24px 64px rgba(var(--color-primary-rgb), 0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
}

.mby-hero__image-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: var(--color-accent);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    opacity: 0.85;
    z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .mby-hero {
        padding: 60px 56px 68px;
    }

    .mby-hero__layout {
        gap: 56px;
    }
}

@media (max-width: 1100px) {
    .mby-hero__layout {
        grid-template-columns: 1fr 1.3fr;
        gap: 48px;
    }
}

@media (max-width: 900px) {
    .mby-hero {
        padding: 48px 32px 52px;
    }

    .mby-hero__layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mby-hero__image-wrap {
        order: -1;
    }

    .mby-hero__image {
        aspect-ratio: 16 / 9;
    }

    .mby-hero__content::before {
        display: none;
    }

    .mby-hero__logo {
        height: 52px;
    }
}

@media (max-width: 480px) {
    .mby-hero {
        padding: 36px 20px 44px;
    }

    .mby-hero__title {
        font-size: clamp(2.4rem, 10vw, 3.2rem) !important;
    }

    .mby-btn {
        padding: 16px 28px;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mby-btn-wrap, .mby-btn-wrap::before, .mby-btn__text {
        animation: none;
    }

    .mby-btn__fill {
        transition: none;
        animation: none !important;
    }

    .mby-btn:hover .mby-btn__sparkle,
    .mby-btn:hover .mby-btn__pulse,
    .mby-btn:hover .mby-btn__icon {
        animation: none;
    }

    .mby-btn::before {
        transition: none;
    }
}
