/* ---------------------------- */
/* ----- Global Variables ----- */
/* ---------------------------- */
:root {
    /* Color Scheme Meta Tag tells browser about supported schemes */
    color-scheme: light dark;

    /* --- Default: Light Theme Variables --- */
    --bg-color: #f8f9fa;
    --card-bg-color: #ffffff;
    --text-color: #212529;
    --text-muted-color: #6c757d;
    --heading-color: #1a1a1a;
    --accent-color: #007bff;
    --accent-hover-color: #0056b3;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --avatar-border-color: var(--card-bg-color);

    /* --- Base Variables (Theme Independent) --- */
    --font-family-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
        Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --border-radius: 8px;
    --transition-speed: 0.2s ease-in-out;
}

/* --- Dark Theme Variables --- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        /* Apply if OS is dark AND no explicit light theme override */
        --bg-color: #121212; /* Very dark grey */
        --card-bg-color: #1e1e1e; /* Slightly lighter card */
        --text-color: #e0e0e5; /* Light grey text */
        --text-muted-color: #a0a0b5; /* Muted grey */
        --heading-color: #ffffff; /* White headings */
        --accent-color: #3391ff; /* Brighter blue for dark mode */
        --accent-hover-color: #5ca9ff;
        --border-color: #333; /* Darker border */
        --shadow-color: rgba(0, 0, 0, 0.2); /* More pronounced shadow maybe */
        --avatar-border-color: var(--card-bg-color);
    }
}

/* --- Explicit Dark Theme Override via Attribute --- */
[data-theme='dark'] {
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e0e0e5;
    --text-muted-color: #a0a0b5;
    --heading-color: #ffffff;
    --accent-color: #3391ff;
    --accent-hover-color: #5ca9ff;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --avatar-border-color: var(--card-bg-color);
}

/* ---------------------------- */
/* ----- Base Styles ----- */
/* ---------------------------- */
body {
    font-family: var(--font-family-base);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 30px 15px;
    transition: background-color var(--transition-speed), color var(--transition-speed); /* Smooth theme transition */
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px; /* Max width for the main content flow */
    flex-grow: 1; /* Allow wrapper to grow if needed */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--accent-hover-color);
    text-decoration: underline; /* Add underline on hover for clarity */
}

h1,
h2 {
    color: var(--heading-color);
    font-weight: 700; /* Bolder headings */
}

p {
    line-height: 1.7; /* Improve readability */
    margin-bottom: 1.2em; /* Consistent paragraph spacing */
}
p:last-child {
    margin-bottom: 0; /* Remove bottom margin from last paragraph in a block */
}

ul {
    padding-left: 25px; /* Standard indentation */
    margin-bottom: 1em;
}
ul ul {
    margin-top: 0.5em; /* Space above nested list */
    margin-bottom: 0.8em; /* Space below nested list */
}
li {
    margin-bottom: 0.5em; /* Space between list items */
}

/* ---------------------------- */
/* ----- Header Styles ----- */
/* ---------------------------- */
.site-header {
    text-align: center;
    margin-bottom: 40px; /* Space below header */
    width: 100%;
}

.avatar {
    width: 100px; /* Larger avatar */
    height: 100px;
    border-radius: 50%; /* Perfect circle */
    margin: 0 auto 15px auto; /* Center and add space below */
    border: 3px solid var(--avatar-border-color); /* Use variable */
    box-shadow: 0 4px 10px var(--shadow-color); /* Use variable */
    transition: border-color var(--transition-speed);
}

.site-header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 700;
}
.site-header h1 a {
    color: var(--heading-color); /* Match heading color */
    text-decoration: none;
}
.site-header h1 a:hover {
    color: var(--accent-color); /* Accent on hover */
    text-decoration: none;
}

.job-title {
    font-size: 1.1rem;
    color: var(--text-muted-color);
    margin-bottom: 25px; /* Space before social links */
    font-weight: 500; /* Medium weight */
}

.social-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.social-links li {
    display: inline-block; /* Arrange icons horizontally */
    margin: 0 10px; /* Space between icons */
}

