/* ========================================
   ROOT VARIABLES & RESET
======================================== */
:root {
    --primary: #6c63ff;
    --primary-light: #8b83ff;
    --secondary: #00d4aa;
    --accent: #ff6b6b;
    --accent-2: #ffd93d;
    --bg-dark: #0a0a0f;
    --bg-dark-2: #12121a;
    --bg-dark-3: #1a1a2e;
    --bg-card: #16162a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --border-color: rgba(108, 99, 255, 0.2);
    --gradient-primary: linear-gradient(135deg, #6c63ff, #00d4aa);
    --gradient-accent: linear-gradient(135deg, #ff6b6b, #ffd93d);
    --shadow-primary: 0 0 30px rgba(108, 99, 255, 0.3);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.2);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: all 0.3s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}
::selection { background: var(--primary); color: white; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========================================
   3D BACKGROUND CANVAS
======================================== */
#three-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

/* ========================================
   CUSTOM CURSOR
======================================== */
.cursor {
    width: 8px; height: 8px; background: var(--primary); border-radius: 50%;
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 99999;
    transition: transform 0.1s ease; mix-blend-mode: difference;
}
.cursor-follower {
    width: 40px; height: 40px; border: 2px solid var(--primary); border-radius: 50%;
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 99998;
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
    mix-blend-mode: difference;
}
@media (max-width: 768px) { .cursor, .cursor-follower { display: none; } }

/* ========================================
   NAVIGATION
======================================== */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 20px 0; transition: var(--transition-smooth); background: transparent;
}
.navbar.scrolled {
    padding: 12px 0; background: rgba(10, 10, 15, 0.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-card);
}
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo .logo-3d {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 900;
    background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-menu { display: flex; gap: 35px; }
.nav-link { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); position: relative; transition: var(--transition-smooth); padding: 5px 0; }
.nav-link::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
    background: var(--gradient-primary); transition: var(--transition-smooth);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-toggle span { width: 25px; height: 2px; background: var(--text-primary); transition: var(--transition-smooth); }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 70%; height: 100vh;
        background: var(--bg-dark-2); flex-direction: column; padding: 100px 40px;
        gap: 25px; transition: right 0.4s ease; border-left: 1px solid var(--border-color);
    }
    .nav-menu.active { right: 0; }
}

/* ========================================
   HERO SECTION
======================================== */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 120px 20px 60px; }
.hero-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; width: 100%; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px;
    background: rgba(108, 99, 255, 0.1); border: 1px solid var(--border-color);
    border-radius: 50px; font-size: 0.85rem; color: var(--primary-light); margin-bottom: 25px; backdrop-filter: blur(10px);
}
.badge-dot { width: 8px; height: 8px; background: var(--secondary); border-radius: 50%; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.5;transform:scale(0.8);} }
.hero-title { margin-bottom: 20px; }
.title-line { display: block; font-family: 'Space Grotesk', sans-serif; }
.title-line:first-child { font-size: 1.5rem; font-weight: 400; color: var(--text-secondary); margin-bottom: 5px; }
.name-3d { font-size: 4.5rem; font-weight: 900; line-height: 1.1; perspective: 1000px; }
.name-first { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; animation: float3d 6s ease-in-out infinite; }
.name-last { background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; animation: float3d 6s ease-in-out infinite 0.5s; }
@keyframes float3d { 0%,100%{transform:translateY(0)rotateX(0);} 25%{transform:translateY(-10px)rotateX(5deg);} 75%{transform:translateY(5px)rotateX(-3deg);} }
.hero-subtitle { font-size: 1.5rem; color: var(--secondary); font-weight: 600; margin-bottom: 20px; min-height: 40px; }
.cursor-blink { animation: blink-cursor 0.8s step-end infinite; color: var(--primary); }
@keyframes blink-cursor { 0%,100%{opacity:1;} 50%{opacity:0;} }
.hero-description { font-size: 1.1rem; color: var(--text-secondary); max-width: 550px; margin-bottom: 35px; line-height: 1.8; }
.hero-buttons { display: flex; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-socials { display: flex; gap: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 32px; border-radius: 12px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; position: relative; overflow: hidden; }
.btn-3d { transform-style: preserve-3d; perspective: 1000px; }
.btn-3d::before { content:''; position:absolute; top:0; left:-100%; width:100%; height:100%; background:linear-gradient(90deg,transparent,rgba(255,255,255,0.2),transparent); transition:left 0.5s; }
.btn-3d:hover::before { left:100%; }
.btn-primary { background: var(--gradient-primary); color: white; box-shadow: var(--shadow-primary); }
.btn-primary:hover { transform: translateY(-3px) rotateX(5deg); box-shadow: 0 15px 40px rgba(108,99,255,0.4); }
.btn-outline { background: transparent; color: var(--text-primary); border: 2px solid var(--border-color); }
.btn-outline:hover { border-color: var(--primary); transform: translateY(-3px) rotateX(5deg); box-shadow: var(--shadow-glow); background: rgba(108,99,255,0.1); }

.social-link { width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-secondary); font-size: 1.1rem; transition: var(--transition); background: rgba(108,99,255,0.05); }
.social-link:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-5px) rotateY(180deg); box-shadow: var(--shadow-glow); }

