@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

:root {
    --primary-text: #171717;
    --secondary-text: #6b7280;
    --link-color: #171717;
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
    --accent-color: #4b5563;
}

/* === AUTOMATIC FONT SCALING === */
html {
    /* Syntax: clamp(MIN, VAL, MAX) 
       1. Minimum: 18px (Ensures text is never small on phones)
       2. Preferred: 1rem + 0.5vw (Scales slowly as screen gets wider)
       3. Maximum: 21px (Caps size on giant monitors)
    */
    font-size: clamp(18px, 1rem + 0.5vw, 21px);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--primary-text);
    /* Increased line-height slightly for the larger font */
    line-height: 1.8; 
    background-color: var(--bg-color);
    
    /* Mobile Layout Defaults */
    width: 100%;
    margin: 0;
    padding: 1.5rem 1.25rem; /* Padding prevents text touching phone edges */
}

/* Desktop Layout Constraint */
@media (min-width: 768px) {
    body {
        max-width: 52rem; /* Slightly narrower to account for larger text reading flow */
        margin: 4rem auto;
        padding: 3rem 4rem;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }
}

/* === FLUID HEADINGS === */
h1, h2, h3, h4, h5, h6 {
    position: relative;
    padding-left: 1rem;
    margin-top: 2.2em;
    margin-bottom: 0.8em;
    line-height: 1.25;
    font-weight: 700;
    word-wrap: break-word;
}

/* Fluid Heading Sizes 
   These effectively say: "Be at least X size, but grow if the screen allows"
*/
h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

/* Decoration Lines */
h1::before, h2::before, h3::before, h4::before, h5::before, h6::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent-color);
    opacity: 0.9;
}

/* Light accent for smaller headings */
h4::before, h5::before, h6::before {
    background-color: var(--border-color);
}

/* Link Styling */
a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    transition: background-color 0.2s ease;
}
a:hover {
    background-color: #f3f4f6;
    border-bottom-color: var(--link-color);
}

/* Blockquote Styling */
blockquote {
    background-color: #f7f7f7;
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.25rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--secondary-text);
}

/* Code Styling */
code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    font-family: monospace;
    font-size: 0.85em; /* Relative to the new larger root size */
    color: var(--primary-text);
    word-break: break-word;
}

pre {
    background-color: #f4f4f5;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}
pre code {
    all: unset;
    color: var(--primary-text);
    font-size: 0.9em;
}

/* Lists */
ul, ol {
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}
ul li::marker { color: var(--accent-color); font-weight: 700; }
ol li::marker { font-weight: 600; color: var(--secondary-text); }

/* Horizontal Rule */
hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 2.5rem 0;
}

/* Image Safety */
img {
    max-width: 100%;
    height: auto;
    display: block;
}