:root {
    --bg-color: #1a1a1a; /* Darker grey background */
    --text-color: #ffffff; /* Pure white text */
    --accent-color: #ff7f50; /* Orange accent throughout */
    --secondary-color: #303030;
    --highlight-color: #bb86fc;
    --bg-gradient-1: rgba(55, 55, 55, 0.03);
    --bg-gradient-2: rgba(26, 26, 26, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: color 0.3s ease, background-color 0.3s ease; /* Add smooth transitions */
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, var(--bg-gradient-1), transparent 40%),
                radial-gradient(circle at 80% 70%, var(--bg-gradient-2), transparent 40%);
    opacity: 0.7;
    z-index: -1;
    animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Adding fade-in animations for page content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header, .profile-image, .about, .contact {
    animation: fadeIn 0.8s ease-out forwards;
}

header {
    animation-delay: 0.1s;
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: none; /* Remove the full-width separator */
    padding-bottom: 2rem;
    position: relative; /* For positioning the separator */
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px; /* 100px wide separator as requested */
    height: 2px; /* Same thickness as the one at the bottom */
    background-color: var(--accent-color); /* Orange color */
}

.profile-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    animation-delay: 0.3s;
    position: relative; /* Add position for hover effect */
}

/* Create a container for each image state */
.profile-photo-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.profile-photo-container:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(255, 127, 80, 0.3);
    border-color: var(--highlight-color);
}

/* Style for both default and hover photos */
.profile-photo-default,
.profile-photo-hover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* Same cropping for both images */
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s ease;
    border-radius: 50%; /* Ensure the images themselves have rounded corners */
}

/* Hide hover image by default */
.profile-photo-hover {
    opacity: 0;
}

/* Show hover image on hover */
.profile-photo-container:hover .profile-photo-hover {
    opacity: 1;
}

/* Hide default image on hover */
.profile-photo-container:hover .profile-photo-default {
    opacity: 0;
}

.about {
    animation-delay: 0.5s;
    width: auto; /* Auto width */
    max-width: 400px; /* Much narrower to match the header name width */
    margin: 0 auto; /* Keep it centered */
}

.contact {
    animation-delay: 0.7s;
    padding: 0; /* Remove padding */
    margin-bottom: 1.5rem; /* Match this with footer margin-top for consistency */
    width: auto; /* Match the width of the about section */
    max-width: 400px; /* Same as the about section */
    margin-left: auto;
    margin-right: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4rem; /* Larger font size for name */
    color: var(--text-color); /* White text */
    margin-bottom: 0.5rem;
    line-height: 1.2; /* Updated line height from 0.9 to 1.2 */
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

h1:hover {
    transform: translateY(-2px) scale(1.01);
    text-shadow: 0 0 10px rgba(255, 127, 80, 0.3);
}

h2 {
    font-size: 2rem;
    color: var(--accent-color); /* Orange accent color */
    margin-top: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 300;
}

.profile {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.image-caption {
    font-style: italic;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #999;
}

.about h2 {
    text-align: center;  /* Center align the "Hello!" */
    font-size: 2.5rem;  /* Larger than before (2rem) but smaller than main title (4rem) */
    margin-bottom: 1.5rem;  /* Add a bit more space below the heading */
}

.about p {
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.about p:hover {
    transform: translateX(3px);
}

.about p:last-child {
    margin-bottom: 0.5rem; /* Reduced from 1.5rem to 0.5rem */
}

.contact-links {
    display: flex;
    justify-content: flex-start; /* Left align the icons */
    gap: 2rem; /* Slightly reduced gap between icons */
    margin-top: 0; /* Remove top margin to bring closer to about section */
    flex-wrap: wrap;
}

/* New icon link styling */
.icon-link {
    color: var(--text-color);
    font-size: 1rem; /* Smaller icon size (reduced from 1.8rem) */
    position: relative;
    transition: all 0.3s ease;
    width: 40px; /* Smaller circle (reduced from 50px) */
    height: 40px; /* Smaller circle (reduced from 50px) */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none; /* Removed the orange border */
}

.icon-link:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 127, 80, 0.2);
}

footer {
    text-align: center;
    padding-top: 2rem;
    margin-top: 3rem; /* Increased from 2.5rem to 3rem */
    border-top: 2px solid var(--accent-color); /* Orange separator */
    font-size: 0.9rem;
    color: #888;
}

/* Responsive design */
@media (min-width: 768px) {
    .profile {
        flex-direction: column; /* Keep the column layout even on larger screens */
        align-items: center;
    }
    
    .profile-image {
        align-items: center;
    }
}

/* Improved mobile responsiveness */
@media (max-width: 480px) {
    h1 {
        font-size: 3rem; /* Smaller font on very small screens */
    }
    
    .about h2 {
        font-size: 2rem;
    }
    
    .profile-photo-container {
        width: 200px;
        height: 200px;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    header::after, footer {
        border-color: #ff7f50;
    }
    
    .icon-link {
        border: 1px solid #ff7f50;
    }
    
    #profile-photo {
        border: 2px solid #ff7f50;
        box-shadow: none;
    }
    
    a {
        color: #ff7f50;
    }
    
    .container {
        padding: 0;
    }
}