* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--color-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-body);
  transition: background var(--motion-normal), color var(--motion-normal);
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-body);
}

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

h1,
h2,
h3 {
  color: var(--color-text);
  line-height: 1.16;
}

h1 {
  font-size: var(--font-size-title);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

h3 {
  font-size: 1.1rem;
}

a {
  color: var(--color-brand);
  text-underline-offset: 0.18em;
}

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

button,
[href],
input,
select,
textarea {
  scroll-margin: var(--space-5);
}

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

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

code {
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  font-size: 0.9em;
}

.hidden {
  display: none !important;
}

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

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