:root {
  --fg: #000;
  --bg: #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.2rem;
  line-height: 1.5;
}

a {
  color: var(--fg);
}

#simple {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 5rem;
  overflow-wrap: break-word;
}

header {
  border-bottom: 2px solid #000;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand {
  margin: 0 0 0.6rem;
  font-size: 1.7rem;
  font-weight: 700;
}

.brand a {
  text-decoration: none;
}

.brand button {
  font: inherit;
  font-weight: 700;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

nav a {
  display: inline-block;
  margin: 0.3rem 0.4rem 0.3rem 0;
  padding: 0.45rem 0.7rem;
  border: 2px solid #000;
  text-decoration: none;
  font-size: 1.05rem;
  transition: background 0.15s ease, color 0.15s ease;
}

nav a:hover,
nav a:focus,
nav a.on {
  background: #000;
  color: #fff;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.8rem;
}

h2 {
  font-size: 1.45rem;
  margin: 1.6rem 0 0.5rem;
}

p, li {
  margin: 0 0 0.8rem;
}

ul {
  padding-left: 1.2rem;
}

.lede {
  font-size: 1.45rem;
}

.btn {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 1.35;
  text-align: left;
  padding: 0.9rem 1rem;
  margin: 0.7rem 0;
  border: 3px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

a.btn {
  display: block;
}

.btn small {
  display: block;
  font-size: 1.05rem;
  font-weight: normal;
  margin-top: 0.25rem;
}

.btn:hover,
.btn:focus {
  background: #000;
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn.skip {
  border-width: 2px;
  font-size: 1.1rem;
  padding: 0.7rem 1rem;
}

.updated {
  font-size: 1.05rem;
  border: 2px solid #000;
  padding: 0.6rem 0.75rem;
  margin: 0 0 1.1rem;
}

.back {
  display: inline-block;
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

button.back {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.note {
  font-size: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.15rem;
  margin: 1rem 0 1.5rem;
}

th, td {
  border-bottom: 1px solid #000;
  text-align: left;
  padding: 0.55rem 0.4rem 0.55rem 0;
  vertical-align: top;
}

th {
  font-weight: 700;
}

.spectrum {
  margin: 1.2rem 0 1.6rem;
  font-size: 1.15rem;
}

.spectrum .row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.6rem;
  margin: 0.55rem 0;
  align-items: baseline;
}

.bar,
.track {
  height: 1.1rem;
  border: 2px solid #000;
  margin: 0.35rem 0 1rem;
  overflow: hidden;
}

.bar > span,
.track > span {
  display: block;
  height: 100%;
  width: 0;
  background: #000;
  animation: fill 0.7s ease-out forwards;
}

@keyframes fill {
  to { width: var(--w, 0%); }
}

.progress {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.track {
  margin: 0 0 1rem;
  height: 0.7rem;
}

#view.in {
  animation: fade-up 0.28s ease-out;
}

#view.fwd {
  animation: slide-left 0.28s ease-out;
}

#view.back {
  animation: slide-right 0.28s ease-out;
}

#view .btn {
  animation: fade-up 0.32s ease-out both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-left {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-right {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}

#term-wrap {
  position: fixed;
  inset: 0;
  background: #fff;
  overflow: auto;
  z-index: 20;
  animation: fade-in 0.22s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#term-wrap .term-bar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #000;
  margin: 0;
  padding: 0.6rem 1rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}

#term-wrap .term-bar button {
  font: inherit;
  background: #fff;
  border: 1px solid #000;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

#term-app {
  max-width: 88ch;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.45;
}

#log {
  white-space: pre-wrap;
  word-break: break-word;
}

#log .cmd { font-weight: 700; }

#log .link {
  cursor: pointer;
  text-decoration: underline;
}

#log .link:hover {
  background: #000;
  color: #fff;
}

#prompt-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#prompt-row label { font-weight: 700; flex: none; }

#cmd {
  flex: 1;
  border: 0;
  border-bottom: 1px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  padding: 0.15rem 0;
  outline: none;
}

noscript { display: block; margin: 2rem; font-family: "Courier New", Courier, monospace; }

@media (prefers-reduced-motion: reduce) {
  #view.in,
  #view.fwd,
  #view.back,
  #view .btn,
  #term-wrap,
  .bar > span,
  .track > span {
    animation: none;
  }

  .bar > span,
  .track > span {
    width: var(--w, 0%);
  }

  .btn,
  nav a {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}
