/* =================================
   CSS VARIABLES (Light & Dark Mode)
   ================================= */
:root {
    /* Light Mode */
    --body-background: #f8f8f8;
    --main-text-color: #333;
    --heading-color: #333;
    --link-color: #0066cc;
    --link-hover-color: #005fa3;
}

/* Dark Mode - Activated by System Preference or Manual Toggle */
@media (prefers-color-scheme: dark) {
    :root {
        --body-background: #1a1a1a;
        --main-text-color: #e0e0e0;
        --heading-color: #e0e0e0;
        --link-color: #79a1d1;
        --link-hover-color: #62707D;
    }
}

body[data-theme='dark'] {
    --body-background: #1a1a1a;
    --main-text-color: #e0e0e0;
    --heading-color: #e0e0e0;
    --link-color: #79a1d1;
    --link-hover-color: #62707D;
}

/* =================================
   Body and Layout Styling
   ================================= */
body {
    /* Sets up a flex container for the sticky footer layout */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Applies colors using CSS variables */
    background-color: var(--body-background);
    color: var(--main-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-wrapper {
    /* Allows this section to grow and push the footer down */
    flex-grow: 1;
    
    /* Centers the content horizontally */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;

    /* Retained padding and top margin */
    padding: 20px;
    margin-top: 80px;

    /* Removed redundant background and color styles as they are handled by the body */
}

/* =================================
   Typography
   ================================= */
h2 {
    font-size: 2em;
    color: var(--heading-color);
    margin-bottom: 0.5em;
    transition: color 0.3s ease;
}

p {
    line-height: 1.6;
    margin-bottom: 1.5em;
}

ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2em;
}

li {
    margin-bottom: 0.75em;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}