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

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--dm-color-text);
  background-color: var(--dm-color-app-bg);
  font: 400 16px/1.6 var(--dm-font-sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dm-color-text);
  font-family: var(--dm-font-sans);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
}

h1.dm-title, h2.dm-title, .dm-font-serif {
  font-family: var(--dm-font-serif);
  font-weight: 600;
}

.dm-handwritten {
  font-family: var(--dm-font-handwriting);
  font-size: 1.25em;
  color: var(--dm-color-text-secondary);
  line-height: 1.2;
}

a {
  color: var(--dm-color-primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover, a:focus-visible {
  color: var(--dm-color-primary-hover);
}

.dm-main p a:hover, .dm-main p a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

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

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

.dm-skip-link:focus {
  z-index: 100000;
  top: var(--dm-space-4);
  left: var(--dm-space-4);
  width: auto;
  height: auto;
  padding: var(--dm-space-3) var(--dm-space-4);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  color: var(--dm-color-white);
  background: var(--dm-color-primary);
  border-radius: var(--dm-radius-small);
  box-shadow: var(--dm-shadow-md);
}

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