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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1.02rem;
}

p {
  margin: 0 0 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  text-decoration: underline;
}

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

button {
  cursor: pointer;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem;
}

.main-content {
  flex: 1;
  padding-bottom: 2.5rem;
}

.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;
}

.muted {
  color: var(--text-muted);
}

@media (min-width: 640px) {
  h1 {
    font-size: 1.75rem;
  }
  .container {
    padding: 1.25rem 1.5rem;
  }
}

@media print {
  .site-header,
  .toolbar,
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .card,
  .term-card {
    box-shadow: none !important;
    break-inside: avoid;
  }
}
