:root {
    --accent-color: #bf00ff;
    --accent-glow: rgba(191, 0, 255, 0.4);
    --obsidian: #0a0510;
    --slate-gray: #807090;
    --terminal-bg: rgba(20, 10, 30, 0.85);
    --mint-gray: #e6d8f0;
    --font-heading: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--obsidian);
    color: var(--mint-gray);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

/* Moving Grid Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(191, 0, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 0, 255, .05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: -2;
    transform: translate(-25%, -25%);
}

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

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

/* CRT Scanlines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1) 0px,
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 100;
}

.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    width: 90%;
}

h1.glitch {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 900;
    color: var(--accent-color);
    letter-spacing: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 0 0 15px var(--accent-glow);
    animation: glitch 5s infinite;
}

h1.glitch::before,
h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    clip: rect(0, 900px, 0, 0);
}

h1.glitch::before {
    left: -2px;
    text-shadow: 2px 0 #ff0080;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

h1.glitch::after {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        text-shadow: 0 0 15px var(--accent-glow);
        transform: skew(0);
    }

    92% {
        text-shadow: -2px 0 #ff0080, 2px 0 #ff00ff;
        transform: skew(2deg);
    }

    94% {
        text-shadow: 2px 0 #ff0080, -2px 0 #ff00ff;
        transform: skew(-2deg);
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(40px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(60px, 9999px, 50px, 0);
    }

    60% {
        clip: rect(80px, 9999px, 70px, 0);
    }

    80% {
        clip: rect(100px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(120px, 9999px, 110px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(10px, 9999px, 20px, 0);
    }

    20% {
        clip: rect(30px, 9999px, 40px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 60px, 0);
    }

    60% {
        clip: rect(70px, 9999px, 80px, 0);
    }

    80% {
        clip: rect(90px, 9999px, 100px, 0);
    }

    100% {
        clip: rect(110px, 9999px, 120px, 0);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--slate-gray);
    letter-spacing: 0.3rem;
    margin-bottom: 4rem;
}

/* Terminal Component */
.terminal {
    background: var(--terminal-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 0;
    text-align: left;
    box-shadow: 0 0 40px var(--accent-glow),
        inset 0 0 30px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    backdrop-filter: blur(15px);
}

.terminal-header {
    background: rgba(191, 0, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(191, 0, 255, 0.25);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #ff5f56;
}

.terminal-dot.yellow {
    background: #ffbd2e;
}

.terminal-dot.green {
    background: #27ca40;
}

.terminal-title {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-color);
    opacity: 0.7;
}

.terminal-content {
    padding: 1.5rem 2rem;
    font-size: 1rem;
    color: var(--accent-color);
    min-height: 200px;
}

.terminal-line {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.terminal-line::before {
    content: ">";
    opacity: 0.5;
}

#status-text::after {
    content: "█";
    margin-left: 0.2rem;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

#status-text {
    color: var(--accent-color);
    font-weight: bold;
}

/* GitHub Link & Glow Effect */
.github-link {
    display: inline-block;
    margin-top: 4rem;
    color: var(--slate-gray);
    transition: all .3s ease;
    text-decoration: none;
}

.github-link:hover {
    color: var(--mint-gray);
    filter: drop-shadow(0 0 8px var(--accent-color));
    transform: translateY(-2px);
}

.github-link svg {
    display: block;
}

/* Leaf Visual Integration */
.visual-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}

.leaf-visual {
    width: 80%;
    max-width: 1200px;
    opacity: 0.15;
    filter: blur(4px) brightness(1.1);
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 70%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 70%);
    animation: breathingLeaf 15s ease-in-out infinite;
}

@keyframes breathingLeaf {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.1;
        filter: blur(4px) brightness(1);
    }

    50% {
        transform: scale(1.03) rotate(0.5deg);
        opacity: 0.2;
        filter: blur(3px) brightness(1.2);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaf-visual {
        width: 150%;
        opacity: 0.15;
    }
}

/* Interactive Impact Glitch */
.impact-glitch {
    animation: impact-glitch-anim 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
}

@keyframes impact-glitch-anim {
    0% {
        transform: translate(0);
        filter: brightness(1) contrast(1);
    }
    10% {
        transform: translate(-10px, -5px) skew(5deg);
        filter: brightness(2) contrast(1.5) hue-rotate(90deg);
    }
    30% {
        transform: translate(10px, 5px) skew(-5deg);
        filter: brightness(1.5) contrast(2) hue-rotate(180deg);
    }
    50% {
        transform: translate(-5px, 10px) skew(2deg);
        filter: brightness(2) contrast(1.2) hue-rotate(270deg);
    }
    70% {
        transform: translate(5px, -10px) skew(-2deg);
        filter: brightness(1.2) contrast(1.8) hue-rotate(360deg);
    }
    90% {
        transform: translate(-2px, 2px);
        filter: brightness(1.5) contrast(1.1);
    }
    100% {
        transform: translate(0);
        filter: brightness(1) contrast(1);
    }
}