/*
 * Zirco Motion Hero — signature animated hero (pairs with resources/views/components/motion-hero.blade.php).
 * Self-contained: every class is prefixed "mh-" and the colours come from the custom properties below,
 * which the component sets from its `primary` / `secondary` props.
 */

.mh {
    --mh-primary: #4f46e5;
    --mh-primary-dark: #3730a3;
    --mh-secondary: #06b6d4;
    --mh-text: #1f2130;
    --mh-muted: #6b7280;
    --mh-border: #e5e7eb;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-align: center;
    padding: 6rem 1rem 5rem;
}

/* ---------- Background: drifting glows + panning grid ---------- */

.mh-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}

.mh-glow-1 {
    top: -180px;
    left: 50%;
    width: 640px;
    height: 640px;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--mh-primary) 16%, transparent) 0%,
        color-mix(in srgb, var(--mh-secondary) 8%, transparent) 45%,
        transparent 70%);
    animation: mh-float 8s ease-in-out infinite;
}

.mh-glow-2 {
    top: 40px;
    left: 78%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--mh-secondary) 16%, transparent) 0%,
        color-mix(in srgb, var(--mh-primary) 8%, transparent) 45%,
        transparent 70%);
    animation: mh-drift 11s ease-in-out infinite;
}

@keyframes mh-float {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 24px); }
}

@keyframes mh-drift {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-75%, 40px) scale(1.12); }
}

.mh-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(color-mix(in srgb, var(--mh-primary) 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--mh-primary) 7%, transparent) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 65%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 65%);
    animation: mh-grid-pan 20s linear infinite;
}

@keyframes mh-grid-pan {
    to { background-position: 44px 44px; }
}

/* ---------- Content ---------- */

.mh-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--mh-primary) 9%, #fff);
    color: var(--mh-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.mh-title {
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--mh-text);
    margin: 0 0 1.25rem;
}

.mh-subtitle {
    font-size: 1.15rem;
    color: var(--mh-muted);
    max-width: 480px;
    margin: 0 auto 2.25rem;
}

.mh-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Load-in: badge, subtitle and actions fade up; headline words rise one by one (--i = order) */

.mh-in,
.mh-word {
    animation: mh-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i) * 0.09s + 0.1s);
}

.mh-word {
    display: inline-block;
}

@keyframes mh-rise {
    from {
        opacity: 0;
        transform: translateY(0.6em);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* Highlighted word: shimmering gradient + hand-drawn underline */

.mh-word-accent {
    position: relative;
    background: linear-gradient(90deg, var(--mh-primary), var(--mh-secondary), color-mix(in srgb, var(--mh-primary) 55%, #fff), var(--mh-primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        mh-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 0.09s + 0.1s) both,
        mh-shimmer 6s linear 1s infinite;
}

@keyframes mh-shimmer {
    to { background-position: 300% 0; }
}

.mh-swoosh {
    position: absolute;
    left: 0;
    bottom: -0.12em;
    width: 92%;
    height: 0.28em;
    overflow: visible;
}

.mh-swoosh path {
    fill: none;
    stroke: var(--mh-secondary);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: mh-draw 0.9s ease-out 1s forwards;
}

@keyframes mh-draw {
    to { stroke-dashoffset: 0; }
}

/* ---------- Floating cards (up to 4, one per corner) ---------- */

.mh-chips {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.mh-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem 0.6rem 0.6rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--mh-border);
    border-radius: 14px;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--mh-primary) 14%, transparent);
    text-align: left;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation:
        mh-pop 0.7s cubic-bezier(0.3, 1.4, 0.5, 1) var(--d) both,
        mh-bob 6s ease-in-out calc(var(--d) + 0.7s) infinite;
}

.mh-chip-tl { top: 16%; left: 0; --x: -1; --r: -4deg; --d: 1.1s; }
.mh-chip-tr { top: 12%; right: 1%; --x: 1; --r: 3deg; --d: 1.3s; animation-duration: 0.7s, 7s; }
.mh-chip-bl { top: 66%; left: 3%; --x: -1; --r: 3deg; --d: 1.5s; animation-duration: 0.7s, 6.5s; }
.mh-chip-br { top: 62%; right: 5%; --x: 1; --r: -3deg; --d: 1.7s; animation-duration: 0.7s, 5.5s; }

@keyframes mh-pop {
    from {
        opacity: 0;
        transform: translate(calc(var(--x) * -40px), 20px) scale(0.6) rotate(0deg);
    }
    to {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(var(--r));
    }
}

@keyframes mh-bob {
    0%, 100% { transform: translate(0, 0) rotate(var(--r)); }
    50% { transform: translate(0, -12px) rotate(var(--r)); }
}

.mh-chip-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mh-primary) 9%, #fff);
    color: var(--mh-primary);
    font-weight: 700;
    font-size: 1rem;
}

.mh-chip-icon svg {
    width: 18px;
    height: 18px;
}

.mh-chip-icon-whatsapp {
    background: #25d366;
    color: #fff;
}

.mh-chip-icon-check {
    background: #dcfce7;
    color: #2f855a;
}

/* Notification ping (chip option 'ping' => true) */
.mh-chip-ping .mh-chip-icon::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    animation: mh-ping 2s ease-out 2s infinite;
}

@keyframes mh-ping {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70%, 100% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.mh-chip-text strong,
.mh-chip-text small {
    display: block;
    line-height: 1.25;
}

.mh-chip-text strong {
    font-size: 0.82rem;
    color: var(--mh-text);
}

.mh-chip-text small {
    font-size: 0.72rem;
    color: var(--mh-muted);
}

/* Solid "price" card: small label over a big value */
.mh-chip-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--mh-primary), var(--mh-primary-dark));
    border-color: transparent;
    color: #fff;
}

.mh-chip-price small {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.mh-chip-price strong {
    font-size: 1.2rem;
    line-height: 1.1;
}

/* Cards need room beside the headline — hide them on smaller screens */
@media (max-width: 1180px) {
    .mh-chips {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mh *,
    .mh *::after {
        animation: none !important;
    }

    .mh-swoosh path {
        stroke-dashoffset: 0;
    }
}
