:root {
    --color-primary: #1a73e8; /* Blue accent */
    --color-background: #ffffff;
    --color-surface: #f7f7f7;
    --color-text-header: #1f1f1f;
    --color-text-body: #4a4a4a;
    --color-shadow: rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 12px;
}

[data-theme="dark"] {
    --color-primary: #8ab4f8; /* Lighter blue for dark mode */
    --color-background: #1f1f1f;
    --color-surface: #2c2c2c;
    --color-text-header: #e0e0e0;
    --color-text-body: #b0b0b0;
    --color-shadow: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Apply smooth transition to colors for theme change */
    transition: background-color var(--transition-speed), color var(--transition-speed), box-shadow var(--transition-speed);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

section {
    padding: 80px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    color: var(--color-text-header);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--color-background);
    box-shadow: 0 2px 4px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--color-text-body);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
    padding: 5px 0;
    position: relative;
}

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

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

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--color-text-header);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    margin-left: 10px;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--color-primary);
}

#home {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--color-primary);
    color: var(--color-background);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px var(--color-shadow);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px var(--color-shadow);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: center;
}

.profile-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px var(--color-shadow);
    justify-self: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

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

.project-card {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--color-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.project-links a {
    color: var(--color-primary);
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 1;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: var(--color-background);
    border: 4px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 2;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -16px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--color-surface);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--color-shadow);
}

.timeline-content h4 {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.timeline-content .duration {
    font-style: italic;
    margin-bottom: 10px;
    display: block;
}

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

.video-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px var(--color-shadow);
    background-color: var(--color-surface);
    text-decoration: none;
    display: block;
    position: relative;
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-card img {
    width: 100%;
    height: auto;
    display: block;
}

.video-info {
    padding: 15px;
}

.video-info h4 {
    font-size: 1.1rem;
    color: var(--color-text-header);
    margin: 0;
    line-height: 1.4;
}

/* * 10. Contact Section (Form and Socials) 
 */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input, .contact-form textarea {
    padding: 12px;
    border: 1px solid var(--color-text-body);
    border-radius: var(--border-radius);
    background-color: var(--color-background);
    color: var(--color-text-body);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.social-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  color: inherit;
  text-decoration: none;
}

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

footer {
    text-align: center;
    padding: 30px 5%;
    border-top: 1px solid var(--color-surface);
    font-size: 0.9rem;
    background-color: var(--color-background);
}

#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
    z-index: 999;
}

#scroll-to-top:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 5%;
    }

    .nav-links {
        /* In a production site, this would be replaced with a hamburger menu */
        display: none; 
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .about-content, .contact-content {
        grid-template-columns: 1fr; /* Stack content vertically */
    }

    .profile-img {
        margin-bottom: 30px;
    }
    
    /* Center timeline items on mobile */
    .timeline::after {
        left: 18px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 15px;
    }

    /* Move the dots and content to the right side of the line */
    .left::after, .right::after {
        left: 10px;
    }

    .right {
        left: 0%;
    }

    .right::after {
         left: 10px;
    }

    .timeline-content .duration {
        font-size: 0.8rem;
    }
}

/* Animation for section content (Bonus) */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}