/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    width: 100vw; /* Ensure HTML element takes full viewport width */
    overflow-x: hidden; /* Prevent horizontal scrolling at the root */
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

body {
    font-family: var(--font-family);
    background: var(--background-dark);
    color: var(--text-primary);
    line-height: var(--line-height-base);
    position: relative;
    width: 100%; /* Ensure body respects the HTML element's width */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { 
    font-size: clamp(2.5rem, 8vw, 4rem); 
}
h2 { 
    font-size: clamp(1.75rem, 5vw, 2.5rem); 
}
h3 { 
    font-size: clamp(1.25rem, 4vw, 1.75rem); 
}

p {
    margin-bottom: 1.5rem;
}

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

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

/* Utility classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

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

/* Ensure images don't overflow their containers */
img {
    max-width: 100%;
    height: auto;
}