.social-links a {
    font-size: 1.8rem; /* Larger icons */
    color: var(--text-muted-color); /* Start with muted color */
    display: inline-block; /* Needed for transform */
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover {
    color: var(--accent-color); /* Accent color on hover */
    text-decoration: none; /* No underline for icons */
    transform: scale(1.15); /* Slight zoom effect */
}

/* ---------------------------- */
/* ----- Main Content Styles ----- */
/* ---------------------------- */
.main-content {
    width: 100%;
    background-color: var(--card-bg-color); /* Use variable */
    border-radius: var(--border-radius);
    padding: 30px 40px; /* More padding inside the card */
    box-shadow: 0 5px 20px var(--shadow-color); /* Use variable */
    margin-bottom: 40px; /* Space before footer */
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

/* Container for Heading and Toggle */
.heading-with-toggle {
    display: flex;
    align-items: center; /* Vertically center items */
    justify-content: space-between; /* Push items to ends */
    margin-bottom: 0.8em; /* Space below the heading line */
    gap: 15px; /* Add some gap between heading and button */
}

/* Modified Heading Style */
.main-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1em; /* Keep default margin for other h2 */
    padding-bottom: 0.5em; /* Space below heading text */
    border-bottom: 1px solid var(--border-color); /* Use variable */
    transition: border-color var(--transition-speed);
}

.main-content h2.intro {
    border-bottom: none; /* No border for the intro heading */
    margin-bottom: 0; /* Remove margin as container handles it */
    font-size: 1.6rem; /* Slightly larger intro heading */
    line-height: 1.3; /* Ensure consistent line height */
}

/* New Theme Toggle Button Style */
.theme-toggle-button {
    background-color: transparent;
    color: var(--text-muted-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px; /* Fixed size */
    height: 36px;
    padding: 0; /* Remove padding */
    font-size: 1rem; /* Icon size */
    cursor: pointer;
    display: inline-flex; /* Use flex to center icon easily */
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
    transition: all var(--transition-speed);
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-top: -15px;
}

.theme-toggle-button:hover {
    color: var(--accent-hover-color);
    border-color: var(--accent-color);
    background-color: rgba(0, 123, 255, 0.05); /* Very subtle background on hover */
    transform: scale(1.1);
    box-shadow: 0 2px 6px var(--shadow-color);
}
/* Style adjustment for dark mode hover */
[data-theme='dark'] .theme-toggle-button:hover {
    background-color: rgba(51, 145, 255, 0.1); /* Dark mode subtle hover bg */
}

.theme-toggle-button .icon-placeholder {
    display: inline-block; /* Allows transforms */
    transition: transform 0.3s ease-out;
}
.theme-toggle-button:hover .icon-placeholder {
    transform: rotate(15deg);
}

.main-content p,
.main-content li {
    font-size: 1rem; /* Standard text size */
    color: var(--text-color); /* Use variable */
}

.hobbies {
    margin-top: 40px; /* Add space above hobbies section */
}

/* ---------------------------- */
/* ----- Footer Styles ----- */
/* ---------------------------- */
.site-footer {
    text-align: center;
    width: 100%;
    padding-top: 20px; /* Space above footer */
    margin-top: auto; /* Push footer to bottom if content is short */
}

.site-footer p {
    color: var(--text-muted-color); /* Use variable */
    font-size: 0.9rem;
}

/* ---------------------------- */
/* ----- Responsive Adjustments ----- */
/* ---------------------------- */
@media (max-width: 600px) {
    body {
        padding: 20px 10px;
    }
    .main-content {
        padding: 25px 20px;
    }
    .site-header h1 {
        font-size: 1.8rem;
    }
    .job-title {
        font-size: 1rem;
    }
    .social-links a {
        font-size: 1.6rem; /* Slightly smaller icons on mobile */
    }
    .social-links li {
        margin: 0 7px;
    }
    .main-content p,
    .main-content li {
        font-size: 0.95rem;
    }
    .heading-with-toggle {
        gap: 10px; /* Reduce gap */
    }
    .main-content h2.intro {
        font-size: 1.4rem; /* Adjust heading size */
    }
    .theme-toggle-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}
