/* Base styles and accessibility foundations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-paper);
  background-image: radial-gradient(var(--dot-grid-color) 1.5px, transparent 1.5px);
  background-size: var(--dot-grid-size) var(--dot-grid-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  background: var(--color-primary);
  color: #111;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border: var(--border-thick);
  box-shadow: var(--shadow-hard);
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #111;
}

/* Accessible focus visible everywhere */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

[data-theme="dark"] :focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.main-content {
  flex: 1 0 auto;
  padding: 2rem 0 4rem;
}

.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;
}
