/* ============================================================================
   PayrAdvisors — Base
   Reset, document defaults, typography, and accessibility primitives.
   Component and layout classes live in components.css.
   ============================================================================ */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* ---------- Document ---------- */
body {
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Headings (serif, brand) ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--weight-heading);
  color: var(--heading);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4); letter-spacing: -0.01em; }
h5 { font-size: var(--fs-h5); letter-spacing: 0; }
h6 { font-size: var(--fs-h6); letter-spacing: 0; }

p {
  max-width: 70ch;
}

/* ---------- Links ---------- */
a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ---------- Forms ---------- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--magenta);
  color: var(--white);
}

/* ---------- Accessibility ---------- */
/* Visible focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}

/* Screen-reader-only utility */
.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — visible on focus */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-overlay);
  background: var(--navy);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

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

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