@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400&family=Noto+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Research-based typography: sans-serif with high x-height for optimal screen reading */
body {
    font-family: 'Inter', 'Source Sans Pro', 'Noto Sans', 'Roboto', 'Verdana', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    max-width: 680px; /* 60-75 characters per line optimal reading length */
    margin: 0 auto;
    padding: 3rem 2rem;
    color: #1A1A1A; /* Deep charcoal - optimal text color (HSL lightness 20-30) */
    background: linear-gradient(135deg, #FAF8F4 0%, #F6F4F0 50%, #FAF8F4 100%); /* Warm off-white (HSL lightness 94-98%) */
    background-attachment: fixed;
    min-height: 100vh;
    font-size: 1.375rem; /* 22px - optimal for desktop reading */
    font-weight: 400;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1 {
    color: #1A1A1A;
    border-bottom: 1px solid #e5e1d9;
    padding-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-family: 'Inter', 'Source Sans Pro', 'Noto Sans', 'Roboto', sans-serif;
    line-height: 1.3;
    margin-bottom: 2rem;
    margin-top: 0;
    font-size: 2.75rem;
}

h2 {
    color: #1A1A1A;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    font-family: 'Inter', 'Source Sans Pro', 'Noto Sans', 'Roboto', sans-serif;
    line-height: 1.4;
    font-size: 2rem;
}

h3 {
    color: #1A1A1A;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-family: 'Inter', 'Source Sans Pro', 'Noto Sans', 'Roboto', sans-serif;
    line-height: 1.4;
    font-size: 1.625rem;
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.5; /* Optimal line-height for screen reading */
    font-weight: 400;
}

.date {
    color: #8a8680;
    font-style: italic;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

code {
    background: #f9f7f2;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: #7a6348;
    border: 1px solid #e5e1d9;
    line-height: 1.6;
}

pre {
    background: #f9f7f2;
    padding: 1.5rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #e5e1d9;
    line-height: 1.7;
}

pre code {
    padding: 0;
    background: none;
    border-radius: 0;
    border: none;
    font-size: 0.9375rem;
    display: block;
    white-space: pre;
    word-wrap: normal;
    color: #1A1A1A;
    line-height: 1.6;
}

.references {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e1d9;
    font-size: 1.0625rem;
    color: #5a5652;
}

.references h3 {
    color: #1A1A1A;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-family: 'Inter', 'Source Sans Pro', 'Noto Sans', 'Roboto', sans-serif;
    font-size: 1.625rem;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

a {
    color: #7a6348;
    text-decoration: underline;
    text-decoration-color: rgba(122, 99, 72, 0.3);
    text-underline-offset: 2px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
    color: #6b5a42;
    text-decoration-color: rgba(107, 90, 66, 0.6);
}

article {
    background: transparent;
    padding: 0;
}

@media (max-width: 768px) {
    body {
        padding: 2rem 1.25rem;
        font-size: 1.125rem; /* 18px - optimal for mobile reading */
        max-width: 100%;
        line-height: 1.6; /* Slightly increased for mobile (1.4-1.6 range) */
        letter-spacing: 0.01em; /* Slightly increased letter-spacing for mobile */
    }

    h1 {
        font-size: 2.25rem;
    }

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

    h3 {
        font-size: 1.5rem;
        margin-top: 1.75rem;
    }

    pre {
        padding: 1.25rem;
        font-size: 0.875rem;
    }

    ul, ol {
        padding-left: 1.5rem;
    }
}
