:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #00d2ff;
    --accent: #3a7bd5;
    --skill-bar-bg: #333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --timeline-line: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-color: #e0e5ec;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-border: rgba(255, 255, 255, 0.4);
    --primary: #007aff;
    --accent: #0056b3;
    --skill-bar-bg: #ccc;
    --shadow-color: rgba(163, 177, 198, 0.6);
    --timeline-line: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

#particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 15px var(--shadow-color);
    font-size: 1.2rem;
    color: var(--text-main);
}

.theme-switch:hover { transform: scale(1.1); }

nav {
    position: fixed;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0; width: 0; height: 2px;
    background: var(--primary);
    transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

section {
    min-height: 100vh;
    padding: 100px 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s, transform 1s;
}

section.visible { opacity: 1; transform: translateY(0); }

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px var(--shadow-color);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px; height: 4px;
    background: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap-reverse;
    gap: 40px;
}

.hero-text h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 15px; }
.hero-text span { color: var(--primary); }
.hero-text p { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; margin-bottom: 30px; }

.btn {
    padding: 12px 30px;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    border: none;
    color: #fff;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.4);
    display: inline-block;
    transition: 0.3s;
}
.btn:hover { transform: translateY(-3px) scale(1.05); }

.profile-wrapper {
    position: relative;
    width: 300px; height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.profile-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-border);
    box-shadow: 0 0 30px var(--primary);
    animation: float 6s ease-in-out infinite;
    z-index: 2;
}
.circle-bg {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px dashed var(--primary);
    animation: spin 20s linear infinite;
    z-index: 1;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes spin { 100% { transform: rotate(360deg); } }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    width: 100%;
}
.skill-item { margin-bottom: 20px; }
.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--skill-bar-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

@keyframes neon-rgb {
    0% { background: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
    20% { background: #ff00ff; box-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff; }
    40% { background: #0000ff; box-shadow: 0 0 10px #0000ff, 0 0 20px #0000ff; }
    60% { background: #00ffff; box-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff; }
    80% { background: #00ff00; box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
    100% { background: #ffff00; box-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00; }
}

.progress {
    height: 100%;
    width: 0;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    animation: neon-rgb 3s linear infinite;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
}
.project-card {
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: 0.4s;
    position: relative;
}
[data-theme="light"] .project-card { background: rgba(255,255,255,0.7); }

.project-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.project-img {
    height: 180px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info { padding: 20px; }
.project-info h3 { color: var(--primary); margin-bottom: 10px; }
.project-info p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }

.timeline {
    position: relative;
    max-width: 800px;
    width: 100%;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--timeline-line);
}
.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}
.timeline-date {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 5px;
}
.timeline-content h3 { margin-bottom: 5px; }
.timeline-content p { color: var(--text-muted); }

.contact-wrapper {
    width: 100%;
    max-width: 600px;
}
.form-group { margin-bottom: 20px; }
.form-control {
    width: 100%;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
}
.form-control:focus { border-color: var(--primary); }

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}
.social-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
}
.social-btn:hover { background: var(--primary); color: #fff; transform: translateY(-5px); }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-text h1 { font-size: 2.5rem; }
    .profile-wrapper { width: 250px; height: 250px; margin: 0 auto; }
    section { padding: 60px 5%; }
    .timeline::before { left: 10px; }
    .timeline-item { padding-left: 40px; }
    .timeline-dot { left: 1px; }
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.popup.show {
    opacity: 1;
    visibility: visible;
}

@keyframes neon-rgb {
    0% { background: #ff0000; box-shadow: 0 0 10px #ff0000; }
    20% { background: #ff00ff; box-shadow: 0 0 10px #ff00ff; }
    40% { background: #0000ff; box-shadow: 0 0 10px #0000ff; }
    60% { background: #00ffff; box-shadow: 0 0 10px #00ffff; }
    80% { background: #00ff00; box-shadow: 0 0 10px #00ff00; }
    100% { background: #ffff00; box-shadow: 0 0 10px #ffff00; }
}

.progress {
    height: 100%;
    width: 0; 
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    animation: neon-rgb 3s linear infinite; 
}