:root {
    --primary-blue: #4A6BFF;
    /* Main brand blue */
    --dark-navy: #1A1A2E;
    /* Dark background for header/footer */
    --light-bg: #F8FAFF;
    /* Light background for sections */
    --accent-cyan: #00B4D8;
    /* Accent color for highlights */
    --text-dark: #333D4D;
    /* Dark gray text */
    --text-light-grey: #6C7A89;
    /* Lighter gray for paragraphs */
    --card-bg: #FFFFFF;
    /* White background for cards */
    --shadow-light: rgba(0, 0, 0, 0.08);
    /* Subtle shadow */
    --shadow-hover: rgba(0, 0, 0, 0.18);
    /* More pronounced shadow on hover */
    --border-radius-sm: 8px;
    --border-radius-lg: 12px;
    --section-padding: 5rem;
    --section-even-bg: #E9F2FF;
    /* Light blue tint for even sections */
}

/* CSS Variables for Dark Theme */
body.dark-mode {
    --primary-blue: #7B68EE;
    /* Slightly lighter purple for dark mode accent */
    --dark-navy: #0D1117;
    /* Very dark grey for background */
    --light-bg: #161B22;
    /* Darker grey for sections */
    --accent-cyan: #00BCD4;
    /* Brighter cyan for highlights */
    --text-dark: #E6EDF3;
    /* Light text for dark mode */
    --text-light-grey: #8B949E;
    /* Lighter grey for paragraphs in dark mode */
    --card-bg: #1F242C;
    /* Darker card background */
    --shadow-light: rgba(0, 0, 0, 0.3);
    /* Darker subtle shadow */
    --shadow-hover: rgba(0, 0, 0, 0.5);
    /* Darker pronounced shadow on hover */
    --section-even-bg: #1A202A;
    /* Even darker tint for even sections in dark mode */
}

/* Universal Box Sizing & Font Smoothing */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Body Typography and Background */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    scroll-behavior: smooth;
    /* Smooth scrolling for anchor links */
    transition: background-color 0.5s ease, color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Reusable Container for Content Width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    /* Consistent horizontal padding */
}

/* Header Section Styling */
header {
    background-color: var(--dark-navy);
    color: white;
    padding: var(--section-padding) 0;
    /* Generous vertical padding */
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Ensures any pseudo-elements stay within bounds */
    box-shadow: 0 4px 20px var(--shadow-light);
    /* Subtle shadow for depth */
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Decorative background shapes in header */
header::before,
header::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    /* Semi-transparent white circles */
    border-radius: 50%;
    z-index: 0;
    /* Keep behind content */
    filter: blur(1px);
    /* Slightly blur for softness */
    transition: background 0.5s ease;
    /* Smooth transition for dark mode */
}

header::before {
    width: 250px;
    height: 250px;
    top: -80px;
    left: -80px;
}

header::after {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -100px;
}

