/* CSS Variables */
:root {
    --primary: #0A0E27;
    --secondary: #1A1F3A;
    --accent: #00D9FF;
    --accent-glow: rgba(0, 217, 255, 0.3);
    --purple: #B794F6;
    --green: #00FF88;
    --text: #E8EEF2;
    --text-muted: #8B95A5;
    --border: rgba(0, 217, 255, 0.2);
    --code-bg: #0D1117;
}

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

/* Base Styles */
body {
    font-family: 'Sora', sans-serif;
    background: var(--primary);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    animation: gridPulse 10s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Floating particles effect */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: float 15s infinite ease-in-out;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* Navigation */
nav {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: '>';
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'JetBrains Mono', monospace;
}

nav a::before {
    content: '$ ';
    opacity: 0;
    transition: opacity 0.3s ease;
}

nav a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

nav a:hover::before {
    opacity: 1;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
    position: relative;
}

.hero-content {
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--purple);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(183, 148, 246, 0.1);
    border: 1px solid rgba(183, 148, 246, 0.3);
    border-radius: 4px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-family: 'JetBrains Mono', monospace;
}

.hero h2 .typing {
    color: var(--green);
    border-right: 2px solid var(--green);
    padding-right: 5px;
    animation: typing 3s steps(30) infinite, blink-cursor 0.75s step-end infinite;
}

@keyframes typing {
    0%, 100% { width: 0; }
    50% { width: 100%; }
}

@keyframes blink-cursor {
    50% { border-color: transparent; }
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    border: 1px solid;
    cursor: pointer;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px var(--accent-glow);
}

.btn-secondary {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: rgba(0, 217, 255, 0.1);
}

/* Stats Bar */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
    margin: 4rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 20px var(--accent-glow);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Section Styles */
section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
}

.section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tab.active {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(0, 217, 255, 0.2);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.project-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.project-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

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

.tag {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 217, 255, 0.1);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.tag.ml { 
    background: rgba(183, 148, 246, 0.1);
    color: var(--purple);
    border-color: rgba(183, 148, 246, 0.3);
}

.tag.live {
    background: rgba(0, 255, 136, 0.1);
    color: var(--green);
    border-color: rgba(0, 255, 136, 0.3);
}

.project-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 217, 255, 0.1);
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: var(--green);
    font-weight: 600;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.project-link {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.3s ease;
}

.project-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 217, 255, 0.05);
}

.project-link.demo {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--green);
    color: var(--green);
}

.project-link.demo:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* ML Demo Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--secondary);
    border: 1px solid var(--accent);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px var(--accent-glow);
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.75rem;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 2rem;
}

.demo-interface {
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 2rem;
}

.demo-input {
    width: 100%;
    padding: 1rem;
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    resize: vertical;
}

.demo-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.demo-output {
    background: var(--primary);
    border: 1px solid var(--green);
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--green);
    min-height: 150px;
    white-space: pre-wrap;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.skill-category {
    background: var(--secondary);
    border: 1px solid var(--border);
    padding: 2rem;
}

.skill-category h3 {
    color: var(--accent);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 0.75rem 0;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-bar {
    width: 60px;
    height: 4px;
    background: rgba(0, 217, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.skill-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    width: var(--skill-level, 80%);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Contact Section */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: var(--text);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--accent);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 968px) {
    nav ul {
        display: none;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .filter-tabs {
        flex-direction: column;
    }

    .filter-tab {
        width: 100%;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}
