:root {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --text-muted: #a0a0a0;
    --primary: #6366f1;
    /* Indigo */
    --secondary: #a855f7;
    /* Purple */
    --accent: #ec4899;
    /* Pink */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for Modern Aesthetic */
.blob-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(60px);
    z-index: -1;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-2 {
    top: auto;
    bottom: -10%;
    left: auto;
    right: -10%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -1px;
}

/* Glassmorphism Utilities */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.glass-card,
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Navigation */
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s;
}

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

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Main Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section */
.hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.greeting {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.glitch-text {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 480px;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-main);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: var(--glass-bg);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* Hero Graphic */
.hero-graphic {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.tech-stack-floating {
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    font-size: 3rem;
    color: var(--text-muted);
    animation: float-slow 6s ease-in-out infinite alternate;
}

.tech-stack-floating i {
    transition: all 0.3s;
}

.tech-stack-floating i:hover {
    color: var(--primary);
    transform: scale(1.1);
}

@keyframes float-slow {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-20px);
    }
}

/* About Section */
.about-container {
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
}

.about-text {
    flex: 2;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.about-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-text {
    color: var(--text-muted);
    font-weight: 600;
}

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

.skill-card {
    padding: 2.5rem;
    transition: transform 0.3s, border-color 0.3s;
    text-align: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.project-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--glass-border);
}

/* Colorful placeholders for projects */
.placeholder-1 {
    background: linear-gradient(45deg, #1e1e2f, #2a2a40);
    position: relative;
}

.placeholder-2 {
    background: linear-gradient(45deg, #152238, #1e3a5f);
    position: relative;
}

.placeholder-3 {
    background: linear-gradient(45deg, #2d1b2e, #4a2545);
    position: relative;
}

.project-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.project-link:hover {
    gap: 0.8rem;
}

/* AI Assistant Section */
.ai-assistant {
    padding-top: 100px;
}

.ai-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.glowing-border::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    z-index: -1;
    border-radius: inherit;
    background-size: 300% 300%;
    animation: gradient-flow 6s ease infinite;
    opacity: 0.3;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
}

.ai-icon {
    font-size: 2rem;
    color: var(--secondary);
    background: rgba(168, 85, 247, 0.1);
    padding: 1rem;
    border-radius: 12px;
}

.ai-header-text h3 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.ai-header-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ai-status {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    margin-left: auto;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ai-chat-area {
    height: 400px;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: slide-up 0.4s ease-out;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.system-msg {
    align-self: flex-start;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    flex-shrink: 0;
}

.user-msg .msg-avatar {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.msg-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.2rem;
    border-radius: 0 16px 16px 16px;
    line-height: 1.5;
    border: 1px solid var(--glass-border);
}

.user-msg .msg-content {
    border-radius: 16px 0 16px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.ai-input-area {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
}

.ai-input-top {
    border-top: none;
    border-bottom: 1px solid var(--glass-border);
    background: transparent;
    padding: 2rem;
}

.ai-output-card {
    margin: 2rem;
    padding: 2rem;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.02);
}

.ai-output-card .ai-message {
    max-width: 100%;
}

/* Game Section */
.game-section {
    padding-top: 100px;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.score-board {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.canvas-wrapper {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    line-height: 0;
}

#pacmanCanvas {
    background: #000;
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

#overlayTitle {
    font-size: 3rem;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary);
}

.win-state #overlayTitle {
    color: #10b981;
    text-shadow: 0 0 15px #10b981;
}

.lose-state #overlayTitle {
    color: #f43f5e;
    text-shadow: 0 0 15px #f43f5e;
}

#overlaySubtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.game-instructions {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

#aiTopicInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    font-family: var(--font-main);
    transition: all 0.3s;
}

#aiTopicInput:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.ai-generate-btn {
    border-radius: 30px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* Scrollbar for chat area */
.ai-chat-area::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-area::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}
.ai-chat-area::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Contact Section */
.contact-container {
    padding: 3rem;
    display: flex;
    gap: 4rem;
}

.contact-form {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-main);
    transition: border-color 0.3s, outline 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.3s, color 0.3s, border-color 0.3s;
}

.social-btn:hover {
    transform: translateY(-3px);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .subtitle {
        margin: 0 auto 2.5rem auto;
    }

    .cta-buttons {
        justify-content: center;
    }

    .about-container {
        flex-direction: column;
    }

    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(12px);
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .glitch-text {
        font-size: 3rem;
    }

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

    section {
        padding: 80px 0;
    }
}