html, body {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-serif: ui-serif, serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --font-technical: "GOST type B", ui-monospace, "SF Mono", Menlo, monospace;
  --hover-color: var(--color-subtle);
  --hover-size: 0;
  --hover-filter: brightness(1);

  /* Sticky-header height — the sidebar/TOC rails offset themselves by this. */
  --header-height: 4rem;

  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: none;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-feature-settings: "liga" 1, "calt" 1, "cv05" 1, "cv08" 1;
  font-optical-sizing: auto;
  line-height: 1.5;
  overflow: unset;
  scroll-behavior: auto;
  text-rendering: optimizeLegibility;
  text-size-adjust: none;
}

a:not([class]) {
  --hover-size: 0;

  color: var(--color-link);
  text-decoration: underline;
  text-decoration-skip-ink: auto;

  &:visited {
    color: var(--color-link);
  }
}

:is(a, button, input, textarea) {
  --outline-size: max(2px, 0.08em);

  caret-color: var(--color-link);
  text-decoration: none;
  touch-action: manipulation;
  transition: box-shadow 150ms ease, outline-offset 150ms ease, background-color 150ms ease, opacity 150ms ease, filter 150ms ease;

  /* Hover */
  @media (any-hover: hover) {
    &:where(:not(:active):hover) {
      box-shadow: 0 0 0 var(--hover-size) var(--hover-color);
    }
  }

  /* Keyboard navigation */
  &:where(:not(:active)):focus-visible {
    outline-width: var(--outline-size);
    outline-color: var(--outline-color, currentColor);
    outline-offset: var(--outline-offset, calc(var(--outline-size) * 2));
  }

  &:where(:focus-visible):active {
    outline: 0;
  }

  /* Pressing */
  &:focus:not(:focus-visible) {
    --outline-offset: 0;
  }

  /* Disabled */
  &:where([disabled]):not(:hover):not(:active) {
    cursor: not-allowed;
    filter: brightness(0.75);
  }
}

::selection {
  background-color: var(--color-selection);
  color: var(--color-selection-ink);
  text-shadow: none;
}

:where(ul, ol):where([role="list"]) {
  margin: 0;
  padding: 0;
  list-style: none;
}

@page {
  margin: 1in;
}

@media print {
  .no-print {
    display: none;
  }
}

turbo-frame {
  display: contents;
}
