/* Global Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;700&display=swap');

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* --- Theme Utilities --- */

/* Cyberpunk Purple Gradient */
.text-gradient {
    background: linear-gradient(to right, #8b5cf6, #d946ef, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow Effects */
.glow-purple {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.2);
}

.glow-cyan {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
}

/* Background Patterns */
.tech-grid {
    background-image: linear-gradient(rgba(30, 41, 59, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 41, 59, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

.code-block {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 0.5rem;
}

/* --- Animation Utilities (from 404 & Terminal) --- */

/* Terminal Cursor Blink */
.cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background-color: #10b981;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Glitch Effect (Simplifed Wrapper) */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    position: relative;
    color: white;
    font-weight: 700;
    line-height: 1;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
    pointer-events: none;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
    pointer-events: none;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
    }

    40% {
        clip-path: inset(40% 0 60% 0);
    }

    60% {
        clip-path: inset(80% 0 20% 0);
    }

    80% {
        clip-path: inset(10% 0 90% 0);
    }

    100% {
        clip-path: inset(30% 0 70% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 90% 0);
    }

    20% {
        clip-path: inset(30% 0 70% 0);
    }

    40% {
        clip-path: inset(10% 0 50% 0);
    }

    60% {
        clip-path: inset(80% 0 20% 0);
    }

    80% {
        clip-path: inset(50% 0 20% 0);
    }

    100% {
        clip-path: inset(0% 0 80% 0);
    }
}

/* --- 3D Tilt Effect --- */
.tilt-card {
    transition: transform 0.1s ease-out;
    will-change: transform;
    transform-style: preserve-3d;
    position: relative;
    /* overflow: hidden; -> Moved to inner content or handled via mask if needed, but let's keep it for now with fixes */
    overflow: hidden;

    /* Robuster jagged edge fixes */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    /* Force AA */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0);

    /* Fix for border-radius clipping in 3D */
    mask-image: radial-gradient(white, white);
    -webkit-mask-image: -webkit-radial-gradient(white, white);
}

/* Smooth return on mouse leave */
.tilt-card:not(:hover) {
    transition: transform 0.5s ease-out;
}

.tilt-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 10;
    border-radius: inherit;
    /* Follow parent radius */
    opacity: 0;
    transition: opacity 0.5s ease;
}