/* Global reset, base element styles, and utility classes.
   Container patterns used across components:
   - Centered: max-width: var(--container-max); margin: 0 auto; padding-inline: 116px;
   - Edge-aware: margin-inline: max(40px, calc((100% - var(--container-max)) / 2));
   The second pattern guarantees minimum 40px side margin at any viewport width. */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text-link);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  color: var(--text-primary);
}

p {
  max-width: 45rem;
}

ul, ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--petroleum);
  outline-offset: 2px;
}

/* Layout utilities */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: calc(var(--spacer) * 1.5);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
