/* --- Base Variables (Dark Mode Default) --- */
:root {
    --bg-dark: #050812; 
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-blue: #00f0ff; 
    --accent-purple: #b52bfa; 
    --accent-green: #39ff14; 
    --shadow-color: rgba(0,0,0,0.6);
}

/* --- Light Mode Variables --- */
body.light-theme {
    --bg-dark: #f0f4f8; 
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0,0,0,0.1);
    --accent-blue: #0284c7; 
    --accent-purple: #7e22ce; 
    --accent-green: #16a34a; 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Segoe UI', sans-serif; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-dark); color: var(--text-main); overflow-x: hidden; line-height: 1.7; transition: background-color 0.5s ease, color 0.5s ease; }

/* Custom Neon Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple)); border-radius: 10px; }

/* 3D Background Canvas Layer */
#bg-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* --- Utility Classes & Accents --- */
.accent-blue { color: var(--accent-blue); text-shadow: 0 0 10px rgba(0, 240, 255, 0.3); }
.accent-purple { color: var(--accent-purple); text-shadow: 0 0 10px rgba(181, 43, 250, 0.3); }
.accent-green { color: var(--accent-green); text-shadow: 0 0 10px rgba(57, 255, 20, 0.3); }

.accent-blue-bg { background: var(--accent-blue); box-shadow: 0 0 15px var(--accent-blue); }
.accent-purple-bg { background: var(--accent-purple); box-shadow: 0 0 15px var(--accent-purple); }
.accent-green-bg { background: var(--accent-green); box-shadow: 0 0 15px var(--accent-green); }

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 16px; padding: 2.5rem;
    display: flex; flex-direction: column; justify-content: flex-start;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.glass-card:hover { transform: translateY(-8px); border-color: var(--accent-blue); box-shadow: 0 10px 30px var(--shadow-color); }

/* --- Navigation & Theme Toggle --- */
header { position: fixed; width: 100%; top: 0; z-index: 1000; }
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 8%; background: var(--glass-bg); backdrop-filter: blur(15px); border-bottom: 1px solid var(--glass-border);
}
.logo { font-size: 2rem; font-weight: 800; letter-spacing: 1px; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 1rem; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent-blue); }

.nav-controls { display: flex; align-items: center; gap: 1.5rem; }
.theme-switch { background: transparent; border: 1px solid var(--glass-border); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: 0.3s; display: flex; justify-content: center; align-items: center; }
.theme-switch:hover { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.menu-btn { display: none; font-size: 1.8rem; cursor: pointer; color: var(--text-main); }

/* --- Global Section Settings --- */
section { padding: 8rem 8% 4rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.section-title { font-size: 3rem; text-align: center; margin-bottom: 4rem; font-weight: 700; }
.section-subtitle { text-align: center; color: var(--text-muted); font-size: 1.1rem; margin-top: -3rem; margin-bottom: 3.5rem; }

/* --- Hero Section --- */
.hero { flex-direction: row; align-items: center; justify-content: space-between; gap: 4rem; }
.hero-content { flex: 1.2; }
.greeting { color: var(--accent-green); font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.hero h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 1rem; }
.hero h2 { font-size: 2.2rem; margin-bottom: 1.5rem; height: 50px; font-weight: 500; }
.hero-desc { font-size: 1.1rem; color: var(--text-muted); max-width: 90%; margin-bottom: 2.5rem; }

.hero-buttons { display: flex; gap: 1.5rem; margin-bottom: 3rem; }
.btn { padding: 1rem 2rem; border-radius: 50px; text-decoration: none; font-weight: 600; transition: all 0.3s; display: inline-flex; align-items: center; gap: 0.5rem; border: none; cursor: pointer; font-size: 1rem; }
.primary-btn { background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple)); color: white; }
.primary-btn:hover { box-shadow: 0 6px 25px rgba(0, 240, 255, 0.4); transform: translateY(-3px); }
.secondary-btn { background: transparent; border: 2px solid var(--glass-border); color: var(--text-main); backdrop-filter: blur(5px); }
.secondary-btn:hover { border-color: var(--accent-blue); transform: translateY(-3px); }

.social-links { display: flex; gap: 1.5rem; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; border-radius: 50%; background: var(--glass-bg); color: var(--text-main); font-size: 1.2rem; transition: 0.3s ease; border: 1px solid var(--glass-border); }
.social-links a:hover { background: var(--accent-blue); color: #fff; transform: translateY(-5px); }

.hero-image-container { flex: 0.8; display: flex; justify-content: center; align-items: center; }
.profile-glow { position: relative; width: 350px; height: 350px; border-radius: 50%; background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple)); padding: 5px; animation: float 6s ease-in-out infinite; box-shadow: 0 0 40px rgba(181, 43, 250, 0.3); }
.profile-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 6px solid var(--bg-dark); }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-20px); } 100% { transform: translateY(0px); } }

