html {
  scroll-behavior: smooth;
}

body {
  user-select: none;

  margin: 0;
  padding: 0 1.5rem;

  background: #0a0a0a;
  color: #d1d1d1;

  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

/* VT323 only reads well at display sizes */
h1,
h2,
h3 {
  font-family: "VT323", monospace;
  line-height: 1.1;
}

a {
  color: #fff;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1 {
  font-weight: 200;
  margin: 0;
}

h1 a {
  color: #d1d1d1;
}

.subtext {
  margin-top: 0;
  font-size: 1rem;
}

.links {
  margin-top: 1rem;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

main {
  max-width: 60rem;
  margin: 0 auto;
  padding-bottom: 6rem;
}

h2 {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 200;
  margin: 0;
}

.grid {
  user-select: text;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1px;

  margin-top: 1.5rem;
  background: #222;
  border: 1px solid #222;
  text-align: left;
}

.grid div {
  background: #0a0a0a;
  padding: 1.25rem 1.5rem;
  overflow-wrap: anywhere;
}

h3 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 200;
  margin: 0 0 0.5rem;
}

h3::before {
  content: "> ";
  color: #555;
}

.grid p {
  margin: 0;
  color: #8a8a8a;
}

/* landing page */

.home header {
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.home h1 {
  font-size: clamp(5rem, 20vw, 10rem);
}

.scroll {
  position: absolute;
  bottom: 2rem;
  color: #555;
}

footer {
  margin-top: 4rem;
}

footer p {
  color: #555;
}

/* commands page */

.navbar {
  /* negative margins cancel body padding so the border spans the full width */
  margin: 0 -1.5rem;
  padding: 0.75rem 1.5rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;

  position: sticky;
  top: 0;
  z-index: 1;
  background: #0a0a0a;
}

.navbar .links {
  margin-top: 0;
}

.brand {
  color: #d1d1d1;
  font-family: "VT323", monospace;
  font-size: 2rem;
  line-height: 1;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
}

.commands header,
.legal header {
  padding: 2rem 0;
}

.cogs {
  margin-top: 0;
  color: #8a8a8a;
}

.cogs a {
  color: #8a8a8a;
}

.cogs a:hover,
.cogs a[aria-current] {
  color: #fff;
}

.search {
  width: 100%;
  max-width: 24rem;
  margin-top: 1.5rem;
  padding: 0.25rem 0.75rem;
  box-sizing: border-box;

  background: transparent;
  color: #fff;
  border: 1px solid #222;
  font: inherit;
}

.search:focus {
  outline: none;
  border-color: #d1d1d1;
}

.search::placeholder {
  color: #555;
}

.empty {
  color: #555;
}

/* gap instead of margins so sections hidden by search leave no space */
.commands main,
.legal main {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

section {
  scroll-margin-top: 1rem;
}

h2 small {
  color: #555;
  font-size: 1.25rem;
}

section > p {
  color: #8a8a8a;
  margin: 0 0 1.5rem;
}

.grid code {
  font-family: inherit;
  color: #d1d1d1;
}

.grid .meta {
  margin-top: 0.75rem;
  color: #555;
}

/* usage and aliases sit together as one block under the description */
.grid .meta + .meta {
  margin-top: 0.125rem;
}

/* legal pages */

.legal main {
  gap: 2rem;
}

.legal header .subtext {
  color: #555;
}

/* long prose reads better left-aligned and people copy from policies */
.legal section {
  user-select: text;
  text-align: left;
}

.legal section > p {
  margin: 1rem 0 0;
}

.legal .grid + p {
  margin-top: 1.5rem;
}

/* main's flex gap already spaces the footer on these pages */
.commands footer,
.legal footer {
  margin-top: 0;
  text-align: center;
}
