:root {
    --bg-color: #030305;
    --glass-bg: rgba(15, 15, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.4);
    --text-main: #ffffff;
    --text-muted: #8892b0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    scroll-behavior: smooth;
}

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

#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* Glass Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 3, 5, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Container & Spacing */
.glass-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 5rem 2rem;
}

.mt-huge { margin-top: 6rem; }
.mt-normal { margin-top: 2rem; }
.text-center { text-align: center; }

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Typography & Hero */
.hero { text-align: left; }

.glitch {
    font-size: 5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-main);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero h2 {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 700px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Glowing Badges */
.tech-stack {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* Grids & Cards */
.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

@media (max-width: 768px) {
    .split-grid { grid-template-columns: 1fr; }
    .glitch { font-size: 3rem; }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.3);
}

.glass-card h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.glass-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Timeline specific styles */
.timeline {
    border-left: 2px solid var(--glass-border);
    padding-left: 1.5rem;
    margin-top: 1.5rem;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.85rem;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-item h5 { color: #fff; font-size: 1.1rem; margin-bottom: 0.3rem;}
.accent-text { color: var(--accent) !important; font-size: 0.9rem; margin-bottom: 0.5rem !important;}
.timeline-item p { margin-bottom: 0; font-size: 0.9rem;}

/* Scroll Reveal Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
/* --- New Logo Styles --- */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-accent {
    color: var(--accent);
}

/* --- Interactive Card Styles (Projects) --- */
a.glass-card {
    text-decoration: none;
    display: block; /* Ensures the whole card is clickable */
    cursor: pointer;
}

a.glass-card h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.link-icon {
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: translate(-10px, 10px);
    transition: all 0.3s ease;
    color: var(--accent);
}

a.glass-card:hover .link-icon {
    opacity: 1;
    transform: translate(0, 0);
}

a.glass-card:hover h4 {
    color: var(--accent);
}

/* Make sure the inner tags on projects don't look like links */
.badge-static {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Interactive Badge Styles (Certifications) --- */
.section-subtitle {
    color: var(--text-muted);
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

a.interactive-badge {
    cursor: pointer;
    position: relative;
    padding-right: 2rem; /* Make room for the arrow */
}

a.interactive-badge::after {
    content: "↗";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

a.interactive-badge:hover::after {
    opacity: 1;
}

/* --- CUSTOM NEON SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- TERMINAL LOADER --- */
#loader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.terminal-text {
    font-family: 'Courier New', Courier, monospace;
    color: #0f0;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #0f0;
}
.blink {
    animation: blinker 1s linear infinite;
}
@keyframes blinker { 50% { opacity: 0; } }

/* --- NAV UPDATES & BUTTONS --- */
.nav-left { display: flex; align-items: center; gap: 15px; }
.icon-btn {
    background: none; border: none; color: var(--text-main);
    font-size: 1.2rem; cursor: pointer; transition: transform 0.2s;
}
.icon-btn:hover { transform: scale(1.1); }
#three-logo { width: 35px; height: 35px; }

.download-btn { border-color: var(--accent); color: var(--accent); }
.highlight-btn {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--accent);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- WIDGETS & GALLERY --- */
.chart-container {
    width: 100%; height: 100px;
    margin: 1rem 0;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.api-widget {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 10px; border-radius: 8px;
    font-size: 0.9rem; margin: 1rem 0;
    display: flex; align-items: center; gap: 8px;
}
.pulse-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.gallery-item {
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    height: 150px;
    border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    color: var(--text-muted); font-size: 0.9rem;
    transition: all 0.3s ease;
}
.gallery-item:hover {
    border-style: solid; border-color: var(--accent);
    background: rgba(0, 240, 255, 0.05); color: var(--accent);
}
/* =========================================
   MOBILE RESPONSIVENESS & HAMBURGER MENU
   ========================================= */

/* Hide hamburger on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Keep it above the glass menu */
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Mobile Adjustments (Phones & Tablets) */
@media (max-width: 768px) {
    
    /* Make text smaller to fit the screen */
    .glitch { font-size: 3rem; }
    .hero h2 { font-size: 1.2rem; }
    .section-title { font-size: 2rem; }
    
    /* Stack grid items vertically */
    .split-grid { grid-template-columns: 1fr; }
    
    /* Show the hamburger menu button */
    .hamburger { display: flex; }

    /* Hide standard nav links and turn them into a sliding glass panel */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(3, 3, 5, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 1px solid var(--glass-border);
        
        /* Animation setup */
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }

    /* When the menu is active/open */
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    /* Fix nav link margins for vertical layout */
    .nav-links a {
        margin: 0;
        font-size: 1.2rem;
    }

    /* Hamburger Animation to 'X' */
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
/* --- SCROLL PROGRESS BAR --- */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999; /* Stay above absolutely everything */
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.1s ease-out;
}
/* =========================================
   CUSTOM MAGNETIC CURSOR
   ========================================= */
/* Hide the default browser cursor everywhere */
body, a, button, .interactive-card, .badge { cursor: none !important; }

#custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: none; /* Let clicks pass through it */
    z-index: 10000;
    transform: translate(-50%, -50%); /* Center the circle on the mouse */
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* The class added by JS when hovering over a link */
.cursor-hover {
    width: 50px !important;
    height: 50px !important;
    background-color: rgba(0, 240, 255, 0.1);
    border-color: #fff !important;
}

/* Hide custom cursor on mobile (phones use touch, not mice) */
@media (max-width: 768px) {
    #custom-cursor { display: none; }
    body, a, button, .interactive-card, .badge { cursor: auto !important; }
}

/* =========================================
   CONTACT FORM STYLES
   ========================================= */
.glass-form {
    max-width: 600px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.glass-form input, .glass-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Glowing outline when typing */
.glass-form input:focus, .glass-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 15px var(--accent-glow);
}

.form-btn {
    width: 100%;
    border: none;
    font-size: 1.1rem;
    padding: 1rem;
}

@media (max-width: 768px) {
    .input-group { flex-direction: column; }
}

/* =========================================
   MATRIX EASTER EGG THEME
   ========================================= */
body.matrix-mode {
    --accent: #00ff00; /* Hacker Green */
    --accent-glow: rgba(0, 255, 0, 0.4);
}

body.matrix-mode .glitch {
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
}

/* =========================================
   "ASK MY AI" CHATBOT STYLES
   ========================================= */
#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#chat-toggle {
    box-shadow: 0 0 20px var(--accent-glow);
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

#chat-window {
    width: 350px;
    height: 450px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.hidden-chat {
    opacity: 0;
    transform: scale(0) translateY(50px);
    pointer-events: none;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.chat-header h4 {
    color: var(--accent);
    margin: 0;
    font-size: 1.1rem;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.bot-msg, .user-msg {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 85%;
}

.bot-msg {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    align-self: flex-start;
}

.user-msg {
    background: var(--accent);
    color: var(--bg-color);
    align-self: flex-end;
    font-weight: 500;
}

.chat-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-footer input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 10px 15px;
    color: #fff;
    font-family: inherit;
}

.chat-footer input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-footer button {
    padding: 10px 15px;
    border: none;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #chatbot-container { bottom: 20px; right: 20px; }
    #chat-window { width: 300px; height: 400px; }
}