/**
 * CSS Reset & Base Styles
 * Box model, typography, accessibility, and reduced motion support
 */

/* ============================================================================
   BOX MODEL RESET
   ============================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

/* ============================================================================
   HTML & BODY
   ============================================================================ */

html {
    scroll-padding-top: 120px;
}

body {
    padding: 0;
    margin: 0;
    padding-top: calc(1.5rem * 2 + var(--header-height-desktop));
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: clamp(15px, 1vw, 17px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.reduced-motion * {
    animation: none !important;
    transition: none !important;
}

/* ============================================================================
   ACCESSIBILITY & FOCUS STATES
   ============================================================================ */

:where(a, button, input, textarea, select, summary, .button, [role="button"]):focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    border-radius: 8px;
}

/* ============================================================================
   LINK STYLES
   ============================================================================ */

a:not(.button) {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(99, 102, 241, 0.6); /* Fallback for browsers without color-mix support */
    text-decoration-color: color-mix(in oklab, var(--primary-color) 60%, transparent);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:not(.button):hover {
    color: var(--secondary-color);
    text-decoration-color: currentColor;
}

/* ============================================================================
   REDUCED MOTION SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================================
   HEADINGS
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1.2rem;
}

h4 {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    margin-bottom: 1rem;
}

h5 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    margin-bottom: 0.8rem;
}

h6 {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    margin-bottom: 0.6rem;
}

/* ============================================================================
   SCREEN READER ONLY
   ============================================================================ */

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