:root {
  --glow: color-mix(in srgb, var(--bright) 16%, transparent);
  font:
    16px/1.55 "SFMono-Regular",
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  background: var(--ground);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
  min-height: 100vh;
  min-height: 100dvh;
  text-shadow: 0 0 5px var(--glow);
}
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.095) 2px 3px
  );
}
.wrap {
  max-width: 872px;
  padding: clamp(34px, 8vh, 84px) 32px 60px;
  margin: 0 auto;
}
.wrap.terminal {
  position: relative;
  --prompt-space: max(clamp(40px, 9dvh, 96px), env(safe-area-inset-bottom));
  padding-bottom: calc(var(--prompt-space) + var(--keyboard-space, 0px));
}
.erase-window {
  position: absolute;
  overflow: clip;
  pointer-events: none;
}
.erase-window > div {
  height: calc(100% + var(--erase-band));
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--ground) 65%, transparent) var(--erase-band),
    var(--ground) var(--erase-band)
  );
}
#keys {
  scroll-margin-bottom: var(--prompt-space);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 1.8rem;
  line-height: 1.25;
  font-weight: 550;
  letter-spacing: -0.055em;
  color: var(--bright);
}
.terminal h1 {
  margin: 19px 0 6px;
}
.bio {
  margin-bottom: 32px;
}
.user,
.entry > span:first-child,
a,
.option {
  color: var(--bright);
}
.path,
.hint,
time,
.back {
  color: var(--quiet);
}
button,
input {
  font: inherit;
  color: inherit;
  text-shadow: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.entry {
  display: grid;
  grid-template-columns: 11ch auto;
  gap: 2ch;
  text-align: left;
  padding: 2px 0;
  width: fit-content;
  max-width: 100%;
}
a,
.option {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Keep the control as the click target while animated text is replaced. */
.out :is(button, a) span {
  pointer-events: none;
}
.entry:hover span:first-child,
.entry:focus-visible span:first-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible {
  outline: 1px dashed var(--bright);
  outline-offset: 3px;
}
.catalog {
  margin: 16px 0 26px;
  padding-left: 2ch;
}
.command {
  overflow-wrap: anywhere;
}
#prompt {
  display: flex;
  align-items: baseline;
  gap: 1ch;
}
#prompt label {
  white-space: nowrap;
}
.input-wrap {
  position: relative;
  min-width: 0;
  flex: 1;
}
input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--bright);
  padding: 0;
  border-radius: 0;
  outline: none;
  caret-color: var(--bright);
}
#cmd {
  color: var(--ink);
}
#cmd.valid-command {
  color: var(--verb);
  font-weight: 600;
}
.beam {
  display: none;
  position: absolute;
  left: 0;
  bottom: 0.22em;
  width: 0.58em;
  height: 1em;
  background: var(--bright);
  pointer-events: none;
}
input:placeholder-shown + .beam {
  display: block;
}
input:placeholder-shown {
  caret-color: transparent;
}
#prompt:focus-within label {
  color: var(--bright);
}
#prompt button {
  color: var(--quiet);
}
.hint {
  font-size: 0.77rem;
  margin-top: 15px;
}
.out {
  margin: 0 0 22px;
}
.result {
  white-space: pre-line;
  max-width: 72ch;
  margin-top: 10px;
}
.shell-links {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25em 2ch;
  margin: 0;
}
.shell-links dt {
  color: var(--quiet);
}
.shell-links dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.shell-links a {
  text-decoration-style: dotted;
}
.shell-links a:is(:hover, :focus-visible) {
  text-decoration-style: solid;
}
.shell-items {
  display: grid;
  gap: 1.55em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-items li {
  position: relative;
  padding-left: 2ch;
}
.shell-items .marker {
  position: absolute;
  left: 0;
  color: var(--quiet);
}
.shell-items strong {
  font-weight: 600;
  color: var(--bright);
}
.result .option {
  display: block;
  margin-left: 2ch;
  padding: 2px 0;
}
.page {
  max-width: 68ch;
}
.page h1 {
  margin: 19px 0 9px;
}
.page p {
  margin: 12px 0 20px;
}
.page h2 {
  font-size: 1.1rem;
  color: var(--bright);
  margin: 32px 0 8px;
}
.post {
  display: flex;
  align-items: center;
  gap: 2ch;
  margin: 28px 0;
}
.post time {
  font-size: 0.85rem;
}
.back {
  font-size: 0.9rem;
}
@keyframes raster {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100vh);
  }
}
@keyframes cursor {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  body:has(.terminal)::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 12vh;
    background: linear-gradient(
      transparent,
      color-mix(in srgb, var(--bright) 3%, transparent),
      transparent
    );
    animation: raster 1.05s ease-out both;
    pointer-events: none;
  }
  .beam {
    animation: cursor 1.15s step-end infinite;
  }
}
@media (max-width: 550px) {
  :root {
    font-size: 14px;
  }
  #cmd {
    font-size: 16px;
  }
  .wrap {
    padding: 32px 19px 50px;
  }
  .catalog {
    padding-left: 1ch;
  }
  .entry {
    grid-template-columns: 9ch auto;
    min-height: 32px;
  }
  .bio {
    margin-bottom: 26px;
  }
  .hint {
    font-size: 0.77rem;
  }
}
@media print {
  :root {
    --ink: #111;
    --bright: #000;
    --quiet: #555;
    color-scheme: light;
    background: white;
  }
  body {
    background: white;
    text-shadow: none;
  }
  .wrap {
    padding: 0;
  }
  .back,
  .print,
  body::after {
    display: none;
  }
}
.host,
a,
.back {
  color: var(--host);
}
.typed,
.entry > span:first-child {
  color: var(--verb);
}
.arguments,
.option,
code,
time {
  color: var(--argument);
}
.error {
  color: var(--error);
}
.result:has(.catalog, .bio) {
  white-space: normal;
  max-width: 100%;
  margin: 0;
}
.terminal:focus,
.reader-scroll:focus {
  outline: none;
}
#ex-input:focus-visible {
  box-shadow: 0 1px var(--quiet);
}
input:not(:focus) + .beam {
  visibility: hidden;
}
.reader {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.reader-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.reader-bar {
  flex: none;
  background: var(--ground);
  border-top: 1px solid var(--quiet);
  font-size: 0.8rem;
  padding: 7px max(19px, calc((100vw - 810px) / 2));
  padding-bottom: max(7px, env(safe-area-inset-bottom));
}
.reader-status,
.reader-keys,
#ex:not([hidden]) {
  display: flex;
  align-items: baseline;
  gap: 1.2ch;
}
.reader-status strong {
  background: var(--bright);
  color: #000;
  text-shadow: none;
  padding: 0 0.6ch;
}
.read-only,
.reader-keys {
  color: var(--quiet);
}
.reader-keys {
  justify-content: space-between;
  margin-top: 4px;
}
.reader-bar button {
  color: var(--verb);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#reader-message {
  white-space: pre-line;
  color: var(--error);
}
#ex-input {
  flex: 1;
}
@media print {
  .reader {
    height: auto;
    display: block;
  }
  .reader-scroll {
    overflow: visible;
  }
  .reader-bar {
    display: none;
  }
}

@media (pointer: coarse) {
  #cmd {
    font-size: max(16px, 1rem);
  }
  #prompt {
    align-items: center;
  }
  #prompt button {
    min-height: 44px;
    min-width: 40px;
  }
  #prompt input {
    height: 44px;
  }
  input:not(:focus):placeholder-shown + .beam {
    visibility: visible;
    opacity: 0.45;
    animation: none;
  }
  .beam {
    bottom: calc(50% - 0.5em);
  }
  .entry,
  .result .option {
    min-height: 40px;
  }
}
@media (max-width: 480px) {
  #prompt label .host,
  #prompt label .path:has(+ .host) {
    display: none;
  }
}
