/* ============================================================
   🦎 Neon Gremlin — Linktree Style
   "An arcade cabinet found abandoned in a swamp."
   ============================================================ */

/* --- CSS Custom Properties (Brand Tokens) --- */
:root {
    --toxic-green: #39FF14;
    --toxic-green-dim: #39ff1433;
    --toxic-green-mid: #39ff1466;
    --laser-pink: #FF007F;
    --laser-pink-dim: #ff007f33;
    --crimson-red: #FF073A;
    --scrapheap-gray: #1A1A24;
    --scrapheap-gray-light: #22222E;
    --scrapheap-gray-lighter: #2A2A38;
    --moss-green: #1B3A2A;
    --moss-green-dark: #0F2219;
    --swamp-teal: #0D4F4F;
    --text-primary: #E8E8EC;
    --text-secondary: #9A9AAE;
    --text-dim: #5E5E72;

    --font-terminal: 'VT323', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-glow-green: 0 0 20px var(--toxic-green-dim), 0 0 60px rgba(57, 255, 20, 0.08);
    --shadow-glow-pink: 0 0 20px var(--laser-pink-dim), 0 0 60px rgba(255, 0, 127, 0.08);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--scrapheap-gray);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;

    /* Swamp gradient background */
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(27, 58, 42, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(13, 79, 79, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 26, 36, 1) 0%, rgba(15, 15, 22, 1) 100%);
    background-attachment: fixed;
}

/* --- Animated Background Particles (Fireflies / Spores) --- */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: float-particle linear infinite;
    opacity: 0;
}

.particle--green {
    background: var(--toxic-green);
    box-shadow: 0 0 6px var(--toxic-green), 0 0 12px var(--toxic-green-dim);
}

.particle--pink {
    background: var(--laser-pink);
    box-shadow: 0 0 6px var(--laser-pink), 0 0 12px var(--laser-pink-dim);
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
        transform: translateY(90vh) translateX(10px) scale(1);
    }
    50% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.6;
        transform: translateY(10vh) translateX(-10px) scale(0.8);
    }
    100% {
        transform: translateY(-5vh) translateX(5px) scale(0);
        opacity: 0;
    }
}

/* --- CRT Scanline Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    animation: scanline-flicker 8s ease-in-out infinite;
}

@keyframes scanline-flicker {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.25; }
}

/* --- Container --- */
.container {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Profile Section --- */
.profile {
    text-align: center;
    margin-bottom: 36px;
}

.avatar-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--moss-green-dark), var(--scrapheap-gray-lighter));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 3px solid var(--toxic-green);
    box-shadow: var(--shadow-glow-green);
}

.avatar-emoji {
    font-size: 52px;
    filter: drop-shadow(0 0 8px var(--toxic-green-dim));
}

.ring-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--toxic-green),
        var(--laser-pink),
        var(--toxic-green),
        transparent,
        var(--toxic-green)
    );
    z-index: 1;
    opacity: 0.5;
    animation: ring-spin 6s linear infinite;
    filter: blur(4px);
}

@keyframes ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.username {
    font-family: var(--font-terminal);
    font-size: 2.4rem;
    color: var(--toxic-green);
    letter-spacing: 2px;
    text-shadow: 
        0 0 10px var(--toxic-green-dim),
        0 0 30px rgba(57, 255, 20, 0.15);
    margin-bottom: 6px;
    animation: text-glow-pulse 3s ease-in-out infinite;
}

@keyframes text-glow-pulse {
    0%, 100% { 
        text-shadow: 
            0 0 10px var(--toxic-green-dim),
            0 0 30px rgba(57, 255, 20, 0.15);
    }
    50% { 
        text-shadow: 
            0 0 15px var(--toxic-green-mid),
            0 0 40px rgba(57, 255, 20, 0.25);
    }
}

.tagline {
    font-family: var(--font-terminal);
    font-size: 1.1rem;
    color: var(--laser-pink);
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-shadow: 0 0 8px var(--laser-pink-dim);
}

.bio {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 320px;
    margin: 0 auto 16px;
}

.status-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(57, 255, 20, 0.06);
    border: 1px solid rgba(57, 255, 20, 0.15);
    border-radius: 100px;
    padding: 5px 16px;
    font-family: var(--font-terminal);
    font-size: 0.85rem;
    color: var(--toxic-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--toxic-green);
    animation: dot-blink 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--toxic-green);
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-text {
    letter-spacing: 1px;
}

/* --- Link Cards --- */
.links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, 
        rgba(34, 34, 46, 0.85), 
        rgba(42, 42, 56, 0.65)
    );
    border: 1px solid rgba(57, 255, 20, 0.1);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(57, 255, 20, 0.04),
        transparent
    );
    transition: left 0.6s ease;
}

