/* =========================================
   CSS RESET & VARIABLES
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #030303;
    --text: #ffffff;
    --text-muted: #888888;
    --accent: #00e5ff;
    --accent-glow: rgba(0, 229, 255, 0.3);
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.code-font {
    font-family: var(--font-code);
}

.text-gradient {
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--text-muted);
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* =========================================
   BACKGROUND EFFECTS
   ========================================= */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -5;
    pointer-events: none;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.04;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 99;
    position: fixed;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(0, 229, 255, 0.1) 50%, rgba(0,0,0,0) 100%);
    opacity: 0.1;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { top: -100px; }
    100% { top: 100vh; }
}

.vignette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 40%, #000000 120%);
}

/* =========================================
   MAIN LAYOUT (GLASSMORPHISM)
   ========================================= */
.app-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    
    /* Initially hidden for GSAP animation */
    opacity: 0;
    transform: translateY(30px);
}

/* =========================================
   PROFILE SECTION
   ========================================= */
.profile-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.avatar-ring {
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    border-left-color: transparent;
    border-bottom-color: transparent;
    animation: spin 4s linear infinite;
    opacity: 0.5;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    border: 2px solid var(--accent);
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

.name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* =========================================
   GLITCH EFFECT
   ========================================= */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text.is-glitching {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

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

.glitch-text.is-glitching::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    animation: glitch-anim-1 0.2s linear infinite alternate-reverse;
}

.glitch-text.is-glitching::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent);
    animation: glitch-anim-2 0.3s linear infinite alternate-reverse;
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-10deg); }
    40% { transform: skew(10deg); }
    60% { transform: skew(-5deg); }
    80% { transform: skew(5deg); }
    100% { transform: skew(0deg); }
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(2px, -1px); }
    20% { clip-path: inset(30% 0 20% 0); transform: translate(-2px, 1px); }
    40% { clip-path: inset(70% 0 10% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(20% 0 50% 0); transform: translate(-2px, 2px); }
    80% { clip-path: inset(50% 0 30% 0); transform: translate(1px, -1px); }
    100% { clip-path: inset(5% 0 80% 0); transform: translate(-1px, 1px); }
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.coords {
    font-size: 0.65rem;
    color: var(--accent);
    opacity: 0.7;
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.05);
}

/* =========================================
   LINKS SECTION
   ========================================= */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.link-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Initial state for GSAP */
    opacity: 0;
    transform: translateY(20px);
}

.link-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.link-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.link-card i {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
}

.link-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    z-index: 1;
}

.link-card:hover {
    border-color: rgba(0, 229, 255, 0.4);
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px var(--accent-glow);
}

.link-card:hover .link-content i {
    color: var(--accent);
    transform: scale(1.1);
}

.link-card:hover .link-title {
    color: var(--accent);
}

.link-card:hover .link-hover-effect {
    transform: translateX(100%);
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact-section {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.contact-header {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 1.2rem;
    opacity: 0.8;
}

.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-value .arrow {
    color: var(--accent);
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

a.contact-value:hover {
    color: var(--accent);
}

a.contact-value:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    .app-container {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .name {
        font-size: 1.5rem;
    }
    
    .link-card {
        padding: 1rem 1.2rem;
    }
}
