/* =========================================================================
   PeopleWill — base
   Reset, element defaults, focus, reduced motion.
   Loads after variables.css. Contains no component styling.
   ========================================================================= */

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

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

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--pw-bg);
  color: var(--pw-text);
  font-family: var(--pw-font-sans);
  font-size: var(--pw-text-base);
  line-height: var(--pw-leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--pw-weight-semibold);
  line-height: var(--pw-leading-tight);
  letter-spacing: var(--pw-tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--pw-text-2xl);
}
h2 {
  font-size: var(--pw-text-xl);
}
h3 {
  font-size: var(--pw-text-lg);
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

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

a {
  color: var(--pw-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--pw-primary-hover);
}

img,
svg,
video {
  display: block;
  max-inline-size: 100%;
  height: auto;
}

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

button {
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Focus — one ring, everywhere. :focus-visible means mouse users don't see it
   on click, keyboard users always do. Never remove this without an equally
   visible replacement.
   --------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--pw-focus-width) solid var(--pw-focus-color);
  outline-offset: var(--pw-focus-offset);
  border-radius: var(--pw-radius-sm);
}

/* Only suppress the default ring where :focus-visible is supported, so older
   browsers keep showing something rather than nothing. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------------- */

/* Visible to screen readers, invisible on screen. Used constantly for the
   accessible names behind flag rows and icon-only controls. */
.pw-visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Becomes visible when focused — the skip link. */
.pw-skip-link {
  position: absolute;
  inset-block-start: var(--pw-space-2);
  inset-inline-start: var(--pw-space-2);
  z-index: var(--pw-z-toast);
  padding: var(--pw-space-2) var(--pw-space-4);
  background: var(--pw-surface);
  color: var(--pw-primary);
  border: 2px solid var(--pw-primary);
  border-radius: var(--pw-radius-md);
  font-weight: var(--pw-weight-semibold);
  transform: translateY(-200%);
  transition: transform var(--pw-duration-fast) var(--pw-ease-out);
}

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

.pw-icon {
  inline-size: 1.25em;
  block-size: 1.25em;
  flex: none;
}

/* ---------------------------------------------------------------------------
   Reduced motion
   Collapses every token-driven animation. This only works because components
   animate through --pw-duration-*, never a hard-coded duration.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :root {
    --pw-duration-fast: 0.01ms;
    --pw-duration-base: 0.01ms;
    --pw-duration-slow: 0.01ms;
  }

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

/* Respect a user's request for more contrast. */
@media (prefers-contrast: more) {
  :root {
    --pw-border: var(--pw-border-strong);
    --pw-text-secondary: var(--pw-text);
    --pw-text-muted: var(--pw-text);
  }
}

@media print {
  .pw-header,
  .pw-footer,
  .pw-skip-link {
    display: none;
  }
}
