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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-gutter: stable;
  }

  body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset {
    margin: 0;
  }
  ul[role="list"], ol[role="list"] {
    list-style: none;
    padding: 0;
  }
  h1, h2, h3, h4 {
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: balance;
  }
  p {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
  }
  a:hover {
    text-decoration-color: currentColor;
  }

  button, input, select, textarea {
    font: inherit;
    color: inherit;
  }
  button {
    cursor: pointer;
  }
  button:disabled {
    cursor: not-allowed;
  }

  img, svg {
    display: block;
    max-width: 100%;
  }
  .ico {
    flex: none;
  }
  .ico [opacity] {
    opacity: 0.4;
  }

  fieldset {
    border: 0;
    padding: 0;
    min-width: 0;
  }
  legend {
    padding: 0;
  }

  mark {
    background: var(--accent-soft);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
  }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* Headings and regions focused by the router for screen readers. */
  [tabindex="-1"]:focus {
    outline: none;
  }

  ::selection {
    background: var(--accent-soft);
    color: var(--ink);
  }

  [hidden] {
    display: none !important;
  }

  /* Theme switches repaint everything at once instead of cross-fading
     every property on every element. */
  html.is-theming *,
  html.is-theming *::before,
  html.is-theming *::after {
    transition: none !important;
  }

  /* The pre-paint script adds this; the boot timeline removes it after the
     shell has animated in. A failsafe in index.html clears it if JS stalls. */
  html.is-booting .side > *,
  html.is-booting .top > *,
  html.is-booting .views {
    opacity: 0;
  }

  html.is-locked {
    overflow: hidden;
  }

  html.is-grabbing,
  html.is-grabbing * {
    cursor: grabbing !important;
    user-select: none;
  }

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

@layer utilities {
  .sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .skip {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s var(--ease-out);
  }
  .skip:focus {
    transform: none;
  }
  .num {
    font-variant-numeric: tabular-nums;
  }
  .muted {
    color: var(--ink-3);
  }
  .nowrap {
    white-space: nowrap;
  }
  @media (width <= 520px) {
    .hide-xs { display: none; }
  }
  @media (width <= 760px) {
    .hide-sm { display: none; }
  }
}
