:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --primary: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.4);
    --secondary: #ff006e;
    --secondary-glow: rgba(255, 0, 110, 0.4);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-1: linear-gradient(135deg, #00d4ff, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #ff006e, #8b5cf6);
    --gradient-3: linear-gradient(135deg, #00d4ff, #ff006e);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 30px var(--primary-glow);
}

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

html {
    scroll-behavior: smooth;
}

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

/* Particles Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.7rem 0;
    background: rgba(10, 10, 15, 0.95);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: var(--transition);
}

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

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 700px;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.typing-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cursor {
    color: var(--primary);
    animation: blink 1s infinite;
}

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

.hero-title {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
}

.btn-primary {
    background: var(--gradient-1);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

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

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

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(15px); opacity: 0; }
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s ease 1s forwards;
}

.code-block {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 100%;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: var(--transition);
}

.code-block:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.code-title {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
}

.keyword { color: #c792ea; }
.function { color: #82aaff; }
.string { color: #c3e88d; }
.number { color: #f78c6c; }

/* Sections */
section {
    padding: 8rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

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

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

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

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 1; /* Ensure visible by default */
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.skill-card:hover::before {
    opacity: 0.05;
}

.skill-card > * {
    position: relative;
    z-index: 1;
}

.skill-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.skill-bar {
    width: 100%;
    height: 6px;
    background: var(--glass);
    border-radius: 3px;
    overflow: hidden;
}

.skill-progress {
    width: var(--progress);
    height: 100%;
    background: var(--gradient-1);
    border-radius: 3px;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    opacity: 1; /* Ensure visible by default */
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.03) 10px,
        rgba(255,255,255,0.03) 20px
    );
}

.project-overlay {
    font-size: 4rem;
    color: rgba(255,255,255,0.3);
    z-index: 1;
}

.project-content {
    padding: 1.5rem;
}

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

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

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

.project-tags span {
    padding: 0.3rem 0.8rem;
    background: var(--glass);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary);
    border: 1px solid var(--glass-border);
}

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

.project-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary);
    transform: scale(1.2);
}

/* Stack Section Modernized */
.stack-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stack-category {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stack-category:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-header i {
    font-size: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-items {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.category-item::before {
    content: '▹';
    color: var(--primary);
    font-weight: bold;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 1.5rem;
    border-color: var(--primary-glow);
}

.category-item span {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .stack-categories {
        grid-template-columns: 1fr;
    }
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    transition: var(--transition);
}

.contact-item:hover {
    border-color: var(--primary);
    transform: translateX(10px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 12px;
    font-size: 1.3rem;
    color: var(--bg-primary);
}

.contact-details h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

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

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

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.form-group label {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
    background: var(--bg-secondary);
    padding: 0 0.5rem;
}

.form-group textarea + label {
    top: 1.5rem;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.8rem;
    color: var(--primary);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    margin-bottom: 1rem;
}

.footer-logo span {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.footer-text i {
    color: var(--secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-glow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

.back-to-top i {
    color: var(--bg-primary);
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
    }

    .hero-content {
        max-width: 100%;
    }

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

    .hero-visual {
        margin-top: 3rem;
    }

    .code-block {
        transform: none;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: var(--transition);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    section {
        padding: 4rem 1rem;
    }

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

    .stack-grid {
        gap: 1rem;
    }

    .stack-item {
        padding: 1rem 1.5rem;
        min-width: 100px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-primary);
}