/* Profile Visual */
.hero-visual { display: flex; justify-content: center; align-items: center; }
.profile-wrapper { position: relative; width: 380px; height: 380px; }
.profile-ring { position: absolute; border: 2px solid transparent; border-radius: 50%; animation: rotate 10s linear infinite; top:0; left:0; width:100%; height:100%; border-top-color: var(--primary); border-right-color: var(--secondary); }
.profile-ring-2 { top: -20px; left: -20px; width: calc(100% + 40px); height: calc(100% + 40px); border-bottom-color: var(--accent); border-left-color: var(--accent-2); animation-direction: reverse; animation-duration: 15s; }
@keyframes rotate { from{transform:rotate(0deg);} to{transform:rotate(360deg);} }
.profile-image-container { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 0 60px rgba(108,99,255,0.3); animation: float3d 6s ease-in-out infinite; }
.profile-image-container img { width: 100%; height: 100%; object-fit: cover; }
.floating-badge { position: absolute; display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: rgba(22,22,42,0.9); backdrop-filter: blur(10px); border: 1px solid var(--border-color); border-radius: 12px; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); animation: float3d 4s ease-in-out infinite; box-shadow: var(--shadow-card); z-index: 2; }
.badge-code { top: 20px; right: -30px; } .badge-code i { color: var(--secondary); }
.badge-design { bottom: 60px; left: -40px; animation-delay: 1s; } .badge-design i { color: var(--accent); }
.badge-perf { bottom: -10px; right: 20px; animation-delay: 2s; } .badge-perf i { color: var(--accent-2); }

/* ========================================
   SECTIONS COMMON
======================================== */
section { padding: 100px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-tag { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--primary-light); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 15px; }
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 2.8rem; font-weight: 800; margin-bottom: 15px; }
.highlight { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.title-line-3d { width: 80px; height: 4px; background: var(--gradient-primary); margin: 0 auto; border-radius: 2px; box-shadow: 0 0 20px rgba(108,99,255,0.5); transform: perspective(500px) rotateY(15deg); }

/* ========================================
   SKILLS (UPDATED)
======================================== */
.skills { background: var(--bg-dark); }
.skill-categories { display: flex; flex-direction: column; gap: 25px; max-width: 900px; margin: 0 auto; }
.skill-group { background: var(--bg-dark-2); padding: 25px; border-radius: 16px; border: 1px solid var(--border-color); transition: var(--transition); transform-style: preserve-3d; perspective: 1000px; }
.skill-group:hover { transform: translateY(-5px) rotateX(5deg); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.skill-group h3 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 12px; }
.skill-group h3 i { color: var(--secondary); }
.skill-tags { color: var(--text-secondary); line-height: 1.8; }
.skill-tags::after { content: " • "; }
.skill-tags span { display: inline; }

/* ========================================
   PROJECTS
======================================== */
.projects { background: var(--bg-dark-2); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
.project-card { display: block; background: var(--bg-card); border-radius: 20px; overflow: hidden; border: 1px solid var(--border-color); transition: var(--transition); transform-style: preserve-3d; perspective: 1000px; }
.project-card:hover { transform: translateY(-10px) rotateX(5deg); box-shadow: var(--shadow-primary); border-color: var(--primary); }
.project-image { position: relative; height: 220px; overflow: hidden; background: var(--bg-dark-3); }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition-smooth); }
.project-card:hover .project-image img { transform: scale(1.05); }
.project-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(108,99,255,0.8); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition-smooth); color: white; font-size: 2rem;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-info { padding: 25px; }
.project-category { font-size: 0.8rem; color: var(--secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.project-info h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; margin: 8px 0; }
.project-info p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-tech { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.75rem; color: var(--primary-light); }
.project-tech span::after { content: " • "; }
@media (max-width: 768px) { .projects-grid { grid-template-columns: 1fr; } }

/* ========================================
   PROJECT DETAIL PAGE
======================================== */
.project-detail { min-height: 100vh; padding-bottom: 80px; }
.detail-header { margin-bottom: 40px; }
.detail-header h1 { font-size: 2.5rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px; }
.detail-cat { background: rgba(0,212,170,0.1); color: var(--secondary); padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.detail-image { border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); }
.detail-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-info h3 { font-size: 1.3rem; margin-bottom: 10px; margin-top: 20px; }
.detail-info p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 15px; }
.detail-actions { display: flex; gap: 15px; margin-top: 25px; }
.detail-full { background: var(--bg-dark-2); padding: 30px; border-radius: 16px; border: 1px solid var(--border-color); }
.detail-full h3 { margin-bottom: 15px; }
.detail-full p { color: var(--text-secondary); line-height: 1.8; }
@media (max-width: 992px) { .detail-grid { grid-template-columns: 1fr; } }