/* Header Content Alignment */
.header-content {
    position: relative;
    /* Brings content to foreground */
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Profile Image Styling */
.profile-img {
    width: 180px;
    /* Larger size */
    height: 180px;
    border-radius: 50%;
    /* Perfect circle */
    object-fit: cover;
    /* Ensures image covers the area without distortion */
    border: 7px solid var(--accent-cyan);
    /* Prominent accent border */
    margin-bottom: 1.5rem;
    /* Space below image */
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out, border-color 0.5s ease;
    /* Smooth hover effects & dark mode transition */
    box-shadow: 0 0 0 5px rgba(0, 180, 216, 0.2);
    /* Outer glow */
}

.profile-img:hover {
    transform: scale(1.05) rotate(3deg);
    /* Slight scale and rotate */
    box-shadow: 0 0 0 8px rgba(0, 180, 216, 0.4);
    /* Enhanced glow */
}

/* Name Styling */
h1 {
    font-size: 3.2rem;
    /* Large and impactful name */
    margin-bottom: 0.8rem;
    font-weight: 800;
    /* Extra bold */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    /* Subtle text shadow */
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

body.dark-mode h1 {
    color: var(--text-dark);
    /* Ensure text color updates in dark mode */
    text-shadow: none;
}

/* Tagline Styling */
.tagline {
    font-size: 1.5rem;
    /* Clear and readable tagline */
    color: var(--accent-cyan);
    /* Accent color */
    margin-bottom: 2rem;
    font-weight: 600;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Social Links Styling */
.social-links {
    display: flex;
    gap: 1.5rem;
    /* Space between icons */
    margin-bottom: 2rem;
}

.social-links a {
    color: white;
    font-size: 2rem;
    /* Large icons */
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-cyan);
    transform: translateY(-5px);
    /* Lift effect */
}

/* Contact Button Styling */
.contact-btn {
    display: inline-flex;
    /* Allows icon and text to align */
    align-items: center;
    background-color: var(--accent-cyan);
    color: white;
    padding: 0.9rem 2.5rem;
    /* Generous padding */
    border-radius: 50px;
    /* Pill shape */
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    gap: 0.75rem;
    /* Space between icon and text */
    box-shadow: 0 5px 15px rgba(0, 180, 216, 0.3);
    /* Initial shadow */
}

.contact-btn:hover {
    background-color: #008da8;
    /* Slightly darker accent on hover */
    transform: translateY(-7px);
    /* More pronounced lift */
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.6);
    /* Stronger shadow */
}

/* Section Common Styling */
section {
    padding: var(--section-padding) 0;
    /* Consistent vertical padding */
    background-color: var(--light-bg);
    transition: background-color 0.5s ease, color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Alternate background for sections for visual separation */
section:nth-of-type(even) {
    background-color: var(--section-even-bg);
    /* Light blue tint */
}

/* Section Title Styling */
.section-title {
    text-align: center;
    margin-bottom: 4.5rem;
    /* More space below title */
    position: relative;
}

.section-title h2 {
    font-size: 2.8rem;
    /* Large section titles */
    display: inline-block;
    padding-bottom: 1rem;
    /* Space for underline */
    font-weight: 700;
    color: var(--dark-navy);
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Underline effect for section titles */
.section-title h2::after {
    content: '';
    position: absolute;
    width: 80px;
    /* Longer underline */
    height: 5px;
    /* Thicker underline */
    background-color: var(--primary-blue);
    /* Primary color underline */
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
    /* Rounded ends */
    transition: background-color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* About Section Layout */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Text wider than image on large screens */
    gap: 3.5rem;
    /* Generous gap */
    align-items: center;
}

/* About Text Styling */
.about-text p {
    margin-bottom: 1.5rem;
    /* Space between paragraphs */
    font-size: 1.15rem;
    color: var(--text-light-grey);
    text-align: justify;
    /* Justify text for clean look */
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* About Image Styling */
.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    /* Rounded corners */
    box-shadow: 0 10px 30px var(--shadow-light);
    /* Prominent shadow */
    transition: transform 0.4s ease-in-out, box-shadow 0.5s ease;
    /* Smooth zoom on hover & dark mode transition */
}

.about-image img:hover {
    transform: scale(1.02);
    /* Slight zoom on hover */
}

/* Skills Section Layout */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Responsive grid for skill categories */
    gap: 2.5rem;
    /* Space between skill cards */
}

/* Skill Category Card Styling (Revised for more resume-oriented style) */
.skill-category {
    background-color: var(--card-bg);
    padding: 1.8rem;
    /* Slightly reduced padding for a more compact feel */
    border-radius: var(--border-radius-lg);
    box-shadow: 0 3px 10px var(--shadow-light);
    /* Less intense initial shadow */
    transition: all 0.3s ease-in-out, background-color 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
    /* Smooth transition for dark mode */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Add a very subtle border */
}

.skill-category:hover {
    transform: translateY(-3px);
    /* Subtle lift on hover */
    box-shadow: 0 6px 20px var(--shadow-hover);
    /* More focused shadow on hover */
    border-color: var(--accent-cyan);
    /* Highlight border on hover */
}

.skill-category h3 {
    margin-bottom: 1.3rem;
    color: var(--primary-blue);
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(0, 180, 216, 0.2);
    /* Subtle accent underline */
    padding-bottom: 0.7rem;
    font-weight: 600;
    transition: color 0.5s ease, border-color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Skill List Item Styling */
.skill-list {
    list-style-type: none;
    /* Remove default list bullets */
}

.skill-list li {
    margin-bottom: 0.8rem;
    /* Space between skills */
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Custom bullet point for skills */
.skill-list li::before {
    content: '\2022';
    /* Unicode solid circle bullet */
    color: var(--accent-cyan);
    margin-right: 0.8rem;
    font-size: 1.3rem;
    line-height: 1;
    /* Align with text vertically */
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Education Section Layout */
.education-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    /* Responsive grid for education items */
    gap: 2.5rem;
}

/* Education Item Card Styling */
.education-item {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
    /* Smooth transition for dark mode */
}

.education-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 35px var(--shadow-hover);
}

.education-item h3 {
    margin-bottom: 0.7rem;
    font-size: 1.45rem;
    color: var(--dark-navy);
    font-weight: 700;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

.education-item .date {
    color: var(--text-light-grey);
    font-style: italic;
    margin-bottom: 0.7rem;
    font-size: 1rem;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

.education-item .institution {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

.education-item p {
    color: var(--text-dark);
    font-size: 1.05rem;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Projects Section Layout */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    /* Responsive grid for project cards */
    gap: 3rem;
    /* More space between projects */
}

/* Project Card Styling */
.project-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    /* Clips image and content within rounded corners */
    box-shadow: 0 8px 25px var(--shadow-light);
    /* Initial shadow */
    transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.5s ease;
    /* Smooth transition for dark mode */
    display: flex;
    /* Use flex for internal layout */
    flex-direction: column;
    /* Stack image on top of info */
}

.project-card:hover {
    transform: translateY(-15px);
    /* More pronounced lift */
    box-shadow: 0 15px 45px var(--shadow-hover);
    /* Stronger shadow */
}

.project-img {
    width: 100%;
    height: 250px;
    /* Consistent image height for visual balance */
    object-fit: cover;
    /* Ensures image covers the area without distortion */
    transition: transform 0.5s ease;
    /* Smooth zoom effect on hover */
    display: block;
    /* Remove extra space below image */
}

.project-card:hover .project-img {
    transform: scale(1.08);
    /* Zoom effect */
}

.project-info {
    padding: 1.8rem;
    flex-grow: 1;
    /* Allows info section to expand */
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.8rem;
    font-size: 1.6rem;
    color: var(--dark-navy);
    font-weight: 800;
    /* Extra bold for project titles */
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

.project-info p {
    margin-bottom: 1.5rem;
    color: var(--text-light-grey);
    font-size: 1.05rem;
    flex-grow: 1;
    /* Allows description to take available space */
    text-align: justify;
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

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

.tech-tag {
    background-color: rgba(74, 107, 255, 0.1);
    /* Light blue background for tags */
    color: var(--primary-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.5s ease, color 0.5s ease;
    /* Smooth transition for dark mode */
}

body.dark-mode .tech-tag {
    background-color: rgba(123, 104, 238, 0.2);
    /* Dark mode tag background */
    color: var(--primary-blue);
}

.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    /* Space from description */
    justify-content: flex-end;
    /* Align links to the right */
    align-items: center;
}

.project-links a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    /* Align icon and text */
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
}

.project-links a:hover {
    color: var(--accent-cyan);
    transform: translateY(-3px);
}

/* Footer Styling */
footer {
    background-color: var(--dark-navy);
    color: white;
    text-align: center;
    padding: 3rem 0;
    box-shadow: 0 -4px 20px var(--shadow-light);
    /* Shadow above footer */
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
    /* Smooth transition for dark mode */
}

.footer-content p {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.5s ease;
    /* Smooth transition for dark mode */
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-navy);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
}

.dark-mode-toggle:hover {
    background-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Hide the moon icon in light mode, sun icon in dark mode */
body:not(.dark-mode) .dark-mode-toggle .fa-moon {
    display: block;
}

body.dark-mode .dark-mode-toggle .fa-moon {
    display: none;
}

body:not(.dark-mode) .dark-mode-toggle .fa-sun {
    display: none;
}

body.dark-mode .dark-mode-toggle .fa-sun {
    display: block;
}


/* --- Responsive Design --- */

/* Tablets and larger phones (768px and up) */
@media (max-width: 992px) {
    :root {
        --section-padding: 4rem;
    }

    h1 {
        font-size: 2.8rem;
    }

    .tagline {
        font-size: 1.3rem;
    }

    .section-title h2 {
        font-size: 2.4rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        /* Stack about sections */
        gap: 2.5rem;
    }

    .about-image {
        order: -1;
        /* Move image above text on smaller screens */
    }

    .skills-container,
    .education-list,
    .projects-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }

    .project-img {
        height: 200px;
    }
}

/* Smaller phones (up to 767px) */
@media (max-width: 767px) {
    :root {
        --section-padding: 3rem;
    }

    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .profile-img {
        width: 140px;
        height: 140px;
    }

    .social-links a {
        font-size: 1.8rem;
    }

    .contact-btn {
        padding: 0.7rem 1.8rem;
        font-size: 0.95rem;
    }

    .section-title h2 {
        font-size: 2rem;
        margin-bottom: 3.5rem;
    }

    .about-text p,
    .skill-list li,
    .education-item p,
    .project-info p {
        font-size: 1rem;
    }

    .skills-container,
    .education-list,
    .projects-container {
        grid-template-columns: 1fr;
        /* Single column layout */
        gap: 1.5rem;
    }

    .skill-category,
    .education-item,
    .project-card {
        padding: 1.5rem;
    }

    .project-img {
        height: 160px;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }

    .project-links {
        justify-content: center;
        /* Center links on mobile */
    }

    .project-links a {
        font-size: 0.95rem;
        gap: 0.3rem;
    }
}

/* Very small phones (up to 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .profile-img {
        width: 100px;
        height: 100px;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        font-size: 1.5rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .about-text p,
    .skill-list li,
    .education-item p,
    .project-info p {
        font-size: 0.9rem;
    }

    .project-img {
        height: 120px;
    }

    .dark-mode-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}