:root {
    /* Dark Theme Variables (Default) */
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #38bdf8;
    --secondary-color: #818cf8;
    --section-bg: #1e293b;
    --card-bg: #1e293b;
    --card-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(15, 23, 42, 0.85);
}

[data-theme="light"] {
    /* Light Theme Variables */
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --primary-color: #0284c7;  /* Slightly darker blue for contrast */
    --secondary-color: #4f46e5;
    --section-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(248, 250, 252, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Custom Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) var(--bg-color);
}

/* Custom Scrollbar for Chrome, Safari, Edge */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

html {
    scroll-behavior: smooth;
}

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

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    backdrop-filter: blur(12px);
    background-color: var(--nav-bg);
    z-index: 1000;
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.4s ease;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.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;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

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

.nav-links a.active {
    font-weight: 700;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
    margin-left: 2rem;
}
.theme-toggle:hover {
    color: var(--primary-color);
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* Sections */
.section {
    padding: 8rem 10% 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    color: var(--text-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Hero Section */
.hero {
    align-items: flex-start;
}

.greeting {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    min-height: 1.5rem; /* Prevent layout shift while typing */
    display: flex;
    align-items: center;
}

.typing-container::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--primary-color);
    margin-left: 2px;
}

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

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

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

/* Buttons */
.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

.cta-button.primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.cta-button.primary:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.1);
}

.cta-button.secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--card-border);
}

.cta-button.secondary:hover {
    border-color: var(--text-secondary);
    transform: translateY(-3px);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}
.about-text strong {
    color: var(--primary-color);
}

.skills-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skills-list li {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 500;
    transition: transform 0.3s ease;
}
.skills-list li:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 14px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-content h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 0.2rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-date {
    display: inline-block;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    background: var(--card-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.timeline-content p {
    color: var(--text-secondary);
}

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

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

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

.project-logo {
    font-size: 3rem;
    color: var(--primary-color);
    padding: 1.5rem 2rem 0;
    margin-bottom: -1rem; /* Overlap slightly with content */
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.project-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

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

/* Contact Section */
#contact {
    text-align: center;
    align-items: center;
}

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

.contact-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.contact-item:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon i {
    font-size: 2.5rem;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-top: 1px solid var(--card-border);
    background-color: var(--nav-bg); /* Match header for cohesion */
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 6rem 5% 4rem;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--nav-bg);
        padding: 2rem 0;
        text-align: center;
        border-bottom: 1px solid var(--card-border);
    }
    .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .timeline::before {
        left: 10px;
    }
    .timeline-item {
        padding-left: 40px;
    }
    .timeline-dot {
        left: 4px;
    }
}
