/**
 * Reset & Baseline Styles
 * Resets browser defaults, establishes standard box model, and enforces accessibility rules.
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--color-canvas);
  color: var(--color-ink-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-ink-primary);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

p {
  color: var(--color-ink-secondary);
  line-height: var(--leading-normal);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

/* Media Elements */
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form & Interactive Elements */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

/* Accessibility Focus States */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent-cobalt);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-ink-primary);
  color: var(--color-ink-inverted);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transition: top var(--duration-fast) var(--ease-out);
}

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

/* Visually Hidden Helper (Screen Readers) */
.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;
}

/* Respect Reduced Motion */
@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;
    scroll-behavior: auto !important;
  }
}
