/**
 * Base Styles
 * Modern CSS reset and global base styles
 */

/* ==================== CSS Reset ==================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-neutral-800);
    background-color: var(--color-neutral-white);
    overflow-x: hidden;
}

/* ==================== Typography ==================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-primary-800);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-5xl);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--text-4xl);
    letter-spacing: -0.025em;
}

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-bottom: var(--space-4);
    color: var(--color-neutral-700);
}

a {
    color: var(--color-primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-600);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--color-accent-600);
    outline-offset: 2px;
}

/* ==================== Lists ==================== */

ul,
ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    color: var(--color-neutral-700);
}

/* ==================== Media ==================== */

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==================== Forms ==================== */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: var(--leading-normal);
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ==================== Accessibility ==================== */

:focus-visible {
    outline: 2px solid var(--color-accent-600);
    outline-offset: 2px;
}

/* Remove default focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only content */
.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;
}

/* ==================== Selection ==================== */

::selection {
    background-color: var(--color-accent-500);
    color: var(--color-neutral-white);
}

::-moz-selection {
    background-color: var(--color-accent-500);
    color: var(--color-neutral-white);
}

/* ==================== Scrollbar (Webkit) ==================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-neutral-400);
    border-radius: var(--border-radius-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* ==================== Responsive Typography ==================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }
}