:root {
  color-scheme: light dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #f6f5f1;
  color: #151515;
  --line: #c9c7bf;
  --muted: #65645f;
  --surface: #fffefa;
  --focus: #315a45;
  --error: #922f2f;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(90deg, transparent 49.9%, rgb(0 0 0 / 3%) 50%, transparent 50.1%),
    #f6f5f1;
}

button,
input {
  font: inherit;
}

.code-shell {
  width: min(42rem, 100%);
}

.code-header {
  margin-block-end: 2rem;
}

.code-kicker,
.code-status {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 0.5rem;
  font-size: clamp(2.25rem, 8vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2 {
  margin-block-end: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.code-intro,
.code-workspace p {
  color: var(--muted);
  line-height: 1.65;
}

.code-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0.65rem 0.65rem 0 #dedcd4;
}

label {
  display: block;
  margin-block-end: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.code-entry {
  display: flex;
  gap: 0.65rem;
}

input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0.8rem 0.9rem;
}

button {
  border: 1px solid #151515;
  border-radius: 0;
  background: #151515;
  color: #fff;
  cursor: pointer;
  padding: 0.8rem 1rem;
}

button:hover {
  background: #30302e;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent);
  outline-offset: 2px;
}

.button-secondary {
  background: transparent;
  color: inherit;
}

.button-secondary:hover {
  background: #efede6;
}

.code-message {
  min-height: 1.3em;
  margin: 0.8rem 0 0;
  color: var(--error);
  font-size: 0.84rem;
}

.code-workspace {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    background: #111;
    color: #f2f1ed;
    --line: #454541;
    --muted: #aaa9a3;
    --surface: #191918;
    --focus: #9ac9ad;
    --error: #ef8f8f;
  }

  body {
    background:
      linear-gradient(90deg, transparent 49.9%, rgb(255 255 255 / 4%) 50%, transparent 50.1%),
      #111;
  }

  .code-card {
    box-shadow: 0.65rem 0.65rem 0 #292927;
  }

  button {
    border-color: #f2f1ed;
    background: #f2f1ed;
    color: #151515;
  }

  button:hover,
  .button-secondary:hover {
    background: #d7d6d1;
    color: #151515;
  }

  .button-secondary {
    background: transparent;
    color: inherit;
  }
}

@media (max-width: 34rem) {
  .code-entry,
  .code-workspace {
    align-items: stretch;
    flex-direction: column;
  }
}
