/*
 * Base: element defaults, type scale, focus and pressed states, motion.
 * Colors and sizes come from tokens.css only.
 */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 { font-size: var(--text-2xl); line-height: 1.15; font-weight: 800; }
h2 { font-size: var(--text-xl); line-height: 1.25; font-weight: 700; }
h3 { font-size: var(--text-lg); line-height: 1.3; font-weight: 700; }

small { font-size: var(--text-sm); }

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

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

/* Inputs at 16px so iOS Safari never zooms the page on focus. */
input,
select,
textarea,
button {
  font: inherit;
  font-size: var(--text-md);
}

input,
select,
textarea {
  min-height: var(--tap-min);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
}

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

svg {
  max-width: 100%;
}

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