/* Shared mobile guardrails for every static page. */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

pre,
table {
  max-width: 100%;
  overflow-x: auto;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

table {
  display: block;
  -webkit-overflow-scrolling: touch;
}

input,
select,
textarea,
button {
  max-width: 100%;
  font: inherit;
}

a,
button,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 680px) {
  nav {
    gap: 12px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  nav .nav-links,
  nav .links {
    flex-wrap: wrap;
    gap: 12px;
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }
}

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