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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* main and a section take focus from a skip link or a number key, never as a control */
main:focus,
.section:focus {
  outline: none;
}

::selection {
  background: rgb(var(--accent-rgb) / 0.28);
  color: var(--text);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.i {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  flex: none;
  vertical-align: -0.05em;
}

.sr-only {
  position: absolute;
  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: var(--gutter);
  top: 0.75rem;
  z-index: 50;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: 500 var(--mono-m) / 1 var(--font-mono);
  transform: translateY(-160%);
}

.skip:focus-visible {
  transform: none;
}

.tlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  padding-bottom: 2px;
  transition: background-size 0.35s var(--ease-out), color 0.2s ease;
}

.tlink .i {
  color: var(--muted);
  transition: transform 0.3s var(--ease-out), color 0.2s ease;
}

.tlink:hover {
  background-size: 100% 1px;
}

.tlink:hover .i,
.tlink:focus-visible .i {
  color: var(--accent);
  transform: translate(2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
  .tlink,
  .tlink .i {
    transition: none;
  }

  .tlink:hover .i,
  .tlink:focus-visible .i {
    transform: none;
  }
}
