* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a0f;
    --card-bg: rgba(26, 26, 36, 0.6);
    --card-hover: rgba(40, 40, 56, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b4b4c4;
    --accent: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-glow: rgba(99, 102, 241, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 20s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.container {
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile Section */
.profile-section {
    text-align: center;
    margin-bottom: 4rem;
    animation: slideDown 1s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-container {
    margin-bottom: 2rem;
    display: inline-block;
    position: relative;
}

.avatar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent));
    background-size: 200% 200%;
    animation: gradientRotate 3s ease infinite;
    opacity: 0.3;
    filter: blur(20px);
}

@keyframes gradientRotate {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 50%, #a78bfa 100%);
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 60px rgba(99, 102, 241, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(99, 102, 241, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.avatar:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 
        0 25px 80px rgba(99, 102, 241, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 60px rgba(139, 92, 246, 0.4);
}

.name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.location-icon {
    font-size: 1rem;
}

.location-text {
    font-weight: 500;
}

/* Links Section */
.links-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease-out;
    cursor: pointer;
    position: relative;
    overflow: visible;
    animation: slideUp 0.6s ease-out backwards;
    box-shadow: none;
    will-change: transform;
    transform: translateZ(0); /* Force GPU acceleration */
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}


.link-card:nth-child(1) { animation-delay: 0.05s; }
.link-card:nth-child(2) { animation-delay: 0.1s; }
.link-card:nth-child(3) { animation-delay: 0.15s; }
.link-card:nth-child(4) { animation-delay: 0.2s; }
.link-card:nth-child(5) { animation-delay: 0.25s; }
.link-card:nth-child(6) { animation-delay: 0.3s; }
.link-card:nth-child(7) { animation-delay: 0.35s; }
.link-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.link-card-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    will-change: transform;
    transform: translateZ(0);
}

.link-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    width: 40px;
    height: 40px;
    transition: transform 0.2s ease-out;
    will-change: transform;
    transform: translateZ(0);
}

.link-card:hover .link-card-image,
.link-card:hover .link-card-fallback {
    transform: translateZ(0) scale(1.1);
}


/* Projects Section */
.projects-section {
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.section-underline {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    margin: 0 auto;
    border-radius: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out backwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-glow {
    opacity: 1;
}

.project-card:nth-child(1) { animation-delay: 0.2s; }
.project-card:nth-child(2) { animation-delay: 0.3s; }
.project-card:nth-child(3) { animation-delay: 0.4s; }

.project-card:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.2);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    display: inline-block;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.project-card:hover .project-icon {
    transform: scale(1.15) rotate(-5deg);
}

.project-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.project-link:hover .project-arrow {
    transform: translateX(5px);
}

.project-link:hover {
    color: var(--accent-hover);
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body {
        padding: 3rem 1rem;
    }
    
    .link-card {
        padding: 1.75rem 2.25rem;
    }

    .container {
        max-width: 700px;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .name {
        font-size: 3rem;
    }

    .container {
        max-width: 900px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--accent);
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-hover);
}

/* Additional polish */
.link-card:active {
    transform: translateX(4px) translateY(-1px);
}

.project-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* Admin Link */
.admin-link {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0.6;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-link:hover {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}

/* Avatar image styling */
#avatar-img.avatar {
    object-fit: cover;
    background: none;
}

.avatar-fallback {
    display: block;
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.audio-toggle {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.audio-toggle:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.audio-volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.volume-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: var(--input-bg);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .audio-player {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        justify-content: space-between;
        border-radius: 25px;
    }
    
    .audio-volume-control {
        flex: 1;
        justify-content: flex-end;
    }
    
    .volume-slider {
        width: 60px;
    }
}
