/* ==========================================================================
   Base — Reset, typography defaults, global element styles
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Headings ---- */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
}

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-lg);  margin-bottom: var(--space-sm); }
h4 { font-size: var(--text-base); margin-bottom: var(--space-sm); }

/* ---- Body text ---- */

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: var(--leading-relaxed);
}

/* ---- Links ---- */

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

a:hover {
    color: var(--accent-hover);
}

/* ---- Lists ---- */

ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
    color: var(--text-secondary);
}

li {
    margin-bottom: var(--space-xs);
}

/* ---- Code ---- */

code {
    font-family: var(--font-mono);
}

.inline-code,
code:not([class]) {
    background: var(--bg-subtle);
    padding: 0.15rem 0.4rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85em;
    font-family: var(--font-mono);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* ---- Images ---- */

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

/* ---- Selection ---- */

::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}

/* ---- Focus ---- */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* ---- Screen reader only ---- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Skip link (accessibility) ---- */

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    z-index: 10000;
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: var(--space-sm);
}

