/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Prevent layout shifts */
#techStack {
    contain: layout style;
}

/* Smooth transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hardware acceleration for animations */
.animate-on-scroll,
.card-hover,
#techStack>div {
    will-change: auto;
    transform: none;
}

/* Optimize hover effects */
.card-hover:hover {
    transform: translateY(-2px) translateZ(0);
}

/* Prevent flash of unstyled content */
#techStack>div {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Parallax animations */
.parallax-float {
    animation: parallax-float 6s ease-in-out infinite;
}

.parallax-slide-up {
    animation: parallax-slide-up 8s ease-in-out infinite;
}

.parallax-slide-down {
    animation: parallax-slide-down 10s ease-in-out infinite;
}

@keyframes parallax-float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-10px) rotate(2deg);
    }

    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

@keyframes parallax-slide-up {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes parallax-slide-down {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(3px);
    }
}

/* New animation types for standards section */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.8s ease-out 0.2s forwards;
}

.slide-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s ease-out 0.4s forwards;
}

.bounce-in {
    opacity: 0;
    transform: scale(0.3);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.rotate-in {
    transform: rotate(-180deg) scale(0);
    animation: rotateIn 0.8s ease-out 0.3s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    to {
        transform: rotate(0deg) scale(1);
    }
}







@media (max-width: 640px) {
    #standardTitle {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        padding: 0 1rem;
    }

    #standardDescription {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        padding: 0 1rem;
        margin-top: 0.75rem !important;
    }

    .about-card {
        min-height: 500px !important;
    }
}

@media (max-width: 480px) {
    #standardTitle {
        font-size: 1.125rem !important;
    }

    #standardDescription {
        font-size: 0.8125rem !important;
    }
}

/* Unique scroll animations */
.scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.scroll-reveal.revealed {
    opacity: 1 !important;
    transform: none !important;
}

.scroll-rotate {
    transition: transform 0.3s ease-out;
}

.scroll-wave {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-morph {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

.glitch-text {
    position: relative;
    animation: glitch 2s infinite;
}

@keyframes glitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

.grid-pattern {
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(49, 100, 244, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(49, 100, 244, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.dots-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(49, 100, 244, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: dotsFloat 15s ease-in-out infinite;
}

@keyframes dotsFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Simple section transitions */
section {
    transition: opacity 0.3s ease;
}

/* Glassmorphism Header Animations */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

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

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

.animate-gradient-shift {
    animation: gradient-shift 3s ease infinite;
}

@keyframes slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-down {
    animation: slide-down 0.5s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slide-in 0.4s ease-out forwards;
}

/* Realistic Butterfly Animation Styles */
.butterfly {
    position: fixed;
    width: 40px;
    height: 40px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
    transition: top 2s cubic-bezier(0.25, 1, 0.5, 1), left 2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease-out, transform 0.5s ease-out;
    transform-style: preserve-3d;
}

.butterfly-body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 16px;
    background: #333;
    border-radius: 2px;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.wing {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 30px;
    background: radial-gradient(circle at 100% 100%, transparent 40%, var(--wing-color, #3164f4) 41%);
    border-radius: 10px;
    transform-origin: 100% 50%;
    animation: flap 0.4s infinite ease-in-out;
}

.wing.left {
    left: 50%;
    transform: translateY(-50%) rotateY(180deg);
}

.wing.right {
    right: 50%;
    transform: translateY(-50%);
}

.wing::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, transparent 40%, var(--wing-color-2, #1eaaf1) 41%);
    border-radius: 10px;
    opacity: 0.7;
}

.wing.forewing {
    width: 22px;
    height: 25px;
    top: 15%;
}

.wing.hindwing {
    width: 18px;
    height: 20px;
    top: 55%;
}

.wing.left.forewing {
    animation-delay: -0.2s;
}

.wing.right.forewing {
    animation-delay: -0.2s;
}

@keyframes flap {

    0%,
    100% {
        transform: translateY(-50%) rotateX(20deg);
    }

    50% {
        transform: translateY(-50%) rotateX(100deg);
    }
}

.wing.left.forewing,
.wing.left.hindwing {
    transform-origin: 100% 50%;
}

.wing.right.forewing,
.wing.right.hindwing {
    transform-origin: 0% 50%;
}

/* Sparkle Trail Styles */
.sparkle-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 9999;
    /* Just below butterflies */
    pointer-events: none;
    opacity: 0;
    animation: sparkle-fade 0.8s ease-out forwards;
    background-color: var(--sparkle-color, white);
    box-shadow: 0 0 10px 2px var(--sparkle-color, white);
}

@keyframes sparkle-fade {
    0% {
        opacity: 0.8;
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: scale(0) translateY(-30px);
    }
}

/* Privacy Policy Card Styles */
#privacyPolicyOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

#privacyPolicyOverlay.show {
    opacity: 1;
    pointer-events: auto;
}

#privacyPolicyCard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 75vh;
    overflow-y: auto;
}

#privacyPolicyCard.show {
    transform: translateY(0);
}

/* Clear Glass Effect for Solithub Logo */
.glass-container {
    perspective: 1000px;
}

.glass-card {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

/* The glare pseudo-element */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--x) var(--y), rgba(255, 255, 255, 0.6), transparent 35%);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.glass-container:hover .glass-card::before,
#soilStyleHeader:hover::before {
    opacity: 1;
}

/* Sparkle Burst Animation */
@keyframes sparkle-burst {
    0% {
        opacity: 0.8;
        transform: scale(1.2) translate(0, 0);
    }

    100% {
        opacity: 0;
        transform: scale(0) translate(var(--translateX), var(--translateY));
    }
}