/* ==========================================================================
   Base: reset, document defaults, accessibility helpers
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Keeps anchored sections clear of the fixed header */
  scroll-padding-top: var(--header-height);
}

body {
  background-color: var(--bg);
  font-family: var(--font-main);
  color: var(--text);
  line-height: 1.5;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* Keep the hidden attribute authoritative even when a class sets `display` */
[hidden] {
  display: none !important;
}

/* Keyboard focus ring (mouse users are unaffected) */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Visually hidden, still available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: appears on keyboard focus only */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  transform: translateY(-200%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
