/*  1. CSS Variables, Base Styles (Accessibility Included) */
:root {
    --primary-color: #2c3e50; 
    --text-color: #333333;
    --card-bg: rgba(255, 255, 255, 0.95); 
    --accent-blue: #ad8599;
    --accent-peach: #ae8a98;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* MOBILE-FIRST: Base Layout and Scrolling Logic */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    
    /* Fixed viewport with internal flex-scrolling */
    height: 100vh; 
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    
    /* Animated Watercolor Background */
    background: linear-gradient(-45deg, #e0eaf5, #f5e0e6, #f5eee0, #e0f5eb);
    background-size: 400% 400%;
    animation: smoothGradient 15s ease infinite;
}

@keyframes smoothGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Accessibility: Focus states for keyboard navigation */
a:focus, button:focus, input:focus {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

/* 2. Header and Footer (Flexbox Fixed Items) */

header {
    flex: 0 0 auto; 
    background-color: transparent; 
    padding: 1.5rem 1rem;
    text-align: center;
}

/* Text styling for Header and Footer */
header h1, footer p {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 1px 2px 5px rgba(44, 62, 80, 0.4);
    font-weight: bold;
}

header h1 {
    font-size: 1.8rem; 
    margin-bottom: 1rem;
}

footer {
    flex: 0 0 auto; 
    background-color: transparent;
    text-align: center;
    padding: 1.5rem;
}

footer p {
    font-size: 0.9rem; 
    margin-bottom: 0;
}

/* FLEXBOX DEMONSTRATION: Navigation Menu */
nav ul {
    list-style: none;
    display: flex;
    flex-direction: row; 
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem; 
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #ffffff;
    text-shadow: 1px 2px 5px rgba(44, 62, 80, 0.4);
}

nav a:hover {
    color: #ffffff;
    text-shadow: none; 
    background: linear-gradient(-45deg, var(--accent-blue), var(--accent-peach), #c4a7d4, #a0d4d6);
    background-size: 400% 400%;
    animation: smoothGradient 15s ease infinite;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 3. MAIN SCROLLING CONTENT */

main {
    flex: 1 1 auto; 
    overflow-y: auto; 
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}

/* Custom Webkit Scrollbar */
main::-webkit-scrollbar {
    width: 8px;
}
main::-webkit-scrollbar-thumb {
    background: rgba(139, 168, 212, 0.5); 
    border-radius: 4px;
}

section {
    background-color: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center; 
}

/* 4. Text Styles & Visual Design */
p, li {
    font-style: italic; 
    color: #444;
}

.book {
    color: var(--accent-peach); 
    font-weight: bold;
}

h2 {
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.8rem;
    margin-bottom: 2rem;
    display: inline-block;
    font-style: normal; 
}

/* Animated underline for main titles */
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(-45deg, var(--accent-blue), var(--accent-peach), #c4a7d4, #a0d4d6);
    background-size: 400% 400%;
    animation: smoothGradient 15s ease infinite;
}

h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: var(--accent-blue); 
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

ul {
    padding-left: 0;
}

ul li {
    list-style-type: none;
    margin-bottom: 0.8rem;
}

blockquote {
    background-color: rgba(194, 120, 155, 0.15); 
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 1.1rem;
    margin: 2rem auto;
    max-width: 80%; 
    color: #555;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.profile-pic {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 15px; 
    padding: 6px; 
    background: linear-gradient(-45deg, var(--accent-blue), var(--accent-peach), #c4a7d4, #a0d4d6);
    background-size: 400% 400%;
    animation: smoothGradient 15s ease infinite;
    margin: 0 auto 2rem auto;
    display: block;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 5. Grid Layouts and Responsive Design */

@media (min-width: 768px) {
    /* Grid for personal info at the top of the profile */
    .personal-info {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }

    /* Grid for splitting the CV section into two columns */
    .cv-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 2rem;
        text-align: left; 
    }
    
    .cv-section h4 {
        color: var(--accent-blue);
        border-bottom: 1px solid #eee;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }
}