/* 1. Reset and Global Styles */
* {
    box-sizing: border-box; /* Crucial for controlling padding/border in layout */
    margin: 0;
    padding: 0;
}

/* 2. BODY/PAGE LAYOUT & TEXT CONFIGURATION */
body {
    /* **Required:** Text Configuration (Font) */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    /* **Required:** Color Configuration */
    background-color: #f8f9fa; /* Light background */
    color: #343a40; /* Dark text for contrast */
    
    /* Overall Layout: Flex container for full height */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 3. HEADER LAYOUT & COLOR */
header {
    background-color: #007bff; /* Primary Brand Color */
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 10px;
}

/* 4. NAVIGATION STYLING */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px; /* Spacing between nav items */
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    /* Hover effect for visual appeal */
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 5. MAIN CONTENT LAYOUT & WHITE SPACE ALLOCATION */
main {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto; /* Generous white space around the main content */
    padding: 30px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    flex-grow: 1; /* Pushes the footer to the bottom */
}

.project-item, .profile-summary {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

/* 6. IMAGE AND FIGURE STYLING */
figure {
    margin: 20px 0;
    text-align: center;
}

figure img {
    max-width: 100%; /* Ensures images scale down on smaller screens */
    height: auto;
    display: block;
    margin: 0 auto;
}

figcaption {
    font-style: italic;
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

/* 7. FOOTER LAYOUT & COLOR */
footer {
    background-color: #343a40; /* Dark color */
    color: #adb5bd; /* Light gray text */
    text-align: center;
    padding: 15px 0;
    font-size: 0.9em;
}

footer a {
    color: #17a2b8; /* Secondary/Accent color for links */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 8. MOBILE DEVICE DISPLAY (Responsiveness) */
/* Media query for screens 768px wide or smaller (common tablet/mobile breakpoint) */
@media (max-width: 768px) {
    main {
        margin: 20px auto;
        padding: 15px;
    }

    /* Stack navigation items vertically on small screens */
    nav ul {
        flex-direction: column;
        gap: 5px;
        padding-top: 10px;
    }
}

.email-link {
    font-size: 1.2em;
    font-weight: bold;
    color: #007bff; /* Primary brand color */
}

/* Styles the list of external links */
.social-links ul {
    list-style: none;
    padding: 0;
}

.social-links li {
    margin-bottom: 10px;
}

.external-link {
    color: #343a40; /* Darker text */
    text-decoration: none;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.external-link:hover {
    background-color: #e9ecef;
    text-decoration: underline;
}

h3 {
    margin-top: 20px;
}

.back-to-top-link {

    
    background-color: #343a40; /* Dark background */
    color: white; 
    text-decoration: none; /* Remove underline */
    padding: 4px 15px;
    border-radius: 4px; 
    font-size: 0.9em;
    opacity: 0.8;
    transition: background-color 0.3s, opacity 0.3s;
}

.back-to-top-link:hover {
    background-color: #007bff; /* Primary color on hover */
    opacity: 1;
}

html {
    scroll-behavior: smooth;
}