/* General Styles */
body {
    font-family: 'Lato', sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #fff;
    text-align: center;
    display: flex; /* Use Flexbox */
    flex-direction: column; /* Arrange children vertically */
    min-height: 100vh; /* Ensure body takes full viewport height */
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for dark mode */
}

h1, h2 {
    font-family: 'Source Sans Pro', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: #555;
}

p {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    color: #666;
    font-weight: 300;
    max-width: 800px; /* Limit text width for readability */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: #555;
}

/* Header */
header {
    /* position: relative; */ /* No longer needed for absolute positioning */
    padding: 10px 20px; /* Add horizontal padding */
    display: flex; /* Use Flexbox */
    align-items: center; /* Vertically center items */
    justify-content: space-around; /* Space out nav and toggle */
    flex-wrap: wrap; /* Allow wrapping if needed, though unlikely here */
}

header nav {
    flex-grow: 1; /* Allow nav to take up available space */
    text-align: center; /* Keep nav links centered within their space */
}

header nav ul {
    list-style: none;
    padding: 10px 0; /* Adjusted padding */
    margin: 0;
}

header nav ul li {
    display: inline-block;
    margin: 0 15px;
}

header nav ul li a {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 20px;
    transition: background-color 0.3s, color 0.3s;
}

header nav ul li a:hover {
    background-color: #eee;
    color: #333;
}

/* Dark Mode Toggle Button */
#darkModeToggle {
    /* position: absolute; */ /* Removed */
    /* top: 50%; */ /* Removed */
    /* right: 30px; */ /* Removed */
    /* transform: translateY(-50%); */ /* Removed */
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 7px;
    line-height: 1;
    transition: background-color 0.3s, border-color 0.3s;
}

#darkModeToggle:hover {
    background-color: #eee;
}

/* Main Content Area */
main {
    padding: 40px 20px 60px 20px; /* Add padding around main content */
    /* min-height: calc(100vh - 250px); */ /* Removed - Flexbox handles this now */
    flex-grow: 1; /* Allow main content to fill available space */
    opacity: 0; /* Start hidden for animation */
    animation: fadeIn 0.8s ease-in-out forwards; /* Apply fade-in animation */
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dividers and Anchors - Updated */
.divider {
    border: none;
    height: 1px;
    /* removed background-image gradient */
    background-color: #eee; /* Simple light grey line */
    margin: 40px auto; 
    width: 80%; 
}

.header-divider {
    border: none; /* remove double line effect */
    background-color: #eee; /* Keep simple line */
    margin-top: 10px; 
    margin-bottom: 50px; 
    width: 100%;
}

/* Remove styles for scrolling anchors/dividers */
/* .about-divider, .contact-divider { ... } */
/* .section-anchor { ... } */

/* Hero Section */
.hero {
    padding: 0 20px 10px 20px;
    margin-top: -60px; /* Increased negative margin further */
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid #f0f0f0;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 2.4em;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.4em;
    max-width: max-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px; /* Increased margin */
    text-transform: uppercase;
}

.separator {
    width: 80px; /* Increased width */
    height: 2px;
    background-color: #aaa;
    margin: 15px auto 15px auto; /* Increased margins */
}

.hero .subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.225em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 20px; /* Reduced margin since we now have a divider */
}

/* About Section */
.about {
    padding: 20px 20px 40px 20px;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 20px; /* Reduced margin since we now have a divider */
}

.about h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    letter-spacing: 0.2em;
    color: #555;
}

.about p {
    margin-bottom: 20px;
    text-align: left;
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
}

/* Contact Section - Updated */
.contact {
    padding: 40px 20px;
    /* margin-top: 0; */ /* Removed */
}

.contact h2 {
    margin-bottom: 30px;
    font-size: 1.5em;
}

.contact p.contact-intro {
    margin-bottom: 30px; /* Space between intro and details */
}

.contact address {
    font-style: normal; /* Remove default italics */
    line-height: 1.8; /* Spacing for address lines */
    color: #666;
}

.contact address a {
    color: #555; /* Match general link color */
    text-decoration: underline; /* Add underline */
    display: inline-block; /* Required for transform */
    transition: transform 0.2s ease; /* Smooth transition for pop effect */
}

.contact address a:hover {
    text-decoration: underline;
    color: #333; /* Slightly darker on hover */
    transform: scale(1.05); /* Pop-out effect */
}

/* Footer - Updated */
.footer-divider {
    border: none;
    background-color: #eee;
    margin: 10px auto 5px auto; /* Further reduced top and bottom margins */
    width: 80%;
}

footer {
    padding: 5px 20px 10px 20px; /* Further reduced padding */
    font-size: 0.9em;
    color: #aaa;
    text-align: center;
}

