/**
 * Base Styles
 * Reset, Typography, Global Elements
 */

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

/* Remove default margins */
* {
    margin: 0;
    padding: 0;
}

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

/* Body defaults */
body {
    min-height: 100vh;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Button reset */
button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Anchor defaults */
a {
    color: var(--color-accent-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

a:focus-visible {
    outline: 2px solid var(--color-accent-light);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

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

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

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

h4 {
    font-size: var(--font-size-lg);
}

/* Paragraphs */
p {
    color: var(--color-text-secondary);
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent-light);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Selection */
::selection {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
}

/* Scrollbar Styling (Webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-accent-dark);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent-dark) var(--color-bg-secondary);
}

/* Screen reader only utility */
.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;
}

/* Hidden utility */
[hidden] {
    display: none !important;
}
