:root {
  --page: #0a0a0a;
  --term: #000;
  --ink: #f2f2f2;
  --muted: #8c8c8c;
  --dim: #5e5e5e;
  --line: #2b2b2b;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono",
    "Liberation Mono", monospace;

  --goose-size: 16px;
  --goose-line: 18px;
  --say-size: 15px;
  --say-line: 22px;
  --term-pad: 28px;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--page);
  color: var(--ink);
  font-family: var(--mono);
}

main {
  width: 100%;
  max-width: 620px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 14px 0 44px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: balance;
}

/* Terminal */

.terminal {
  background: var(--term);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  overflow: hidden;
}

.bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.dots {
  display: flex;
  gap: 7px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6e6e6e;
}

.bar-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.screen {
  padding: 20px var(--term-pad) 18px;
}

.prompt {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.4;
}

.prompt span {
  margin-right: 6px;
  color: var(--muted);
}

.stage {
  display: flex;
  align-items: flex-start;
}

.goose {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.goose:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 6px;
}

.goose-art {
  display: block;
  white-space: pre;
  font-size: var(--goose-size);
  line-height: var(--goose-line);
  animation: bob 3.8s ease-in-out infinite alternate;
  user-select: none;
  -webkit-user-select: none;
}

.goose.is-reacting .goose-art {
  animation-play-state: paused;
}

@keyframes bob {
  from {
    transform: translateY(1px);
  }
  to {
    transform: translateY(-3px);
  }
}

.is-paused .goose-art {
  animation-play-state: paused;
}

/* First saying line sits level with the beak (row 3 of the goose). */
.speech {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding-top: calc(var(--goose-line) * 2 + (var(--goose-line) - var(--say-line)) / 2);
  font-size: var(--say-size);
  line-height: var(--say-line);
}

.arrow {
  flex: none;
  color: var(--muted);
  white-space: pre;
  letter-spacing: 0;
}

.saying {
  min-width: 0;
  color: #fff;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.saying-pending {
  visibility: hidden;
}

.water {
  display: block;
  margin: 16px 0 0;
  overflow: hidden;
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
  white-space: pre;
}

/* Below the terminal */

.hint {
  margin: 18px 0 0;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin-top: 8px;
}

.control {
  display: inline-block;
  padding: 10px 2px;
  border: 0;
  background: none;
  color: #bdbdbd;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-color: #4a4a4a;
  text-underline-offset: 5px;
  cursor: pointer;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.control:hover,
.foot a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.control:focus-visible,
.foot a:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 2px;
}

.control:disabled {
  cursor: progress;
  color: var(--muted);
}

/* Install guide */

.install {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.install h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

.install-note {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 32px;
  counter-increment: step;
}

.steps li + li {
  margin-top: 22px;
}

.steps li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.steps p {
  margin: 0;
  color: #bdbdbd;
  font-size: 12px;
  line-height: 1.6;
}

.steps b {
  color: var(--ink);
  font-weight: 400;
}

.steps a {
  color: var(--ink);
  text-decoration-color: #4a4a4a;
  text-underline-offset: 3px;
}

.steps a:hover {
  text-decoration-color: #fff;
}

.steps .aside {
  margin-top: 8px;
  color: var(--muted);
}

.steps code,
.steps kbd {
  font-family: var(--mono);
  font-size: 11.5px;
}

.steps p code {
  color: var(--ink);
}

kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}

.cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 10px 10px 14px;
  background: var(--term);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.cmd code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  color: #fff;
  white-space: pre;
  line-height: 1.6;
}

.cmd code::before {
  content: "$ ";
  color: var(--muted);
}

.copy {
  flex: none;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.copy:hover {
  color: #fff;
  border-color: #5e5e5e;
}

.copy:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 2px;
}

/* Footer */

.foot {
  width: 100%;
  max-width: 620px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.foot p {
  margin: 0 0 6px;
  text-wrap: balance;
}

.foot a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-color: #4a4a4a;
}

.contract {
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 520px) {
  :root {
    --goose-size: 14px;
    --goose-line: 16px;
    --say-size: 14px;
    --say-line: 20px;
    --term-pad: 16px;
  }

  body {
    padding: 32px 16px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    margin-bottom: 32px;
  }

  .speech {
    gap: 6px;
  }

  .control {
    padding: 13px 4px;
    font-size: 13px;
  }
}

/* A shell script is no use on a phone. */
@media (hover: none) {
  .desktop-only {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .goose-art {
    animation: none;
  }

  .control {
    transition: none;
  }
}
