:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #0f172a;
    --accent: #38bdf8;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --secondary: #f1f5f9;
    --accent: #0ea5e9;
    --bg-light: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --white: #1e293b;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --card-bg: #1e293b;
    --input-bg: #1e293b;
    --input-border: #334155;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Utilities */
.highlight {
    color: var(--primary);
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
}

.logo-icon {
    color: var(--primary);
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    align-items: center;
}

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

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

.btn-nav {
    padding: 10px 20px;
    background: var(--primary);
    color: #ffffff !important;
    border-radius: 8px;
    transition: background 0.3s;
}

.btn-nav:hover {
    background: var(--primary-dark);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

#theme-btn {
    background: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

#theme-btn:hover {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top right, var(--white) 0%, transparent 40%),
                radial-gradient(circle at bottom left, var(--white) 0%, transparent 40%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--secondary);
    font-weight: 800;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-main);
}

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

.tech-stack {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--input-border);
    padding-top: 24px;
}

.tech-stack i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.tech-stack i:hover {
    color: var(--primary);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 400px;
}

.code-block {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    transform: rotate(-2deg);
    transition: transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block:hover {
    transform: rotate(0deg);
}

.code-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

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

.red { background: #ef4444; }
.yellow { background: #f59e0b; }
.green { background: #10b981; }

.keyword { color: #c084fc; }
.var { color: #60a5fa; }
.class { color: #fbbf24; }
.string { color: #34d399; }
.method { color: #22d3ee; }
.comment { color: #64748b; display: block; margin-top: 8px; }

.floating-card {
    position: absolute;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.card-1 {
    top: -20px;
    right: 20px;
    color: var(--primary);
}

.card-2 {
    bottom: 40px;
    left: -20px;
    color: #10b981;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Services Section */
.services {
    padding: 100px 0;
    background: var(--card-bg);
    transition: background-color 0.3s ease;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--secondary);
}

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-light);
    padding: 40px 30px;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.service-card:hover {
    background: var(--card-bg);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--input-border);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
    font-size: 1.5rem;
    border: 1px solid var(--input-border);
}

.service-card h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: var(--secondary);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Portfolio Section */
.portfolio {
    padding: 100px 0;
    background: var(--bg-light);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.portfolio-item {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.portfolio-image {
    height: 200px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--text-muted);
}

.portfolio-image .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
}

.portfolio-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.portfolio-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--secondary);
}

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

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

.link-arrow:hover {
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-light);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background: var(--gradient-primary);
    color: #ffffff;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: #ffffff;
}

.cta-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #ffffff;
}

.btn-white {
    background: #ffffff;
    color: var(--primary);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s;
    display: inline-block;
}

.btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: var(--card-bg);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--secondary);
}

.contact-info > p {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
}

.info-item .icon {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    border: 1px solid var(--input-border);
}

.info-item h4 {
    margin-bottom: 4px;
    font-size: 1rem;
    color: var(--secondary);
}

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

.contact-form {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--input-bg);
    color: var(--text-main);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 40px;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-logo span {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.footer-logo p {
    font-size: 0.9rem;
    max-width: 250px;
    color: #94a3b8;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

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

.social-links a {
    color: #94a3b8;
    font-size: 1.25rem;
    margin-left: 16px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #ffffff;
}

.copyright {
    text-align: center;
    padding-top: 24px;
    font-size: 0.85rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease 0.2s;
}

.reveal-delay.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 30px 0;
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--input-border);
    }

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

    .theme-toggle {
        margin-left: auto;
        margin-right: 20px;
    }

    .hamburger {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--secondary);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

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

    .tech-stack {
        justify-content: center;
    }

    .hero-visual {
        height: 300px;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

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

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .social-links a {
        margin: 0 8px;
    }
}