/* Footer Icons - Updated */
footer .social-link {
    display: inline-block;
    margin: 0 10px; /* Space between icons */
    border: 1px solid #ddd;
    border-radius: 50%;
    padding: 8px; /* Padding around SVG */
    line-height: 0; /* Prevent extra space */
    transition: transform 0.3s ease, background-color 0.3s ease; /* Added transform transition */
}

footer .social-link:hover {
    background-color: #f5f5f5; /* Light background on hover */
    transform: scale(1.15); /* Added scale effect */
}

.social-icon {
    width: 20px; /* Adjusted size */
    height: 20px;
    fill: #aaa; /* Icon color */
    transition: fill 0.3s;
    vertical-align: middle; /* Align icon nicely */
}

footer .social-link:hover .social-icon {
    fill: #555; /* Darken icon on hover */
}

/* --- Dark Mode Styles --- */
body.dark-mode {
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Lighter text */
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #f0f0f0; /* Lighter headings */
}

body.dark-mode p,
body.dark-mode .hero .subtitle,
body.dark-mode .contact address {
    color: #bdbdbd; /* Lighter paragraph text */
}

body.dark-mode a {
    color: #cccccc; /* Lighter link text */
}

body.dark-mode header nav ul li a {
    border-color: #444;
    color: #cccccc;
}

body.dark-mode header nav ul li a:hover {
    background-color: #333;
    border-color: #555;
    color: #f0f0f0;
}

body.dark-mode .divider,
body.dark-mode .header-divider,
body.dark-mode .footer-divider {
    background-color: #444; /* Darker dividers */
}

body.dark-mode .separator {
    background-color: #666;
}

body.dark-mode .profile-pic {
    border-color: #333;
}

body.dark-mode .profile-pic:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .contact address a {
    color: #bdbdbd; /* Light color for dark mode */
    text-decoration: underline;
}

body.dark-mode .contact address a:hover {
    color: #ffffff; /* White on hover in dark mode */
    transform: scale(1.05); /* Pop-out effect */
}

body.dark-mode footer {
    color: #888; /* Adjust footer text color */
}

body.dark-mode footer .social-link {
    border-color: #444;
}

body.dark-mode footer .social-link:hover {
    background-color: #333;
    /* Transform effect is inherited from the base style, no need to repeat */
}

body.dark-mode .social-icon {
    fill: #888; /* Dark mode icon color */
}

body.dark-mode footer .social-link:hover .social-icon {
    fill: #ccc; /* Dark mode icon hover color */
}

body.dark-mode #darkModeToggle {
    border-color: #444;
    color: #ccc;
}

body.dark-mode #darkModeToggle:hover {
    background-color: #333;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    /* Stack header items vertically on small screens */
    header {
        flex-direction: column; /* Keep stacking nav and button */
        align-items: center; /* Center stacked items */
        gap: 1rem; /* Add space between nav and toggle */
        padding: 15px 10px;
    }

    header nav {
        width: 100%;
        /* text-align: center; Removed, ul handles centering now */
    }
    
    /* Make ul a flex container for better centering */
    header nav ul {
        padding: 5px 0;
        display: flex; /* Use flexbox */
        flex-wrap: wrap; /* Allow wrapping */
        justify-content: center; /* Center items horizontally */
        gap: 0; /* Remove default gap if any, rely on li margin */
        list-style: none; /* Ensure list style is none */
        margin: 0; /* Remove default ul margin */
    }

    /* Adjust li margin */
    header nav ul li {
        /* display: inline-block; Removed */
        margin: 8px; /* Keep margin for spacing */
    }
    
    /* Restore button appearance for links, adjust size */
    header nav ul li a {
        padding: 8px 12px; /* Adjusted padding */
        font-size: 0.85em; /* Slightly smaller font */
        border: 1px solid #ddd; /* Restore border */
        border-radius: 20px; /* Restore border-radius */
    }
    
    /* Restore original hover effects */
    body:not(.dark-mode) header nav ul li a:hover {
         background-color: #eee; /* Restore light mode hover */
         color: #333;
    }
    body.dark-mode header nav ul li a:hover {
         background-color: #333; /* Restore dark mode hover */
         border-color: #555;
         color: #f0f0f0;
    }
    
    /* Dark mode border for mobile buttons */
    body.dark-mode header nav ul li a {
        border-color: #444;
        color: #cccccc;
    }
    
    .hero h1 {
        font-size: 2em;
    }

    .profile-pic {
        width: 150px;
        height: 150px;
    }
}

/* Image Security Styles */
img {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
}

/* Styles ONLY for specifically secured images (like profile pic) */
.secure-image-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.secure-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

body.dark-mode .secure-image-container:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.secure-image-container img {
    display: block;
    pointer-events: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10;
    cursor: default;
}

.section-divider {
    border: none;
    height: 1px;
    background-color: #eee;
    margin: 20px auto;
    width: 60%;
}

/* Dark mode adjustment for the new divider */
body.dark-mode .section-divider {
    background-color: #444;
} 