.link-card:hover::before {
    left: 100%;
}

.link-card:hover {
    border-color: rgba(57, 255, 20, 0.4);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 4px 20px rgba(57, 255, 20, 0.1),
        0 0 0 1px rgba(57, 255, 20, 0.15);
    background: linear-gradient(135deg, 
        rgba(34, 34, 46, 0.95), 
        rgba(42, 42, 56, 0.8)
    );
}

.link-card:active {
    transform: translateY(0) scale(0.99);
}

/* Highlight variant for Ko-fi */
.link-card--highlight {
    border-color: rgba(255, 0, 127, 0.2);
    background: linear-gradient(135deg, 
        rgba(50, 26, 40, 0.85), 
        rgba(42, 42, 56, 0.65)
    );
}

.link-card--highlight:hover {
    border-color: rgba(255, 0, 127, 0.5);
    box-shadow: 
        0 4px 20px rgba(255, 0, 127, 0.12),
        0 0 0 1px rgba(255, 0, 127, 0.2);
}

.link-card--highlight .link-icon {
    color: var(--laser-pink);
    background: rgba(255, 0, 127, 0.1);
}

.link-card--highlight::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 0, 127, 0.04),
        transparent
    );
}

.link-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(57, 255, 20, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--toxic-green);
    transition: all 0.3s ease;
}

.link-icon svg {
    width: 20px;
    height: 20px;
}

.link-card:hover .link-icon {
    transform: scale(1.1);
    background: rgba(57, 255, 20, 0.15);
}

.link-card--highlight:hover .link-icon {
    background: rgba(255, 0, 127, 0.2);
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.link-subtitle {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    flex-shrink: 0;
    font-family: var(--font-terminal);
    font-size: 1.4rem;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.link-card:hover .link-arrow {
    color: var(--toxic-green);
    transform: translateX(4px);
}

.link-card--highlight:hover .link-arrow {
    color: var(--laser-pink);
}

/* --- Platform-specific icon tints on hover --- */
#link-twitch:hover .link-icon { color: #9146FF; background: rgba(145, 70, 255, 0.12); }
#link-youtube:hover .link-icon { color: #FF0000; background: rgba(255, 0, 0, 0.12); }
#link-discord:hover .link-icon { color: #5865F2; background: rgba(88, 101, 242, 0.12); }
#link-instagram:hover .link-icon { color: #E4405F; background: rgba(228, 64, 95, 0.12); }
#link-github:hover .link-icon { color: #FFFFFF; background: rgba(255, 255, 255, 0.1); }

#link-twitch:hover { border-color: rgba(145, 70, 255, 0.35); box-shadow: 0 4px 20px rgba(145, 70, 255, 0.1); }
#link-youtube:hover { border-color: rgba(255, 0, 0, 0.3); box-shadow: 0 4px 20px rgba(255, 0, 0, 0.08); }
#link-discord:hover { border-color: rgba(88, 101, 242, 0.35); box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1); }
#link-instagram:hover { border-color: rgba(228, 64, 95, 0.3); box-shadow: 0 4px 20px rgba(228, 64, 95, 0.08); }
#link-github:hover { border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 4px 20px rgba(255, 255, 255, 0.06); }

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
}

.footer-terminal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-terminal);
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    padding: 6px 14px;
    background: rgba(26, 26, 36, 0.8);
    border: 1px solid rgba(57, 255, 20, 0.08);
    border-radius: var(--radius-sm);
}

.terminal-prompt {
    color: var(--toxic-green);
}

.terminal-text {
    color: var(--text-secondary);
}

.terminal-cursor {
    color: var(--toxic-green);
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.footer-copy {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* --- Entrance Animations --- */
.profile {
    animation: fade-up 0.8s ease-out;
}

.link-card {
    animation: fade-up 0.6s ease-out both;
}

.link-card:nth-child(1) { animation-delay: 0.1s; }
.link-card:nth-child(2) { animation-delay: 0.18s; }
.link-card:nth-child(3) { animation-delay: 0.26s; }
.link-card:nth-child(4) { animation-delay: 0.34s; }
.link-card:nth-child(5) { animation-delay: 0.42s; }
.link-card:nth-child(6) { animation-delay: 0.50s; }

.footer {
    animation: fade-up 0.6s ease-out 0.6s both;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .container {
        padding: 30px 16px 50px;
    }

    .username {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .link-card {
        padding: 12px 14px;
    }
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scanlines {
        display: none;
    }

    .ring-glow {
        animation: none;
        opacity: 0.3;
    }

    .particle {
        display: none;
    }
}

/* --- Selection Color --- */
::selection {
    background: var(--toxic-green);
    color: var(--scrapheap-gray);
}
