/**
 * Base Styles - Reset & Fundamentals
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Forms */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-primary);
    color: var(--color-text-white);
    padding: var(--space-sm) var(--space-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal;
}

.screen-reader-text:focus {
    clip: auto;
    display: block;
    height: auto;
    width: auto;
    position: fixed;
    top: 5px;
    left: 5px;
    background: var(--color-bg);
    padding: var(--space-md);
    z-index: 9999;
}

/* Selection */
::selection {
    background-color: var(--color-secondary-lighter);
    color: var(--color-primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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