/* Reset, base type, focus, skip link, reduced motion and touch targets. Tokens: tokens.css. */

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

html {
  color-scheme: light;
  scrollbar-color: var(--color-control-border) var(--color-surface);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh);
}

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

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

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

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

.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 {
  position: absolute;
  top: var(--space-8);
  left: var(--space-8);
  z-index: var(--z-toast);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

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

@media (max-width: 1023px) {
  button,
  a,
  input,
  select,
  textarea,
  [role="button"] {
    min-height: var(--target-min);
  }

  input[type="checkbox"],
  input[type="radio"] {
    min-width: var(--target-min);
  }

  /* Inline links ignore min-height: links in table cells and trails become boxes so they meet the target. */
  td a,
  main nav a {
    display: inline-flex;
    align-items: center;
  }
}
