/* === ReactBits Effects (ported to vanilla CSS) === */
/* Source: https://github.com/DavidHDev/react-bits (MIT) */

/* --- @property for StarBorder animation --- */
@property --rb-border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* === Text Animations === */

/* --- GradientText --- */
.rb-gradient-text {
    background: linear-gradient(270deg, #76b900, #00b4d8, #76b900);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rb-gradient-shift 4s ease infinite;
}

@keyframes rb-gradient-shift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* --- BlurText --- */
.rb-blur-reveal {
    filter: blur(8px);
    opacity: 0;
    transition: filter 0.8s ease-out, opacity 0.8s ease-out;
}

.rb-blur-reveal.rb-visible {
    filter: blur(0);
    opacity: 1;
}

/* --- ScrollFloat --- */
.rb-scroll-float {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.rb-scroll-float.rb-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ShinyText --- */
.rb-shiny-text {
    background: linear-gradient(
        120deg,
        var(--rb-text-color, #ffffff) 40%,
        rgba(255, 255, 255, 0.8) 50%,
        var(--rb-text-color, #ffffff) 60%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rb-shiny-sweep 3s linear infinite;
}

@keyframes rb-shiny-sweep {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* --- FadeContent --- */
.rb-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.rb-fade-in.rb-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- AnimatedContent (staggered children) --- */
.rb-animated-content > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.rb-animated-content.rb-visible > *:nth-child(1) { transition-delay: 0s; }
.rb-animated-content.rb-visible > *:nth-child(2) { transition-delay: 0.1s; }
.rb-animated-content.rb-visible > *:nth-child(3) { transition-delay: 0.15s; }
.rb-animated-content.rb-visible > *:nth-child(4) { transition-delay: 0.2s; }
.rb-animated-content.rb-visible > *:nth-child(5) { transition-delay: 0.25s; }
.rb-animated-content.rb-visible > *:nth-child(n+6) { transition-delay: 0.3s; }

.rb-animated-content.rb-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* === Backgrounds === */

/* --- Aurora --- */
.rb-aurora {
    position: relative;
    overflow: hidden;
    background: #0a0a1a;
}

.rb-aurora::before,
.rb-aurora::after {
    content: "";
    position: absolute;
    inset: -50%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    z-index: 0;
    will-change: transform, filter;
    animation: rb-aurora-move 8s ease-in-out infinite alternate;
}

.rb-aurora::before {
    background: radial-gradient(circle, #76b900 0%, transparent 70%);
}

.rb-aurora::after {
    background: radial-gradient(circle, #00b4d8 0%, transparent 70%);
    animation-delay: -4s;
    animation-direction: alternate-reverse;
}

@keyframes rb-aurora-move {
    0% { transform: translate(-20%, -20%) scale(1); }
    100% { transform: translate(20%, 20%) scale(1.2); }
}

/* Aurora light mode */
html[data-theme="light"] .rb-aurora {
    background: #f0f4f8;
}

html[data-theme="light"] .rb-aurora::before {
    background: radial-gradient(circle, rgba(118, 185, 0, 0.3) 0%, transparent 70%);
    opacity: 0.4;
}

html[data-theme="light"] .rb-aurora::after {
    background: radial-gradient(circle, rgba(0, 180, 216, 0.3) 0%, transparent 70%);
    opacity: 0.4;
}

/* Aurora z-index: hero content must sit above pseudo-elements */
.rb-aurora .hero-section__label,
.rb-aurora .hero-section__title,
.rb-aurora .hero-section__subtitle,
.rb-aurora .hero-section__cta {
    position: relative;
    z-index: 1;
}

/* === Card/UI Effects === */

/* --- TiltedCard --- */
.rb-tilt {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
}

/* --- SpotlightCard --- */
.rb-spotlight {
    position: relative;
    overflow: hidden;
}

.rb-spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        300px circle at var(--rb-mouse-x, 50%) var(--rb-mouse-y, 50%),
        rgba(118, 185, 0, 0.15),
        transparent 60%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.rb-spotlight:hover::before {
    opacity: 1;
}

/* --- StarBorder --- */
.rb-star-border {
    position: relative;
    overflow: visible;
}

.rb-star-border::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--rb-border-angle, 0deg),
        transparent 40%,
        #76b900 50%,
        transparent 60%
    );
    z-index: -1;
    animation: rb-star-rotate 4s linear infinite;
}

@keyframes rb-star-rotate {
    to { --rb-border-angle: 360deg; }
}

/* === Accessibility: Reduced Motion === */

@media (prefers-reduced-motion: reduce) {
    .rb-gradient-text,
    .rb-shiny-text {
        animation: none;
    }

    .rb-aurora::before,
    .rb-aurora::after {
        animation: none;
    }

    .rb-star-border::after {
        animation: none;
    }

    .rb-blur-reveal,
    .rb-scroll-float,
    .rb-fade-in,
    .rb-animated-content > * {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}
