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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Component rules below set `display` on classes that also toggle the native
   `hidden` attribute; without `!important` here, equal-specificity source
   order would let those rules win and show "hidden" elements. */
[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-3);
  clip: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-focus);
  border-radius: var(--radius-sm);
  z-index: 1000;
}

:focus {
  outline: none;
}

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

/* Checkboxes: drawn rather than native, so the box uses the same outline
   tokens as every other control instead of the browser's own dark border. */
input[type='checkbox'] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

input[type='checkbox']::before {
  content: '';
  width: 10px;
  height: 10px;
  transform: scale(0);
  background: var(--color-inverse-text);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 10%, 37% 70%);
}

input[type='checkbox']:checked {
  background: var(--color-inverse-bg);
  border-color: var(--color-inverse-bg);
}

input[type='checkbox']:checked::before {
  transform: scale(1);
}

/* Forced colors (Windows High Contrast) ignores backgrounds: fall back to
   the native control there. */
@media (forced-colors: active) {
  input[type='checkbox'] {
    appearance: auto;
  }

  input[type='checkbox']::before {
    display: none;
  }
}

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