/* ===== CSS VARIABLES ===== */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(15, 23, 42, 0.8);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-accent: #0ea5e9;
    
    --border: rgba(30, 41, 59, 0.5);
    --border-light: rgba(100, 116, 139, 0.2);
    --border-accent: rgba(14, 165, 233, 0.3);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
    
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    --gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    
    --animation-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --animation-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --animation-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --animation-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== UTILITIES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all var(--animation-normal);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border: 1px solid var(--border-accent);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(14, 165, 233, 0.2);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.section-padding {
    padding: 6rem 0;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--animation-normal);
}

.header.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    padding: 0.5rem 0;
    transition: all var(--animation-normal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--animation-normal);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--animation-normal);
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav-link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all var(--animation-normal);
}

.mobile-nav-link:hover {
    color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    animation: floatBackground 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(14, 165, 233, 0.3) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.1;
    mask: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

@keyframes floatBackground {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-10px, -20px) rotate(0.5deg); }
    66% { transform: translate(10px, -10px) rotate(-0.5deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid var(--border-accent);
    border-radius: 9999px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== STATS SECTION ===== */
.stats {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== CERTIFICATIONS SECTION ===== */
.certifications {
    padding: 6rem 0;
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.cert-card {
    position: relative;
    padding: 1rem;
    overflow: hidden;
    transition: all var(--animation-slow);
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    transition: left 0.8s ease;
}

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

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.cert-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cert-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cert-info h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.cert-full-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cert-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== EXPERIENCE SECTION ===== */
.experience {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    padding-left: 5rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
}

.timeline-card {
    padding: 2rem;
    position: relative;
    transition: all var(--animation-slow);
}

.timeline-card:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    color: var(--text-secondary);
    font-weight: 600;
}

.timeline-description {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== SKILLS SECTION ===== */
.skills {
    padding: 6rem 0;
    background: var(--bg-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--animation-slow);
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--animation-slow);
}

.skill-card:hover::after {
    transform: scaleX(1);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.skill-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.skill-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.skill-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== PROJECTS SECTION ===== */
.projects {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 3rem;
}

.project-card {
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--animation-slow);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.05), transparent);
    transition: left 0.8s ease;
}

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

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.project-icon {
    width: 80px;
    height: 80px;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.project-icon.minecraft {
    background: linear-gradient(135deg, #10b981, #059669);
}

.project-icon.cpp {
    background: var(--gradient-primary);
}

.project-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-tech {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.project-features {
    margin-bottom: 2rem;
}

.project-features h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-list {
    list-style: none;
}

.feature-list li {
    color: var(--text-secondary);
    padding: 0.375rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ===== CONTACT SECTION ===== */
.contact {
    padding: 6rem 0;
    background: var(--bg-primary);
    text-align: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    padding: 2rem;
    transition: all var(--animation-slow);
    text-align: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-secondary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.contact-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--animation-normal);
}

.contact-card a:hover {
    color: var(--primary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

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

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--animation-normal);
}

.footer-links a:hover {
    color: var(--primary);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 2rem 0;
        min-height: 90vh;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .certs-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .timeline::before {
        left: 1rem;
    }

    .timeline-item {
        padding-left: 3rem;
    }

    .timeline-item::before {
        left: 0.5rem;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .stats-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .project-card,
    .cert-card,
    .skill-card {
        padding: 1.5rem;
    }

    .timeline-card {
        padding: 1.5rem;
    }
}

/* ===== LOADING ANIMATION ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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