/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* Base size, a11y adjustable later */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-main);
    color: white;
    padding: var(--space-3) var(--space-4);
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

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

/* Base Typo */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
    font-weight: 700;
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

p {
    margin-bottom: var(--space-4);
    max-width: 70ch;
    /* Readability */
}

a {
    color: var(--primary-main);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul,
ol {
    list-style: none;
    /* Custom bullets usually preferred in design */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Utilities --- */
.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.text-center {
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Layout --- */
main {
    flex: 1;
    /* Push footer down */
}

section {
    padding: var(--space-10) 0;
}

section:nth-child(even) {
    background-color: var(--bg-alt);
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}