html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-md);
  line-height: var(--line-height-base);
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

a {
  color: var(--color-primary-700);
  text-decoration: none;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-900);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  color: var(--color-primary-950);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
}

h1 {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

h3 {
  font-size: var(--font-size-lg);
  line-height: 1.35;
}

p {
  color: var(--color-text-soft);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

code {
  background: var(--color-surface-muted);
  border-radius: var(--radius-xs);
  color: var(--color-primary-900);
  font-size: 0.95em;
  padding: 0.1rem 0.3rem;
}

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

@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
  }

  h1 {
    font-size: 2.5rem;
  }
}
