:root {
  color-scheme: dark;

  --bg: #0b0b0b;
  --fg: #e6e6e3;
  --dim: #8b8b86;
  --user: #7ee787;
  --path: #79c0ff;
  --err: #ff7b72;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --step: 90ms;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

.term {
  min-height: 100svh;
  padding: clamp(1.25rem, 4vw, 2.75rem);
}

.cmd + .cmd,
.cmd + .prompt {
  margin-top: 1.1rem;
}

.prompt {
  white-space: nowrap;
}

.cmd:nth-of-type(1) { --c: 0; }
.cmd:nth-of-type(2) { --c: 1; }
.cmd:nth-of-type(3) { --c: 2; }
.cmd:nth-of-type(4) { --c: 3; }
.cmd:nth-of-type(5) { --c: 4; }
.cmd:nth-of-type(6) { --c: 5; }
.cmd:nth-of-type(7) { --c: 6; }
.cmd:nth-of-type(8) { --c: 7; }

.prompt { --i: calc(var(--c) * 2); }
.out { --i: calc(var(--c) * 2 + 1); }

.cmd:nth-of-type(1) + .idle { --i: 2; }
.cmd:nth-of-type(2) + .idle { --i: 4; }
.cmd:nth-of-type(3) + .idle { --i: 6; }
.cmd:nth-of-type(4) + .idle { --i: 8; }
.cmd:nth-of-type(5) + .idle { --i: 10; }
.cmd:nth-of-type(6) + .idle { --i: 12; }
.cmd:nth-of-type(7) + .idle { --i: 14; }
.cmd:nth-of-type(8) + .idle { --i: 16; }

.prompt,
.out {
  animation: appear 0s calc(var(--i) * var(--step) + 150ms) both;
}

.user {
  color: var(--user);
}

.path {
  color: var(--path);
}

.sym {
  color: var(--dim);
}

.cur {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: var(--fg);
  animation: blink 1.1s steps(1) infinite;
}

h1 {
  font: inherit;
  font-weight: 700;
}

.err {
  font-weight: 400;
  color: var(--err);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2ch;
}

.links a {
  color: var(--path);
  font-weight: 700;
  text-decoration: none;
}

.links a:hover,
.links a:focus-visible {
  background: var(--path);
  color: var(--bg);
  outline: none;
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .prompt,
  .out,
  .cur {
    animation: none;
  }
}

@media (max-width: 30rem) {
  html {
    font-size: 13.5px;
  }
}
