/* 
 * Base Styles & Reset
 */

/* Box Sizing Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Base Document */
html {
    font-family: var(--font-sans);
    font-size: 100%;
    /* Base 16px */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    margin: 0;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    transition: background-color var(--duration-normal), color var(--duration-normal);
    overflow-x: hidden;
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: var(--space-4);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

h1 {
    font-size: clamp(2rem, 6vw, var(--text-5xl));
}

h2 {
    font-size: clamp(1.5rem, 4vw, var(--text-4xl));
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    margin-top: 0;
    margin-bottom: var(--space-4);
    color: var(--text-primary); /* Increased contrast for all paragraphs */
}

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

a:hover {
    color: var(--primary-600);
}

/* Focus States (Accessibility) */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Images */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* Button Reset */
button {
    font-family: inherit;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}