/* Parallel additions on top of the docs shell. */
.brand-mark {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  background: currentColor;
  -webkit-mask: url(/assets/logo-mask.png) center / contain no-repeat;
  mask: url(/assets/logo-mask.png) center / contain no-repeat;
}

.sl-markdown-content .doc-formula {
  margin: 1.25rem 0;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 1px var(--sl-color-hairline);
  color: var(--sl-color-gray-1);
  font: 500 0.9375rem/1.5 var(--sl-font-mono, ui-monospace, monospace);
  letter-spacing: 0;
}

.sl-markdown-content .doc-table {
  overflow-x: auto;
  margin: 1.25rem 0;
}
.sl-markdown-content .doc-table table {
  margin: 0;
}

/* The mobile menu covers the page: keep article content from painting above it. */
@media (max-width: 49.99rem) {
  body[data-mobile-menu-expanded] .main-frame {
    visibility: hidden;
  }
}

/* ------------------------------------------------------------------ motion */
/* Everything here animates transform and opacity only, so it stays on the compositor. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Performance: the shell's continuously repainting effects are switched off.
   The dotted title texture stays, without its infinite expanding pulse, and the
   sticky bars use a solid background instead of a live backdrop blur. */
.proxima-moire__pulse {
  display: none !important;
  animation: none !important;
}
.page > header.header,
.sidebar-search {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Hover and press feedback on controls. */
.page-context-actions button,
.sidebar-search__trigger,
.theme-toggle,
.pagination-links a,
.proxima-search-bridge button[data-open-modal] {
  transition: transform 0.18s var(--ease-out), color 0.16s ease, background-color 0.16s ease;
}
.page-context-actions button:hover,
.sidebar-search__trigger:hover,
.proxima-search-bridge button[data-open-modal]:hover {
  transform: translateY(-1px);
}
.page-context-actions button:active,
.sidebar-search__trigger:active,
.theme-toggle:active,
.pagination-links a:active,
.proxima-search-bridge button[data-open-modal]:active {
  transform: scale(0.97);
}
.theme-toggle:hover svg {
  transform: rotate(35deg) scale(1.08);
}
.brand-mark {
  transition: transform 0.35s var(--ease-out);
}
.proxima-brand:hover .brand-mark {
  transform: scale(1.1) rotate(-8deg);
}

/* Sidebar and table of contents: the label nudges towards the reader. */
.sidebar-tree a .sidebar-icon,
.sidebar-tree a .sidebar-link-label,
.right-sidebar-panel a {
  transition: transform 0.18s var(--ease-out), color 0.16s ease;
}
.sidebar-tree a:hover .sidebar-icon {
  transform: scale(1.12);
}
.sidebar-tree a:hover .sidebar-link-label,
.right-sidebar-panel a:hover {
  transform: translateX(2px);
}

/* Pagination: the arrow travels in the direction of the link. */
.pagination-links a svg {
  transition: transform 0.2s var(--ease-out);
}
.pagination-links a[rel='prev']:hover svg {
  transform: translateX(-4px);
}
.pagination-links a[rel='next']:hover svg {
  transform: translateX(4px);
}

/* Article: table rows, callouts, formula, steps. */
.sl-markdown-content tbody tr {
  transition: background-color 0.15s ease;
}
.sl-markdown-content tbody tr:hover {
  background-color: rgb(128 134 150 / 0.07);
}
.sl-markdown-content .hint,
.sl-markdown-content .doc-formula,
.numbered-steps > li > h2 {
  transition: transform 0.2s var(--ease-out);
}
.sl-markdown-content .hint:hover,
.sl-markdown-content .doc-formula:hover {
  transform: translateY(-2px);
}
.numbered-steps > li:hover > h2 {
  transform: translateX(3px);
}
#starlight__search .pagefind-ui__result-title {
  transition: transform 0.18s var(--ease-out), background-color 0.16s ease;
}
#starlight__search .pagefind-ui__result-title:hover {
  transform: translateX(2px);
}

/* Entrances. `anim` is set by an inline script, so nothing is hidden without JavaScript.
   The title block and the article each enter as ONE layer; only blocks that start
   below the fold are revealed individually while scrolling. */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.anim .page-title-row,
.anim .page-title-toolbar,
.anim .sl-markdown-content {
  animation: rise-in 0.4s var(--ease-out) both;
}
.anim .page-title-toolbar {
  animation-delay: 0.05s;
}
.anim .sl-markdown-content {
  animation-delay: 0.08s;
}
.anim .right-sidebar-panel nav {
  animation: fade-in 0.4s ease 0.1s both;
}
/* Sidebar entrance plays once per session, not on every page change. */
.anim.anim-first .sidebar-tree {
  animation: fade-in 0.45s ease both;
}

.anim [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
}
.anim [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.anim.anim-done [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .anim [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
