/* ============================================
   Base Styles
   Reset and foundational styles
   ============================================ */

/* Import design tokens */
@import url('design-tokens.css');

/* ========== CSS Reset ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    text-transform: lowercase;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--surface-background);
    min-height: 100vh;
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-4);
    color: var(--text-primary);
}

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

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

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

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

p {
    margin-bottom: var(--spacing-4);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary-500);
    text-decoration: none;
    transition: color var(--duration-quick) var(--easing-standard);
}

a:hover {
    color: var(--color-primary-300);
    text-decoration: none;
    filter: brightness(1.2);
}

a:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-small);
}

/* ========== Lists ========== */
ul,
ol {
    margin-bottom: var(--spacing-4);
    padding-left: var(--spacing-6);
}

li {
    margin-bottom: var(--spacing-2);
}

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

/* ========== Layout Utilities ========== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.container-narrow {
    max-width: 960px;
}

.container-wide {
    max-width: 1536px;
}

/* ========== Accessibility ========== */
.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;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary-500);
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    text-decoration: none;
    z-index: var(--z-tooltip);
}

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

/* ========== Responsive Media Queries ========== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .container {
        padding: 0 var(--spacing-3);
    }
}

@media (min-width: 1280px) {
    html {
        font-size: 18px;
    }
}