/* ---- Reset: remove browser defaults we do not want ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

/* ---- Base document ---- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

h1 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-lg); }

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* form controls do not inherit fonts by default — fix that */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* numbers in tables and stats line up */
table,
.stat-value,
.card-value {
  font-variant-numeric: tabular-nums;
}

/* keyboard focus must always be visible — accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

::selection {
  background: var(--color-primary-ring);
}

/* thin dark scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

/* no animation for people who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
