* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: white;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.6)), url("/background.webp") center / cover fixed;
  font-family: system-ui, sans-serif;
}

main {
  width: min(700px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3rem 0;
}

main.wide {
  width: min(1100px, calc(100% - 3rem));
}

nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 5rem;
}

nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

nav a:hover,
nav .active {
  color: white;
}

h1 {
  margin: 0 0 2rem;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: -0.06em;
}

p,
li {
  font-size: 1.1rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.demo {
  display: block;
  width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.links {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.links a {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  color: white;
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-decoration: none;
}

.links a:hover {
  background: rgba(40, 70, 120, 0.8);
}

.note {
  width: fit-content;
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  color: #ffe28a;
  background: rgba(255, 190, 70, 0.12);
  border: 1px solid rgba(255, 226, 138, 0.45);
  border-radius: 8px;
}

small {
  font-size: 0.75rem;
}

.docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 2rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.sidebar a {
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  text-decoration: none;
}

.sidebar a:hover {
  color: white;
}

.sidebar .active {
  color: white;
  background: rgba(100, 175, 255, 0.18);
}

.content h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.content h2 {
  margin-top: 2.5rem;
  font-size: 1.5rem;
}

.content h3 {
  margin-top: 2rem;
}

code {
  padding: 0.1em 0.35em;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: rgba(7, 17, 31, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

pre code {
  padding: 0;
  background: none;
}

.table-wrap {
  overflow-x: auto;
  background: rgba(7, 17, 31, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

tr:last-child td {
  border-bottom: none;
}

th {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

td:first-child {
  white-space: nowrap;
}

a:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 500px) {
  main,
  main.wide {
    width: min(100% - 2rem, 700px);
    padding-top: 2rem;
  }

  nav {
    margin-bottom: 3rem;
  }
}
