/* Reset and element defaults. Everything here is unclassed HTML.
   Colours, spacing and type all come from tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); letter-spacing: var(--tracking-normal); }

p { margin: 0; }

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

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

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

/* One focus ring for the whole app. :focus-visible so it appears for keyboard
   users without ringing every mouse click. Never remove this without an
   equally visible replacement - it is how keyboard users know where they are. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Visible only once tabbed to. */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: calc(var(--space-2) * -10);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--weight-medium);
  transition: top var(--duration) var(--ease);
}
.skip-link:focus { top: var(--space-2); }

/* Hidden visually, still read aloud. */
.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;
}

::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

::selection {
  background: var(--accent-strong);
  color: #fff;
}
