@font-face {
    font-family: 'Source Code Pro';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('fonts/SourceCodePro-Light.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Code Pro';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/SourceCodePro-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Code Pro';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/SourceCodePro-Medium.woff2') format('woff2');
}

:root {
    --bg-color: white;
    --text-color: black;
    --link-color: black;
    --link-hover-color: #333;
}

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

html {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);

    font-family: "Source Code Pro", monospace, system-ui, -apple-system, sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;

    padding: 60px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-text-size-adjust: 100%;
}

header {
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

section {
    margin-bottom: 2rem;
}

nav ul {
    list-style: none;
    padding-left: 0;
}

nav ul li {
    margin-bottom: 1rem;
}

/* Article content lists */
article ul,
article ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

article ul {
    list-style: disc;
}

article ol {
    list-style: decimal;
}

article li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

th, td {
    border: 1px solid var(--text-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

th {
    font-weight: 500;
}

/* Code blocks */
pre {
    background: rgba(128, 128, 128, 0.1);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: "Source Code Pro", monospace;
    font-size: 0.9em;
}

p {
    margin: 1rem 0;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    display: inline-block;
    padding: 0.25rem 0;
    word-break: break-all;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

a:hover {
    color: var(--link-hover-color);
    text-decoration-thickness: 2px;
}

a:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 4px;
    border-radius: 2px;
}

a:active {
    opacity: 0.7;
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--text-color);
    opacity: 0.6;
}

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

/* Tablet and smaller */
@media (max-width: 768px) {
    body {
        padding: 40px 16px 40px;
        font-size: 1rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    h2 {
        font-size: 1.25rem;
        margin-top: 2rem;
    }

    nav ul li {
        margin-bottom: 1.25rem;
    }

    footer {
        margin-top: 3rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 30px 16px 30px;
        font-size: 1rem;
        font-weight: 400;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    section {
        margin-bottom: 1.5rem;
    }

    nav ul li {
        margin-bottom: 1.25rem;
    }

    a {
        padding: 0.5rem 0;
        text-underline-offset: 4px;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: black;
        --text-color: white;
        --link-color: white;
        --link-hover-color: #ccc;
    }

    a {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
