/* ================================
   Base Styles / Reset
   ================================ */

/* Box sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Remove default list styles */
ul, ol {
    list-style: none;
}

/* Prevent font size inflation */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

/* Body defaults */
body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Remove default anchor styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Make images easier to work with */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input, button, textarea, select {
    font: inherit;
}

/* Remove all animations for people who've turned them off */
@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;
    }
}

/* ================================
   Typography
   ================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }

p {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ================================
   Layout Utilities
   ================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-wide {
    max-width: var(--container-wide);
}

section {
    padding: var(--section-padding) 0;
    position: relative;
}

/* ================================
   Selection
   ================================ */

::selection {
    background: var(--primary);
    color: var(--bg-primary);
}

/* ================================
   Scrollbar (WebKit)
   ================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ================================
   Focus Styles
   ================================ */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ================================
   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: 0;
}
