:root {
    --primary-color: #2563eb;
    --secondary-color: #4b5563;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --accent-color: #3b82f6;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --secondary-color: #9ca3af;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-light: #cbd5e1;
    --accent-color: #38bdf8;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

h1,
h2,
h3,
h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary-color);
}

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

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.btn-primary.small {
    padding: 0.5rem 1rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--text-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    margin-top: 0;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.hero h2 {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    max-width: 500px;
}

.circuit-pattern {
    width: 400px;
    height: 400px;
    background-image: radial-gradient(var(--text-light) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Animations */
.animate-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

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

/* Sections */
.section {
    padding: 5rem 2rem;
}

.bg-alt {
    background-color: var(--card-bg);
    /* Use card-bg logic for alt sections effectively */
}

/* Use slightly different shade for bg-alt if card-bg is same as main bg in some themes */
[data-theme="light"] .bg-alt {
    background-color: #fff;
}

[data-theme="dark"] .bg-alt {
    background-color: #162032;
}


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

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

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item h3 {
    font-size: 2rem;
    color: var(--primary-color);
}

.img-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--card-bg);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--text-light);
    box-shadow: var(--shadow);
}

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

.skill-category h3 {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

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

.tags span {
    background-color: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    font-weight: 500;
}

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

.project-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
}

.img-placeholder-rect {
    width: 100%;
    height: 200px;
    background-color: var(--secondary-color);
    opacity: 0.2;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
}

.card-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tech-stack span {
    font-size: 0.75rem;
    background-color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.card-links a {
    margin-right: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Experience */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    border-left: 2px solid var(--primary-color);
    padding-left: 2rem;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.contact-info p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

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

.social-links a {
    font-size: 2rem;
    color: var(--text-color);
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--secondary-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    background-color: var(--card-bg);
    margin-top: 4rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow);
        transition: 0.3s;
    }

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

    .hamburger {
        display: block;
    }

    .hero {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        margin-top: 2rem;
    }

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}