/* --- 1. Variables & Reset --- */
:root {
    --bg-dark: #050511;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: #94a3b8;
    --glow-primary: rgba(99, 102, 241, 0.6); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; 
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* --- 2. BACKGROUND ANIMATIONS --- */
.nebula-bg {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, #1e1e3f 0%, #050511 40%, #000 70%);
    animation: rotateSpace 100s linear infinite;
    z-index: -2;
    opacity: 0.6;
    pointer-events: none;
}

@keyframes rotateSpace {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.background-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: 0; 
    animation: floatAndTwinkle linear infinite;
}

@keyframes floatAndTwinkle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    20% { opacity: 0.8; }
    50% { opacity: 0.4; } 
    80% { opacity: 0.8; } 
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.shooting-star {
    position: absolute;
    top: 50%; left: 50%; height: 2px;
    background: linear-gradient(-45deg, #5f91ff, rgba(0, 0, 255, 0));
    border-radius: 999px;
    filter: drop-shadow(0 0 6px #699bff);
    animation: shoot 3s ease-in-out infinite;
    opacity: 0; width: 0;
}

.shooting-star::before {
    content: ''; position: absolute; top: calc(50% - 1px); right: 0; height: 2px;
    background: linear-gradient(-45deg, rgba(0, 0, 255, 0), #5f91ff, rgba(0, 0, 255, 0));
    transform: translateX(50%) rotateZ(45deg);
    border-radius: 100%;
    animation: shining 3s ease-in-out infinite;
}

@keyframes shoot {
    0% { transform: translateX(0); width: 0; opacity: 1; }
    20% { width: 100px; }
    100% { transform: translateX(300px); width: 0; opacity: 0; }
}

/* --- 3. Layout --- */
.main-container {
    display: flex;
    gap: 3rem;
    width: 90%;
    max-width: 1000px;
    padding: 20px;
    z-index: 10;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 
                inset 0 0 20px rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    transition: transform 0.3s ease;
}

/* --- 4. Profile Section --- */
.profile-section {
    flex: 1;
    max-width: 380px;
    padding: 3.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.profile-section:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.profile-section::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--glow-primary);
    filter: blur(80px);
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    opacity: 0.5;
}

/* --- UPDATED LOGO DARK LIGHT EFFECT --- */
.avatar-box {
    width: 130px; 
    height: 130px;
    background: #fff; 
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    /* Changed border from white to subtle blue */
    border: 2px solid rgba(120, 140, 255, 0.3);
    
    /* THE NEW DARKER BACKLIGHT EFFECT (Deep Blues and Purples) */
    box-shadow: 
        0 0 25px rgba(77, 77, 255, 0.8),   /* Inner intense deep blue */
        0 0 60px rgba(106, 13, 173, 0.6),  /* Middle deep purple halo */
        0 0 100px rgba(35, 0, 100, 0.5);   /* Wide dark ambient indigo */
        
    position: relative;
    overflow: hidden; 
    animation: floatDarkLight 4s ease-in-out infinite; /* Gentle floating movement */
}

/* Updated animation for dark lights */
@keyframes floatDarkLight {
    0%, 100% { 
        transform: translateY(0); 
        box-shadow: 
            0 0 25px rgba(77, 77, 255, 0.8),
            0 0 60px rgba(106, 13, 173, 0.6),
            0 0 100px rgba(35, 0, 100, 0.5);
    }
    50% { 
        transform: translateY(-4px); 
        box-shadow: 
            0 0 35px rgba(90, 90, 255, 0.9), /* Brighter peak */
            0 0 75px rgba(130, 20, 200, 0.7),
            0 0 120px rgba(50, 10, 130, 0.6);
    }
}

.avatar-box::after {
    content: '';
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: #818cf8;
    border-bottom-color: #818cf8;
    animation: spin 10s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 50%;
}

.profile-name {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 30%, #ffefd5 100%); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 239, 213, 0.2);
}

.profile-role {
    font-size: 1rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
    font-weight: 400;
}

.typing-container {
    margin-top: auto;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-text {
    color: #818cf8;
    font-family: 'Times New Roman', Times, serif; 
    font-size: 0.9rem; 
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #818cf8;
    margin-left: 5px;
    animation: blink 0.8s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- 5. Links Section --- */
.links-section {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px; 
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Featured Link (Portfolio) */
.featured-link {
    grid-column: span 2;
    background: rgba(40, 40, 60, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.link-card {
    background: rgba(30, 30, 40, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.link-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%); transition: 0.5s;
}
.link-card:hover::after { transform: translateX(100%); }

.link-card:hover {
    transform: translateY(-5px);
    background: rgba(50, 50, 70, 0.7);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.icon-wrapper {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white; transition: transform 0.3s ease;
}
.link-card:hover .icon-wrapper { transform: scale(1.1) rotate(5deg); }

/* Gradients */
.bg-gradient-1 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.bg-gradient-2 { background: linear-gradient(135deg, #333333, #4a4a4a); }
.bg-gradient-3 { background: linear-gradient(135deg, #0077b5, #00a0dc); }
.bg-gradient-4 { background: linear-gradient(135deg, #1da1f2, #1a91da); }
.bg-gradient-5 { background: linear-gradient(135deg, #fd1d1d, #833ab4); }
.bg-gradient-6 { background: linear-gradient(135deg, #ea580c, #f97316); }

.link-info h3 { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.link-info p { font-size: 0.8rem; color: var(--text-secondary); font-weight: 300; }

/* --- 6. Responsive Mobile Styles --- */
@media (max-width: 850px) {
    body { 
        overflow-y: auto; 
        display: block;   
        padding: 40px 0;
    }
    .main-container { 
        flex-direction: column; 
        width: 90%;
        margin: 0 auto;
        padding: 0;
    }
    .profile-section { width: 100%; max-width: 100%; }
    .links-section { width: 100%; }
    .links-grid { grid-template-columns: 1fr; }
    .featured-link { grid-column: span 1; }
    .nebula-bg { position: fixed; }
}