/* Base Styles */
body {
    cursor: none;
    /* We use a custom cursor */
    background-color: #FFFDF5;
    background-image:
        radial-gradient(#000 1px, transparent 1px),
        linear-gradient(to right, #e5e5e5 1px, transparent 1px),
        linear-gradient(to bottom, #e5e5e5 1px, transparent 1px);
    background-size: 40px 40px, 100px 100px, 100px 100px;
}

/* Custom Cursor */
#cursor {
    pointer-events: none;
    position: fixed;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.2s, height 0.2s, background-color 0.2s, transform 0.1s;
}

/* Animations */
.marquee-container {
    overflow: hidden;
}

.marquee-content {
    display: flex;
    animation: scroll 40s linear infinite;
    width: max-content;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

.marquee-content-reverse {
    display: inline-block;
    animation: scroll-reverse 20s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Glitch Effect on Hover */
.glitch-hover:hover {
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #FF2A2A;
}

@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

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

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

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

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

    100% {
        transform: translate(0)
    }
}

/* Loading Screen */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

#loader .loader-grid {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image:
        linear-gradient(#333 1px, transparent 1px),
        linear-gradient(90deg, #333 1px, transparent 1px);
    background-size: 40px 40px;
}

#loader .loader-bar {
    width: 0%;
    height: 6px;
    background: #33FF57;
    border: 2px solid #33FF57;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(51, 255, 87, 0.4);
}

#loader .loader-text {
    font-family: 'JetBrains Mono', monospace;
    color: #33FF57;
    font-size: 12px;
    letter-spacing: 0.1em;
}

#loader .loader-title {
    font-family: 'Space Grotesk', sans-serif;
    color: #FFFDF5;
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.85;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

#loader .loader-shape-1 {
    position: absolute;
    top: 15%;
    left: 10%;
    width: 40px;
    height: 40px;
    background: #FBFF48;
    border: 3px solid #FFFDF5;
    animation: loader-spin 2s linear infinite;
}

#loader .loader-shape-2 {
    position: absolute;
    bottom: 20%;
    right: 12%;
    width: 50px;
    height: 50px;
    background: #FF70A6;
    border-radius: 50%;
    border: 3px solid #FFFDF5;
    animation: loader-pulse 1.5s ease-in-out infinite;
}

#loader .loader-shape-3 {
    position: absolute;
    top: 25%;
    right: 20%;
    width: 30px;
    height: 30px;
    background: #3B82F6;
    border: 3px solid #FFFDF5;
    animation: loader-spin 3s linear infinite reverse;
    transform: rotate(45deg);
}

@keyframes loader-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes loader-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes loader-glitch {

    0%,
    100% {
        text-shadow: 2px 0 #FF2A2A, -2px 0 #3B82F6;
    }

    25% {
        text-shadow: -2px 2px #FF2A2A, 2px -2px #3B82F6;
    }

    50% {
        text-shadow: 2px -2px #33FF57, -2px 2px #FF70A6;
    }

    75% {
        text-shadow: -1px -1px #FBFF48, 1px 1px #A855F7;
    }
}

body.loading {
    overflow: hidden;
}

/* Flip Card */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
}

.group:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-card-front {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flip-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {

    /* Flip Card - Show image by default */
    .flip-card-inner {
        transform: rotateY(180deg);
    }

    /* Loader Responsive Styles */
    #loader .loader-shape-1 {
        width: 30px;
        height: 30px;
        top: 10%;
        left: 5%;
    }

    #loader .loader-shape-2 {
        width: 40px;
        height: 40px;
        bottom: 15%;
        right: 8%;
    }

    #loader .loader-shape-3 {
        width: 20px;
        height: 20px;
        top: 20%;
        right: 10%;
    }

    #loader .loader-title {
        font-size: 15vw;
        /* Larger on mobile for impact */
    }
}

/* Text Stroke Responsive Class */
.text-stroke-responsive {
    -webkit-text-stroke: 1px black;
}

@media (min-width: 768px) {
    .text-stroke-responsive {
        -webkit-text-stroke: 3px black;
    }
}
