/* ==========================================================================
   CSS Reset / Normalize
   A modern CSS reset with sensible defaults
   ========================================================================== */

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

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

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Body defaults */
body {
    min-height: 100vh;
    line-height: var(--leading-normal, 1.5);
    font-family: var(--font-primary, system-ui, sans-serif);
    font-size: var(--text-base, 1rem);
    color: var(--color-gray-800, #1a202c);
    background-color: var(--color-white, #ffffff);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight, 1.25);
    font-weight: var(--font-bold, 700);
    text-wrap: balance;
}

/* Paragraphs */
p {
    text-wrap: pretty;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:not([class]) {
    text-decoration-skip-ink: auto;
    color: var(--color-primary, #1a365d);
}

a:not([class]):hover {
    text-decoration: underline;
}

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

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

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

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

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

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Table */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Form elements */
input,
textarea,
select {
    background-color: transparent;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-primary, #1a365d);
    outline-offset: 2px;
}

/* Textarea */
textarea {
    resize: vertical;
}

/* Remove built-in form typography styles */
input::placeholder,
textarea::placeholder {
    color: var(--color-gray-400, #a0aec0);
    opacity: 1;
}

/* Remove default fieldset styles */
fieldset {
    border: none;
}

/* Remove legend padding */
legend {
    padding: 0;
}

/* Remove default summary styles */
summary {
    cursor: pointer;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--color-gray-200, #e2e8f0);
    margin: var(--space-8, 2rem) 0;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--color-primary, #1a365d);
    padding-left: var(--space-4, 1rem);
    font-style: italic;
}

/* Code */
code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

pre {
    overflow-x: auto;
    padding: var(--space-4, 1rem);
    background-color: var(--color-gray-100, #edf2f7);
    border-radius: var(--radius-md, 0.5rem);
}

code:not(pre code) {
    padding: 0.125rem 0.25rem;
    background-color: var(--color-gray-100, #edf2f7);
    border-radius: var(--radius-sm, 0.25rem);
    font-size: 0.875em;
}

/* Selection */
::selection {
    background-color: var(--color-primary, #1a365d);
    color: var(--color-white, #ffffff);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-primary, #1a365d);
    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;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4, 1rem);
    z-index: var(--z-tooltip, 600);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    background-color: var(--color-primary, #1a365d);
    color: var(--color-white, #ffffff);
    border-radius: var(--radius-md, 0.5rem);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-4, 1rem);
}