/* ========================================
   EXPERIENCE / TIMELINE
======================================== */
.experience { background: var(--bg-dark); }
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: var(--gradient-primary); transform: translateX(-50%); }
.timeline-item { position: relative; margin-bottom: 50px; }
.timeline-item:nth-child(odd) { padding-right: calc(50% + 40px); text-align: right; }
.timeline-item:nth-child(even) { padding-left: calc(50% + 40px); }
.timeline-dot { position: absolute; left: 50%; top: 20px; width: 16px; height: 16px; background: var(--primary); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 20px rgba(108,99,255,0.5); z-index: 2; }
.timeline-dot::before { content: ''; position: absolute; top: -4px; left: -4px; width: 24px; height: 24px; border: 2px solid var(--primary); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.5);opacity:0;} }
.timeline-content { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 25px; transition: var(--transition); transform-style: preserve-3d; perspective: 1000px; }
.timeline-content:hover { transform: translateY(-5px) rotateX(5deg); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.timeline-date { display: inline-block; padding: 4px 14px; background: rgba(108,99,255,0.1); border-radius: 20px; font-size: 0.8rem; color: var(--primary-light); font-weight: 600; margin-bottom: 10px; }
.timeline-content h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 5px; }
.timeline-company { font-size: 0.9rem; color: var(--secondary); font-weight: 600; margin-bottom: 10px; display: block; }
.timeline-content p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 15px; }
.timeline-tech { display: flex; gap: 8px; flex-wrap: wrap; color: var(--primary-light); font-size: 0.75rem; }
.timeline-item:nth-child(odd) .timeline-tech { justify-content: flex-end; }
@media (max-width: 768px) {
    .timeline::before { left: 20px; } .timeline-dot { left: 20px; }
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) { padding-left: 55px; padding-right: 0; text-align: left; }
    .timeline-item:nth-child(odd) .timeline-tech { justify-content: flex-start; }
}

/* ========================================
   CONTACT
======================================== */
.contact { background: var(--bg-dark-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start; }
.contact-info h3 { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 15px; }
.contact-info > p { color: var(--text-secondary); margin-bottom: 35px; line-height: 1.8; }
.contact-details { display: flex; flex-direction: column; gap: 20px; margin-bottom: 35px; }
.contact-item { display: flex; align-items: center; gap: 15px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; transition: var(--transition); transform-style: preserve-3d; perspective: 1000px; }
.contact-item:hover { transform: translateY(-3px) rotateY(5deg); border-color: var(--primary); box-shadow: var(--shadow-glow); }
.contact-icon { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: var(--gradient-primary); border-radius: 14px; color: white; font-size: 1.2rem; flex-shrink: 0; }
.contact-text span { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 3px; }
.contact-text a { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; }
.contact-form { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 24px; padding: 40px; }
.form-group { position: relative; margin-bottom: 25px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 15px 0; background: transparent; border: none;
    border-bottom: 2px solid var(--border-color); color: var(--text-primary);
    font-size: 1rem; font-family: 'Inter', sans-serif; outline: none; transition: var(--transition-smooth);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group textarea:focus { border-bottom-color: var(--primary); }
.form-line { position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--gradient-primary); transition: width 0.4s ease; }
.form-group input:focus ~ .form-line, .form-group textarea:focus ~ .form-line { width: 100%; }
.btn-submit { width: 100%; justify-content: center; padding: 16px; font-size: 1rem; }
@media (max-width: 992px) { .contact-grid { grid-template-columns: 1fr; } }

/* ========================================
   FOOTER
======================================== */
footer { background: var(--bg-dark); padding: 40px 0 20px; border-top: 1px solid var(--border-color); }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; margin-bottom: 30px; }
.footer-logo .logo-3d { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 900; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: block; }
.footer-links { display: flex; gap: 25px; }
.footer-links a { color: var(--text-secondary); transition: var(--transition-smooth); }
.footer-links a:hover { color: var(--primary); }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-secondary); transition: var(--transition); }
.footer-socials a:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.85rem; }

/* ========================================
   BACK TO TOP
======================================== */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: var(--gradient-primary); border: none; border-radius: 14px; color: white;
    font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 999; opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--transition);
    box-shadow: var(--shadow-primary);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-5px) rotateX(15deg); }

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 992px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-description { margin: 0 auto 35px; }
    .hero-buttons { justify-content: center; }
    .hero-socials { justify-content: center; }
    .profile-wrapper { width: 280px; height: 280px; }
    .floating-badge { display: none; }
    .name-3d { font-size: 3rem; }
}
@media (max-width: 576px) {
    .section-title { font-size: 2rem; }
    .name-3d { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .contact-form { padding: 25px; }
    .detail-header h1 { font-size: 1.8rem; }
}