html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

/* MathJax: inherit color; scroll wide display math only. */
mjx-container { color: inherit; }
mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 !important;
}
/* Inline math must stay in the sentence (mjx-container and its SVG). */
mjx-container:not([display="true"]) {
  display: inline;
  vertical-align: -0.15em;
  margin: 0 0.05em;
  max-width: none;
}
mjx-container:not([display="true"]) svg {
  display: inline;
  vertical-align: inherit;
  max-width: none;
}

/* Subtle in-view reveal for sections. */
@media (prefers-reduced-motion: no-preference) {
  section { animation: rise .6s ease-out both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Focus ring for keyboard users. */
a:focus-visible, button:focus-visible, details > summary:focus-visible {
  outline: 2px solid #f5b642;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Make <code> blocks inside <pre> a little softer on eyes. */
pre code { white-space: pre; }
