/* style.css */

/* 1. Base Styles & Typography */
body {
    font-family: system-ui, -apple-system, sans-serif; /* High legibility */
    line-height: 1.6;
    color: #222; /* High contrast */
    padding: 2rem;
    max-width: 50rem;
    margin: 0 auto;
}

/* 2. Accessibility: Focus States */
/* Ensures keyboard users can see where they are on the page */
a:focus, button:focus {
    outline: 3px solid #005a9c;
    outline-offset: 4px;
}

/* 3. Skip to Content Link */
/* Hidden visually, but appears when tabbing */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #005a9c;
    color: white;
    padding: 10px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 4. Semantic Layout Spacing */
header, main, footer {
    margin-bottom: 2rem;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

/* 5. Define Default (Light) Colors */
:root {
    --bg-color: #ffffff;
    --text-color: #222222;
    --link-color: #005a9c;
    --border-color: #dddddd;
}

/* 6. Define Dark Mode Colors */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212; /* Deep charcoal, better than pure black */
        --text-color: #f0f0f0;
        --link-color: #82b1ff;
        --border-color: #444444;
    }
}

/* 7. Apply the Variables to your Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    padding: 2rem;
    max-width: 50rem;
    margin: 0 auto;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition */
}

a {
    color: var(--link-color);
}

.skip-link {
    background: var(--link-color);
    color: var(--bg-color);
}