/* --- About & Skills --- */
.about-content { max-width: 950px; margin: 0 auto; text-align: center; font-size: 1.15rem; color: var(--text-muted); }
.skills-grid, .project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.skill-card { text-align: center; }
.skill-icon { font-size: 2.5rem; margin-bottom: 1.5rem; }
.skill-card h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.skill-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Experience Timeline --- */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::after { content: ''; position: absolute; width: 4px; background: var(--glass-border); top: 0; bottom: 0; left: 50%; margin-left: -2px; border-radius: 2px; }
.timeline-item { padding: 10px 40px; position: relative; width: 50%; left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-dot { position: absolute; width: 20px; height: 20px; right: -10px; top: 30px; border-radius: 50%; z-index: 1; border: 4px solid var(--bg-dark); }
.timeline-item:nth-child(even) .timeline-dot { left: -10px; }
.timeline-content h3 { margin-top: 10px; margin-bottom: 10px; font-size: 1.3rem; }
.timeline-content p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Projects & In The Lab --- */
.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.project-header h3 { font-size: 1.3rem; line-height: 1.3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;}
.project-header a { color: var(--text-muted); font-size: 1.5rem; transition: 0.3s; }
.project-header a:hover { color: var(--accent-green); }
.project-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; flex-grow: 1; }
.tech-stack { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; }
.tech-stack span { background: rgba(0, 240, 255, 0.08); color: var(--accent-blue); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--glass-border); }

/* Lab Specific Styling */
.wip-card { border: 1px dashed var(--accent-purple); background: rgba(15, 23, 42, 0.4); }
.wip-card:hover { border-style: solid; box-shadow: 0 0 25px rgba(181, 43, 250, 0.2); }
.badge { font-size: 0.7rem; padding: 3px 10px; border-radius: 12px; font-weight: bold; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-purple { background: var(--accent-purple); color: #fff; }
.badge-blue { background: var(--accent-blue); color: #000; }
.badge-green { background: var(--accent-green); color: #000; }
.lock-icon { color: var(--text-muted); font-size: 1.2rem; }

/* --- Contact Section --- */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.contact-info h3 { font-size: 2rem; margin-bottom: 1rem; }
.contact-info p { color: var(--text-muted); margin-bottom: 2rem; }
.info-items { display: flex; flex-direction: column; gap: 1.5rem; }
.info-item { display: flex; align-items: center; gap: 1rem; font-size: 1.1rem; }
.info-item i { font-size: 1.5rem; width: 30px; }

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.input-group input, .input-group textarea { width: 100%; padding: 1.2rem; border-radius: 12px; background: rgba(0,0,0,0.1); border: 1px solid var(--glass-border); color: var(--text-main); outline: none; font-size: 1rem; transition: 0.3s; }
.input-group input:focus, .input-group textarea:focus { border-color: var(--accent-blue); }

/* --- Scroll to Top Button --- */
#scrollTopBtn {
    display: none; position: fixed; bottom: 30px; right: 30px; z-index: 99;
    border: none; outline: none; background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white; cursor: pointer; padding: 15px; border-radius: 50%;
    font-size: 18px; box-shadow: 0 4px 15px var(--shadow-color); transition: 0.3s;
}
#scrollTopBtn:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(181, 43, 250, 0.6); }

footer { text-align: center; padding: 2rem; border-top: 1px solid var(--glass-border); color: var(--text-muted); margin-top: 4rem; }

/* --- Animations --- */
.hidden { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.show { opacity: 1; transform: translateY(0); }
.cursor { animation: blink 0.8s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- Mobile Responsiveness --- */
@media (max-width: 992px) {
    .hero { flex-direction: column-reverse; text-align: center; padding-top: 9rem; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero h1 { font-size: 3.5rem; }
    .hero-buttons { justify-content: center; flex-wrap: wrap; }
    .contact-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .menu-btn { display: block; }
    .nav-links { position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-dark); flex-direction: column; text-align: center; padding: 2rem 0; border-bottom: 1px solid var(--glass-border); clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    .profile-glow { width: 260px; height: 260px; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 0px; }
    .timeline-item:nth-child(even) { left: 0%; }
    .timeline-dot, .timeline-item:nth-child(even) .timeline-dot { left: 21px; }
    #scrollTopBtn { bottom: 20px; right: 20px; padding: 12px; }
}