/* ReactBits-inspired Animations */

/* 1. Gradient Text Effect (Ported from ReactBits GradientText) */
:root {
    --grad-c1: #5227FF;
    --grad-c2: #FF9FFC;
    --grad-c3: #B19EEF;
    --grad-speed: 8s;
}

.gradient-text-animated {
    /* Fallback */
    color: #5227FF;

    /* Config */
    background: linear-gradient(to right,
            var(--grad-c1),
            var(--grad-c2),
            var(--grad-c3),
            var(--grad-c1)) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;

    /* Animation: mimics the yoyo effect */
    animation: gradient-yoyo var(--grad-speed) ease-in-out infinite alternate !important;

    /* Pause on hover prop */
    cursor: pointer;
}

.gradient-text-animated:hover {
    animation-play-state: paused !important;
}

@keyframes gradient-yoyo {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* Scroll-Dependent Gradient (New) */
.scroll-gradient-text {
    background: linear-gradient(to right,
            #ef4444,
            /* red */
            #eab308,
            /* yellow */
            #22c55e,
            /* green */
            #3b82f6,
            /* blue */
            #a855f7,
            /* purple */
            #ec4899
            /* pink */
        );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* The position comes from the JS variable --scroll-p (0 to 1) */
    background-position: calc(var(--scroll-p, 0) * 100%) 50%;
    transition: background-position 0.1s linear;
}

/* Velocity Skew Effect (New) */
.velocity-skew {
    will-change: transform;
    /* skew variable set by JS */
    transform: skewX(var(--skew-x, 0deg));
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-block;
}

/* 2. Spotlight Card Effect */
.spotlight-card {
    position: relative;
    overflow: hidden;
    /* Ensure existing card styles are preserved but override border handling */
    border: 1px solid rgba(226, 232, 240, 0.4);
    /* slate-200 with opacity */
    background-color: rgb(255, 255, 255);
    /* fallback */
    z-index: 1;
}

.spotlight-card::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s;
    /* The magic gradient */
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(99, 102, 241, 0.06),
            /* Indigo tint */
            transparent 40%);
}

.spotlight-card::after {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.5s;
    /* Border Glow */
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(99, 102, 241, 0.3),
            /* Indigo Border */
            transparent 40%);
    /* Use mask to show only border */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    padding: 1px;
    /* Border width */
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
    opacity: 1;
}

/* 3. Blur Reveal Effect (Scroll Animation) */
.reveal-on-scroll {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.2, 0.65, 0.3, 0.9);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Staggered delays for children */
.reveal-group>*:nth-child(1) {
    transition-delay: 100ms;
}

.reveal-group>*:nth-child(2) {
    transition-delay: 200ms;
}

.reveal-group>*:nth-child(3) {
    transition-delay: 300ms;
}

.reveal-group>*:nth-child(4) {
    transition-delay: 400ms;
}

/* 4. Gooey Navigation Styles */
.gooey-nav {
    position: fixed;
    right: 2rem;
    /* approx right-8 in tailwind */
    bottom: 2rem;
    /* approx bottom-8 in tailwind */
    width: 60px;
    height: 60px;
    box-sizing: border-box;
    font-size: 20px;
    text-align: left;
    filter: url("#goo");
    z-index: 100;
}

.menu-item,
.menu-open-button {
    background: #1e293b;
    /* slate-800 */
    border-radius: 100%;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    position: absolute;
    top: 20px;
    color: white;
    text-align: center;
    line-height: 60px;
    transform: translate3d(0, 0, 0);
    transition: transform ease-out 200ms;
}

.menu-open {
    display: none;
}

/* Hamburger Lines */
.lines {
    width: 25px;
    height: 3px;
    background: white;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -12.5px;
    margin-top: -1.5px;
    transition: all 0.2s ease-in-out;
}

.line-1 {
    transform: translate3d(0, -8px, 0);
}

.line-2 {
    transform: translate3d(0, 0, 0);
}

.line-3 {
    transform: translate3d(0, 8px, 0);
}

.menu-open:checked+.menu-open-button .line-1 {
    transform: translate3d(0, 0, 0) rotate(45deg);
}

.menu-open:checked+.menu-open-button .line-2 {
    transform: translate3d(0, 0, 0) scale(0.1, 1);
}

.menu-open:checked+.menu-open-button .line-3 {
    transform: translate3d(0, 0, 0) rotate(-45deg);
}

.menu-item:hover {
    background: #4f46e5;
    /* indigo-600 */
    color: white;
}

.menu-item {
    transition-duration: 180ms;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Trigger opening */
.menu-open-button {
    z-index: 2;
    transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition-duration: 400ms;
    transform: scale(1.1, 1.1) translate3d(0, 0, 0);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.menu-open-button:hover {
    transform: scale(1.2, 1.2) translate3d(0, 0, 0);
    background: #4f46e5;
    /* indigo-600 */
}

.menu-open:checked+.menu-open-button {
    transition-timing-function: linear;
    transition-duration: 200ms;
    transform: scale(0.8, 0.8) translate3d(0, 0, 0);
}

/* Animations for items when opened */
.menu-open:checked~.menu-item {
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Position items vertically upwards */
.menu-open:checked~.item-1 {
    transition-duration: 190ms;
    transform: translate3d(0, -80px, 0);
}

.menu-open:checked~.item-2 {
    transition-duration: 290ms;
    transform: translate3d(0, -160px, 0);
}

.menu-open:checked~.item-3 {
    transition-duration: 390ms;
    transform: translate3d(0, -240px, 0);
}

.menu-open:checked~.item-4 {
    transition-duration: 490ms;
    transform: translate3d(0, -320px, 0);
}

.menu-open:checked~.item-5 {
    transition-duration: 590ms;
    transform: translate3d(0, -400px, 0);
}

.menu-open:checked~.item-6 {
    transition-duration: 690ms;
    transform: translate3d(0, -480px, 0);
}